react-measure
Advanced tools
Comparing version 2.1.3 to 2.2.0
## CHANGELOG | ||
### 2.2.0 | ||
Remove `componentWillMount` for React >16 StrictMode compliance | ||
[#121](https://github.com/souporserious/react-measure/pull/121) | ||
Upgrade `get-node-dimensions` package to `1.2.1` | ||
Upgrade `prop-types` package to `15.6.2` | ||
Fixes `disconnect` being used instead of `unobserve` for `ResizeObserver` | ||
### 2.1.3 | ||
@@ -4,0 +15,0 @@ |
{ | ||
"name": "react-measure", | ||
"version": "2.1.3", | ||
"version": "2.2.0", | ||
"description": "Compute measurements of React components.", | ||
"main": "lib/react-measure.js", | ||
"main": "dist/index.cjs.js", | ||
"module": "dist/index.esm.js", | ||
"files": [ | ||
"dist", | ||
"lib" | ||
"src" | ||
], | ||
"scripts": { | ||
"build:lib": "babel src --out-dir lib", | ||
"build": "npm run build:lib && NODE_ENV=production webpack --config webpack.prod.config.js", | ||
"dev": "webpack-dev-server --inline --hot --progress --colors --host 0.0.0.0 --devtool eval", | ||
"postbuild": "NODE_ENV=production TARGET=minify webpack --config webpack.prod.config.js", | ||
"prebuild": "rm -rf dist && mkdir dist", | ||
"prepublish": "npm run build", | ||
"deploy": "NODE_ENV=production TARGET=minify webpack && git-directory-deploy --directory example --branch gh-pages" | ||
"build": "rollup -c", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -44,28 +40,17 @@ "repository": { | ||
"dependencies": { | ||
"get-node-dimensions": "^1.2.0", | ||
"prop-types": "^15.5.10", | ||
"get-node-dimensions": "^1.2.1", | ||
"prop-types": "^15.6.2", | ||
"resize-observer-polyfill": "^1.5.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.16.0", | ||
"babel-core": "^6.17.0", | ||
"babel-loader": "^6.2.5", | ||
"babel-preset-es2015": "^6.16.0", | ||
"babel-preset-react": "^6.16.0", | ||
"babel-preset-stage-0": "^6.16.0", | ||
"chokidar": "^1.6.1", | ||
"css-loader": "^0.25.0", | ||
"git-directory-deploy": "^1.5.1", | ||
"http-server": "^0.11.1", | ||
"node-libs-browser": "^1.0.0", | ||
"node-sass": "^4.9.2", | ||
"postcss-loader": "^0.13.0", | ||
"react": "15.3.2", | ||
"react-dom": "15.3.2", | ||
"react-motion": "^0.4.2", | ||
"sass-loader": "^4.0.2", | ||
"style-loader": "^0.13.1", | ||
"webpack": "^1.13.2", | ||
"webpack-dev-server": "^3.1.5" | ||
"@babel/cli": "^7.2.0", | ||
"@babel/core": "^7.2.0", | ||
"@babel/plugin-proposal-class-properties": "^7.2.1", | ||
"@babel/plugin-transform-runtime": "^7.2.0", | ||
"@babel/preset-env": "^7.2.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"rollup": "^0.67.4", | ||
"rollup-plugin-babel": "^4.1.0", | ||
"rollup-plugin-node-resolve": "^4.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
## React Measure | ||
## 📏 React Measure | ||
@@ -6,6 +6,10 @@ [![npm version](https://badge.fury.io/js/react-measure.svg)](https://badge.fury.io/js/react-measure) | ||
Compute measurements of React components. Uses | ||
[resize-observer-polyfill](https://github.com/que-etc/resize-observer-polyfill) | ||
to detect changes of an element and return the new dimensions. | ||
Compute measurements of React components. Uses a | ||
[`ResizeObserver`](https://developers.google.com/web/updates/2016/10/resizeobserver) | ||
to detect when an element's dimensions have changed. | ||
Includes a | ||
[polyfill for `ResizeObserver`](https://github.com/que-etc/resize-observer-polyfill) | ||
in unsupported browsers. | ||
## Install | ||
@@ -43,6 +47,6 @@ | ||
[offsetTop](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop), | ||
[offsetLeft](https://developer.mozilla.org/en-US/docs/Web/API/Element/offsetLeft), | ||
[offsetWidth](https://developer.mozilla.org/en-US/docs/Web/API/Element/offsetWidth), | ||
[offsetLeft](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetLeft), | ||
[offsetWidth](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetWidth), | ||
and | ||
[offsetHeight](https://developer.mozilla.org/en-US/docs/Web/API/Element/offsetHeight). | ||
[offsetHeight](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight). | ||
@@ -182,10 +186,12 @@ #### `scroll`: PropTypes.bool | ||
install dependencies | ||
install package dependencies | ||
`npm install` | ||
`yarn` | ||
run dev mode | ||
move into site folder and install local site dependencies | ||
`npm run dev` | ||
`cd ~/site && yarn` | ||
open your browser and visit: `http://localhost:8080/` | ||
run development mode | ||
`gatsby develop` |
Sorry, the diff of this file is not supported yet
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
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
9
12
1510
0
195
0
70407
2
Updatedget-node-dimensions@^1.2.1
Updatedprop-types@^15.6.2