Skip to content

refactor(reatom): idiomatic withResizeObserver exposing plain Size state - #52

Open
vekilibot[bot] wants to merge 1 commit into
mainfrom
refactor/reatom-idiomatic-resize-observer
Open

vekilibot[bot] wants to merge 1 commit into
mainfrom
refactor/reatom-idiomatic-resize-observer

Conversation

@vekilibot

@vekilibot vekilibot Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • withResizeObserver now exposes plain Size state ({ width, height }) instead of the live ResizeObserverEntry platform object — Reatom state should be immutable, serializable plain data
  • Renamed the derived atom sizeEntry → size (domain data, not the platform type) and simplified the entry lookup to entries.at(-1) since a single node is observed
  • Kept the target() read inside memo — it's load-bearing: memo recreates the observable (and disconnects the old ResizeObserver) when the node changes
  • Updated the demo AppShell (target.size()?.height ?? 0), the mirrored create-karkas template copy, and added a patch changeset

Test plan

  • mise run ci (or repo equivalent) on the branch
  • Manual: resize the window with the app-shell header visible, confirm appShell.headerHeight still tracks it

Expose { width, height } plain data instead of the live ResizeObserverEntry
platform object, so state stays serializable and consumers read a stable
shape. Rename the derived atom sizeEntry -> size and simplify the entry
lookup (single observed node). Update the demo app-shell and the
create-karkas template copy, plus a patch changeset.
@coderabbitai

coderabbitai Bot commented Oct 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 86ddc551-58fd-47d8-96a3-e1bf05406ec8

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
  • Autopilot · 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.

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