Skip to content

fix(resize-observer): preserve hydration ids for accessor targets - #1065

Open
everton-dgn wants to merge 1 commit into
solidjs-community:nextfrom
everton-dgn:fix/resize-observer-hydration
Open

everton-dgn wants to merge 1 commit into
solidjs-community:nextfrom
everton-dgn:fix/resize-observer-hydration

Conversation

@everton-dgn

Copy link
Copy Markdown

createElementSize(accessor) returned early during SSR while allocating a target effect on the client. In Solid 2, that effect consumes a hydration child identifier, so subsequent elements received different keys and hydration left server-rendered nodes unclaimed.

Reserve the same effect identifier on the server without evaluating the target or accessing browser APIs. Preserve nullable dimensions and the browser observer lifecycle.

Add real SSR-to-client hydration coverage for accessor and direct-element targets, including server node identity and observer disposal, plus target replacement/removal and SSR safety tests. The shared hydration harness now exposes original nodes and disposes the hydrated root on cleanup.

Fixes #1060.

Validation:

  • Baseline accessor hydration failed with mismatched keys; direct-element hydration passed. Both pass with the fix.
  • Related client suites: 177 tests across 11 files; related SSR suites: 9 tests across 3 files.
  • Package build, typecheck, lint and formatting passed.

Hydration uses real Solid SSR/hydrate with jsdom rather than a graphical browser. Existing shared-harness formatting and console-lint failures, and missing Babel declarations in a standalone strict harness typecheck, remain outside this patch. The package gates pass.

@netlify

netlify Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for solid-primitives-v2 ready!

Name Link
🔨 Latest commit 52673b2
🔍 Latest deploy log https://app.netlify.com/projects/solid-primitives-v2/deploys/6abcdc863575e80008cd8e3d
😎 Deploy Preview https://deploy-preview-1065--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.

@changeset-bot

changeset-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 52673b2

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

This PR includes changesets to release 1 package
Name Type
@solid-primitives/resize-observer 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

@coderabbitai

coderabbitai Bot commented Sep 30, 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: c7b3f8ae-9a36-4905-a86c-a9376cc8300e

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

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.

This branch has not been deployed

No deployments
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.

1 participant