Skip to content

fix(solid,vue): import generated control-flow components under private names - #1222

Merged
jonkwheeler merged 12 commits into
tsrx-org:mainfrom
jonkwheeler:fix/vue-solid-private-imports
Nov 12, 2026
Merged

jonkwheeler merged 12 commits into
tsrx-org:mainfrom
jonkwheeler:fix/vue-solid-private-imports

Conversation

@jonkwheeler

@jonkwheeler jonkwheeler commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #1175; review the commits after b1809e0; merge after #1175.

Summary

Solid and Vue import their generated components under private names (#1199). #1175 did this for the shared injector (React, Preact, Hono). Solid's and Vue's own injectors still imported public names: Solid's Show, For, Switch, Match, Errored and Loading from solid-js, and Vue's VaporFor from vue-jsx-vapor. An authored binding with one of those names broke the build or took the generated element's place.

Before → after, compiling with @tsrx/solid / @tsrx/vue and transforming with Vite's transformWithOxc:

Target Authored binding #1175 (b1809e0) This branch
Solid import { Show } from './my-show' with @if Identifier `Show` has already been declared builds; <__Show>
Solid import type { For } from 'solid-js' with @for Identifier `For` has already been declared builds
Solid setup local const Show = … with @if … @else the @if renders through the local Show renders the branch
Solid module const Errored = 'mine' with @try … @catch the boundary element is 'mine' <__Errored>
Solid @for (const Match of rows) { @switch … } <Match> names the row; Solid throws createComponent: expected a component function but got object renders the arms
Vue import { VaporFor } from './my-for' with a keyed @for Identifier `VaporFor` has already been declared builds; <__VaporFor>
Vue import type { VaporFor } from 'vue-jsx-vapor' with a keyed @for Identifier `VaporFor` has already been declared (on main: merged into the type-only import and erased) stays type-only; import { defineVaporComponent, VaporFor as __VaporFor } from 'vue-jsx-vapor' is a separate value import
Vue module or setup local const VaporFor = … the loop renders the authored value renders the rows

Solid's JSX compiler only special-cases these names to auto-import them when they are unbound, so <__Show> and the rest compile as ordinary components. vue-jsx-vapor compiles <__VaporFor> exactly like <VaporFor> (DOM, SSR, HMR and interop output compared, apart from the name).

A tag counts as a component unless it starts with a lowercase letter, as in JSX. The compiler counted a tag as a component only when it started with A–Z, so __Show, __Switch and __Loading looked like host tags. Solid vetoes hoisting a subtree that renders a component; without the veto, a static @if, @switch or @pending subtree went to one module-level node, and a component rendered twice showed one copy. is_component_jsx_name, is_component_like_element and is_component_like_jsx_name now treat any first character outside a–z as a component. I compiled all 79 .tsrx files in the repo with every target before and after this change: React, Preact, Hono and Vue output is byte-identical, and Solid output matches main and #1175 apart from the private names. An authored tag such as <_Card> is now a component too, as JSX treats it. Separately, is_composite_jsx_element in transform/scoping.js (which elements get the scope class) still keys off A–Z; it only sees authored tags, so I left it.

Vue's defineVaporComponent keeps its public name, and a module can't declare its own (TSRX2032). vue-jsx-vapor finds components by that callee name, so __defineVaporComponent(…) loses:

  • the macros: destructured props are no longer declared or reactive, and { rows, title = 'x' } loses its props options;
  • HMR registration (configurable through compiler.hmr.defineComponentName);
  • SSR registration (_defineVaporSSRComponent and ssrRegisterHelper are not emitted);
  • Vapor output in interop mode (it compiles to VDOM).

The last two have no option in vue-jsx-vapor 3.2.14. Following the #1073/#1125 rule for code vue-jsx-vapor would compile wrongly, an authored binding named defineVaporComponent is now a compile error with a new code, TSRX2032, that names the reason:

Authored binding #1175 (b1809e0) This branch
import { defineVaporComponent } from './my-helpers' Identifier `defineVaporComponent` has already been declared TSRX2032 on the import
module function defineVaporComponent(x) { return x; } (or a const) builds; every component is wrapped in the authored function TSRX2032 on the function
const defineVaporComponent = … in a component (or any other local or parameter) builds; the local shadows the name there, and vue-jsx-vapor's macros still treat any call of it as a component definition TSRX2032 on the local
declare function defineVaporComponent(…), a namespace with a value, or if (…) { var defineVaporComponent } the generated import conflicts with it (TypeScript TS2440) TSRX2032
declare namespace defineVaporComponent { type … } (types only) builds unchanged: no error, and the generated import is added
import { "defineVaporComponent" as defineVaporComponent } from 'vue-jsx-vapor' Identifier `defineVaporComponent` has already been declared (the compiler added the name a second time) no error; the quoted import is reused
import type { defineVaporComponent } from 'vue-jsx-vapor' Identifier `defineVaporComponent` has already been declared (on main: merged into the type-only import and erased) becomes the value import import { defineVaporComponent } from 'vue-jsx-vapor'; no error

An import of defineVaporComponent from vue-jsx-vapor itself, plain or quoted, is still the binding the compiler uses. In collect and editor mode the compiler adds no defineVaporComponent import once it has reported TSRX2032, so TypeScript reports no duplicate declaration on top of it. The promoted type-only specifier is printed without a location, like a name the compiler adds, so Organize Imports maps no edit of that import back to the source.

TSRX2032 has an entry in @tsrx/core/diagnostics (TSRX_ERRORS.DEFINE_VAPOR_COMPONENT_BINDING, code key TARGET_RESERVED_NAME), a row in the specification's error-code appendix, a sentence in llms.txt, and an example in the content mapper's error examples. That suite checks each error through the TypeScript 7 language server, and now has a Vue workspace beside React and Solid.

Verification

  • Shared compile tests (packages/tsrx/tests/shared/compile.js), now also run for Solid (all six components) and Vue (VaporFor): for each, an authored value import from the same source, a type-only import, an inline type import, a default, namespace and other-module import, a module const and a setup local. Each asserts no TypeScript redeclaration diagnostic, a private value import and private generated tags. Plus Solid's @for (const Match of rows) around @switch. 57 cases, all failing on fix(core): import generated Suspense, Fragment and TsrxErrorBoundary under private names #1175's head.
  • Vue: import type { VaporFor } from 'vue-jsx-vapor' stays type-only and the generated names get a separate value import. Failed before.
  • Vue defineVaporComponent: an import from another module, a module function, a declared function, a module const, a namespace with a value, a var in a top-level block and a component local each throw TSRX2032 in a strict compile, and report exactly one TSRX2032 at the binding in collect mode and in the editor compile (compile_to_volar_mappings), with no generated import. A types-only namespace and a quoted import from vue-jsx-vapor report nothing in all three modes. import type { defineVaporComponent }, import { type defineVaporComponent } and import type { defineVaporComponent, VaporForProps } from vue-jsx-vapor become value imports with no error in all three modes, and a type-only import in a module without components stays type-only. The content-mapper example shows TSRX2032 once through the TypeScript 7 language server, with no TypeScript error on it.
  • Solid runtime: a component whose static @if, @for, @switch, @pending or @catch subtree reads no binding, rendered twice, shows two copies. The @if, @switch and @pending cases showed one copy before the component-name change, and all five pass with fix(core): import generated Suspense, Fragment and TsrxErrorBoundary under private names #1175's public names.
  • Runtime (Vite + real Solid / vue-jsx-vapor compile): Solid renders @switch arms with a loop variable named Match (threw before) and an @if … @else beside a setup-local Show (rendered through the local before); Vue renders a keyed @for beside a setup-local VaporFor (rendered the local before).
  • Full npx vitest run: 10195 passed, 2 failed: 5–6s timeouts in content-mapper targets.test.js and native-resolution.test.js (they spawn tsc), which pass when rerun alone (7 tests). All five targets' compile and runtime projects pass (4330 tests).
  • pnpm typecheck clean, pnpm changeset:check passes, Prettier clean on changed files.

Related

Fixes #1199
Related: #1141, #1175, #1073, #1125

🤖 Generated with Claude Code


Note

Medium Risk
Compiler output and import shapes change for all Solid/Vue control-flow and Vue defineVaporComponent handling; mis-detection could still affect hoisting or macro wrapping, but behavior is heavily regression-tested.

Overview
Solid and Vue no longer emit generated control-flow imports under public names that authors might shadow. Solid maps @if/@for/@switch/@try output to __Show, __For, __Switch, __Match, __Errored, and __Loading with matching import { … as __… } from 'solid-js'. Vue emits __VaporFor (VaporFor as __VaporFor) so local bindings, type-only imports, and loop variables like Match do not collide or replace generated markup.

Component detection in core now follows JSX: a tag is a component unless its first character is a lowercase ASCII letter, so names like __Show and <_Card> are not treated as host elements—fixing incorrect static hoisting when the same static control-flow subtree is rendered twice.

Vue reserves defineVaporComponent: any other binding with that name raises TSRX2032 (DEFINE_VAPOR_COMPONENT_BINDING); type-only imports from vue-jsx-vapor are promoted to the value import the compiler needs. Docs, error examples, and shared/runtime tests are updated for the new names and diagnostics.

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

jonkwheeler and others added 6 commits October 26, 2026 14:45
…srx on HMR

handleHotUpdate compiled every changed .tsrx file to refresh its
stylesheet before checking whether a stylesheet module existed. A file
imported only as `?raw` (an incomplete docs example, say) failed to
compile, and Vite sent an HMR error instead of the raw update.

Look the stylesheet module up first and compile only when it exists,
as the Hono plugin already does.

Fixes tsrx-org#566

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The shared JSX import injector always added
`import { Suspense } from '<source>'` for `@try … @pending` and
`import { Fragment } from '<source>'` for keyed fragment bodies, even
when the module already imported that name from the same source. The
duplicate declaration failed the build with "Identifier `Suspense` has
already been declared".

Skip the injected import when the module already has a value import of
the same name and local from the same source. React, Preact and Hono
share this injector.

Fixes tsrx-org#862

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

The import injector added `Suspense`, `Fragment` and `TsrxErrorBoundary`
under their public names, and the generated elements referenced those
names. Any other authored binding with one of them broke the build
("Identifier `Suspense` has already been declared") for a type-only,
default, namespace or other-source import, or silently replaced the
generated element for a setup local or a `@for (const Fragment of ...)`
loop variable.

Import them as `__Suspense`, `__Fragment` and `__TsrxErrorBoundary`, as
the injector already does for `mergeRefs`, and reference those aliases
from the generated elements, including Hono's `fallbackRender` boundary.
This replaces the same-name import reuse from tsrx-org#1102, which no longer has
anything to reuse.

Vue imports `TsrxErrorBoundary` itself for the core-generated boundary,
so its injector takes the alias too, and it no longer merges that value
import into an authored `import type` declaration, where it would be
erased.

Fixes tsrx-org#1141

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

Every import injector put its imports at index 0, ahead of a
`'use client'` or `'use server'` directive, which then stopped being a
directive. Any module using `@pending`, `@catch`, a keyed fragment row,
a dynamic tag or another construct with a generated import lost its
directive; Next.js treated a `'use client'` .tsrx module as a server
component ("You're importing a module that depends on `useState` into
a React Server Component module").

Insert generated imports (and the type-only style anchors) after the
directive prologue in the core, Vue and Solid injectors.

Vue's `ensure_named_import` also counted an inline `type` specifier as
the value import, so `import { type Suspense } from 'vue'` with
`@pending` left `Suspense` unbound. Require a value specifier, and
import Vue's generated `Suspense` as `__Suspense` like the core
transform does, so the value import never redeclares an authored
binding. vue-jsx-vapor compiles the aliased element the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Solid imported Show, For, Switch, Match, Errored and Loading from
solid-js under their public names, and Vue imported VaporFor the same
way. An authored binding with one of those names either collided with
the generated import (another module's import, a type-only import) or
replaced the generated element (a module or setup local, or a
`@for (const Match of rows)` loop variable).

Import them as __Show, __For, __Switch, __Match, __Errored, __Loading
and __VaporFor, the way tsrx-org#1175 imports Suspense, Fragment and
TsrxErrorBoundary. Solid's compiler treats the aliased tags as plain
components, and vue-jsx-vapor compiles <__VaporFor> exactly like
<VaporFor> in DOM, SSR, HMR and interop output.

defineVaporComponent keeps its public name: vue-jsx-vapor's macros,
HMR registration, SSR registration and interop compile all find
components by that callee name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
vue-jsx-vapor finds components by calls to `defineVaporComponent`, so
the compiler's import of it can't take a private name the way VaporFor
now does. An authored binding of that name either collided with the
generated import (an import from another module) or replaced it (a
module function or const), and vue-jsx-vapor's macros treat every call
of the name as a component definition anyway.

Report each such binding with a new code, TSRX2032: an import from
anywhere but `vue-jsx-vapor`, a module function, const or class, and a
local or parameter in any scope. In collect and editor mode a
module-level binding keeps the name, and the compiler adds no import
that would declare it again. A type-only import of
`defineVaporComponent` from `vue-jsx-vapor` itself becomes the value
import the components need.

The error has an entry in the error tables, a row in the specification
and an example the content mapper checks through TypeScript 7, which
now covers Vue as well as React and Solid.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jonkwheeler added a commit to jonkwheeler/tsrx that referenced this pull request Oct 27, 2026
…st reactive reads

Review fixes for TSRX2031:

- A top-level pattern with no key vue-jsx-vapor reads was left alone,
  on the reading that the macro keeps it as a plain destructuring
  parameter. But such a component gets no props option, so Vue passes
  setup an empty object: `function C({ ['s']: v = 3 })` rendered `3`
  with `s="A"`, and `{ 's': v }` rendered `undefined`. Every computed or
  non-name key is now reported at every level.
- vue-jsx-vapor applies a default inside a destructured prop
  (`{ s: { a = 3 } }`) only when the whole prop is missing, so it is lost
  whenever `s` is passed without `a`. TSRX2029 now reports these too,
  with its own message.
- The suggested rewrite read the prop once at setup (`const v =
  props[k] ?? 3`), which goes stale when the parent changes, and `??`
  also replaces `null`. The messages, TSRX2029's included, now suggest
  reading the prop where it is used, for example
  `{props.s === undefined ? 3 : props.s}`, or a `computed`; a kebab-case
  key is read by its camelized name (`props.aB`), as Vue normalizes it.
- A key that spans lines is printed on one line instead of as `[null]`.
- The content mapper's Vue error examples use the names tsrx-org#1222 uses for
  the same workspace, so whichever merges second conflicts least, and
  the nested default has an example.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jonkwheeler and others added 3 commits October 27, 2026 20:47
The previous commit named Solid's generated control-flow components
`__Show`, `__Switch`, `__Loading` and so on. The compiler counted a tag
as a component only when it started with A-Z, so those looked like host
tags. Solid vetoes hoisting a subtree that renders a component, and
without the veto a static `@if`, `@switch` or `@pending` subtree went to
one module-level node: a component rendered twice showed one copy.

Decide as JSX does instead: a tag is a host element only when its first
character is a lowercase ASCII letter. Compiled on every .tsrx file in
the repo, React, Preact, Hono and Vue output is byte-identical before
and after, and Solid output matches tsrx-org#1175's apart from the private
names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- `declare function defineVaporComponent` declares the name, so it is
  reported too.
- After any TSRX2032 the compiler adds no `defineVaporComponent` import.
  A `var` in a top-level block hoists to module scope, so the import
  redeclared it (TS2440) even though the binding is not at module level.
- A namespace of types only binds no value, so it is not reported.
- A quoted specifier, `{ "defineVaporComponent" as defineVaporComponent }`
  from `vue-jsx-vapor`, is the compiler's own import: it is not reported,
  and the compiler reuses it instead of adding the name again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jonkwheeler
jonkwheeler marked this pull request as ready for review October 28, 2026 01:05
jonkwheeler added a commit to jonkwheeler/tsrx that referenced this pull request Nov 6, 2026
tsrx-org#1175 and tsrx-org#1222 import `Suspense` as `__Suspense`, so the test failed once
either was merged with this branch. The name isn't what it's about.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jonkwheeler added a commit that referenced this pull request Nov 12, 2026
…pins (#1296)

* fix(vue): leave Vue's slot flag out of the type-only @pending boundary

`vue-jsx-vapor` 3.2.29 types a component's `v-slots` from its real slots, so
the `_` flag on `Suspense` is an excess property and every `@try` with
`@pending` reports TS2322 in the editor. The flag only matters at runtime, so
keep it in compiled output and drop it from the type-only print.

* chore(vue): bump vue to 3.6.0-rc.14 and vue-jsx-vapor to 3.2.29

Moves every dev pin, and adds `vue-jsx-vapor` as a dev dependency of
`@tsrx/vue` so its peer stops resolving to 3.2.14 in the lockfile.

Runs the Vue runtime tests on the real `vue-jsx-vapor` runtime instead of a
hand-copied shim. The shim had the #870 bug and lacked `normalizeVaporSlots`,
which the new compiler output imports, so it would have hidden the fix.

* test(vue): run the worker regression in a worker-like scope

The test matched text: it looked only at the first mention of
`__VUE_HMR_RUNTIME__` and rejected only uses at column 0, so an indented,
unguarded `createRecord` after one guarded use passed. It now runs the served
module with `self` and none of Vue's globals, and checks what it posted.

* test(vue): pin the Suspense slot flag in compiled output

Nothing failed when `_: 1` was dropped from compiled output. Pin it there and
pin its absence from type-only output, for both ways `@pending` is lowered.

Correct the changeset and 4a43094's message: `vue-jsx-vapor` rejects the flag
from 3.2.20, not 3.2.29, and leaving it out clears the error from 3.2.22.
4a43094's "the flag only matters at runtime" is also unsupported: removing it
fails no runtime test, and I haven't shown what depends on it.

* chore(vue): drop an unused paths entry from the plugin test tsconfig

Nothing in the project imports Vue's Vapor browser build. Only
`vue-runtime-shim.js` does, and that file isn't part of the project. `tsc`
reports the same with and without the entry.

* test(vue): move the Suspense slot flag test to its own file

At the end of `type-only-types.test.js` it conflicted with #1177, which changes
the lines before it.

* test(vue): stop the slot flag test passing on missing output

The type-only assertion was only a negative match, so it also passed if the
`Suspense` boundary was gone. Require the boundary, and no compile errors,
before checking that the flag is absent.

* test(vue): let the slot flag test accept a private Suspense name

#1175 and #1222 import `Suspense` as `__Suspense`, so the test failed once
either was merged with this branch. The name isn't what it's about.

* style(vue): format the slot flag test

* fix(vue): require vue 3.6 and vue-jsx-vapor 3.2.27 as peers

Raise the floors in all five packages that declare them: `@tsrx/vue`,
`@tsrx/vue-runtime`, `@tsrx/vite-plugin-vue`, `@tsrx/rspack-plugin-vue` and
`@tsrx/bun-plugin-vue`.

`vue >=3.6.0-0` admits the 3.6 prereleases and rejects 3.5, which has no
Vapor. The old `>=3.5` rejected every 3.6 prerelease under npm, so no Vapor
setup installed with npm's defaults. `vue-jsx-vapor` 3.2.27 is the first
release with the fixes for both #186 (3.2.26) and #870 (3.2.27).

Minor, because a project on `vue-jsx-vapor` 3.2.26 that installs today under
pnpm's `strict-peer-dependencies` fails after this.

* docs(vue): name Vue 3.6 in the install commands

`vue` alone installs Vue's `latest`, 3.5.45, which has no Vapor: with pnpm,
`vite build` then fails with MISSING_EXPORT. Name `vue@^3.6.0-0`, which picks
the newest 3.6 prerelease now and stable 3.6 once it ships.

* docs(changeset): drop the 3.2.20 to 3.2.22 notes from the slot flag changeset

With `vue-jsx-vapor` 3.2.27 as the floor, every supported version rejects the
flag, and every one accepts the output without it.

* docs(changeset): say which Vue prereleases the new floor admits

`>=3.6.0-0` admits 3.6.0's prereleases, not later ones such as 3.6.1-alpha.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jonkwheeler added a commit that referenced this pull request Nov 12, 2026
…2031) (#1231)

* refactor(vue): take the TSRX2028 and TSRX2029 messages from the core error table

#1125 wrote both Vue messages inline in the transform. They are now
TSRX_ERRORS.TARGET_COMPONENT_READ_BEFORE_DECLARATION and
TSRX_ERRORS.TARGET_PROP_DEFAULT_UNSUPPORTED in @tsrx/core/diagnostics,
taking the target's name like the other TARGET_* entries, so tools that
load the tables see them. The messages are unchanged.

Every table entry needs an example in the content mapper's error
examples, so those now run Vue too, in a vue/ directory configured like
the Vue target fixture, and both new entries have one. Each shows once
through TypeScript 7.

Related: #1202

* fix(vue): report a destructured prop key vue-jsx-vapor misreads (TSRX2031)

vue-jsx-vapor's props macro reads a destructured prop by its key's name
and ignores whether the key is computed, so `{ [k]: v }` declared and
read a prop literally named `k`, dropping any default. It also skips a
key that is not a name (a string or number literal, or a computed
expression), which leaves that binding undefined once it reads any other
prop from the pattern, and always inside a nested pattern. TSRX reported
none of these, and TSRX2029 skipped computed keys.

Wrapped Vue components now report TSRX2031 at each such key, mirroring
the macro: a computed name anywhere in the props pattern, and any other
non-name key in a pattern the macro reads (a top-level pattern with a
name key or a rest element, or any nested pattern). A top-level pattern
with no key the macro reads stays an ordinary destructuring parameter,
which works, so it is left alone. The message suggests reading the prop
from a props parameter, with an example built from the key and the
binding (`const v = props[k] ?? cfg.size`).

TSRX2031 follows #1223's TSRX2030. TSRX2029 now builds its example the
same way, so a renamed prop (`{ s: size = cfg.size }`) suggests
`const size = props.s ?? cfg.size`.

* fix(vue): report every misread prop key and nested default, and suggest reactive reads

Review fixes for TSRX2031:

- A top-level pattern with no key vue-jsx-vapor reads was left alone,
  on the reading that the macro keeps it as a plain destructuring
  parameter. But such a component gets no props option, so Vue passes
  setup an empty object: `function C({ ['s']: v = 3 })` rendered `3`
  with `s="A"`, and `{ 's': v }` rendered `undefined`. Every computed or
  non-name key is now reported at every level.
- vue-jsx-vapor applies a default inside a destructured prop
  (`{ s: { a = 3 } }`) only when the whole prop is missing, so it is lost
  whenever `s` is passed without `a`. TSRX2029 now reports these too,
  with its own message.
- The suggested rewrite read the prop once at setup (`const v =
  props[k] ?? 3`), which goes stale when the parent changes, and `??`
  also replaces `null`. The messages, TSRX2029's included, now suggest
  reading the prop where it is used, for example
  `{props.s === undefined ? 3 : props.s}`, or a `computed`; a kebab-case
  key is read by its camelized name (`props.aB`), as Vue normalizes it.
- A key that spans lines is printed on one line instead of as `[null]`.
- The content mapper's Vue error examples use the names #1222 uses for
  the same workspace, so whichever merges second conflicts least, and
  the nested default has an example.

* fix(vue): report a defaulted props parameter and a rest element inside a prop

More shapes vue-jsx-vapor's props macro compiles wrongly, checked at
runtime in the new props-params runtime test:

- It skips a props parameter with a default (`{ s } = {}` or
  `props = {}`), so the component gets no prop options and Vue passes it
  no props: `v` is always undefined. TSRX2031 now reports it at the
  default and suggests removing it, since Vue always passes a props
  object.
- It gives the props pattern's last rest element the component's attrs,
  even inside a prop, and an array's rest element the whole array, so in
  `{ t: { a, ...r } }` or `{ t: [a, ...r] }` `r` held `other`, not `b`.
  TSRX2031 reports those. A prop's object rest followed by the pattern's
  own rest is read right and still compiles.
- The examples for a value inside a prop use optional chaining
  (`props.t?.a`), since the prop can be missing.

* fix(vue): report every rest element inside a prop

The previous commit accepted a prop's object rest followed by the
pattern's own rest (`{ t: { a, ...r }, ...rest }`), where
vue-jsx-vapor emits `createPropsRestProxy(__props.t, ['a'])`. That runs
once at setup, so when the parent replaces `t`, `a` follows and `r`
keeps the old rest; `{ t: [{ a, ...r }], ...rest }` goes stale the same
way. TSRX2031 now reports every rest element inside a prop, whatever
its order. A rest element of the props themselves still compiles.

The runtime test replaces `t` from a parent to show the stale rest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jonkwheeler and others added 3 commits November 12, 2026 12:02
Solid's transform keeps main's memoized @switch, ref-prop imports and createMemo/untrack specifiers, with the control-flow components still imported under their private names. diagnostics.js and the spec list this branch's TSRX2032 after main's TSRX2027-2031 (2032 is still free on main), and the Solid and shared tests keep main's expectations (inline statics, the @catch value binding, keyed={false}) with the private `__Show`, `__Errored`, `__Loading` and `__For` names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
…ests

This branch imports Solid's Show, For, Switch, Match, Errored and Loading
and Vue's VaporFor under `__` names. Tests main added since (the static
@if fallbacks from tsrx-org#1129, the @{ } block bodies from tsrx-org#1128, the memoized
@switch, the untracked @Try body, and the keyed-array @for from tsrx-org#1135)
matched the public names; they now match the private ones.

The memoized @switch also imports `createMemo` from solid-js, so the
generated import no longer fits on one line and the printer wraps it. The
shared generated-import check and the @switch memo test now read an import
across lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
…s params test

Main's tsrx-org#1231 added a runtime test that imports `defineVaporComponent` from
`vue` and calls it directly, so vue-jsx-vapor's props macro sees the
patterns as written. This branch reports every binding of that name other
than an import from `vue-jsx-vapor` (TSRX2032), because the compiler
imports it from there for each component it wraps and a second binding
would collide. Import it from `vue-jsx-vapor`, as the compiler does; the
macro still finds the calls by name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
@jonkwheeler
jonkwheeler merged commit e0c07b5 into tsrx-org:main Nov 12, 2026
8 checks passed
jonkwheeler added a commit to jonkwheeler/tsrx that referenced this pull request Nov 12, 2026
Main's tsrx-org#1222 imports Solid's control-flow components under private names through CONTROL_FLOW_LOCALS. The import injector keeps this branch's iterable-helper import and its single CREATE_MEMO_INTERNAL_NAME specifier (for @switch and destructured @for rows) and maps the control-flow names through CONTROL_FLOW_LOCALS. The tests expect `<__For each={__for_items(…)}`, including this branch's for-of-any-iterable test.

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 12, 2026
Main added TSRX2032 (tsrx-org#1222), so this branch's TSRX2035 code, its two messages, and its spec rows follow it. The content mapper's error examples keep main's TSRX2032 entry ahead of this branch's two warning entries.

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 12, 2026
Main added TSRX2032 (tsrx-org#1222), so this branch's TSRX2033 follows it in diagnostics.js and the spec's code list.

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 12, 2026
Main added TSRX2032 (tsrx-org#1222), so this branch's TSRX2034 follows it in diagnostics.js and the spec's code list.

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.

[Bug]: vue, solid: generated VaporFor, defineVaporComponent and Solid control-flow imports collide with or are shadowed by authored bindings

1 participant