tl;dr: This is mostly a bugfix only release, with one notable exception. Due to popular demand we reversed our decision to remove support for string styles and brought them back π All users on the next
tag are encouraged to upgrade π
You may have already noticed the rc
suffix in the release number and that is because we're finally out of beta π rc
stands for roughly complete... uh... release candidate and this means that a final Preact X release is really close π We do wanted to give it another phase of testing before going final though and it gives us a bit time to get our docs in shape.
8.x will be maintained further π§
Don't worry if there is something you would have loved to see in X, but that didn't make the cut. The final X release is more of a sign that we think it's stable and maybe even more so than 8.x ever was π This also means that we can focus more on adding new features and reduce our current maintenance overhead of working on two release lines simultaneously. The upgrade should be pretty seamless for everyone and we'll publish a complete migration guide along with the final X release. If you for some reason can't update to X don't worry. We'll keep maintaining the 8.x release line for a good while.
Now Youβre Thinking With Portals
This release contains some noteworthy fixes to our Portal
-Component. But not just that, we also added back support for string styles due to popular demand. Originally we removed them to save bytes, but it turns out that this feature is way to useful not to have. Additionally it aligns better with out philosophy with being "closest to the DOM". Thank you'all for everyone who participated in that journey and helped us make the right decision moving forward π π―
SSR Boost π€
This change has been cooking for a while and plays well along with the research @developit and @housseindjirdeh have been doing about hydration. When you look at the way SSR works, you'll notice that pretty much the complete diff phase is redundant. The HTML that is sent to the client matches the vnode
tree completely, so there isn't much point in comparing changes. The thing is that we can't remove it completely though, because we still need to attach event listeners. For that case we introduced a faster code path which bypasses most of the diffing. After the initial render is done, Preact will continue with the usual diff mode.
Note: This may be a breaking change if you are sending an incorrect DOM structure to the client and relied on hydrate
to correct that for you. To fix this make sure to sent HTML that matches the initial vnode
tree on the client.
Rock solid ecosystem
At this point we'd like to give a shoutout to @robertknight who continues to quietly maintain enzyme-adapter-preact-pure. It's rock solid already and it's only getting better. Be sure to check it out π€
Without further ado: Here is the full changelog of our first (p)release candidate π₯
Features
- Add back support for string styles (#1744, thanks @marvinhagemeister)
Bug Fixes
- Add
requestAnimationFrame
fallback when tab is not focused (#1763, thanks @calebeby) - Move Code of Conduct into
.github
dir (#1765, thanks @developit) - Move
eslintignore
intopackage.json
(#1764, thanks @developit) - Fix various scenarios with
Portals
(#1749, thanks @JoviDeCroock) - Minor debug enhancements (#1755, thanks @marvinhagemeister)
- Bypass
props
during hydration (#1697, thanks @developit) - Fix uncontrolled inputs not changing
value
(#1760, thanks @JoviDeCroock) - Replace
catchRender
withcatchError
(#1742, thanks @andrewiggins) - Warn on invalid table DOM structure (#1745, thanks @JoviDeCroock)
- Fix
replaceNode
not unmounting when diffing twice withreplaceNode
a (#1723, thanks @JoviDeCroock) - Fix up
compat
types and tests (#1740, thanks @andrewiggins) - Golf sibling DOM handling (#1737, thanks @andrewiggins)
- Add return type to
_childDidSuspend
(#1735, thanks @pmkroeker) - Fix
compat
render not destroying existing DOM (#1729, thanks @marvinhagemeister)