Skip to content

refactor(solid): type createOwner only through solid-js/internal - #4515

Merged
ryansolid merged 1 commit into
nextfrom
claude/project-thread-x1ore2-owner-internal
Oct 30, 2026
Merged

ryansolid merged 1 commit into
nextfrom
claude/project-thread-x1ore2-owner-internal

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Before: createOwner is in solid-js's public types, so apps can build on it. Its dispose is a shared method, so a detached owner.dispose throws (#4444).

After: createOwner is typed only through solid-js/internal, the same way #3709 handled the boundary primitives behind Errored, Loading and Reveal. It is still a runtime export of both solid-js entries for the renderers, but it is @internal, so it is stripped from types/index.d.ts and types/server/index.d.ts. Solid 1.x had no createOwner. Apps host a scope with createRoot(), whose dispose argument can be passed around as a plain function, and re-enter one with runWithOwner(). The maintainer decided this on 2026-10-30. It supersedes #4508, which bound dispose on the public createOwner.

How:

  • packages/solid/src/index.ts and server/index.ts drop createOwner from the public export lists and re-export it under /** @internal */ with a note.
  • packages/solid/src/internal.ts types it for renderers (Owner & { dispose(self?): void }), and the header lists it.
  • @solidjs/web keeps importing it from solid-js at runtime, with a @ts-expect-error on the two typed imports (Portal and the frames client), so the bundle holds one binding. Importing it through solid-js/internal instead cost +6 B minified on the server-components pages and +29 B on live + router (the const re-binding and a cross-chunk import). The web specs that create owners import it from solid-js/internal.
  • @solidjs/signals still exports createOwner. Its doc is already tagged @internal, and signals' declarations aren't stripped, so nothing changes there.
  • Downstream:

Tests (after a full build): solid-js 917 passed, test-types ok. Web: 1,583 passed / 7 expected fail; hydrate config 716 passed / 10 expected fail; test-types ok. Server config: 1,910 passed and 1 failed. The failure, server-functions-adapter-request.spec.tsx "keeps a rebuild failure's own error…", also fails on next @ 71a6a75 in this container.

Size (client, vs next e6c2f3b, measured locally): 0 B brotli and 0 B minified on every scenario. Hello world is 9,971 B.

Closes nothing on its own. #4444 is to be closed as not planned once this lands, since createOwner is internal and runWithOwner over a createRoot owner is the supported pattern.


Generated by Claude Code

Ryan's call on #4444 (2026-10-30): `createOwner` isn't intended as
application API, and 1.x had none. Like the boundary primitives in
#3709, it stays a runtime export of both solid-js entries but is
`@internal` (stripped from the declarations) and typed for renderers in
`solid-js/internal`. Apps host a scope with `createRoot()` and re-enter
it with `runWithOwner()`.

@solidjs/web keeps importing it from solid-js at runtime, with a
`@ts-expect-error` on the two typed imports (`Portal`, the frames
client), so the bundle holds one binding: 0 B on every size scenario.
Importing it through solid-js/internal instead cost +6 to +29 B
minified. The web specs that create owners import it from
solid-js/internal.

Supersedes #4508.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
@changeset-bot

changeset-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e2d6984

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
solid-js Patch
@solidjs/web Patch
@solidjs/diagnostics Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
test-integration Patch
@solidjs/universal Patch
board-example Patch
canvas-example Patch
server-dbmon-example Patch
todos-server-example Patch
@solidjs/babel-plugin Patch
@solidjs/compiler Patch
@solidjs/signals Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown

Size (brotli, eager entry chunk)

