Releases: preactjs/preact
10.5.9
Happy New Year to everyone 🎉 Let's kick of the year with a few welcome bug fixes regarding preact/compat
👍
Bug Fixes
- Fix bug when re-rendering a suspended hydration node (#2903, thanks @andrewiggins)
- Fix devtools error with portals (#2904, thanks @JoviDeCroock)
- Fix child reordering with
memo
(#2896, thanks @andrewiggins)
Maintenance
- Replace webpack with esbuild + babel in karma test runner(#2907, thanks @marvinhagemeister)
- Rename "coverage" env to "COVERAGE" (#2906, thanks @marvinhagemeister)
- Ensure expression is not marked for removal (#2905, thanks @marvinhagemeister)
- Prepare test code to be run in ES2015+ environments (#2901, thanks @marvinhagemeister)
- Fix invalid jsx comment (#2902, thanks @marvinhagemeister)
- Fix console.log not showing up in browser (#2900, thanks @marvinhagemeister)
- Improve hydration tests (#2899, thanks @andrewiggins)
- Add support for pretty printing karma console logs (#2893, thanks @marvinhagemeister)
10.5.8
This is probably the last release for 2020. Thank you everyone for the amazing contributions over the year and we can't wait to see where Preact is going in 2021! Lot's of interesting ideas are being worked on 🎉
Bug Fixes
- Correct
_nextDom
pointer if it is being unmounted (#2889, thanks @andrewiggins) - Updating
/compat/server
exports to work with import/export syntax and webpack 5 (#2873, thanks @SomethingSexy) - Remove arguments warning for
useMemo
/useCallback
hooks (#2870, thanks @afzalsayed96) - Use strict equality checks when comparing
VNode
type (#2855, thanks @andrewiggins) - Fix
ref
not being removed fromprops
withjsx-runtime
(#2840, thanks @marvinhagemeister) - Compat: Don't convert
onchange
tooninput
forinput[type=range]
in IE11 (#2817, thanks @gcraftyg)
Types
- Improve
JSDoc
comments (#2883, thanks @andrewiggins) - Use
CSSStyleDeclaration
for CSS property list (#2869, thanks @developit) - Add
readonly
attribute (#2868, thanks @rschristian) - Add
defaultValue
for select tag (#2848, thanks @Rafi993) - Update
_original
typings (#2830, thanks @marvinhagemeister) - Update
csstype
from version 2 to version 3 (#2829, thanks @bz2)
Other
- SimplifyPortal implementation (#2890, thanks @marvinhagemeister, @developit)
- Simplify
vnode
re-use detection (-2 B) (#2863, thanks @marvinhagemeister) - Save 6 Bytes (#2844, thanks @marvinhagemeister)
- Move child reodering to
diffChildren
(#2813, thanks @JoviDeCroock)
Maintenance
- Add discussions and a csb template (#2875, thanks @JoviDeCroock)
- In benches, abstract framework differences with
createRoot
API (#2866, thanks @andrewiggins) - Add filter benchmark (#2851, thanks @marvinhagemeister)
- Update benchmarks (#2865, thanks @andrewiggins)
- Add preactjs-gh-sponsor account to
FUNDING.yml
(#2861, thanks @JoviDeCroock) - Upgrade
devDependencies
(#2856, thanks @andrewiggins) - Add package tags (#2841, thanks @developit)
- Trial codesandbox-ci (#2819, thanks @JoviDeCroock)
10.5.7
- Fix
compat/jsx-runtime
missing in npm package (#2827, thanks @marvinhagemeister)
10.5.6
Bug Fixes
- Throw when hook is invoked outside of render (#2816, thanks @marvinhagemeister)
- Make
jsx-runtime
work when using an alias (#2805, thanks @JoviDeCroock) - Allow rendering from an effect (#2804, thanks @JoviDeCroock)
Types
- Add
animateTransform
tag type (#2822, thanks @HuHguZ) - Add
displayName
to context (#2820, thanks @max-voronov) - Improve
style
attribute types (#1797, thanks @mnkhouri) - General JSX types export for
jsx-runtime
, fixes TS4.1 compatibility (#2811, thanks @ddprrt) - Make
ref
types' current property non-optional (#2803, thanks @ivantm)
Maintenance
- Remove circular
vnode
reference and golf implementation (#2517, thanks @JoviDeCroock) - Add hydration suspend tests (#2755, thanks @andrewiggins)
- Fix prototype spies not being reset in tests (#2823, thanks @marvinhagemeister)
10.5.5
Bug Fixes
- Reset hooks state when
Suspense
triggers (#2796, thanks @JoviDeCroock) - Run parent effects when child throws (#2794, thanks @sventschui)
Typings
- Fix memo function types definition (#2793, thanks @dzhykaiev)
10.5.4
tl;dr: Bug-Fix only release that should get rid of the last className edge cases. We encourage everyone to upgrade.
Despite our effort to account for all edge cases regarding className
handling in preact/compat
, we got some reports of some missed ones. This release corrects those 🎉
This release contains a fix to increase compatibility with next.js that ensures that the error overlay will show up.
Bug Fixes
- Emit error event for errors handled by an error boundary (#2784, thanks @sventschui)
- Fix
className
descriptors on Elementvnodes
(#2786, thanks @developit) - Give precedence to
className
overclass
(#2782, thanks @JoviDeCroock)
10.5.3
This release fixes a regression in regards to class/className
handling in preact/compat
. We encourage everyone to upgrade.
Bug Fixes
- Fix
className
normalization (#2774, thanks @JoviDeCroock) - Fix edge cases for thrown
Promises
in Suspense (#2776, thanks @kitten)
Maintenance
- Replace custom script with
check-export-map
(#2777, thanks @marvinhagemeister) - Upgrade bench infra and add tachometer PR reporter (#2775, thanks @andrewiggins)
- Optimizations for preact/jsx-runtime (#2771, thanks @developit)
10.5.2
- Fix incorrect package export for
jsx-runtime
(#2769, thanks @marvinhagemeister)
10.5.1
10.5.0 - JSX Reloaded
New JSX-runtime functions
This has been a long time in the making for various virtual-dom based frameworks. Historically JSX was always transpiled to createElement
function calls.
// input
<div>foobar</div>
// output, we need to move "foobar" to `props.children`
createElement("div, {}, "foobar");
While this has served us well and is very reliable, it has proven to be hard to optimize. Most of the things we do in our createElement
function could by done by babel directly, thereby making it smaller and faster. This is very desirable for us as this function is called a lot in any application. It's part of the so-called hot-path.
And that's exactly what the new signature does. It removes the need for us to pull out key from props
, add back children
to props and just makes the implementation simpler. As a nice benefit users won't need to manually import h/createElement
anymore 🎉
// input
<li key="foo">foobar</li>
// output
jsx("li", { children: "foobar" }, "foo");
Usage with babel:
// babel.config.js
module.exports = {
plugins: [
["@babel/plugin-transform-react-jsx", {
runtime: "automatic", // defaults to classic (classic == createElement calls)
importSource: "preact", // NOT preact/jsx-runtime
}]
]
}
Note that the JSX transformer in TypeScript is a work in progress and will likely be released as part of version 4.1. We're currently running into microsoft/TypeScript#40502 though, so the JSX typings are not found.
Features
- Add
jsx-runtime
support (#2764, thanks @JoviDeCroock, @marvinhagemeister) - Implement Suspend & Resume for both hydration and new tree construction (#2754, thanks @developit)
Bug Fixes
- Fix unable to set progress value to
0
(#2757, thanks @marvinhagemeister) - Fix capturing and non-capturing listeners on the same element (#2740, thanks @devongovett)
- Prevent cursor jumps inside
contenteditable
(#2701, thanks @sventschui) - Add length check for hooks dependency array (#2729, thanks @JoviDeCroock)
- Fix rendering children as zero number (#2725, thanks @JiLiZART)
- Avoid assigning to readonly
style
(#2723, thanks @JoviDeCroock)
Maintenance
- Add mangle key for
_suspended
(#2765, thanks @marvinhagemeister) - Compat Optimizations (v11 backport) (#2752, thanks @developit)
- Add version check to issue template (#2731, thanks @marvinhagemeister