chore(deps): update dependency preact to v10 #298
Closed
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.
This PR contains the following updates:
8.5.3
->10.4.6
Release Notes
preactjs/preact
v10.4.6
Compare Source
tl;dr: This is a bug-fix only release and safe to upgrade 🎉
We've landed some very anticipated fixes and therefore thought to cut a new release not soon after 🙌
Bug Fixes
children
if they'renull
in suspense (#2570, thanks @sventschui)textarea
doesn't reset state (#2615, thanks @JoviDeCroock)null
toforwardRef
(#2600, thanks @JoviDeCroock)Typings
strokeMiterlimit
accept a number as well (#2620, thanks @lfamorim)feDropShadow
definition (#2609, thanks @Somnid)Maintenance
LICENSE
files and fix submodule names (#2611, thanks @hbroer)CONTRIBUTING.md
(#2603, thanks @futantan)v10.4.5
Compare Source
This is a bugfix-only release and updating is seamless. We encourage everyone to do so 👍
Bug Fixes
Suspense
from inadvertently modifying sharedComponent
class (#2594, thanks @andrewiggins)Fragment
edge case (#2551, thanks @JoviDeCroock)requestAnimationFrame
while cancelling effects it (#2573, thanks @Hydrophobefireman)setState
in render (#2565, thanks @jamesb3ll)forwardRef
passing object instead of null (#2567, thanks @marvinhagemeister)compat
(#2558, thanks @btk5h)useReducer
from mutating the previous returned result (#2550, thanks @JoviDeCroock)Maintenance
v10.4.4
Compare Source
This is a hotfix for today's 10.4.2 release that:
v10.4.3
Compare Source
v10.4.2
Compare Source
What a month we had! The weather is getting warmer and I think we can all enjoy a new refreshment in the form of a Preact release! The past weeks saw a good chunk of bug fixes and a bit of house keeping. Upgrades should be as straightforward as swapping out the version number in
package.json
and runningnpm install
oryarn install
once!Introducing prefresh (experimental)
It was one of those miracle days where all the pieces fell into place just perfectly: @JoviDeCroock got a HMR (=hot module reloading) prototype up without any changes to Preact and running in a couple hours! With the biggset achievement being that it works amazingly well in keeping hooks state around.
Since then he was contacted by various maintainers of bundlers to collaborate on an ideal developer experience. Today, about a little more than a week later we have them ready to be tested. And we need your feedback to make it the best HMR experience we can! Please file any issue you come across!
Snowpack template
Oh and while we were at it @sventschui added a Preact template for snowpack! You can get it up and running via this line:
Preact sightings
Recently deno cut it's 1.0.0 release which is a huge achievement. It's a new spin on what node could look like if it would have started fresh in 2019 and we're excited where this experiment will lead to! Despite it being very early it made some waves in our community and we were filled with joy when we noticed that the website is built with our beloved framework!
Bug Fixes
React.StrictMode
tocompat
(#2529, thanks @developit)useReducer
(#2526, thanks @hadeeb)IS_NON_DIMENSIONAL
for compatibility with animation-iteration-count (#2523, thanks @viko16)debug
(#2514, thanks @JoviDeCroock)hydrate
export incompat
(#2511, thanks @hadeeb)useEffect
(#2493, thanks @JoviDeCroock)Types
StrictMode
tocompat/src/index.d.ts
(#2530, thanks @38elements)loading
attribute toHTMLAttributes
TypeScript interface (#2521, thanks @gerardo-rodriguez)Maintenance
CONTRIBUTING.md
indentation (#2528, thanks @Vincent-Carrier)spy
helper (#2524, thanks @JoviDeCroock)Fragments
(#2507, thanks @andrewiggins)processingException
check (#2483, thanks @JoviDeCroock)excessDomChildren
creation (#2491, thanks @andrewiggins)js-framework-benchmark
(#2489, thanks @andrewiggins)v10.4.1
Compare Source
tl;dr: This release allows our devtools extension to inspect hooks. Apart from that it includes the usual round of bug fixes.
We have a nice little present for you and that is hooks are now fully supported in Preact Devtools 0.5.0 🎉 The extension is currently awaiting approval in browsers stores and your browser will automatically update to it in the following days.
Both @andrewiggins and @JoviDeCroock went full on bug hunting mode and got some neat fixes in! We also saw an awesome contribution from @davidje13 who found an error in our types for
memo
👍But the true star from the show is without a doubt that we finally have updated our typings to bring back the
marquee
element. @developit himself took the honors and made sure that developers can continue to use this element in their demo applications.Bug Fixes
setProperty
to set "value" and "checked" properties (#2472, thanks @andrewiggins)cloneElement
(#2469, thanks @JoviDeCroock)displayName
(#2454, thanks @marvinhagemeister)Typings
<marquee>
typings (#2466, thanks @developit)defaultProps
when wrapping components withmemo
(#2461, thanks @davidje13)Maintenance
v10.4.0
Compare Source
tl;dr: This release contains some very amazing improvements to hydration and to performance when memoized
vnodes
are used. We recommend everyone to upgrade 🎉We understand that the past weeks have been very strange for everybody across the world. We've spent that last weeks mainly focusing on making sure our families and loved ones are safe and taken care of. Whether you're using Preact at work or in a sideproject we hope that this release brings you a little bit of joy and makes your day a little bit brighter 🌠
Strictly equal
vnodes
bail out of renderWhen an
vnode
is equal to the one from the last render we will successfully bail out of rendering. This is a performance optimization many state libraries frequently make use of. The most well known of those is probablyreact-redux
. We've wanted to add this for the initial Preact X release but had to postpone due to not having found the proper solution back then. In the following months we've passed around various ideas on how to best solve this and it wasn't until last month when it finally clicked and the pieces fell together. @JoviDeCroock had a prototype up running in a few days and has spent a lot of time into making sure that this performance optimization works in all scenarios. We can't stress enough how much of an accomplishment this is. This is really amazing work by @JoviDeCroock and we're over the moon that it has finally landed in Preact 🎉hydrate falls back to render for new subtrees
When doing SSR there are cases where the DOM tree and the
vnodes
don't match. This can lead to a lot of problems, but for now we handle situations a bit more gracefully when there is no existing DOM node present. If we encounter that, we just opt out of hydration for that tree and revert back to doing a full diff. In the future we plan to add more warnings topreact/debug
for that.Features
vnodes
(#2386, thanks @JoviDeCroock)hydration
(#2438, thanks @JoviDeCroock)Bug Fixes
setProperty
for known bypass cases (key, children) (#2213, thanks @developit)act
callback (#2433, thanks @robertknight)ref
is mutable even if a DOM node is inserted into it (#2422, thanks @JoviDeCroock)defaultValue
(#2420, thanks @JoviDeCroock)Typings
act
type signature (#2444, thanks @ddayguerrero)_patchedLifecycles
tocompat/src/internal.d.ts
(#2408, thanks @38elements)Maintenance
typeof
(#2409, thanks @polemius)v10.3.4
Compare Source
This is a maintenance release, upgrading should be free, please do report it in case you encounter any issues.
render-queue sorting
Preact batches all rendering work and executes from the top of the Virtual DOM tree to the bottom. However, if new rendering tasks were added during an existing render, they were processed without regard for their depth in the tree.
Thanks to a clever fix from @jviide, Preact's render queue is now immutable. Any new tasks added during rendering are placed into a second batch.
material-ui integration
A peculiar issue users were seeing with material-ui related to a ref never getting populated, we went very deep into the codebase and found out that our forwardRef was a bit too eager, at creation it would already start forwarding. We moved this to a later point, now just before the vnode will get diffed the ref will be forwarded.
Fixes:
Maintenance:
v10.3.3
Compare Source
tl;dr: Some minor changes which make this release safe to upgrade for everyone!
Another week, another Preact release! It seems like the previous one wasn't too long ago, but there are already so many cool changes in
master
that we're eager to bundle them in a neat release!Much improved conditional rendering
One insanely cool and very important change was done by @andrewiggins, who woke up one day and found a very elegant solution to handling conditionally rendered elements. Most virtual-dom-based frameworks mark a falsy result with some sort placeholder (sometimes referred to as "holes"), so that the diffing algorithm can ensure that elements are not moved around needlessly.
It's not just for performance though as they are some real world consequences to moving nodes around. The most common annoyance is
<input>
-elements losing focus whenever a parent is moved. With this change we are pretty confident that we squashed all known issues on that front 👍Improved SVG attribute casing
SVG also received a big change by @steveharrison . It's his first contribution Preact and he already knocked it out of the park with an excellent PR. HE went through the whole SVG spec and noticed that we didn't match some of the weird casings of SVG-Attributes properly and his PR remedies that beautifully! 💯
Preact sightings
@pksjce finished her YouTube series where she reads through a portion of the Preact source code. With that she helped us tremendously in spotting areas in code which lacked comments and finally pushed us to create a proper "Contributing" guide. If you are considering contributing to Preact, this short document is well worth a read as it contains an overview of the repo's structure and answers for the most common questions regarding our code. That said if you feel like something is missing or you do have troubles understanding some sections of the source, please reach out to us! We're here to help and feedback about friction points is crucial to making Preact better for everyone 👍
Checking our official website you may have noticed some slight changes here and there. They're mostly to simplify navigation or to give our docs a more fitting structure. The long term plan is to integrate our learnings about the most common support questions we get and fill in those spots. @NJalal7 spotted a few of those areas and even found a bug in Preact in the process that we we're promptly able to fix 🙌
Thank you so much to everyone who contributed code, helped us in narrowing down issues or participated in making Preact even better. Preact wouldn't be were it is now without you all ❤️
Features
isPropagationStopped
fn to event (#2378, thanks @reznord)isDefaultPrevented
fn to event (#2377, thanks @teodragovic)preact/debug
(#2362, thanks @developit)Bug Fixes
event.isPropagationStopped()
(#2380, thanks @38elements)setState
insidecomponentWillMount
(#2367, thanks @marvinhagemeister)useEffect/useLayoutEffect
(#2358, thanks @JoviDeCroock)null
placeholder DOM placement (#2355, thanks @andrewiggins)Typings
options.event
type definition (#2381, thanks @38elements)Maintenance
excessDomChildren
into the same code block (#2356, thanks @andrewiggins)null
placeholders (#2352, thanks @andrewiggins)v10.3.2
Compare Source
tl;dr: Another bug-fix only release. It's safe to upgrade and we encourage everybody to do so 👍
It's sunny today and I haven't been outside yet, so I'll make it quick: Those pesky ref TypeScript errors when used with a CSS-in-JS library should be no more! So if you're using
styled-components
,emotion
,goober
or any other CSS-in-JS library, this update is for you! 💯@robertknight found that
false
values where not special cased foraria-*
attributes as they have a different way of treating boolean values compared to the DOM. Many boolean-like attributes likearia-checked
have three states:true
element is checkedfalse
element is unchecked, but it's possible to check itundefined
(default) element can't be checkedAs usual thank you so much for everyone who helped make Preact better by contributing code or reporting issues! You all rock 👍
Bug Fixes
false
value in aria-attributes (#2347, thanks @marvinhagemeister)React.Children.map
and.forEach
(#2326, thanks @mhmdanas)React.Children.map/forEach
missing index (#2322, thanks @JoviDeCroock)Typings
useErrorBoundary
type withcomponentDidCatch
(#2332, thanks @intrnl)ref
typing with ReactElement (& popular react libraries) (#2099, thanks @xiel)useErrorBoundary
's callback param optional (#2320, thanks @intrnl)Maintenance
useImperativeHandle
tests (#2346, thanks @marvinhagemeister)ISSUE_TEMPLATE.md
(#2342, thanks @JoviDeCroock)package.json
topackage.exports
(#2319, thanks @MylesBorins)v10.3.1
Compare Source
tl;dr: Just a minor bug-fix-only release. Safe to upgrade for everyone.
We've been notified of an issue with the way we used the new
exports
feature that was introduced with Node 13, so we wanted to get out patch release as quickly as possible. Despite that we managed to include several other fixes in such a short timeframe that are worthy to mention.Run tests against the minfied production artifact
This is big for us. @andrewiggins did an amazing PR which modifies our testing infrastructure to execute the tests against the minfied production bundles that are published to npm. This greatly reduces any chances of us not catching bugs that may exist in transpilers or the custom minify config we're using. And Andre promptly found a few misconfigurations already. Most of you propably didn't run into these issues as they are somewhat in the edge case area, but it's amazing to have a tool to automatically check our code for an mishaps 💯
A new size bot
In the early days of the Preact X rewrite we made a promise to ourselves in that we would check the effects on size for each PR. We started by printing out all the sizes of our exports via microbundle, but we did still have to compare those manually against what's in
master
. Both @kristoferbaxter and @developit have been joining forces and created a bot which does that automatically. As soon as the pipeline on a PR succeeds it will add a comment listing all the size differences 👍Changelog
Bug Fixes
className
not being applied when set to an emptystring
withpreact/compat
(#2309, thanks @JoviDeCroock)Maintenance
umd
and make browser a modularexport
for future bundlers (#2311, thanks @JoviDeCroock)v10.3.0
Compare Source
tl;dr: This release contains a good number of bug fixes and we encourage all users to upgrade.
A little bit of time has passed since our last release and we're excited to ship another one, making Preact even more robust! The fixes nearly touch all packages and further improves compatibility with third-party libraries 🎉
If you glance at the contributor names, you'll notice a few new ones there. It's safe to say that we were amazed and super ecstatic by the amount of new first time contributors to Preact! 🙌
Features
built-in
elements (#2266, thanks @defx)preact/devtools
import (#2246, thanks @marvinhagemeister)Bug Fixes
shouldComponentUpdate
(#2125, thanks @andrewiggins)dom.nextSibling
(#2294, thanks @andrewiggins)Children.map
not flattening result (#2287, thanks @marvinhagemeister)size
to an invalid value (#2285, thanks @marvinhagemeister)clipPathUnits
(#2251, thanks @friebe)class
andclassName
being enumerable (#2280, thanks @marvinhagemeister)className
patch not applied to props (#2279, thanks @marvinhagemeister)replaceNode
calls (#2274, thanks @JoviDeCroock)shouldComponentUpdate
getting called onsetState
afterforceUpdate
(#2258, thanks @laino)process.env.NODE_ENV
check frompreact/debug
which broke browsers (#2257, thanks @marvinhagemeister)Types
null
as an initial value foruseRef
(#2281, thanks @armujahid)Maintenance
_lastDomChildSibling
to_nextDom
(#2297, thanks @andrewiggins)mangle.json
with Suspense prop rename (#2298, thanks @andrewiggins)size
action (#2270, thanks @developit)postinstall
from running on installation (#2271, thanks @JoviDeCroock)createElement
(#2273, thanks @zubhav)npm ci
to speed up travis (#2255, thanks @JoviDeCroock)package-lock.json
(#2254, thanks @JoviDeCroock)v10.2.1
Compare Source
This release corrects an issue regarding hydration that was found in yesterdays
10.2.0
release 🎉Bug Fixes
hydrate()
(#2238, thanks @JoviDeCroock)v10.2.0
Compare Source
Happy belated New Years to everybody 🎉 We hope you enjoyed the holidays and had some time off to recharge 👍 Our very first release in 2020 brings two new features and the usual round of bug fixes 💯
New
useErrorBoundary
hookThere is a new hook called
useErrorBoundary
which allows you to catch errors that are thrown by any child components. It's essentially the hook version ofcomponentDidCatch
.Usage example:
Lazy works with non-default export
This PR was one of the smallest ones, but something that makes working with different kind of lazy loaded modules a lot easier. Previously
lazy
would always use thedefault
export of the imported module. With this change it's now possible to use it with anyexport
.On top of that we have the usual round of bug fixes. We'd like to thank everyone who reported them and helped us make Preact even better. Thank you so much!! 👍
Features
useErrorBoundary
hook (#2205, thanks @JoviDeCroock)lazy()
usage with non-default imports (#2212, thanks @developit)Bug Fixes
ref
value on siblingvnodes
(#2217, thanks @JoviDeCroock)Text
nodes being re-rendered unnecessarily (#2215, thanks @developit)renderToString
dependency error (#2207, thanks @developit)getDerivedStateFromError
andcomponentDidCatch
(#2200, thanks @JoviDeCroock)Typings
onReset/onFormData
to Form Event types (#2209, thanks @thesmartwon)Maintenance
Suspense
(#2229, thanks @sventschui)sinon
global (#2220, thanks @JoviDeCroock)v10.1.1
Compare Source
tl;dr: A tiny maintenance release, which helps with debugging Preact apps.
This release is a lot smaller compared to our usual ones, but we deemed one feature important enough to have in users hands that we made this release. And that's component stacks which we hope will reduce the issue count in our tracker slightly 🎉
On top of that we want to congratulate @jamesb3ll for his first-time contribution to Preact 🥇 He found an issue and filled it with every detail one can imagine (codesandbox is awesome!). But instead of stopping there, he tinkered a bit and found a genius fix for it! Thank you for your PR 👍 🍀
Component Stacks
Whenever you include
preact/debug
you get a lot of hints and warnings about how you can make your application better. But sometimes it was hard to tell where the error originated from. To resolve that we automatically append a component stack trace telling you directly which component threw the error.The above code will print the following warning to the browser's console:
With the stack appended at the bottom it's much easier to track down the source 💯 To get those beautiful file and line mappings, make sure that you have @babel/plugin-transform-react-jsx-source enabled in your babel config 👍
Features
Bug Fixes
componentWillReceiveProps
not called on child component when parent is queued in the same commit (#2186, thanks @jamesb3ll)Maintenance
sinon
esm bundle (#2188, thanks @marvinhagemeister)v10.1.0
Compare Source
tl;dr: This release adds support for the highly anticipated preact-devtools extension. It's in an early preview state, but it has proven to be very useful already for inspecting a component tree in our internal testing. Apart from that there is a new
SuspenseList
component to control loading in lists and the usual round of bug fixes.Christmas comes early in the form of another feature packed Preact release 🎉 We're particular proud of this one as it represents the results of a lot of work behind the scenes. Especially when it comes to the devtools.
Developers, Developers, Developers! 🔧
For the longest time we've been able to reuse the react devtools extension that was (as the name implies) written specifically for React. We did this by hooking ourselves into the init procedure and shimming in a conversion layer that translated our inner workings to something React would use under the hood. Over the past year we've kept up with all the internal changes of React's private structures, but it took us more and more time to make sure that the integration wasn't breaking or running into weird edge cases.
Faced with a choice we decided to pursue the development of our own extension specifically written for Preact. This way we are not affected by any breaking changes on React's side and have the possibility to extend the devtools with custom UI, like for the Composition-API PR #1923 .
That said the extension is not what we would call final yet. It's more of an early preview, akin to an
alpha
release. Despite bugs you may encounter, we found it useful enough in our testing that we didn't want to hold back any longer.Download it here: https://preactjs.github.io/preact-devtools/
SuspenseList 🔢
SuspenseList
is a new component that can control the order in which any child suspensions are revealed. Take a list of images for example. Due to the browser firing the requests to download them in parallel, the images may appear in any order. This can be a bit jarring, when some sort ofappear
animation is involved. WithSuspenseList
we can force all images to appear at the same time, inorder or in reverse.In the following example
A
will appear first, followed byB
even ifC
was loaded beforeB
. And finallyC
will appear.Features
SuspenseList
optimisations (#2121, thanks @jviide)SuspenseList
component (#2063, thanks @prateekbh)Bug Fixes
Suspense
should support unmounting suspender (#2134, thanks @sventschui)this
type for event handlers (#2166, thanks @marvinhagemeister)type
attribute (#2147, thanks @Rafi993)touch
events incompat
(#2120, thanks @sventschui)Fragment
(#2107, thanks @jviide)Typings
onToggle
event to TypeScript defs. (#2151, thanks @xorgy)FunctionComponent
frompreact/compat
(#2087, thanks @jokester)dir
property values (#2108, thanks @antonk52)Golf ⛳ 🏌️♀️
createElement
(#2135, thanks @developit)useMemo
_callback
to_factory
(+0 B) (#2131, thanks @andrewiggins)if
clause in suspense_catchError
(#2119, thanks @sventschui)VNode
compat options (-62 B) (#2116, thanks @andrewiggins)Maintenance
master
(#2158, thanks @andrewiggins)compat
src and tests (#2124, thanks @andrewiggins)v10.0.5
Compare Source
tl;dr: This release is a bug fix only release and all users are encouraged to update.
This week saw many cool improvements surrounding our TypeScript definitions. Thanks to an amazing contribution from @lukeshiru the event target is now correctly inferred for all native elements. This alone should remove many manually casted event arguments in your code 🎉
Together @JoviDeCroock and @cristianbote set their minds on fixing a few newly reported issues surrounding
refs
and the like. Personally, I'm pretty impressed how quickly they could identify and resolve the issues. Much respect to you two 👍As the year is coming to an end @andrewiggins did some house-cleaning and found various places where we could save even more bytes! I don't know how he does it and it's just amazing to witness so much pure talent!
Beside that, the changes mainly revolve around maintenance tasks. We've switched to
prettier
for automatic code formatting, lowering the barrier for new contributors even more. The formatting is automatically applied on each commit via a git-hook, and everything will be taken care of for you 💯We also saw two exciting contributions from Googlers: @jridgewell found a very hard t
Renovate configuration
📅 Schedule: "before 3am on Monday" (UTC).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.