Repository navigation
feat(solid): onHydrationEnd is public as @experimental (#4000) - #4024
Conversation
`onHydrationEnd` was already a runtime export of both `solid-js` entries, stripped from the declarations as `@internal`. It now leaves the container-trace seam block and is declared next to `isHydrating` / `isHydratable` on both entries, tagged `@experimental` like `setLinkClaim` (#3921), so end-to-end tests have a documented end-of-hydration signal instead of reading `_$HY`. No runtime bytes. `sharedConfig` and `isHydrationInProgress` stay internal. The JSDoc and RFC 12 say what it does not promise: register it after `hydrate()` (before, or after a `hydrate()` parked mid-parse per #3971, it runs in the next microtask); it ends with a failed document-root module preload too; with several roots it can fire before a preload-deferred root claims (GH5); it is for test tooling, not app branching. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NcUAu8BQ6Xsf8XRBhr9V1w
🦋 Changeset detectedLatest commit: 63044f7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 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)
|
Generated by Claude Code |
Coverage Report for CI Build 38433181592Coverage remained the same at 77.429%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Merging this PR will improve performance by 10.2%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | createStore setter: delete + set one root key (#3044 overlay) |
2.1 ms | 1.8 ms | +13.31% |
| ⚡ | memo + sync render effect only (reference) |
28.6 ms | 26.7 ms | +7.17% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing claude/project-thread-w8qjvi-4000 (63044f7) with next (be845cb)
Generated by Claude Code |
Generated by Claude Code |
Requested by Ryan · project thread
Summary
Closes #4000.
Before:
onHydrationEndwas a runtime export ofsolid-jsbut@internal, so E2E tests had no documented way to tell when hydration finished and read_$HY.eventsorsharedConfiginstead.After:
onHydrationEnd(callback)is public fromsolid-js, tagged@experimental, with docs scoped to test tooling and markers.sharedConfigandisHydrationInProgressstay internal.How: the client export moves out of the
@internalcontainer-trace block insrc/index.ts; the declaration inclient/hydration.tsgets full JSDoc; the server stub moves toserver/hydration.tsnext toisHydrating. Docs: a new section indocumentation/solid-2.0/12-ssr-http.mdwith a Playwright example, and one sentence in frames-rulings Ruling 3.The documented caveats, each checked against the code:
hydrate(). Registered before, it runs in the next microtask. The same happens whenhydrate()parks because anasyncentry ran while the parser was still inside the shell (hydrate() run mid-parse leaves dead server nodes beside fresh client copies (async entry script) #3971 path); that case is documented and pinned in a test, with no runtime change.Public API changes
onHydrationEnd(callback: () => void): voidfromsolid-js(client and server types),@experimental. It was already a runtime export, so it adds no runtime bytes; client dist files are byte-identical.Notes for review
_$HY.done(read from the code, not tested). Wrapping each call costs a few bytes; not done here.isHydrating; it can stay inserver/index.tsif byte-identical server dists matter more.How did you test this change?
packages/web/test/hydration/on-hydration-end-public.spec.tsx(6 tests, imports fromsolid-js): fires after hydrate, before-hydrate registration, failed document-root preload, non-document root fallback, the parked hydrate() run mid-parse leaves dead server nodes beside fresh client copies (async entry script) #3971 case.internal-surface.spec.ts:onHydrationEndnow required in both declaration entries.published-declarations.spec.ts: the hydration probe imports it and checks its signature.next.pnpm typecheck19/19; webtest-typesfails onnextwith the new spec (the export was missing from types) and passes here.🤖 Generated with Claude Code
https://claude.ai/code/session_01NcUAu8BQ6Xsf8XRBhr9V1w
Generated by Claude Code