Repository navigation
refactor(solid): type createOwner only through solid-js/internal - #4515
Conversation
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 detectedLatest commit: e2d6984 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
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 |
Size (brotli, eager entry chunk)
|
Coverage Report for CI Build 41142315093Coverage increased (+0.008%) to 78.108%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Merging this PR will degrade performance by 10.66%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Before:
createOwneris in solid-js's public types, so apps can build on it. Itsdisposeis a shared method, so a detachedowner.disposethrows (#4444).After:
createOwneris typed only throughsolid-js/internal, the same way #3709 handled the boundary primitives behindErrored,LoadingandReveal. It is still a runtime export of both solid-js entries for the renderers, but it is@internal, so it is stripped fromtypes/index.d.tsandtypes/server/index.d.ts. Solid 1.x had nocreateOwner. Apps host a scope withcreateRoot(), whosedisposeargument can be passed around as a plain function, and re-enter one withrunWithOwner(). The maintainer decided this on 2026-10-30. It supersedes #4508, which bounddisposeon the publiccreateOwner.How:
packages/solid/src/index.tsandserver/index.tsdropcreateOwnerfrom the public export lists and re-export it under/** @internal */with a note.packages/solid/src/internal.tstypes it for renderers (Owner & { dispose(self?): void }), and the header lists it.@solidjs/webkeeps importing it fromsolid-jsat runtime, with a@ts-expect-erroron the two typed imports (Portaland the frames client), so the bundle holds one binding. Importing it throughsolid-js/internalinstead cost +6 B minified on the server-components pages and +29 B on live + router (theconstre-binding and a cross-chunk import). The web specs that create owners import it fromsolid-js/internal.@solidjs/signalsstill exportscreateOwner. Its doc is already tagged@internal, and signals' declarations aren't stripped, so nothing changes there.v2-rebuildalready listscreateOwneramong the internal names its reference extractor skips.@solidjs/routercallscreateOwner()once. refactor: create the route-root owner with createRoot, not createOwner solid-router#711 moves it tocreateRoot(() => getOwner()), which uses only the public API (+7 B minified / −39 B brotli on the router pages vscreateOwner).Tests (after a full build): solid-js 917 passed,
test-typesok. Web: 1,583 passed / 7 expected fail; hydrate config 716 passed / 10 expected fail;test-typesok. 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 onnext@ 71a6a75 in this container.Size (client, vs
nexte6c2f3b, 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
createOwneris internal andrunWithOwnerover acreateRootowner is the supported pattern.Generated by Claude Code