[Snyk] Upgrade preact from 7.2.1 to 10.0.4 #5
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 7.2.1 to 10.0.4.Warning: This is a major version upgrade, and may be a breaking change.
Release notes
This release fixes a build issue that caused errors when using effect hooks.
_renderCallbacks
mangle configuration (#2060, thanks @robertknight)This release corrects an issue where a debug warning was printed incorrectly to the console, that (rightfully) confused users. So we wanted to fix that as quick as possible 👍
Bug Fixes
setState
warning always being printed (#2057, thanks @marvinhagemeister)Maintenance
layoutEffects
in component render callbacks array (+0 B) (#2050, thanks @andrewiggins)debug
tests into multiple files and fix some bugs in debug (#2047, thanks @andrewiggins)tl;dr: This is release contains mostly bug fixes and some size reductions. We encourage everyone to upgrade.
Just a week has passed since the last release and there are already an exciting number of new commits in master. Hackoktoberfest has had really positive effects on us and we're excited to see some new contributors in this release 💯
As you can see from the changelog: @andrewiggins is currently on a byte removing spree, so I thought it'd be appropriate to list them in their own category 🎉 A few others joined him and marie kondo'ed everything that didn't spark joy in us!
Besides some great savings, there are new debug warnings for components and fixes for our Suspense implementation 🎉
Features
setState
orforceUpdate
on an unmounted component (#2037, thanks @andrewiggins)Bug Fixes
<Suspense>
(#2025, thanks @andrewiggins)ref
not always called inuseImperativeHandle
(#2021, thanks @JoviDeCroock)Golf (size reductions)
coerceToVNode
inside oftoChildArray
(-21 B) (#2040, thanks @andrewiggins)useImperativeHandle
to useuseLayoutEffect
(-35 B) (#2003, thanks @andrewiggins)renderCallbacks
as a general per-component commit queue (#2011, thanks @andrewiggins)Types
nonce
to JSXHTMLAttributes
types for better Content Security Policy support. (#2035, thanks @calvinf)vnode
typings (#2015, thanks @pmkroeker)Maintenance
compat/mangle.json
(#2053, thanks @38elements)_afterPaintQueued
and_fallback
tomangle.json
(#2043, thanks @38elements)preact/compat
in readme (#2029, thanks @developit)_force
and_lastDomChild
tomangle.json
(#2023, thanks @developit)_suspensions
to mangle (#2019, thanks @JoviDeCroock)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)This release is a maintenance release and all users of the 8.x release line are encouraged to upgrade to it.
This is a maintenance release and fixes a minor issue with the packaging of the
devtools
import. All users on the8.x
release line are encouraged to upgrade.🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs