Skip to content

feat: Add Component.sizeSignal() for tracking component size via ResizeObserver#23618

Draft
Artur- wants to merge 2 commits intomainfrom
component-size-signal
Draft

feat: Add Component.sizeSignal() for tracking component size via ResizeObserver#23618
Artur- wants to merge 2 commits intomainfrom
component-size-signal

Conversation

@Artur-
Copy link
Member

@Artur- Artur- commented Feb 21, 2026

Adds a lazily-initialized, read-only signal on Component that tracks the element's size using the browser's ResizeObserver API. A per-UI ComponentSizeObserver manages a single shared ResizeObserver instance and dispatches size updates to individual component signals.

…zeObserver

Adds a lazily-initialized, read-only signal on Component that tracks
the element's size using the browser's ResizeObserver API. A per-UI
ComponentSizeObserver manages a single shared ResizeObserver instance
and dispatches size updates to individual component signals.
@github-actions
Copy link

github-actions bot commented Feb 21, 2026

Test Results

 1 362 files  + 1   1 362 suites  +1   1h 20m 35s ⏱️ - 1m 35s
 9 673 tests + 4   9 606 ✅ + 4  67 💤 ±0  0 ❌ ±0 
10 137 runs  +11  10 061 ✅ +11  76 💤 ±0  0 ❌ ±0 

Results for commit 709c9d4. ± Comparison against base commit d16f71e.

♻️ This comment has been updated with latest results.

@Legioth
Copy link
Member

Legioth commented Feb 23, 2026

I'd keep this one on hold until we have refined the big picture related to responsive layouting APIs. Some open questions to consider:

  • Most responsive layouting is based on specific breakpoints rather than exact pixel values. Would it be useful to express those breakpoints in the API for better ergonomics or to allow client-side filtering of events?
  • How important is it to be able to apply certain effect (e.g. adding or removing a CSS class name when some size crosses a breakpoint) immediately in the client without relying on a server round trip?

@Artur-
Copy link
Member Author

Artur- commented Feb 23, 2026

I would see this as the building block for higher level features

@Legioth
Copy link
Member

Legioth commented Feb 23, 2026

I see it as highly visible API that has the risk of not being a practical building block (e.g. if client-side breakpoints are needed)

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants