[Snyk] Upgrade preact from 8.5.2 to 10.0.1 #6
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.
Snyk has created this PR to upgrade
preact
from 8.5.2 to 10.0.1.Warning: This is a major version upgrade, and may be a breaking change.
Release notes
tl;dr: This is a standard bug-fix release with no new features. We encourage everyone to upgrade
Wow, we've been overwhelmed with the reactions to our final Preact X release! We saw a huge uptick in npm downloads to 200.000 per week 🎉 Another exciting announcement is that Google AMP is officially using Preact under the hood. We've receivied many more thank you notes (and even stroopwafels!) from companies using Preact. Those range from small companies to big enterprise ones, where Preact is used in a wide span of different environments.
We preactively allocated the weeks after the big launch for a period of bug-fixes only in case something slipped through. It was admittedly a more conservative decision after our long alpha and beta period, but we wanted to make sure that you all would have a butter smooth experience no matter what 🌠 It's safe to say that it went really well and we've only received a couple bug reports so far 🎉
In the short amount of time that has passed since the release, we managed to squash a good portion of those! Thank you so much to everyone for reporting bugs and helping us track them down! You rock 👍 💯
Bug Fixes
virtual-dom
(#1987, thanks @JoviDeCroock)context
values (forcreateContext
-API) (#2005, thanks @JoviDeCroock)setState
callbacks (-6 B) (#2010, thanks @andrewiggins)preact-context
library (#2001, thanks @jackbravo)forceUpdate
enqueued child update being skipped (#1988, thanks @marvinhagemeister)Portal
node to container instead of prepend (#1971, thanks @toraora)_force
flag from component (#1984, thanks @marvinhagemeister)replaceNode
not always taking effect (#1970, thanks @JoviDeCroock)Types
null
fromVNode.type
TS definition and add some TS tests (#1994, thanks @andrewiggins)_force
to internal.d.ts (#1990, thanks @38elements)VNode
typings (#1979, thanks @andrewiggins)Maintenance
shouldComponentUpdate
(#1980, thanks @JoviDeCroock)tl;dr: Preact X is the next major version of Preact fully packed with features like Fragments, Hooks, componentDidCatch, Test-Utils, Debug-Warnings, many compatibility fixes and so much more 🎉
It's finally happening! After months of hard work we've crossed the finish line and are over the moon with excitement to finally mark Preact X as stable. We'd like to thank everybody who tested it and submitted bug reports.
We originally planned to release a sort-of migration release as version 9 with just the breaking changes from X, but that got canned because many users reported that the upgrade process was easy enough and didn't warrant a long migration period in-between. In fact we got many reports that the upgrade could be done in under an hour, despite some of the breaking changes in X, making the need for a migration release even less desirable.
What's new?
Preact X ships with several major features and we combined them all in a single document on our site. If you're upgrading an existing Preact
8.x
project, we got you covered with a detailed upgrade guide.To give a quick summary of the new features:
Fragments
componentDidCatch
preact/hooks
addonpreact/test-utils
addoncreateContext
APIcompat
moved to corepreact/debug
Again, we highly recommend checking out our new site and specifically the what's new section.
Changes since RC 4
Bug Fixes
shouldComponentUpdate
handling to take more edge cases into account (#1931, thanks @JoviDeCroock)UNSAFE_*
lifecycles being overwritten incompat
(#1946, thanks @marvinhagemeister)PureComponent
rerendering when__source
changes (#1950, thanks @JoviDeCroock)useState
not applied in rare cases (#1948, thanks @JoviDeCroock).forceUpdate()
to participate in the update queue (#1939, thanks @developit)vnode._children
should keep their type asarray
when diffing (#1924, thanks @cristianbote)opacity
) (#1927, thanks @JoviDeCroock)Typings
disableRemotePlayback
to HTML Attributes (#1955, thanks @JoviDeCroock)volume
to HTML Attributes (#1938, thanks @jessicabyrne)Maintenance
__source
and__self
(#1958, thanks @JoviDeCroock)So uhm... just yesterday we've published RC2 and we've mentioned that it would be likely the last RC before going final. Turns out that fate had other plans. One seemingly minor change to our jsx constructor function lead to pretty weird and nasty bug depending on whether the code was run in
use strict
mode or not. @jviide wrote up a great summary on how this issue came to be.Bug Fixes
children
refs increateElement
(#1917, thanks @JoviDeCroock)Typings
tl;dr: This release contains a lot of bug fixes in many areas and we encourage everyone to upgrade. We're confident that this is the last
rc
release before marking X as stable.It's time for another Preact release 🎉 We've spent the past weeks on make
Preact as robust as we can. Most fixes are ones you all submitted to our
tracker. This is super awesome and we wouldn't be where we are without all your
help!
On top of countless fixes, a few minor features found their way into the
package like
isValidElement
that can be used to check if something is valid torender, meaning it's a valid child that was created by
h
/createElement
.The test utils also received much love and we're very impressed with how quickly
@robertknight was able to land support for
async
callbacks and nested callsto
act
💯 This is useful in cases where triggering an effect or state changeinvolves async steps, such as waiting for a
fetch
call to resolve.Preact Devtools are coming
We think it'd be good to give a setSate of the union here about where we are
with the devtools. As many of you are aware we've always depended on the
react-devtools
extension for a long time now. We were very excited tointegrate with version 4, not just because of the new featureset, but also
because the adapter and protocol is so much better than before.
We got very far, but despite of all our efforts we ran into blocker issues with
the expected order of events that need to be sent to the extension. Our
internals differ quite a bit and after trying for weeks to get it right we
ultimately went back to the drawing board.
It became clear that just writing our own extension would be less resource
intensive and would make it easier for us to maintain. It's pre-alpha right now,
but we expect to mature in the coming weeks/month. Here is a screenshot as a
little sneak peek:
Very early pre-alpha preview of
preact-devtools
We'll keep you posted! Here is the full list of changes in this release:
Features
isValidElement
to core (#1861, thanks @marvinhagemeister)children
(#1858, thanks @marvinhagemeister)form
attribute onbuttons
andinputs
(#1863, thanks @sventschui)setState
in aconstructor
(#1857, thanks @marvinhagemeister)act
callbacks and nested calls toact
(#1854, thanks @robertknight)Bug Fixes
setState
calls with accuratethis.state
(#1748, thanks @JoviDeCroock)useImperativeHandle
handles after rendering (#1909, thanks @JoviDeCroock)shouldComponentUpdate
leading to invalid DOM without children (#1888, thanks @JoviDeCroock)shouldComponentUpdate
check forcontext.Consumer
(#1901, thanks @cristianbote)replaceNode
argument not always replacing node (#1900, thanks @JoviDeCroock)shouldComponentUpdate
(#1871, thanks @marvinhagemeister)undefined
styles not being cleared (#1853, thanks @marvinhagemeister)act
not flushing effects/updates if global effect/update queues are non-empty beforeact
call (#1851, thanks @robertknight)refs
tomemo
'ed components (#1860, thanks @sventschui)forwardRef
&memo
proxy components as React components (#1844, thanks @developit)select
value (#1838, thanks @marvinhagemeister)fn.prototype
where possible (#1835, thanks @developit)Typings
compat
types (#1752, thanks @marvinhagemeister)key
to all jsx elements (#1887, thanks @marvinhagemeister)getDerivedStateFromProps
andgetDerivedStateFromError
(#1874, thanks @38elements)VNode.constructor
to internal type definitions (#1810, thanks @38elements)Maintenance
form
attribute test on IE11 (#1868, thanks @marvinhagemeister)tl;dr: This release contains many little fixes and we encourage all X users to upgrade.
As we're nearing closer to the actual release we're hoping to sweeten the wait with another
rc
-release 🎉 While the docs are coming along nicely we have a preview of our upcoming migration guide to Preact X from 8.x. We have a little polish left to do, but apart from that the new docs are basically ready :fingers_crossed:But back to the actual release! This time the fixes touch a broad area in Preact. There are a few for
Portals
, some foronTransition*
oronAnimation*
events and the usual round of browser or typing PRs.It's arguably less feature packed than previous releases, but that's a really good sign for the release candidate phase. It means that X is mature and is in great shape for going gold 👍 💯
Features
props
when replacing a node and don't diff whenhydrating
(#1786, thanks @JoviDeCroock)Bug Fixes
lazy
not forwardingrefs
(#1826, thanks @JoviDeCroock)hydration
flag (#1802, thanks @developit)animation
andtransition
events handlers not being recognized (#1804, thanks @JoviDeCroock)createPortal
-> normalvnode
(#1805, thanks @JoviDeCroock)Portal
children always being mounted (#1781, thanks @marvinhagemeister)debug
crash withhooks
import (#1773, thanks @JoviDeCroock)Typings
Partial
tosetState
(#1779, thanks @pmkroeker)Maintenance
xvfb
config for Travis CI (#1822, thanks @prateekbh)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 initialvnode
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
Bug Fixes
requestAnimationFrame
fallback when tab is not focused (#1763, thanks @calebeby).github
dir (#1765, thanks @developit)eslintignore
intopackage.json
(#1764, thanks @developit)Portals
(#1749, thanks @JoviDeCroock)props
during hydration (#1697, thanks @developit)value
(#1760, thanks @JoviDeCroock)catchRender
withcatchError
(#1742, thanks @andrewiggins)replaceNode
not unmounting when diffing twice withreplaceNode
a (#1723, thanks @JoviDeCroock)compat
types and tests (#1740, thanks @andrewiggins)_childDidSuspend
(#1735, thanks @pmkroeker)compat
render not destroying existing DOM (#1729, thanks @marvinhagemeister)tl;dr This is a bug-fix-only release and all users are encouraged to update. A final release is in sight 🎉
It's the summer and while hopefully most of you will be able to enjoy the time
outside we couldn't pass the opportunity to let our latest beta release free
into the world! This might be the last beta we'll publish before going gold,
so stay tuned 😉 For this reason we focused purely on shaking all bugs out
and make this the most stable preact release we can 👍 💯
Most notably this includes some rethinking of how we deal with
Fragments
internally. Over the past weeks we received bug reports which all seemed to be
related and it turns out they were! They all shared the problem that the sibling
order was different after a component update. We all got our heads together
and found a better internal implementation for
Fragments
that's a lot moresound theoretically. It should fix all ordering issues for good 👍 🏁
Although this release is quite and we've set our sights on a final release we're
already working on getting the Preact debug adapter in shape for the upcoming
react-devtools v4 🎉 It's not just more performant, but also adds the
hooks panel right in the devtools. More on that soon 😉
Again, you are awesome
As always Preact wouldn't be what it is today without you all. Whether you've
been helping us squash bugs, joined feature discussions or just spread the word,
we're really thankful to be part of such an amazing community. We even got to
meet some of you at this years JSConfEU!
With all said: We can't wait to unleash the final release soon! If you're new
to the beta releases, don't worry. The final release will be accompanied with
a migration guide 👍
Important
Because of the internal restructuring preact-render-to-string needs to be updated to at least version
5.0.4
.Bug Fixes
act
(#1683, thanks @JoviDeCroock)diff
instead ofdiffChildren
and other golf ⛳ (#1715, thanks @andrewiggins)useRef
withuseState
(#1679, thanks @JoviDeCroock)falsy
event values beeing added (#1712, thanks @cristianbote)Portal
unmounting and props diffing (#1691, thanks @JoviDeCroock)diff
with next DOM sibling inforceUpdate
(#1689, thanks @andrewiggins)ancestorComponent
withvnode
parent pointer (+5 B) (#1688, thanks @andrewiggins)__self
and__source
(#1690, thanks @mxstbr)_children
& combine Fragment and Component diffing (-73 B) (#1658, thanks @andrewiggins)typeof
check forh
(#1676, thanks @JoviDeCroock)Typings
style
to error onstrings
(#1675, thanks @pmkroeker)Maintenance
preact-charts
to Component Libraries (#1667, thanks @pmkroeker)🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs