-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌳Maintainance Update (v8.0.0) #227
Conversation
@@ -1,6 +1,6 @@ | |||
The MIT License (MIT) | |||
|
|||
Copyright (c) 2016 Denis Rul | |||
Copyright (c) 2023 Vitalii Maslianok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
@@ -1,4 +1,4 @@ | |||
# Handle element resizes like it's 2022! | |||
# Handle element resizes like it's 2023! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WOW! 😲
Thank you so much for this PR 👏 Well done!
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
isSSR
check inside theuseEffect
hookTypes
any
withunknown
where possibleuseResizeDetector
hookEslint + Prettier
.vscode
prettier config.eslintrc
package.json
:prettier
- run Prettier formatting on all files,lint
- run Eslint linting on all files,lint-fix
- run Eslint linting on all files and fix all auto-fixable problems,fix
- run both Prettier + EslintRollup v3
rollup-plugin-typescript2
=>@rollup/plugin-typescript
@rollup/plugin-terser
addedrollup-plugin-node-externals
addedResizeDetectorProps
anduseResizeDetectorProps
types in the rootprepublishOnly
scriptbuild
folder moved to thetypes
folderwithPolyfill.d.ts
fileComponentsProps
=>ResizeDetectorProps
patchResizeHandlerType
=>PatchedResizeObserverCallback
handleWidth
andhandleHeight
are turned off,ResizeObserver
andresizeCallback
won't be createdTesting 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: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.