Skip to content

fix: keep hydration ids aligned for client-only effects in Solid 2 - #1070

Merged
davedbase merged 3 commits into
solidjs-community:nextfrom
devagrawal09:fix/server-owner-symmetry
Oct 13, 2026
Merged

davedbase merged 3 commits into
solidjs-community:nextfrom
devagrawal09:fix/server-owner-symmetry

Conversation

@devagrawal09

@devagrawal09 devagrawal09 commented Oct 13, 2026 •

Copy link
Copy Markdown

Problem

This is the same Solid 2 hydration issue as #1048. Primitives that create no owner on the server, but create effects or onSettled on the client, shift the hydration keys of every later sibling.

Fix

  • Client-only effects are marked { transparent: true }:
    • the eventListener() factory (event-listener);
    • createInteractOutside (interaction);
    • createKeyDown (keyboard);
    • createPreventScroll (scroll).
  • createEventListenerMap drops its server early return and delegates to createEventListener.
  • The hydratable helpers in media, utils (createHydratableSignal) and static-store call onSettled on both sides. This also covers the media fallback when matchMedia is missing.

Why not createOwner() on the server (as #1048 did for createEventListener): these effects only exist on the client, so instead of faking an owner on the server they opt out of hydration ID counting with transparent: 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.14 peer range. onSettled already reserves its ID on the server, so the hydratable helpers just call it on both sides. createEventListener could adopt transparent in a follow-up for consistency.

interaction overlaps 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: createBreakpoints with watchChange still raises CLEANUP_IN_FORBIDDEN_SCOPE. It has a separate cause.

@changeset-bot

changeset-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3bd2223

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

This PR includes changesets to release 7 packages
Name Type
@solid-primitives/event-listener Patch
@solid-primitives/interaction Patch
@solid-primitives/keyboard Patch
@solid-primitives/scroll Patch
@solid-primitives/media Patch
@solid-primitives/utils Patch
@solid-primitives/static-store 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

@netlify

netlify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for solid-primitives-v2 ready!

Name Link
🔨 Latest commit 3bd2223
🔍 Latest deploy log https://app.netlify.com/projects/solid-primitives-v2/deploys/6ace62398e46e5ef61c2cf5d
😎 Deploy Preview https://deploy-preview-1070--solid-primitives-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 09a25fce-bd70-4bda-9f12-977eab9766b6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devagrawal09
devagrawal09 force-pushed the fix/server-owner-symmetry branch from 1325b0c to dd165cd Compare October 13, 2026 04:08
@devagrawal09 devagrawal09 changed the title fix: match server owners during Solid 2 hydration fix: keep hydration ids aligned for client-only effects in Solid 2 Oct 13, 2026
@davedbase
davedbase merged commit fed58ca into solidjs-community:next Oct 13, 2026
2 of 3 checks passed
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.

2 participants