Releases: preactjs/preact
8.1.0
As of 8.1.0, we're officially out of beta! If you were waiting to upgrade to Preact 8, now's the time.
💁 8.x included a few important backwards-incompatible changes, so we've put together a 8.0 migration guide to help. The guide includes "polyfills" you can use to restore 7.x functionality so your migration goes smoothly.
If you have any issues upgrading, including anything caused by this release, drop us a line!
This release resolves a few issues people have had when upgrading.
- Remove object check before setting attributes (fixes custom toString, #401 - thanks @NekR!)
- Cast boolean children to null for component props (fixes rc-animate, #629 - thanks @hassanbazzi!)
- Call
componentDidMounton children beforecomponentDidUpdateon parent (#440, #506 - thanks @robertknight!) - Revert 8.0.0 behavior of throwing when encountering undefined components (#627)
preact/debugwill be released shortly and does a much better job reporting stack traces!
🌈 Also worth noting, the linkstate module is now available.
8.0.1
8.0.0
8.0.0 (beta)
It's here! 🌈
This release represents a huge step forward for Preact:
- Significantly increased performance - in some cases by 30%.
- Better compatibility -
keyfor PFC's,classintegrations, capturing events. - Fewer edge cases - goodbye to unnecessary mounts and DOM hierarchy errors.
- Even smaller - Preact had been 3.9kb for a while - now it's 3.3kb (and headed for 2.9kb!)
💁 If you're looking to upgrade, be sure to read the quick guide.
Breaking Changes
- Pure Functional Components now have backing instances. This means
keynow works perfectly on PFC's. It also means you could use state and lifecycle methods in Functional Components... (#163, #517, #536, #586, #474) linkState()has been removed from Preact itself. It is being published as a standalone linkstate module shortly.classandclassNameno longer serialize Object values to Strings. Instead, use classnames (#401)preact/aliasesis no longer necessary.createElement()is now an alias ofh()right out of the box!- DOM element recycling has been removed. It was a source of issues for many, and is no longer necessary for great performance thanks to diff optimizations that reduce the number of cases where elements are removed and re-added. (#544, #351, #461, #459, #503, #535, #562)
- Undefined components references now throw rather than rendering
<undefined>(#574) - No more
Symbol. Instead of try to useSymbol.for('preactattr'),__preactattr_is always used. - Render debouncing now uses
setTimeout(0)instead of Promises. It's smaller, doesn't swallow rendering errors in Safari, and was already the fallback (#357) - The non-standard
componentDidUnmount()lifecycle method is removed. UsecomponentWillUnmount(). onXxxxCaptureis now supported for registering capturing event handlers.- Events like
focusandblurare no longer automatically capturing by default.
Bugs Fixed
- Hierarchy errors are a thing of the past (thanks to recycler and PFC rewrites) (#380, #391)
- Fixed edge case that could cause children to be rendered out of order (#581, #603)
- Unmount lifecycle is always fired when replacing a Component with an empty element (#538, #534)
reffunctions attached to DOM nodes are no longer invoked for updates, only for mount/unmount.
Other Notable Changes
- "holes" in JSX children are now preserved and used intelligently by the diff (#580, #540)
- Re-rendering a compositional child with a different
keyprop now triggers a remount (#338) - JSX children passed to a Component are preserved rather than normalized (#551)
- Preact no longer relies on the
TextorArrayconstructors for type checks, instead relying on duck typing (#595, #530) - Ignore whitespace-only Text nodes during SSR hydration. SSR boot is now significantly faster than cold boot.
Here's the list of changes itemized by commit:
master...8
7.2.1
7.2.0
⚛️ Preact 7.2.0 is now available as a regular release!
npm install --save preact
Bugs Squashed
- Fix IE issues from 7.1 and update test cases (huge thanks to @mkxml for the hard work on this 🙇)
- Fix TextNode duplication in IE (#430, thanks also to @mkxml)
- Fix unnececssary diff when swapping from
dangerouslySetInnerHTMLtochildren(thanks @harish2704) - Fix issue in 7.x with
<select>sometimes not applyingvalueprop (#446) - Don't stringify
truechildren, instead skip them (#468, thanks @jxodwyer) - Fix issue where unmount could be skipped on a top-level component (#493, discovered by @insin)
- (DevTools Integration) Fix multiple root element issue
New Features
- Use a shared empty Array for
props.childrenwhen there are no children. Fixes simple shallow equality-basedshouldComponentUpdatefor leaf nodes 🎉 - Remove
instanceof SVGElementcheck in favor of duck typing. Fixes JSDOM compatibility and improves diff performance (#423, thanks @nhunzaker) - Better TypeScript Definitions: Component lifecycle methods, setState callback, etc
7.1.0
- 10x performance boost for initial rendering (#416)
- Fix edge case when swapping component root (#414)
- Fix diff reflow when removing leading element (#394)
- Check existence of firstChild before checking if it is a Text node
- Performance optimization for element/tree removal
- Re-add short-circuit for PFC's (fixes compositional PFC triggering constant recycling)
- Fixed TypeScript definition signature for linkState (#427)
- Add a whole bunch of explanatory comments to the diff engine 🎉
7.0.3
Bugfix
This release fixes an issue when hydrating from a static server-rendered DOM that could cause Preact to do far more work than it should have been doing. If you're doing SSR, check out this release for a massive performance boost.
7.0.2
7.x
7.x is currently in beta. It should be an entirely safe upgrade for most.
The reason it's a new major version is because Preact now ignores externally created DOM elements when rendering, unless performing hydration from a server-render (ie - the diff is initiated from a render() against an element that was not created by the DOM renderer).
6.4.0
Features
- Preliminary React DevTools support thanks to the amazing @robertknight! 🙇
Fixes
- Prevent against reassignment of the same value to TextNodes in Firefox (#368, thanks @zbinlin)
- When swapping the base of a composed child component, update its parent's base reference (#349)
- Prevent accidental duplicate recycling of elements when swapping a component's root element (#373, thanks @jakearchibald)
6.3.0
With 6.3.0, the children prop (on a VNode) is now always an Array, even if there are no children. This allows us to skip an existence check when plucking children within render:
// 6.2.1 & prior:
({ children }) => children && children[0];
// As of 6.3.0:
({ children }) => children[0];This change is backwards compatible since previously an empty array was already being returned for no children in some cases. Now it's just more consistent! 🌈
