Socket
Socket
Sign inDemoInstall

@juggle/resize-observer

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@juggle/resize-observer - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "@juggle/resize-observer",
"version": "2.0.0",
"version": "2.0.1",
"description": "Polyfills the ResizeObserver API and supports box size options from the latest spec",

@@ -5,0 +5,0 @@ "main": "./lib/ResizeObserver.js",

@@ -12,4 +12,3 @@ # Resize Observer Polyfill

> **Warning:**<br/>
> The latest Resize Observer specification is not yet finalised and is subject to change.
> The latest [Resize Observer specification](https://drafts.csswg.org/resize-observer-1/) is not yet finalised and is subject to change.
> Any drastic changes to the specification will bump the major version of this library, as there will likely be breaking changes.

@@ -94,3 +93,2 @@

> **Warning:**<br/>
> This is a **deprecated** feature and will possibly be removed in later versions.

@@ -108,3 +106,3 @@

// Uses native or polyfill, depending on browser support
// Uses native or polyfill, depending on browser support.
const ro = new ResizeObserver((entries, observer) => {

@@ -115,3 +113,18 @@ console.log('Something has resized!');

> **Warning:**<br/>
To improve this even more, you could use dynamic imports to only load the file when the polyfill is required.
``` js
(async () => {
if ('ResizeObserver' in window === false) {
// Loads polyfill asynchronously, only if required.
const module = await import('@juggle/resize-observer');
window.ResizeObserver = module.ResizeObserver;
}
// Uses native or polyfill, depending on browser support.
const ro = new ResizeObserver((entries, observer) => {
console.log('Something has resized!');
});
})();
```
> Browsers with native support may be behind on the latest specification.

@@ -125,3 +138,3 @@ > Use `entry.contentRect` when switching between native and polyfilled versions.

If an element's observed box size changes again within the same resize loop, the observation will be skipped and an error event will be dispatched on the window.
If an element's observed box size changes again within the same resize loop, the observation will be skipped and an error event will be dispatched on the window. Elements with undelivered notifications will be considered for delivery in the next loop.

@@ -184,6 +197,6 @@ ```js

- No support for **IE10** and below. **IE11** is supported, when bundled and transpiled into ES5.
- Dynamic stylesheet changes may not be noticed.*
- Transitions with initial delays cannot be detected.*
- Animations and transitions with long periods of no change, will not be detected.*
- No support for **IE10** and below. **IE11** is supported, when bundled and transpiled into ES5. Additional polyfills may also be required, depending on tooling used.

@@ -190,0 +203,0 @@ \* If other interaction occurs, changes will be detected.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc