Repository navigation
feat(octane): infer primitive DOM text children - #1003
Merged
domgan-oai merged 4 commits intoSep 8, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
September 8, 2026 20:59
14 of 21 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
Number(),BigInt(),Date(), numeric operators, andtypeof.as stringtext behavior and client/server hydration layout; keep watch/HMR syntax-only.Why
Direct primitive DOM children can use Octane's text binding without requiring casts or
String()calls. The optional checker can prove typed member reads and imported aliases that syntax alone cannot resolve. Numeric proofs stay distinct from string proofs so they do not change concatenation inference.Changes
Validation
pnpm install --frozen-lockfile --registry=https://registry.npmjs.org/(explicitly authorized),pnpm sync, and scopedpnpm format:files:check.pnpm typecheck:filesfor changed compiler, Vite, Rspack, and Rsbuild files.node benchmarks/bench.mjs --quick --ratios text-type-roots: warm snapshot ratio guard passed; 34-root 0.0016 ms, 20,002-root 0.0018 ms.node --checkon changed JavaScript andgit diff --check.pnpm format:check,pnpm typecheck, andpnpm testwere not run locally; targeted package gates above cover the changed paths.91bc9a49dfe8bff2b42021185f27445b9e3b7e81after rerunning a transient Chromium-backed parity worker failure on the same head.Risk / follow-ups
as stringclassification already works on the base; the new test preserves that behavior. Numeric literal static baking is excluded because root static text already has a separate client/server inconsistency.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes how DOM children are classified for SSR and hydration; mismatched client/server facts or stale Rspack cache would cause subtle layout bugs, though the PR adds guards and invalidation for the new production path.
Overview
Extends DOM child text binding beyond strings to locally provable numbers and bigints (literals, numeric operators,
Number/BigInt/Date()/typeof, and related syntax), while keeping explicitas stringbehavior and separate string vs primitive TypeScript proofs so numeric evidence does not affect string concatenation inference.The compiler threads optional
textTypeFacts(now includingprimitiveTextChildRanges) through client/server emission and hydration adjacency so both sides agree on text holes vs renderable children.Vite, Rspack, and Rsbuild gain an opt-in
textTypes: { tsconfig }for one-shot production builds: a shared TypeScript project supplies facts to the compiler; dev/HMR/watch stay syntax-only. Vite fails closed if proofs drift between client and server in the same build. Rspack disables parallel compilation and persistent module caching for typed Octane modules so imported type changes cannot reuse stale output.Docs and types describe the broader primitive domains, safety boundaries (booleans/objects stay renderable), and optional
rooton the TS project adapter for renderer rule alignment.Reviewed by Cursor Bugbot for commit 91bc9a4. Bugbot is set up for automated code reviews on this repo. Configure here.