Releases: preactjs/preact
5.3.1
5.3.0
🎉 Preact 5 is here! 🎈
Version 5 represents a fairly major jump forward. It should be backwards-compatible, but major version increment is to signify a few new features that will not be made available in older versions - mainly built-in SVG support, and async rendering.
Take a few seconds and upgrade, you'll be happy you did! 🌈
Tip: If you're using preact-compat, it's best to upgrade that to
2.0.0
at the same time. Since Preact 5+ now includes built-in support for SVG,preact-compat@2
drops thepreact-svg
dependency, saving you around1.7kb
.
Along with the lovely stable
stamp, this release includes some finishing touches:
Bug Fixes
- Fix case where a
ref
may be nulled before a component is unmounted (#232, thanks @slmgc!) - Ensure remounting component trees invokes mount lifecycle events for deeply nested children (thanks to @kruczy @Madumo et al for their help with this!)
New Features
-
Style objects now have a lightning fast pipeline out to the DOM. (#228, thanks @trashhalo!)
Example:
<div style={{ foo:'bar '}} />
now diffs against the current style rather than stringifying the object
5.2.0-beta.0
5.1.0-beta.22
5.1.0-beta.21
5.1.0-beta.20
Minor Changes
-
Fix an inconsistency with how
defaultProps
are applied (preactjs/preact-compat#47)A key in
props
with a value ofundefined
should be treated as a missing key, and the value fromdefaultProps
should be used in its place. -
Switch
setImmediate
backend fromMessageChannel
toPromise#then
(change diff)This is much faster!
However: This comes with the caveat of being unusable for animation. While this matches the use-case for
setImmediate()
within Preact (debouncing rendering), it means thatcomponentDidUpdate()
andsetState()
callbacks should not be used as a means of animation. ** This is only true when using the built-in debounce mechanism. Overriding to requestAnimationFrame is still a great way to do animations via these hooks.
5.1.0-beta.19
Bug Fixes
-
Fix an issue where swapping between functional and classful children of a high-order component could trigger an unmount in certain cases
💁 If you're using preact-router, this fixes a redirect breakage
5.1.0-beta.18
5.1.0-beta.17
Bugfixes
- Ignore
props.children
ifchildren
are manually specified (as jsx children, or the third argument toh()
) - Fix and test for the
<svg class>
bug @zhenkunou found and reported in #202 - Tiny size optimizations to offset the cost of the above fix :)