Modernize code + dependencies to prepare for React 19 #99
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This started as "remove
defaultProps
because React 19 drops support for them" but sort of expanded a bit when a bunch of stuff failed to install.Runtime changes:
defaultProps
replaced with ES6 default parameters.@babel/preset-react
now uses thejsx
transform instead ofReact.createElement
, since it's also unsupported in React 19.@babel/preset-env
updated to target> 0.25%, not dead
, so features like arrow functions are required at runtime (unless you transpile the module).terser
becauseuglify
is no longer supported.The above changes reduce the tarball size from ~16k to ~12k, and likely include runtime benefits from the new transform, lack of
defaultProps
(which sound like they carry a penalty), and reduction in polyfills.Dev environment changes:
devDeps
upgraded. Webpack, ESLint, Jest, Babel, Flow, Prettier, and React all needed bumping either to support the new features, modern Node, or other upgraded packages.defaultProps
did.Verification
Tests all pass, and swapping this version in for the current latest version in my local dev environment both renders correctly and quiets all the deprecation warnings under React 18.3.0.
I plan to release this as a major version.