You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a36b9f6
Browse filesBrowse the repository at this point in the historyBrowse files
feat(compiler,babel-plugin,solid): componentNames for SSR output; ssrScope swaps the id-bearing owner
The SSR generate honours `componentNames` the way `dom` does. Under the
option both compilers keep the `createComponent` call they otherwise inline
to `Comp(props)` and pass the source tag text —
`_$createComponent(Comp, props, "Comp")` — so the server runtime's
observe/dev `createComponent` (a transparent, labelled owner around the
body, #3433) labels every compiled component and a server finding's
`ownerPath` reads `<App> › <Page>` like the client's. Without the option
SSR still inlines: prod output is byte-identical. Universal and dynamic
stay unlabelled. `@solidjs/vite-plugin` already passes the option for its
dev and observe postures for every generate, so app server builds pick this
up with no config change. Oxc's `jsx_tag_name` is now a shared,
closure-based helper so the SSR lowering reuses it (`this.Row` through the
`_self$` pre-pass, member tags). The `ssrInert` fixture becomes `ssr`,
widened to the DOM fixture's shapes; the Oxc suite pins that SSR without
the option imports no `createComponent`.
Compiling the web server suite with the option (vite.config.server.mjs —
the dev posture) surfaced a latent `ssrScope` bug: the virtual hole scope
swapped the CURRENT owner's `id`/`_childCount`, but content inside a hole
resolves ids by walking up past transparent owners, so with one in between
the reserved slot was invisible and the hole's content took fresh ids from
the enclosing counter (`_hk=3` where the client expects `_hk=10`). Reachable
in prod today through `runInServerComponentScope` (transparent), ubiquitous
once every component body runs under a labelled owner. The scope now swaps
the nearest id-bearing owner (solid/test/server/ssr-scope.spec.ts covers a
plain transparent owner, the server-component scope, the labelled
component owner, and nesting).
server-diagnostics.spec.tsx drops its `mount()` workaround for plain JSX;
boundaries are compiled components too, so a boundary's finding now locates
as `<App> › <Errored>` / `<App> › <Loading>` — as on the client. Server,
hydrate and client suites pass under the native compiler and
JSX_COMPILER=babel.
Co-authored-by: Cursor <[email protected]>
`componentNames` now applies to SSR output. Under the option both compilers keep the `createComponent` call they otherwise inline to `Comp(props)` and pass the source tag name — `createComponent(Comp, props, "Comp")` — so the server runtime's observe/dev `createComponent` labels the owner and a server finding's `ownerPath` reads `<App> › <Page>` like the client's. Without the option (prod builds) SSR output is unchanged. `@solidjs/vite-plugin` already passes the option for its dev and observe postures, so app server builds pick this up with no config change.
8
+
9
+
Fixes `ssrScope` under transparent owners: the virtual hole scope swapped the current owner's id counter, but content inside a hole resolves ids by walking past transparent owners, so with one in between (the server-component scope owner; now the labelled component owner) the hole's content took ids from the enclosing counter and disagreed with the client. The scope now swaps the nearest id-bearing owner.
Copy file name to clipboardExpand all lines: packages/babel-plugin/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,7 @@ Development output. With `hydratable`, emits the hydration walk validation helpe
132
132
- Type: `boolean`
133
133
- Default: `false`
134
134
135
-
DOM output only. Emit the tag as written in source as a third `createComponent` argument — `<Home />` compiles to `createComponent(Home, props, "Home")`, `<Ui.Button />` to `"Ui.Button"` — so the dev and observe runtimes label each component's owner (`<Home>` in diagnostic `ownerPath`s and attribution chains) even after a minifier renames the function or a `lazy()`/HMR wrapper hides it. The production runtime ignores the argument; SSR and universal output are unaffected. `@solidjs/vite-plugin` turns this on for its dev and `observe` postures.
135
+
Emit the tag as written in source as a third `createComponent` argument — `<Home />` compiles to `createComponent(Home, props, "Home")`, `<Ui.Button />` to `"Ui.Button"` — so the dev and observe runtimes label each component's owner (`<Home>` in diagnostic `ownerPath`s and attribution chains) even after a minifier renames the function or a `lazy()`/HMR wrapper hides it. Applies to DOM and SSR output; for SSR the compiler keeps the `createComponent` call it otherwise inlines to `Comp(props)`, so the server runtime labels the owner the same way (prod SSR output, without the option, is unchanged). Universal and dynamic output are unaffected. The production runtimes ignore the argument. `@solidjs/vite-plugin` turns this on for its dev and `observe` postures.
0 commit comments