Repository navigation
fix: keep hydration ids aligned for client-only effects in Solid 2 - #1070
Conversation
🦋 Changeset detectedLatest commit: 3bd2223 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 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 |
✅ Deploy Preview for solid-primitives-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1325b0c to
dd165cd
Compare
Problem
This is the same Solid 2 hydration issue as #1048. Primitives that create no owner on the server, but create effects or
onSettledon the client, shift the hydration keys of every later sibling.Fix
{ transparent: true }:eventListener()factory (event-listener);createInteractOutside(interaction);createKeyDown(keyboard);createPreventScroll(scroll).createEventListenerMapdrops its server early return and delegates tocreateEventListener.createHydratableSignal) and static-store callonSettledon both sides. This also covers the media fallback whenmatchMediais missing.Why not
createOwner()on the server (as #1048 did forcreateEventListener): these effects only exist on the client, so instead of faking an owner on the server they opt out of hydration ID counting withtransparent: true. Solid documents this option as being 'for client-only effects the server never created', and it's available in the^2.0.0-rc.14peer range.onSettledalready reserves its ID on the server, so the hydratable helpers just call it on both sides.createEventListenercould adopttransparentin a follow-up for consistency.interactionoverlaps with #1056 in the same file; the changes are independent.Tests
One short hydration regression per package, each with a following sibling. Each fails before the fix. 267 client + 21 SSR tests pass.
Not addressed:
createBreakpointswithwatchChangestill raisesCLEANUP_IN_FORBIDDEN_SCOPE. It has a separate cause.