Open shaal opened 1 year ago
Latest commit: 5b3724a4a76571957bfdc83e1f1db0142364765d
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Name | Link |
---|---|
Latest commit | 5b3724a4a76571957bfdc83e1f1db0142364765d |
Latest deploy log | https://app.netlify.com/sites/outlinejs/deploys/65c247cf76f0e1000864634d |
Deploy Preview | https://deploy-preview-393--outlinejs.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
The update introduces a new utility module named resize-controller
, which includes a ResizeController
class for monitoring and reacting to size changes in web components. This module enhances dynamic responsiveness by simplifying the handling of resize events and enabling developers to execute actions based on component size adjustments.
File Path | Change Summary |
---|---|
.../resize-controller/ |
Introduces the resize-controller utility module for monitoring and reacting to web component size changes. |
.../resize-controller/index.ts |
Exports the ResizeController class from src/resize-controller . |
.../resize-controller/src/resize-controller.ts |
Adds ResizeController class implementing ReactiveController for observing element resize events and managing breakpoints. |
this needs to be updated @shaal
Testing
Description
The new resize controller includes multiple improvements over previous attempts
This resize-controller has been extensively tested by multiple projects.
Component width is being tracked by the Browser API's resize observer
Debounce during resize to reduce amount of events
Only when component width moves over from one breakpoint range to another, component update is called.
During component render, only current breakpoint range variable is read (no function is being called)
Provides the ability to separate the element tracking width from the element that will be updated (useful when we need to synchronize all items in a container to switch together at the same breakpoint).
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist
Summary by CodeRabbit
ResizeController
utility for monitoring and reacting to size changes in web components, enabling responsive design adjustments.