Changelog History
Page 2
-
v10.4.6 Changes
July 14, 2020_ 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
- ๐ Initialize
children
if they'renull
in suspense (#2570, thanks @sventschui) - ๐ Fix case where
textarea
doesn't reset state (#2615, thanks @JoviDeCroock) - ๐ Fix passing
null
toforwardRef
(#2600, thanks @JoviDeCroock)
Typings
- ๐ Make
strokeMiterlimit
accept a number as well (#2620, thanks @lfamorim) - โ Add
feDropShadow
definition (#2609, thanks @Somnid)
๐ง Maintenance
- โ Add missing
LICENSE
files and fix submodule names (#2611, thanks @hbroer) - ๐ Fix typo in
CONTRIBUTING.md
(#2603, thanks @futantan) - HTTPS fix for README image (#2602, thanks @developit)
- โ Run same workflow on PR and master push (#2601, thanks @andrewiggins)
- ๐ Initialize
-
v10.4.5 Changes
June 30, 2020๐ This is a bugfix-only release and updating is seamless. We encourage everyone to do so ๐
๐ Bug Fixes
- Prevent
Suspense
from inadvertently modifying sharedComponent
class (#2594, thanks @andrewiggins) - ๐ Fix
Fragment
edge case (#2551, thanks @JoviDeCroock) - Check for existence of
requestAnimationFrame
while cancelling effects it (#2573, thanks @Hydrophobefireman) - ๐ Handle
setState
in render (#2565, thanks @jamesb3ll) - ๐ Fix
forwardRef
passing object instead of null (#2567, thanks @marvinhagemeister) - Normalize value prop on textareas in
compat
(#2558, thanks @btk5h) - Prevent
useReducer
from mutating the previous returned result (#2550, thanks @JoviDeCroock)
๐ง Maintenance
- ๐ Improve code coverage (#2596, thanks @andrewiggins)
- โก๏ธ Optimize unpkg entry: Commonjs plus globals default export (#2261, thanks @developit)
- ๐ Share build output between action jobs (#2579, thanks @andrewiggins)
- โ Add TypeScript for extending JSX types with custom elements (#2581, thanks @andrewiggins)
- โก๏ธ Update Node version in actions and format YAML files using prettier (#2577, thanks @andrewiggins)
- โ Add GitHub action to run benches (#2560, thanks @andrewiggins)
- โ Add many_updates benchmark (#2559, thanks @andrewiggins)
- ๐ฑ ๐๏ธโโ๏ธ rAF check (#2555, thanks @developit)
- put rerenderCount on the Component prototype (#2552, thanks @JoviDeCroock)
- ๐ Use "babel-plugin-transform-rename-properties" to consistently mangle properties (#2548, thanks @andrewiggins)
- Prevent
-
v10.4.4 Changes
May 18, 2020๐ This is a hotfix for today's 10.4.2 release that:
- โ addresses an issue with mobx-react (#2541, thanks @marvinhagemeister)
- ๐ fixes a regression in useEffect cleanup callbacks (#2542, thanks @fuzetsu)
-
v10.4.2 Changes
May 18, 2020๐ What a month we had! The weather is getting warmer and I think we an all enjoy a new refreshment in the form of a Preact release! The past weeks saw a good chunk of bug fixes and and a bit of house keeping. Upgrades should be as straigthforward 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 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:
npx create-snowpack-app my-project --template @snowpack/app-template-preact
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 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
- โ Add noop
React.StrictMode
tocompat
(#2529, thanks @developit) - โ
Use latest reducer function in
useReducer
(#2526, thanks @hadeeb) - Improve
IS_NON_DIMENSIONAL
for compatibility with animation-iteration-count (#2523, thanks @viko16) - Polyfill prototype setter in
debug
(#2514, thanks @JoviDeCroock) - ๐ Fix
hydrate
export incompat
(#2511, thanks @hadeeb) - ๐ Fix creating multiple roots from
useEffect
(#2493, thanks @JoviDeCroock)
Types
- โ Add
StrictMode
tocompat/src/index.d.ts
(#2530, thanks @38elements) - โ Add
loading
attribute toHTMLAttributes
TypeScript interface (#2521, thanks @gerardo-rodriguez)
๐ง Maintenance
- ๐ Fix
CONTRIBUTING.md
indentation (#2528, thanks @Vincent-Carrier) - ๐ Fix test on IE11 by wrapping the
spy
helper (#2524, thanks @JoviDeCroock) - โ Remove unnecessary cloning of props (#2516, thanks @hadeeb)
- Iteratively diff children and convert array children to
Fragments
(#2507, thanks @andrewiggins) - โก๏ธ Update focus tests to better match user behavior (#2506, thanks @andrewiggins)
- IE11+ -> IE11 (#2499, thanks @38elements)
- โ Reorganize render test file (#2487, thanks @andrewiggins)
- golf effect cleanup (#2494, thanks @JoviDeCroock)
- โ Remove
processingException
check (#2483, thanks @JoviDeCroock) - โฌ๏ธ Reduce unnecessary DOM attribute reads (#2486, thanks @andrewiggins)
- โ Remove unnecessary
excessDomChildren
creation (#2491, thanks @andrewiggins) - โ Add update benchmark from
js-framework-benchmark
(#2489, thanks @andrewiggins)
- โ Add noop
-
v10.4.1 Changes
April 20, 2020_ 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
- โ Add support for hooks inspection via devtools (#2480, thanks @marvinhagemeister)
- ๐ Make warn effectively warn instead of throwing (#2477, thanks @JoviDeCroock)
- ๐ Support node13 (#2451, thanks @JoviDeCroock)
- ๐ Use
setProperty
to set "value" and "checked" properties (#2472, thanks @andrewiggins) - ๐ฏ Normalize props on
cloneElement
(#2469, thanks @JoviDeCroock) - Set value/checked on custom-elements (#2465, thanks @JoviDeCroock)
- โ Add support for context
displayName
(#2454, thanks @marvinhagemeister)
Typings
- โ Add
<marquee>
typings (#2466, thanks @developit) - 0๏ธโฃ Account for
defaultProps
when wrapping components withmemo
(#2461, thanks @davidje13)
๐ง Maintenance
- ๐ Run benchmarks with v8, master, and local builds (#2475, thanks @andrewiggins)
- โฌ๏ธ Reduce number of builds in actions (#2476, thanks @andrewiggins)
- โ Add npm prepare script (#2473, thanks @andrewiggins)
- โฌ๏ธ Upgrade devtools adapter (#2471, thanks @marvinhagemeister)
- Tachometer benchmarks (#2462, thanks @andrewiggins)
-
v10.4.0 Changes
April 08, 2020_ 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 render๐ When 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
- Implement strict-equality for
vnodes
(#2386, thanks @JoviDeCroock) - Fallback to render when subtrees are inserted on
hydration
(#2438, thanks @JoviDeCroock) - โ Add owner stack for invalid child warning (#2416, thanks @marvinhagemeister)
๐ Bug Fixes
- ๐ Fix error messages logged by failed prop type checks (#2434, thanks @robertknight)
- Skip
setProperty
for known bypass cases (key, children) (#2213, thanks @developit) - ๐ Improve handling of exceptions thrown during
act
callback (#2433, thanks @robertknight) - Ensure
ref
is mutable even if a DOM node is inserted into it (#2422, thanks @JoviDeCroock) - ๐ Fix Context not re-rendering when reset to
defaultValue
(#2420, thanks @JoviDeCroock) - Disable normalization of string vnodes (#2410, thanks @JoviDeCroock)
Typings
- โก๏ธ Update
act
type signature (#2444, thanks @ddayguerrero) - โ Add
_patchedLifecycles
tocompat/src/internal.d.ts
(#2408, thanks @38elements)
๐ง Maintenance
- ๐ Docs: Fix simple typo, stucture -> structure (#2440, thanks @timgates42)
- ๐ Fix CONTRIBUTING typo (#2417, thanks @futantan)
- ๐ Use double equal with
typeof
(#2409, thanks @polemius) - Enable saucelabs-connect (#2411, thanks @developit)
- ๐ Move from Travis to Github Actions (#2401, thanks @JoviDeCroock)
- Implement strict-equality for
-
v10.3.4 Changes
March 11, 2020๐ 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:
- ๐ Fix mui Popover integration (#2403, thanks @JoviDeCroock)
- ๐ Fix defaultValue with re-render (#2392, thanks @aralroca)
- Sort new renderqueue items (#2396, thanks @jviide)
๐ง Maintenance:
- ๐ Fix stopPropagation override for IE11 (#2390, thanks @JoviDeCroock)
- ๐ Use createEvent since InputEvent and new Event won't work in IE11 (#2400, thanks @JoviDeCroock)
- ๐ Fix useErrorBoundary hook callback type (#2397, thanks @Sasha-Sorokin)
- โก๏ธ Update cloneElement typings (#2388, thanks @ddayguerrero)
-
v10.3.3 Changes
March 01, 2020_ 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
- Compat: Add
isPropagationStopped
fn to event (#2378, thanks @reznord) - 0๏ธโฃ Compat: Add
isDefaultPrevented
fn to event (#2377, thanks @teodragovic) - ๐ Large performance boost in
preact/debug
(#2362, thanks @developit)
๐ Bug Fixes
- ๐ Fix
event.isPropagationStopped()
(#2380, thanks @38elements) - ๐ Fixed SVG attribute names not being converted to the correct attribute names in the DOM. (#2366, thanks @steveharrison)
- ๐ Fix incorrect warning on
setState
insidecomponentWillMount
(#2367, thanks @marvinhagemeister) - ๐ Fix static hydration (#2365, thanks @JoviDeCroock)
- ๐ Fix hook outside of component test (#2359, thanks @JoviDeCroock)
- โ Remove warning for
useEffect/useLayoutEffect
(#2358, thanks @JoviDeCroock) - ๐ Improve
null
placeholder DOM placement (#2355, thanks @andrewiggins)
Typings
- ๐ Fix
options.event
type definition (#2381, thanks @38elements)
๐ง Maintenance
- โ Add comment to clarify seemingly redundant string concatenation (#2369, thanks @mhmdanas)
- ๐ Rename some variables to increase legibility (#2361, thanks @andrewiggins)
- Combine searches in
excessDomChildren
into the same code block (#2356, thanks @andrewiggins) - ๐ Fix failing test by defaulting to empty array (#2353, thanks @JoviDeCroock)
- โ Add new test file for
null
placeholders (#2352, thanks @andrewiggins)
- Compat: Add
-
v10.3.2 Changes
February 15, 2020_ 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 it- 0๏ธโฃ
undefined
(default) element can't be checked
๐ฑ As usual thank you so much for everyone who helped make Preact better by contributing code or reporting issues! You all rock ๐
๐ Bug Fixes
- โ Add support for
false
value in aria-attributes (#2347, thanks @marvinhagemeister) - โ Remove array provided to callback in
React.Children.map
and.forEach
(#2326, thanks @mhmdanas) - ๐ Fix
React.Children.map/forEach
missing index (#2322, thanks @JoviDeCroock)
Typings
- ๐ Match
useErrorBoundary
type withcomponentDidCatch
(#2332, thanks @intrnl) - ๐ Fix incompatible
ref
typing with ReactElement (& popular react libraries) (#2099, thanks @xiel) - ๐ Make
useErrorBoundary
's callback param optional (#2320, thanks @intrnl)
๐ง Maintenance
- ๐ Fix failing
useImperativeHandle
tests (#2346, thanks @marvinhagemeister) - Create
ISSUE_TEMPLATE.md
(#2342, thanks @JoviDeCroock) - Node "exports" adjustments (#2327, thanks @guybedford)
- โ Add
package.json
topackage.exports
(#2319, thanks @MylesBorins)
-
v10.3.1 Changes
February 06, 2020_ 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
- ๐ Fix
className
not being applied when set to an emptystring
withpreact/compat
(#2309, thanks @JoviDeCroock) - ๐ Run karma tests against build output (#2300, thanks @andrewiggins) โค๏ธ
- ๐ Fix: Resolves Node submodule subpath error (#2304, thanks @4cm4k1)
๐ง Maintenance
- โ Add to
umd
and make browser a modularexport
for future bundlers (#2311, thanks @JoviDeCroock) - โ Add root exports (#2310, thanks @JoviDeCroock)
- โ Removes warning from tests by removing console.log in render.test.js (#2305, thanks @theZieger)
- ๐ Fix