Skip to content

Version Packages - #1

Merged
leonidaz merged 1 commit into
mainfrom
changeset-release/main
Aug 25, 2026
Merged

leonidaz merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

  • 16a87b2
    Thanks @leonidaz! - Remove deprecated
    Ripple-named compatibility aliases from the target-neutral compiler and language
    tooling. Ripple remains supported as an explicitly detected compiler target with
    target-gated runtime completions.
  • Updated dependencies
    [16a87b2]:

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

  • 16a87b2
    Thanks @leonidaz! - Remove deprecated
    Ripple-named compatibility aliases from the target-neutral compiler and language
    tooling. Ripple remains supported as an explicitly detected compiler target with
    target-gated runtime completions.

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes

@tsrx/[email protected]

Patch Changes


Note

Medium Risk
Removing deprecated Ripple compatibility aliases can break projects or editor configs still relying on old names; otherwise this is mostly automated version/changelog churn.

Overview
Changesets release that publishes patch versions across the monorepo after consuming .changeset/clean-otters-smile.md (that file is removed from the repo in this PR).

The release ships @tsrx/[email protected] and matching bumps for @tsrx/typescript-plugin, @tsrx/language-server, ESLint/Prettier/MCP tooling, framework compilers (@tsrx/react, preact, solid, vue), Vite/Bun/Rspack/Turbopack plugins, @tsrx/[email protected], and packages/zed-plugin’s pinned @tsrx/language-server 0.3.126. Most integration packages only record dependency-only changelog entries.

User-facing behavior in this release (from the changelog text, not new edits in this diff): deprecated Ripple-named compatibility aliases are dropped from target-neutral compiler and language tooling; Ripple stays supported as an explicitly detected target with target-gated runtime completions.

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

@leonidaz

Copy link
Copy Markdown
Contributor

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit bfc1058. Configure here.

@leonidaz
leonidaz merged commit 7cb0127 into main Aug 25, 2026
8 checks passed
leonidaz added a commit that referenced this pull request Sep 5, 2026
* feat(tsrx): lexically scoped style blocks, $class, and apply

Implement RFC tsrx-org/RFCs#1 in @tsrx/core:

- parser: self-closing <style … /> (no body, no scope hash) and <style>
  siblings around the single output node in @{ } and directive bodies;
  raw-text elements restore the tokenizer context before reading the token
  after their closing tag, so a <style> in a @case body no longer breaks
  the following } or @case
- analyzer: style-analyze pass (run with createScopes inside analyzeTsrx)
  classifies assigned blocks as theme or class-map, resolves apply targets
  through real bindings with declared-before-use, and reports the new
  STYLE_* and CSS_GLOBAL_PLACEMENT diagnostic codes
- transform: a style-scopes pre-pass owns scope discovery, lexical CSS
  emission order, and class stamping (hashes outer→inner, then applied
  themes); replaces the per-fragment collection and the 'one style tag'
  error; element-rooted assigned templates keep their CSS; assigned blocks
  expose $class; prepareStylesheetForRender gains scope/class-map/theme
  modes; cssHash is deduped per scope
- tests: parser spec table (oxc-tsrx porting spec), analyzer matrix,
  shared scope/theme/diagnostic cases for every JSX target, an ordering
  property test, and type-level $class tests

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(tsrx): scope @else if bodies and dedupe static theme diamonds

- the style pre-pass and analyzer treat the plain IfStatement alternates
  of an @if directive (@else if chains) as branch scopes
- statically resolvable hashes appear once in $class and in stamped
  classes when a theme is applied directly and through another theme (D12)
- conformance fixtures under tests/fixtures/scoped-styles with a
  fixture-driven describe for every JSX target (Octane vendors them)

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(tooling): editor and lint support for scoped style blocks and apply

- typescript-plugin: attribute-aware <style> fallback regex (self-closing,
  '>' inside apply={…}), real cssMappings in workspace fixtures
