Repository navigation
refactor(website): dogfood sibling-scoped styles in CoreApiDemo - #958
Merged
domgan-oai merged 1 commit intoSep 5, 2026
Merged
domgan-oai merged 1 commit into
domgan-oai merged 1 commit into
Conversation
Migrate the Core APIs live examples off a class-map plus :global descendants
onto sibling scopes, control-flow scopes, and <style apply={theme} />. Move
PortalEventDemo toast rules into ToastBody. Document the class-map pruning
trap and the apply path for shared chrome.
Co-authored-by: Jon Wheeler <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
jonkwheeler
marked this pull request as ready for review
September 4, 2026 19:10
leonidaz
added a commit
that referenced
this pull request
Sep 5, 2026
The released plugin drops the stray `;` after `@try` blocks in three fixtures, and #958's styling table is realigned. Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 task done
leonidaz
added a commit
that referenced
this pull request
Sep 5, 2026
…RFC #1) (#939) * feat(compiler): lexically scoped style blocks, $class, and apply Implement RFC tsrx-org/RFCs#1 on the Octane compiler with one copy-on-write pre-pass per top-level statement (src/compiler/style-scopes.js): - scopes: component render, nested @{ }, every control-flow branch body (including @else if chains), assigned element/fragment templates; several blocks per scope share the first block's hash and ONE injectStyle call; nested scopes get their own; injections are pushed in lexical pre-order with an order key that sorts among module-level entries on the server - stamping: every host element carries its enclosing scope hashes outer→ inner, then applied theme classes (same-module themes inline as literals so static templates stay hoisted; imports read theme.$class at runtime through the dynamic class path); {style(expr)} resolves to the chain in the pre-pass, so resolveStyleExpr no longer sees style calls - assigned blocks lower anywhere a declaration is legal (component bodies, nested blocks, plain functions, object properties), expose $class, and render in theme or class-map mode from the core analyzer's classification - Float <style href precedence> resources stay outside the model - applyStyleMap/applyCssScoping/componentStyleRoots/annotateRootWithHash/ addHashClassToElement/wrapScopedClassExprs are removed - OCTANE_HYDRATE_SPLIT_STYLE names the style scope, not the component - scripts/sync-style-conformance-fixtures.mjs vendors the tsrx conformance fixtures and parser spec table (pnpm sync:style-fixtures[:check]) Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(octane): read the scoped-style fixtures from @tsrx/core instead of vendoring Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(compiler): control-flow style CSS on the client and imported theme CSS on the server - inheritOriginLoc no longer descends into StyleSheet subtrees: their positions are CSS-relative, and stamping module positions onto them rendered a control-flow scope's CSS as '.hash b {}' on the client - server: assigned blocks lower to styleMap(hash, css, map, applied), a proxy that injects the sheet (after the sheets of the themes it applies) into the active request on property access, and every component touches the imported themes its scopes apply (touchStyleMap) before its own injectStyle calls, so a theme from another module reaches the css collector ahead of the applying scope's rules Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(octane): scoped styles, themes, and apply across docs, website, rules, evals, and scaffold - docs/tsrx-basics.md Styles section; stale single-scope claims fixed in deferred-hydration, ssr, differences-from-react (with the STYLE_* codes), getting-started, css-module-constants, universal-renderer-architecture, product-example-regressions, octane-cleanup-plan - website: new Learn Octane › Styling page (docs-meta, docs, sitemap, llms index, pagination pin), styles mentioned on tsrx-vs-tsx and quick-start, build-tools notes per bundler, llms.txt authoring bullets, regenerated TextMate grammar, scoped-styles playground example - rulesync: tsrx-authoring Styles section, skill enumeration, one-line project pointer within the context budget; MCP skills; CONTRIBUTING and README mentions - evals: scoped-styles coverage axis with tsrx.nested-scope-styles and octane.theme-apply tasks, corpus regenerated (21 tasks) - scaffold: the link styles are an applied theme; harbor PriceBadge dark variant via apply; examples catalog regenerated - tests: conformance runner over @tsrx/core's fixtures (client + server + evaluation) and the parser spec-table fallback replay Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(octane): scoped style fixtures, parity, runtime, streaming, and browser coverage - fixtures: style-scopes, style-theme(+consumer), style-element-rooted, style-local-assigned, style-order-theme/applier, returned nested scopes - suites: RFC class table and head order, multi-block/nested/control-flow/ sibling scopes, {style()} chains, $class pins, SSR cascade with in-body themes, streaming per-hash dedupe and theme waves, Float sibling and apply-is-not-a-resource, clsx spread + hashes + theme.$class parity, frozen-AST run over every fixture, per-scope inspect origins, emit audit, deferred-hydration split message, universal renderer rejection, React- hosted multi-hash islands, injectStyle DOM order, HMR hazard pin (it.fails, #938), Playwright cascade (client, SSR+hydrate) - runtime: the client dedupe matches React's batched data-href by token, so hydrating a multi-hash island no longer re-injects its sheets - typetest: theme.$class is string under tsrx-tsc - docs: server-side lazy theme injection described in tsrx-basics and the Styling page; Scoped CSS notes in the bundler plugin READMEs Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: patch-level changeset for octane A minor bump cascades into major bumps for every dependent's peer range; the release plan checker rejects it without a coordinated peer expansion. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(evals): regenerate the corpus manifest after merging main Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: consume @tsrx/core from the scoped-styles branch until it ships packages/octane, @octanejs/evals, and website depend on github:tsrx-org/tsrx#feat/scoped-styles-apply&path:packages/tsrx (a git dependency is not allowed as a subdependency, so the spec lives on the direct dependents); overrides pin the branch manifest's workspace/catalog dependencies to the published runtime and the tsrx catalog ranges. Also: the client injectStyle refreshes a sheet it already owns when an HMR re-evaluation arrives with an unchanged hash and changed CSS (#938). Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: interim formatter ignores and regenerated react-parity lockfile hashes The published @tsrx/prettier-plugin cannot parse the fixtures that place a <style> beside a code block's output node until its release ships the new parser; the react-parity audit files hash the lockfile, which the branch dependency changed. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(compiler): keep server theme touches in the applying component's body The touches were handed to the shared body emitter through a context slot that the first nested branch helper drained; they are now a parameter that only the component body passes (nested helpers pass none), with a test pinning the placement ahead of the component's own injectStyle calls. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(evals): regenerate the corpus manifest for the branch lockfile Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: keep vitest peer resolution as on main; no skipped conformance test The non-frozen install that introduced the branch dependency also swapped the happy-dom peer suffix of five vitest snapshots, which changed which vitest instance packages/pdf resolved and broke its typecheck (TS2769); those hunks are reverted. The conformance runner asserts the documented compiled-output-only reason instead of skipping (test-marker policy). Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(evals): regenerate the corpus manifest for the final lockfile Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: let packed consumers install the branch @tsrx/core (interim) The pack validator and the Lynx consumer generators write their own pnpm-workspace.yaml; while octane depends on @tsrx/core from a git branch they now emit blockExoticSubdeps: false (pnpm 11 blocks a git dependency below a packed package by default) plus the branch-manifest pins read from the root workspace, so the block disappears with that override at release. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: regenerate react-parity lockfile hashes for the final lockfile Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(octane): drop the react-compat $class typetest until the core release That directory is type-checked through the published @tsrx/react and its released @tsrx/core, which has no $class yet; the compiled-output checks in the conformance and style-map suites cover $class on the Octane side. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: interim workspace for the external packed consumer too Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(octane): opting elements into a theme with $class Document `class={theme.$class}` (and passing it to a child through a prop) as the selective counterpart of `apply` in tsrx-basics, the Styling page, llms.txt, and the tsrx-authoring rule; extend the playground's scoped-styles example with an `accent` theme, a Footnote child, and an untouched sibling; add a client/server test suite for the pattern. Lockfile moves to the tsrx branch commit that classifies a block whose $class is read as a theme (and ships the class-opt-in conformance fixture), with the parity and corpus hashes regenerated. Co-Authored-By: Claude Fable 5.1 <[email protected]> * feat(octane): scope standalone <style> blocks to their children list Amendment A1 of RFC tsrx-org/RFCs#1. A standalone block is a child of an element or a fragment and styles the items beside it and everything below them; it never styles the element that contains it. Every children list holding a block is a scope with its own hash, and a `@{ … }` or directive body holds one output node, so the statement-list scope machinery is gone (those lists are only searched for nested templates and assigned blocks). Rule C: `<style>{expr}</style>` is an ordinary element; a `style` host is never stamped, and the Node parser entry retries that shape in the JavaScript parser when the native facade's CSS reader rejects it with a bare Error. Rule B's `tsrx-style-standalone-outside-template` comes from the core analyzer through compile.js and volar.js. Fixtures and tests that relied on a nested block styling its container move the block beside the element in a fragment; the Status class table from the spec and the rule B/C placement forms are pinned on the client and the server. The placement suite and the conformance runner wait on the core lockfile bump. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(website): put scoped <style> blocks beside the elements they style Every component whose block sat as the last child of its classed root element (41 files), the embedded playground examples, and the docs code samples now wrap the block and the root output in a fragment, so the root keeps its rules under amendment A1. The pinned Counter scope hash in the playground mapping test moves with the block's position. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs: describe the sibling-scope <style> rule and the new diagnostics A block styles the items beside it and everything below them, never the element that contains it; raw CSS in <style> is TSRX template syntax and plain TSX uses <style>{css}</style>. Rewrites the Styles sections of tsrx-basics, the tsrx-authoring rule (regenerated), llms.txt, the styling and quick-start pages, differences-from-react, ssr.md, the MCP skills, the scaffold templates, the harbor PriceBadge island, and the nested-scope evals task (prompt and reference). Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: extend the scoped-style changeset with amendment A1 Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: drop the interim prettierignore entries for scoped-style fixtures The four fixtures now use the fragment form, which the published @tsrx/prettier-plugin parses, so they format like every other file. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(octane): prune standalone scopes like core and re-pin the parser table Against tsrx c05ca370. The conformance runner's `sibling-scope` fixture resolved the `status` label to two hashes: core prunes a standalone block's selectors against the list's other children (the `.status` rule inside the section reaches nothing and becomes an `(unused)` comment), Octane kept every selector. `prepareScope` now mirrors core: the list's other children are cloned (fresh metadata per node, so the frozen parser AST is never written), their host elements collected with ancestor paths, and each sheet is `analyzeCss` + `pruneCss` per element instead of the blanket `prepareStylesheetForRender('scope')`. The conformance runner asserts `expected.pruned` across every sheet, and the tests that relied on a container-aimed rule surviving pin the pruned shape. The style-syntax fallback test follows the flipped spec table: the multiple-outputs forms and the four `<style>{css}</style>` shapes fall back to the JavaScript parser; the self-closed-block cases parse natively and stay pinned as the known `css: undefined` divergence (tsrx-org/tsrx#46). The rule C server assertion checks the server's nested template-literal runs instead of the client's single template string. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: lockfile on tsrx c05ca370 (amendment A1), parity hashes, evals corpus Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(octane): inject a theme's applied same-module themes on the server Bugbot on #939: `wrapServerStyleMap` listed only imported `theme.$class` reads as injection dependencies, and a body-less assigned block skipped the wrapper. A same-module theme an exported theme applies is inlined as a hash in the class list, so when another module's component touched the export only the export's own sheet reached the SSR collector while the applied themes' class names were present without their CSS. Every `styleApplies` expression is now a dependency of the server wrapper, same-module and imported alike, so `touchStyleMap(theme)` and `theme.$class` reads inject the apply chain transitively, applied before applier, each sheet once (the wrappers dedupe by hash and guard re-entry). A body-less bundle lowers to `_$styleMap(null, null, map, [applied])` and the runtime skips its own injection while forwarding the touch. The client path is unchanged: every sheet is a module-level `injectStyle` there. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(octane): keep a returned styled fragment a static descriptor A render-only `@{ <>…</> }` child of a returned fragment is transparent grouping — the same rule normalizeChildren and extractFragment already apply — so `requiresTemplateNormalization` now looks at its render instead of forcing the compiled-renderer path for any code block. Under amendment A1 a value factory in plain TSX keeps its scoped CSS in exactly that block (raw CSS needs a `@{ … }` container), and the tests inspecting the stored value expect the static `Fragment` element it used to be, not a lowered renderer function. Fixes signals-deferred-values in the signals projects. Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(website): locate playground keywords through the editor document The playground e2e tests found a keyword by walking the text nodes CodeMirror had rendered, so a keyword below the initial viewport (the counter example now opens with its <style> block) was reported missing. Find it in the document, scroll its line into view, wait for the viewport to cover it, and read the node from the editor. Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(octane): render a value factory's render-only styled block Pins, with a mounted client tree and a server render, that a plain-TSX value factory returning `<><h1/>@{ <><style/><div class="x"/></> }</>` renders the heading and the styled div with the scope hash and the injected sheet on both sides (dev and prod compiles, frozen-AST guard included): the render-only block is transparent grouping in the descriptor path, and its output is not dropped. Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(website): find playground keywords beyond the rendered viewport CodeMirror renders only the lines around its scroll position, so the playground e2e helpers could not see a keyword further down the source. Sweep the scroller, record every occurrence by its document-coordinate line top, scroll the chosen one into view, and read the node after the re-render. The counter example opens with its markup again and keeps the style block last in the fragment, so the default demo reads top-down and the token hovers land on JSX rather than on CSS selectors; the pinned scope hash follows the block's new position. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(website): place playground style blocks beside the markup they style A standalone <style> block styles the other children of the list it sits in and their descendants, never the element that contains it and never a child component's elements. Rework the TSRX playground examples around that rule: - Examples whose subject is not styling put the markup first and the block below it in the same fragment (branch-hooks, context, portals, dynamic-tags, parallel-use, form-actions, esm-sh, octane-compat island, react-compat host). view-transition keeps its block first: the CSS animations are what enter="card-in"/exit="card-out" name. theme-app is untouched. - counter, keyed-list, inputs, suspense, and transitions split their block: the container rule stays at the top of the fragment and each part's rules sit beside the markup they style (toolbar row, output panel, or inside the <ul> next to the @for and @empty rows). - Rules aimed at a child component's elements never matched and were being pruned as (unused): ThemeCard's .card, the dynamic-tags chips, Quote's .quote, SlowList's and Elapsed's .hint, SubmitButton's button, and IslandData's .data now live in their own component's fragment. playground-examples.test.ts gates this for every .tsrx file, client and server: no injected sheet may contain an (unused) rule, and every authored class a block targets must carry a scope hash in the compiled markup. The counter's pinned scope hash in playground-mapping.test.ts follows the block's new position. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs: call the <style> scope a sibling scope A standalone <style> block is scoped to the children list it is written in, not to the @{ … } body around it. Readers took "lexically scoped" to mean the latter, so every doc surface now says "sibling scope" and defines it once where it first appears: a block styles its siblings and everything below them, and sibling blocks share one hash. "Lexical order"/"lexical pre-order" for CSS emission order, "lexically inside a @{ … } body" for the TSX rule, and "lexical scope" in its JavaScript binding sense are unchanged. Regenerated the RuleSync outputs and the evals user-app corpus after editing the rule and the task prompt. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(styling): say each rule in plain words Rework the Styling page so every section makes one point, its title states that point, and the body opens with the rule, then a short example, then what to do. Define "hash class" once up front and use it instead of "stamp"/"stamping"; say "branch" instead of "arm", "the block that applies it" instead of "applier", "a block with CSS in it" instead of "bodied", and describe output order as "source order, outer scope first" instead of "lexical pre-order". The control-flow section is now "Styles inside @if and @for" with a shorter example; the fragment rule and the static-CSS rule get their own sections; the runtime injection details move out of "Which rule wins" into "Where the CSS goes at runtime". Apply the same wording to the Styles section of docs/tsrx-basics.md, the styling bullets of website/public/llms.txt, and the tsrx-authoring rule (regenerated). No fact, compiled output, example output, or diagnostic changes; the new examples were compiled to confirm the documented sheet count, class chains, and parser error. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(styling): drop the last two jargon terms and fix the Next link Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(styling): document :global, its forms, ranking, and when to pass $class Add "Reach outside the scope with :global" to the Styling page, with the same material in docs/tsrx-basics.md, llms.txt, and the tsrx-authoring rule: the selector forms (bare, prefixed, leading, compound), the block form and its nested use under a scoped rule, the CSS_GLOBAL_PLACEMENT limit, how a global rule ranks against a scoped one (hash on the first compound, :where() on the rest), and a decision table that prefers passing theme.$class to a child over reaching in with :global. Pin the compiled selector shapes on both emitters in packages/octane/tests/style-global-forms.test.ts. Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(octane): give the :global fixture a real .note sibling The purple .note pin held only because a sibling with a dynamic class kept every class selector alive. A <p class="note"> makes the scoped rule live on its own, and the test now also asserts nothing in the sheet was removed as unused. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: rebase the react-parity audit files on main's evidence hashes The merge kept the branch side of the audit files, whose evidence-file hashes predate main's changes; take main's files and refresh only the lockfile integrity, which is all this branch changes. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(octane): resolve style(expr) only in class-string positions Bugbot on #939: the style-scope pre-pass rewrote every one-argument call to an identifier named `style` it walked — a local `const s = style(props)` became `const s = props`, an imported helper in `style={style(props)}` was rewritten too. Before the pre-pass the emitters expanded `style(expr)` only as the expression of a JSX attribute value or of a template expression child, so that is the rule now: an attribute value (the `style` attribute excepted — its value is CSS, never a class list, so the old rewrite there was a quirk and is retired) or a template child hole, directly or nested in the array/conditional/logical/template expressions of that container. Every other `style(...)` — a statement, a declaration initializer, a call argument, a callback body — is a user call and prints as authored. The attribute walk now runs before the stamp so nested calls resolve first, and a resolved value is marked so the stamp does not append the chain again; the emitters' `resolveStyleExpr` fallback is a pass-through. Also pins that a rule matched only by a dynamic-tag sibling stays in the sheet on both emitters (a `<{expr}>` can match any selector). Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(website): wait for CodeMirror to paint before reading keywords The scroller sweep waited two animation frames per step, which a slow runner can outpace, so a keyword's lines were sometimes never in the DOM when read ("@empty not found" on the production run). Each step now waits until a line is painted inside the visible range, uses half-height steps, and the final read retries until the target line appears. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs: give the opt-in example's article its own local class; core on tsrx 393d1754 The $class opt-in example declared a .local rule the article never used; the article now carries local alongside the passed theme class, and the opt-in test expects it on client and server. The lockfile moves to the tsrx commit whose class-opt-in conformance fixture has the same shape, with parity hashes and the evals corpus regenerated. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore: consume the released @tsrx/core 0.1.66 tsrx-org/tsrx#68 shipped the sibling-scoped style blocks, `$class`, and `apply` this branch was consuming from the `feat/scoped-styles-apply` git branch, so: - `packages/octane`, `@octanejs/evals`, and `website` depend on `@tsrx/core` through `catalog:default` again; - the catalog moves every `@tsrx/*` entry to that release (core 0.1.66, prettier/typescript plugins 0.3.132, react 0.2.66, solid 0.1.66, vite plugins 0.0.99/0.0.96) and `minimumReleaseAgeExclude` follows; - the INTERIM override block that made the branch manifest installable is deleted, and the pack validator, its canary tests, and the Lynx consumer generators drop the `blockExoticSubdeps` shim (back to main's versions); - `pnpm sync` regenerates the lockfile-hashed parity audits and the evals manifest. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(octane): allow complete style scopes inside Hydrate splits (#959) * fix(octane): allow complete style scopes inside Hydrate splits Lift OCTANE_HYDRATE_SPLIT_STYLE when a lexical style scope sits entirely inside the extracted child (plan S8.5). Keep the error when the scope has blocks or stamped hosts on both sides of the boundary. Co-authored-by: Jon Wheeler <[email protected]> * fix(octane): keep hydrate extraction from writing frozen style nodes Extraction now reaches complete in-boundary style scopes. Skip frozen parser/StyleSheet nodes when stamping generated origins, and assert the split child's sheet after the child hydrates. Co-authored-by: Jon Wheeler <[email protected]> * fix(octane): count namespaced hosts in hydrate style-scope straddle check JSXNamespacedName hosts are stamped by the style-scope pass. Treat them as stampable so a parent-list scoped style with only namespaced hosts inside a split Hydrate is rejected as OCTANE_HYDRATE_SPLIT_STYLE. Co-authored-by: Jon Wheeler <[email protected]> --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Jon Wheeler <[email protected]> * refactor(website): dogfood sibling-scoped styles in CoreApiDemo (#958) Migrate the Core APIs live examples off a class-map plus :global descendants onto sibling scopes, control-flow scopes, and <style apply={theme} />. Move PortalEventDemo toast rules into ToastBody. Document the class-map pruning trap and the apply path for shared chrome. Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Jon Wheeler <[email protected]> * fix(octane): stamp the scope chain once when style() is part of a class value A `style(expr)` nested in an array, conditional, logical, or template class value resolved to the chain plus its value, and the element's stamp then appended the chain again (Bugbot on #939). Inside the class of an element the chain is stamped on, a call that is only part of the value now yields its value alone and the stamp adds the chain once to the composed value, so the chain is present whichever branch runs and never twice. A whole-value `class={style(expr)}` keeps its chain-first form, now also through parenthesized and TS wrapper expressions. Co-Authored-By: Claude Fable 5.1 <[email protected]> * style: format for @tsrx/prettier-plugin 0.3.132 The released plugin drops the stray `;` after `@try` blocks in three fixtures, and #958's styling table is realigned. Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: Jon Wheeler <[email protected]> Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Jon Wheeler <[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.
Closes #936.
Summary
CoreApiDemooff the assigneddemoStylesclass map and its 63:globaldescendant escapes.<style apply={demoControls}>.packing-empty,search-updating,product-empty) live in@empty/@ifscopes; child-owned cards (ProfileResult,DashboardReportPanel,ProductResults) own their own blocks.PortalEventDemotoast rules intoToastBodyso the portaled child no longer needs:global.styling.mdxmismatches found while migrating: class-map pruning drops descendant /:globalrules, and shared chrome across your own components isapply, not:global.Why
Lexical sibling scopes and
applylanded onfeat/scoped-styles-apply(#939) and are not onmainyet. The old assigned class map keeps only single-class selectors, so those:globaldescendants were unused CSS on this branch. This is the S8.7 dogfood pass.Changes
website/src/components/CoreApiDemo.tsrx: 63:globalescapes → 0.website/src/components/PortalEventDemo.tsrx: 6:globalescapes → 0.website/src/content/docs/styling.mdx: class-map pruning note; apply row in the “which one to use” table.Intentionally left
ViewTransitionsDemo:global(::view-transition-*)— document-level view-transition pseudos, not our own elements.FileTreeprefixed:global— rows come from a recursive callback, which is outside a sibling scope.Header,DocPage,Playground,LynxShowcase, home sections,DocsLayout— third-party / markdown / CodeMirror / routerLinkchildren we do not own.Validation
pnpm format:files:checkon the touched.tsrxfiles (not repo-widepnpm format:check)pnpm --filter website typecheck(tsrx-tsc --noEmit) andpnpm typecheck:fileson the two.tsrxfilespnpm test(full suite not run)website/tests/core-apis-docs.test.ts(website-unit, 1 passed)CoreApiDemo.tsrx: 17injectStylesheets, 0 diagnostics, 0 compiled:global, 0 unused selectorspnpm --filter website dev(http://localhost:5179/docs/core-apis): state / packing / profile / search / form / portal interactions; computed styles show sibling-scope and apply hashes; toast usesToastBody's own hashItems packed live example after the style migration
Packing list live example with card rows and pill buttons
Portal toast styled from ToastBody
Risk / follow-ups
feat/scoped-styles-applybecause the lexical-scopes compiler is not onmain. Merge this after feat(compiler): sibling-scoped style blocks, $class, and apply (tsrx RFC #1) #939, or rebase ontomainonce that lands.Provenance
agent-authored)To show artifacts inline, enable in settings.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.