react-resize-detector
Advanced tools
Comparing version 6.0.0-alpha.0 to 6.0.0-alpha.1
{ | ||
"name": "react-resize-detector", | ||
"description": "React resize detector", | ||
"main": "build/index.js", | ||
"module": "build/index.esm.js", | ||
"files": [ | ||
"build" | ||
], | ||
"types": "build/index.d.ts", | ||
"repository": { | ||
@@ -9,12 +15,9 @@ "type": "git", | ||
"scripts": { | ||
"build": "npm link react react-dom && npm run build:cjs && npm run build:esm", | ||
"build:cjs": "babel src --out-dir lib", | ||
"build:esm": "cross-env BABEL_ENV=esm babel src --out-dir lib/esm", | ||
"clean": "rimraf lib", | ||
"lint": "eslint -c .eslintrc src", | ||
"test": "npm run lint && npm run clean && npm run build" | ||
"build": "rollup -c", | ||
"link": "npm link react react-dom", | ||
"prerelease": "npm version premajor --preid=alpha" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.20", | ||
"prop-types": "^15.7.2", | ||
"lodash.debounce": "^4.0.8", | ||
"lodash.throttle": "^4.1.1", | ||
"raf-schd": "^4.0.2", | ||
@@ -26,16 +29,24 @@ "resize-observer-polyfill": "^1.5.1" | ||
"@babel/core": "^7.12.10", | ||
"@babel/plugin-proposal-class-properties": "^7.12.1", | ||
"@babel/preset-env": "^7.12.11", | ||
"@babel/preset-react": "^7.12.10", | ||
"@rollup/plugin-babel": "^5.2.2", | ||
"@rollup/plugin-commonjs": "^17.0.0", | ||
"@rollup/plugin-inject": "^4.0.2", | ||
"@rollup/plugin-node-resolve": "^11.0.1", | ||
"@types/lodash": "^4.14.167", | ||
"@types/raf-schd": "^4.0.0", | ||
"@types/react": "^17.0.0", | ||
"@types/react-dom": "^17.0.0", | ||
"@types/resize-observer-browser": "^0.1.4", | ||
"@typescript-eslint/eslint-plugin": "^4.12.0", | ||
"@typescript-eslint/parser": "^4.12.0", | ||
"babel-eslint": "^10.0.3", | ||
"babel-plugin-module-resolver": "^4.1.0", | ||
"babel-plugin-transform-imports": "^2.0.0", | ||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^7.17.0", | ||
"eslint-config-airbnb": "^18.2.1", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jsx-a11y": "^6.4.1", | ||
"eslint-plugin-react": "^7.22.0", | ||
"rimraf": "^3.0.0" | ||
"rimraf": "^3.0.0", | ||
"rollup": "^2.36.1", | ||
"rollup-plugin-typescript2": "^0.29.0", | ||
"tslint": "^6.1.3", | ||
"typescript": "^4.1.3" | ||
}, | ||
@@ -47,3 +58,3 @@ "peerDependencies": { | ||
"author": "Vitalii Maslianok <maslianok@gmail.com> (https://github.com/maslianok)", | ||
"version": "6.0.0-alpha.0", | ||
"version": "6.0.0-alpha.1", | ||
"bugs": { | ||
@@ -62,8 +73,6 @@ "url": "https://github.com/maslianok/react-resize-detector/issues" | ||
"license": "MIT", | ||
"main": "lib/index.js", | ||
"module": "lib/esm/index.js", | ||
"sideEffects": false, | ||
"maintainers": [ | ||
{ | ||
"name": "maslianok", | ||
"name": "Vitalii Maslianok", | ||
"email": "maslianok@gmail.com" | ||
@@ -70,0 +79,0 @@ } |
@@ -1,2 +0,2 @@ | ||
# Handle element resizes like it's 2020! | ||
# Handle element resizes like it's 2021! | ||
@@ -8,8 +8,17 @@ <img src="https://img.shields.io/npm/dy/react-resize-detector?style=flat-square"> | ||
Nowadays browsers have started to support element resize handling natively using [ResizeObservers](https://wicg.github.io/ResizeObserver/). We use this feature (with a [polyfill](https://github.com/que-etc/resize-observer-polyfill)) to help you handle element resizes in React. | ||
No `window.resize` listeners! No timeouts! Just a pure implementation with a lightning-fast polyfill! | ||
Nowadays browsers support element resize handling natively using [ResizeObservers](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver). The library uses these observers to help you handle element resizes in React. | ||
🐥 Tiny [~6kb](https://bundlephobia.com/result?p=react-resize-detector) | ||
🐼 Written in TypeScript | ||
🦁 Supports Function and Class Components | ||
🐠 Trusted by [many different projects](https://www.npmjs.com/browse/depended/react-resize-detector) | ||
No `window.resize` listeners! No timeouts! No 👑 viruses! :) | ||
## Installation | ||
``` | ||
```ssh | ||
npm i react-resize-detector | ||
@@ -20,2 +29,11 @@ // OR | ||
and | ||
```jsx | ||
import ResizeObserver from 'react-resize-detector'; | ||
// or, in case you need IE support and ready to load extra kilobytes | ||
import ResizeObserver from 'react-resize-detector/withPolyfill'; | ||
``` | ||
## Examples | ||
@@ -22,0 +40,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170695
1055
222
24
1
+ Addedlodash.debounce@^4.0.8
+ Addedlodash.throttle@^4.1.1
+ Addedlodash.debounce@4.0.8(transitive)
+ Addedlodash.throttle@4.1.1(transitive)
- Removedlodash@^4.17.20
- Removedprop-types@^15.7.2
- Removedlodash@4.17.21(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact-is@16.13.1(transitive)