- language tooling tests for prettier (idempotent formatting of every
  new form), eslint rules (style siblings are not output nodes), eslint
  parser scope references through apply={…}
- tsrx-mcp review_tsrx_styles recognizes self-closed blocks and themes
- TextMate and tree-sitter grammars: self-closing <style … />, style
  siblings in code-block and directive bodies; regenerated bundle, queries
  copied to zed/nvim; vscode grammar scope tests
- changesets for the vscode and zed extensions

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(language-server): scoped style blocks, apply, and coded diagnostics

- completion snippets for <style> and <style apply={…} />
- style diagnostics keep their core codes (tsrx-style-apply-target, …)
- auto-insert matches opening tags with a brace/quote-aware scanner, so
  '>' inside apply={…} and self-closed <style … /> behave, and closes an
  unclosed <style> even while the file only has fallback mappings
- tests: embedded CSS codes per block, snippets, auto-insert, diagnostics
  on the apply target, hover/definition on $class through TypeScript

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(tsrx): map the type-only apply $class read for verification only

The synthesized `theme.$class` read in editor output borrows the target's
span so type errors land on the authored identifier, but it no longer
serves hover or navigation there, and the renamed data-tsrx-apply
attribute is unmapped.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs(tsrx): specify lexically scoped style blocks, $class, and apply

- specification.tsrx: grammar (self-closing <style>, apply targets, style
  siblings in code-block and directive bodies), scope model, $class and
  theme vs class-map, apply resolution and declared-before-use, normative
  emission order, and one static-constraint entry per STYLE_* code
- features.tsrx, llms.txt, demo snippets: lexical scopes, precedence,
  themes and apply; the playground shows Octane's injected CSS
- README and bundler READMEs say lexically scoped; rulesync rules gain the
  scope/theme authoring assumptions (generated files regenerated)
- tsrx-mcp docs index regenerated with the new spec sections
- core exports buildStyleClassMap for consumer compilers

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore: changesets for the scoped-style tooling and MCP changes

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(tsrx): expose the scoped-style conformance fixtures and parser spec table

Consumer compilers run them from @tsrx/core/test-harness/scoped-styles-fixtures
and @tsrx/core/test-harness/style-syntax instead of vendoring copies; the
fixture files ship in the package.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(tsrx): print type-only style stand-ins as void expressions

Consecutive <style> siblings in a code-block or directive body printed as
adjacent JSX expression statements in editor output, which TypeScript
rejects (TS2657); each stand-in is now its own void expression.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore: changeset for the IntelliJ plugin grammar update

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(vscode-plugin): type the runtime-registered grammar id for shiki

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(tsrx): ship the MIT license file with @tsrx/core