scenario head vs base minified vs base minified vs recorded cap lazy chunks (not counted)
signals: core floor (createSignal/Memo/Effect/Root/flush) 7.41 KB 0 B 0 B −3 B 7.43 KB ✅
signals: + createStore 14.97 KB 0 B 0 B +24 B 14.99 KB ✅
signals: + isPending/latest 11.34 KB 0 B 0 B −3 B 11.35 KB ✅
signals: + until/refresh (truth readers, no optimism) 8.04 KB 0 B 0 B −1 B 8.06 KB ✅
app: render + one signal (the simple-app floor) 9.79 KB 0 B 0 B −3 B 9.80 KB ✅
app: hydrating (no stores) with Show/For/Loading/Errored/lazy 18.78 KB 0 B 0 B +4 B 18.74 KB ⚠️ over by 43 B, 16 B minified headroom lazy-page.js 0.04 KB
app: hydrating + every store primitive family 32.43 KB 0 B 0 B +49 B 32.48 KB ✅ lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.43 KB 0 B 0 B +13 B 13.47 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 15.18 KB 0 B 0 B +13 B 15.20 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 29.78 KB 0 B 0 B +13 B 29.78 KB ⚠️ over by 4 B, 7 B minified headroom lazy-page.js 0.04 KB
app: compiled floor (one template, one text hole, one delegated click) 9.98 KB 0 B 0 B −1 B 9.98 KB ✅
app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store) 26.30 KB 0 B 0 B +32 B 26.36 KB ✅ stats.js 0.18 KB
app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable) 32.50 KB 0 B 0 B +32 B 32.54 KB ✅ stats.js 0.20 KB
frames: eager client consumer (frames client + transport, lazy codec) 11.75 KB 0 B 0 B 0 B 11.77 KB ✅
page: base server components (hydrating + dynamic + frames + sf reference) 33.80 KB 0 B 0 B +4 B 33.77 KB ⚠️ over by 29 B, 16 B minified headroom assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.19 KB, wire.js 3.47 KB
page: live server components (base + live/GET + action + isPending/latest) 39.08 KB 0 B 0 B +4 B 39.10 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.18 KB, wire.js 3.47 KB
page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread) 35.69 KB 0 B 0 B +4 B 35.72 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.06 KB, sc-comments.js 0.20 KB, trace.js 9.15 KB, wire.js 3.47 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 43.03 KB 0 B 0 B +4 B 43.02 KB ⚠️ over by 11 B, 16 B minified headroom eager (counted): web.js 23.01 KB; assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.07 KB, sc-comments.js 0.19 KB, trace.js 9.17 KB, wire.js 3.47 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 41.10 KB 0 B 0 B −53 B 41.25 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.58 KB, trace.js 9.13 KB, wire.js 3.48 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 48.63 KB 0 B 0 B −69 B 48.67 KB ✅ eager (counted): client.js 28.12 KB; assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.30 KB, trace.js 9.13 KB, wire.js 3.49 KB
server: floor (getRequestEvent + isServer) 1.27 KB 0 B 0 B 0 B 1.29 KB ✅
server: renderToString (the server-render floor) 22.85 KB 0 B 0 B 0 B 22.87 KB ✅

⚠️ Over the brotli cap within the minified allowance (passes)

  • app: hydrating (no stores) with Show/For/Loading/Errored/lazy: over brotli cap by 43 B; minified 53,611 B vs 53,607 B recorded with the cap (+4 B) — 16 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • app: CSR, observe tier + attribution engine enabled: over brotli cap by 4 B; minified 88,329 B vs 88,316 B recorded with the cap (+13 B) — 7 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • page: base server components (hydrating + dynamic + frames + sf reference): over brotli cap by 29 B; minified 101,710 B vs 101,706 B recorded with the cap (+4 B) — 16 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • page: compiled live server components (the compiled base page + live/GET + action + isPending/latest): over brotli cap by 11 B; minified 126,200 B vs 126,196 B recorded with the cap (+4 B) — 16 B of the 20 B minified allowance left; +0 B minified over this PR's base

Bundled with Rolldown (what Vite ships), brotli q11, decimal KB. A scenario fails only when it is over its brotli cap and its minified size is more than 20 B over the minified recorded with the cap; over the cap within that allowance is brotli layout noise and passes with a warning. Caps and their recorded minified in scripts/size/scenarios.js; the floor and page caps in floor-caps.json are frozen (lower only, or Size-Exception: in the PR body). npm run ratchet lowers caps per RC; it never raises one (scripts/size/README.md).

@ryansolid
ryansolid merged commit 61bb177 into next Oct 30, 2026
8 checks passed
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 41142315093

Coverage increased (+0.008%) to 78.108%

Details

  • Coverage increased (+0.008%) from the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1363
Covered Lines: 1126
Line Coverage: 82.61%
Relevant Branches: 1090
Covered Branches: 790
Branch Coverage: 72.48%
Branches in Coverage %: Yes
Coverage Strength: 29.87 hits per line

💛 - Coveralls

@codspeed

codspeed Bot commented Oct 30, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 10.66%

2 warnings

⚠️ 2 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 1 benchmark with a significant change ran on different hardware

Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

❌ 1 regressed benchmark
✅ 199 untouched benchmarks
⏩ 5 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ arrow in template 11.1 ms 12.4 ms -10.66%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/project-thread-x1ore2-owner-internal (e2d6984) with next (ecf3011)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

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.

3 participants