maslianok / react-resize-detector

A Cross-Browser, Event-based, Element Resize Detection for React
http://maslianok.github.io/react-resize-detector/
MIT License
1.25k stars 91 forks source link

🌳Maintainance Update (v8.0.0) #227

Closed snelsi closed 1 year ago

snelsi commented 1 year ago

This PR is a combination of various fixes, project setup improvements, and chore/dependencies updates.

It includes some major (and possibly breaking) changes, so make sure to test it before the release. Also, please consider releasing this as a new major version (v8).

✅ ChangeLog:

Dependencies

Docs

Refactor

Types

Eslint + Prettier

Rollup v3

⚠️ Breaking Changes:

Testing Fork

You can test this PR by installing my fork npm i @snelsi/react-resize-detector: https://www.npmjs.com/package/@snelsi/react-resize-detector

Note about Terser and Build size In my tests adding `terser` rollup plugin reduces the build output from ~200kb to ~56kb `(-72% reduction)` by removing comments, and spaces, and minimizing variable names: ![image](https://user-images.githubusercontent.com/15171036/211223292-12b3c7d8-340d-4f06-b8cb-5903db447a8a.png) But it uglifies the source code, so I'm not sure if it makes sense to keep it or not. Will probably remove it after some more testing.