Consumers that bundle the package (Octane's Volar compiler bundle) look for
a license notice inside the package directory, which a git checkout lacked.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* refactor(tsrx): inline is_reference so the analyzer bundles without an extra notice

analyzeTsrx now runs createScopes, which pulls scope.js into consumer
bundles (Octane's Volar compiler bundle); [email protected] ships no
license file, so the 40-line helper is inlined with attribution.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(tsrx): a block whose $class is read is a theme

Reading `theme.$class` opts one element (or a child component's element,
through a prop) into the block's whole stylesheet, so such a block keeps
every selector like an exported or applied one instead of pruning its
element selectors as a class map.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(tsrx): conformance fixture for opting elements into a theme with $class

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs(tsrx): opting elements into a theme with $class

Spec 4.6.3 (theme = exported, applied, or `$class` read; `styleClassRead`
metadata), a features-page subsection with a Card/App example, llms.txt
bullets and a cheat-sheet row, a demo snippet, the rulesync clause, and
the regenerated MCP docs index.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(tsrx-mcp): escape the docs-index sentence template

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore: regenerate agent rules

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(tsrx): amendment A1 for scoped style blocks

Rule A: a standalone `<style>` block is a child of an element or fragment
and that children list is its scope. It styles the items beside it and
everything below them, never the element that contains it; a selector that
only matches the container is pruned. Statement lists hold no standalone
blocks: the D3 parser relaxation is reverted, so a block beside the output
node of a `@{ … }` or control-flow body is the ordinary multiple-outputs
error again, and a lone block there (or a block in statement position) is
the new `STYLE_STANDALONE_NEEDS_FRAGMENT` diagnostic. The pre-pass drops
its statement-list scope machinery and threads `<style ref>` maps of
children-list scopes to the nearest statement slot.

Rule B: raw CSS in `<style>` is TSRX template syntax. A bodied standalone
block outside every `@{ … }` and control-flow body is the new
`STYLE_STANDALONE_OUTSIDE_TEMPLATE` diagnostic; head styles, resource
styles, and self-closing blocks are exempt.

Rule C: `<style>` whose first non-whitespace child character is `{` parses
as an ordinary `JSXElement` named `style` with expression-container
children — no stylesheet, no hash, never stamped or extracted.

Fixtures, the shared suite (including the seeded ordering property test,
which now models element children lists as scopes), the analyzer placement
tables, and the `STYLE_SYNTAX_CASES` parser table follow the new rules; the
`sibling-scope` fixture pins the amendment's Status class table.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(tooling): hold scoped style blocks in fragments

A `<style>` block is an output node again, so the eslint
`require-statement-container-body` rule returns to counting it as template
output (its D3 relaxation is removed) and the eslint, prettier, and
language-server cases move their blocks into fragments beside the output.
Plain-TSX plugin fixtures become `@{ … }` bodies. Completion snippet text
and the MCP `review_tsrx_styles` wording describe the amended rules, and
`<style>{css}</style>` is reported as an ordinary element rather than an
error.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: amendment A1 wording for scoped style blocks

The specification (4.6.1, 4.6.2, 5.1, A.3, the grammar table, and the
static-constraints listing), the features page, llms.txt, the shared agent
rules, the core README, and the MCP documentation index describe the
children-list scope rule, the two new diagnostics, and plain-TSX
`<style>{css}</style>`. Examples that relied on a nested block styling its
container, or on a block beside the output node, wrap the block and its
output in a fragment. Changesets are extended accordingly (patch bumps).

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 sits in:
it styles its siblings and everything below them, and sibling blocks
share one hash. Readers took "lexically scoped" to mean the block reaches
everything in its `@{ ... }` body, so the docs, llms.txt, specification
(4.6, 4.6.2 is now "Sibling scopes"), features page, package READMEs,
changesets, the MCP docs index, and the language-server `<style>`
completion now say "sibling scope" and define it where it first appears.
"Lexical" keeps its JavaScript meaning (binding scope, emission order,
and the TSX placement rule).

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: rewrite the style docs in plain language

Each style section now makes one point, its title states that point,
and it opens with the rule, then an example, then what to do. "Hash
class" is defined once up front on every surface (the class the compiler
adds to an element so the block's selectors match only there) and used
afterwards. Jargon is replaced with plain words: branch for arm, "adds
the hash class" for stamp, "the block that applies it" for applier, "a
block with CSS in it" for bodied, and "output", "removed as unused",
"moved to the top of the module", and "source order, outer first" for
emit, prune, hoist, and pre-order.

Covers features.tsrx (new subsections and a before/after fragment
example), llms.txt, README.md, packages/tsrx/README.md, specification
4.6 prose and the 5.1 closing paragraph, and the MCP docs index with its
test. No fact, example output, code, grammar, or diagnostic changes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: explain :global() and when to pass $class instead

Expand the features page's ":global()" section into a full treatment: the
four forms with their compiled output, the specificity rule (hash on the
first compound only, :where on the rest), and a decision table for choosing
between :global and passing theme.$class to a child. Add a compact version
with the same table to llms.txt and the MCP docs index, one rule line to the
agent rules, and one normative sentence to specification 4.6.

Pin the :global output shapes for every target in the shared scoped-styles
tests.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: document the :global block form and nesting

Add the block form, :global { ... }, beside the selector form in the
features page, llms.txt, the MCP docs index, the agent rules, and the one
normative sentence in specification 4.6. Show a :global block nested under
a scoped selector as the way to style several classes of a child you cannot
change, and contrast it with plain nesting, which scopes both parts.

Pin the block, nested, and plain-nesting output shapes for every target in
the shared global-forms test.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: give the opt-in example's article its own local class

The $class opt-in example declared a .local rule the article never used. The article now carries local alongside the passed theme class, written as a template literal because array class values are a target-specific feature; the shared test, the class-opt-in conformance fixture, and the generated MCP docs index follow.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix: map recovered unclosed tags to the opening name token (#61)

Loose-mode recovery synthesized a closing element with the whole
element's location, so the generated </span> name mapped to <spa and
the opening < lost its mapping. Leave the synthesized close unlocated
and clone the name from the opening tag token.

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Jon Wheeler <[email protected]>

* fix(tests): type source mapping helper

---------

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]>
leonidaz added a commit that referenced this pull request Sep 16, 2026
* fix(grammar): recognize multiline JSX expression boundaries

* fix(intellij): align embedded JSX member roles

* chore: publish JSX highlighting parity

* fix(review): apply review findings

* fix(ci): make highlighting fixtures format-stable

* Address PR review feedback (#101)

- avoid the key probe's fixture identifier collision

* feat(intellij): analyze rainbow bracket structure

* feat(intellij): integrate optional Rainbow Brackets

* test(intellij): prove Rainbow Brackets integration

* docs(intellij): document Rainbow compatibility

* perf(intellij): keep rainbow highlighting linear

* fix(review): apply rainbow findings #1-#4

* docs(plan): record Rainbow Brackets delivery

* fix(intellij): preserve nested JSX and align rainbow color cycles

* chore: remove local Rainbow Brackets plan

* style(intellij): format Rainbow Brackets fixture

* test(intellij): use implicit output in template fixtures

---------

Co-authored-by: Leonidas <[email protected]>
leonidaz added a commit that referenced this pull request Sep 24, 2026
An assigned `<style>` block was a class map unless it was exported,
applied, or read as `theme.$class`, and a class map commented out its
element and descendant rules. `$class` is an ordinary string, so any
path the static check could not see (destructuring, a holding object, a
prop, a return value, iteration) dropped the styles while the element
still carried the hash class.

RFC #1 states the rule: an assigned block keeps all its selectors,
because `apply` and `$class` can attach its hash anywhere. The
dead-CSS carve-out that kept pre-RFC class-map pruning for local blocks
is removed:

- the analyzer marks every assigned block `styleKind: 'theme'` and drops
  the classification-only `styleExported` and `styleClassRead` metadata;
- `prepare_stylesheet_for_render` prunes nothing in any mode, so the
  `'class-map'` mode and the boolean form render as `'theme'` for
  consumers that still pass them;
- the class-map selector marking that only served pruning is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
leonidaz added a commit that referenced this pull request Sep 24, 2026
…250) (#251)

* fix(core): keep every selector of assigned style blocks (#248, #249)

An assigned `<style>` block was a class map unless it was exported,
applied, or read as `theme.$class`, and a class map commented out its
element and descendant rules. `$class` is an ordinary string, so any
path the static check could not see (destructuring, a holding object, a
prop, a return value, iteration) dropped the styles while the element
still carried the hash class.

RFC #1 states the rule: an assigned block keeps all its selectors,
because `apply` and `$class` can attach its hash anywhere. The
dead-CSS carve-out that kept pre-RFC class-map pruning for local blocks
is removed:

- the analyzer marks every assigned block `styleKind: 'theme'` and drops
  the classification-only `styleExported` and `styleClassRead` metadata;
- `prepare_stylesheet_for_render` prunes nothing in any mode, so the
  `'class-map'` mode and the boolean form render as `'theme'` for
  consumers that still pass them;
- the class-map selector marking that only served pruning is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(core): record TS-wrapped reads as scope references (#250)

`createScopes` skipped every identifier whose parent was a TypeScript
node, which also dropped the value-level wrappers `value as T`,
`value!`, `value satisfies T`, and `fn<T>`. These read the binding at
runtime, so they now count as references; type positions such as
`typeof value` still do not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
jonkwheeler added a commit that referenced this pull request Nov 14, 2026
…code (#1339)

* fix(core): read text after a directive's block as text when it isn't code

After a directive's closing `}`, the next token was read as code, and
template text the tokenizer can't read as code (`1st prize`, `10px`, `#1`,
`0x`, `'s`, an unclosed quote) threw in every mode. That token is now an
empty text token whenever template text follows, not only `//` text, so
the text reads as it does after an element. In an element in a `{ … }`
container, the element's children context is put back on top after the
directive, so text after a later child (`<b /> 1st prize`) reads as text
too.

Fixes #1323

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
jonkwheeler added a commit to jonkwheeler/tsrx that referenced this pull request Nov 30, 2026
…`/>` in container text as text

Two readings around a directive's block that tsrx-org#1548's fix exposed:

- After a directive's block, the token after it is read as code (it may
  be the directive's clause), so an `@` there pushes a statement context
  over the element's children context. A directive drops it after its
  blocks; a `@{ }` code block kept it and put it back after its `}`. So
  what followed the block read as code and the closing tag popped the
  wrong context: `(<a>@if (k) {}@{ <i /> }{c && <i />}</a>) / 2`, the
  same in a template literal or a directive's header (which parsed on
  main only because main's own miscount cancelled this one), and
  `<Foo p={<a>@if (k) {}@{} 1st</a>} />` or `@{}tsrx-org#1` in a container
  (which failed on main too) threw. `parseTemplateBody` now drops that
  context before it reads a code block child.
- In an element inside a `{ }` container, `jsx_readToken` read a `/>`
  in text as the end of a tag, so `<Foo p={<a>x /> y</a>} />` and
  `<Foo p={<a>< b /></a>} />` threw `Invalid regular expression flag`.
  With the code block fixed, `< b />` right after a directive and a code
  block in a container (text on main) hit this too. A `/>` after text in
  the same run is now text, as outside a container.

Also pins that a `<` that can't start a tag right after a directive or
a code block is text (`< b />`, `<3`, `<\tb />`), in and out of
containers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
jonkwheeler added a commit that referenced this pull request Nov 30, 2026
…e value (#1551)

* fix(core): parse a directive two or more elements deep in an attribute value

A directive that is a child of an element drops the template contexts
from the tokenizer's stack while it reads its header and blocks
(`#filterTemplateScriptContexts`): in a `{ }` container, those of the
elements opened in it, and outside one, all of them. After its blocks,
`#resumeContainerTemplateChildren` put back one children context, and
only in a container. So with the directive two or more elements deep,
each later closing tag popped one context more than was left for it,
and what followed the elements read in the wrong mode:

- `<Foo p={c ? <a><b>@for (…) {<i />}</b></a> : null} />` popped the
  attribute's `{`, read `null` in the host's opening tag and threw
  `Unexpected token` (three elements: `Unexpected token \`}\``). Depth 1
  was right by chance (one dropped, one put back), and depth 4 landed on
  the component body's `{`, a code context. The `:` branch and `p={…}`
  only parsed because a `}` reads the same in an opening tag; with more
  elements they failed too (`Unterminated regular expression`).
- `(<a><b>@if (c) {}</b></a>, 1) / 2` popped the `(` and read `/ 2` as a
  regular expression; so did a `${ }` around the elements.

`#parseJSXControlFlowExpression` now keeps the stack as it was at the
directive's `@`, and `#resumeTemplateChildren` (renamed, as it now runs
outside containers too) restores it after each block before popping the
statement context, so the stack is the element's children stack, as
after a child that isn't a directive.

Fixes #1548

* test(core): cover more directive shapes around elements in a container

Adds `@empty` and `@pending` clauses, a directive in another's block,
and elements in a directive's header to the `?`-versus-`:` tree test,
and a directive value and an attribute value without braces to the test
of what follows the markup (the latter threw on main as well).

* docs(changeset): say how many contexts a directive put back outside a container

* fix(core): read a `@{ }` child after a directive like any child, and `/>` in container text as text

Two readings around a directive's block that #1548's fix exposed:

- After a directive's block, the token after it is read as code (it may
  be the directive's clause), so an `@` there pushes a statement context
  over the element's children context. A directive drops it after its
  blocks; a `@{ }` code block kept it and put it back after its `}`. So
  what followed the block read as code and the closing tag popped the
  wrong context: `(<a>@if (k) {}@{ <i /> }{c && <i />}</a>) / 2`, the
  same in a template literal or a directive's header (which parsed on
  main only because main's own miscount cancelled this one), and
  `<Foo p={<a>@if (k) {}@{} 1st</a>} />` or `@{}#1` in a container
  (which failed on main too) threw. `parseTemplateBody` now drops that
  context before it reads a code block child.
- In an element inside a `{ }` container, `jsx_readToken` read a `/>`
  in text as the end of a tag, so `<Foo p={<a>x /> y</a>} />` and
  `<Foo p={<a>< b /></a>} />` threw `Invalid regular expression flag`.
  With the code block fixed, `< b />` right after a directive and a code
  block in a container (text on main) hit this too. A `/>` after text in
  the same run is now text, as outside a container.

Also pins that a `<` that can't start a tag right after a directive or
a code block is text (`< b />`, `<3`, `<\tb />`), in and out of
containers.

* fix(core): keep an element's context under an element in a directive's header or a stray clause

`#popTokenContextsAfterTemplateExpressionElement` strips a `b_stat`
over a `tc_expr` after an element in expression position, for the
leftovers of a container inside the element. It did so even once the
stack was below the element's enclosing depth, where those contexts
belong to what holds the element: a directive's statement context over
the children context of an element around it. So:

- in a collecting or loose parse, a clause that belongs to no directive
  right after another directive's block (`@for (…) {…}@else {<u />}`,
  TSRX1012) threw `Unexpected token` instead of collecting TSRX1012 in
  an attribute's conditional (either branch, with anything after the
  container), in `p={…} q={1}`, `p=<a>…</a> q={1}`, `( , 1) / 2` and a
  template literal; and
- `<Foo p={<a><a>@if (<b />) {}</a></a>} q={1} />` failed with TSRX1008.

The strip now stops at the enclosing depth, as the branches after it
already do. The changeset becomes minor: a `<` with whitespace after it
right after a directive is text now, so `< b></b>` there fails, with a
Migration line.

* test(core): pin `< b />` after a code block that follows a directive, and `x/>` in a container

Codex on 2970f71: in a container, `< b />` right after a `@{ }` block
with statements that follows a directive was an element on main and is
text now (empty blocks already read text), and `<Foo p={<a>x/><b /></a>} />`
dropped the `x` on main. Both get assertions, and the changeset names
the first in the Migration's scope and says a `/>` that starts a run of
text still fails, in and out of containers.

* docs(changeset): list the `/>` reading after a directive, and narrow the `< b` scope

Review round 2: a `/>` that starts a run of text right after a child
that follows a directive (outside a container), or a directive and a
`@{ }` block with statements and no output (anywhere), was text on main
and now fails, as it does without a directive before it. The changeset
lists it with the `< b` change and gives its Migration (`/&gt;` or
`{'/>'}`). It also says the `< b` change follows a block with no output,
that the `/>` fix covers attribute values without braces, and that main
dropped all the text before a run's first `/>`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant