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 to spot unnecessary case in a regex we use to append px
to certain CSS values and @jakearchibald found an html attribute we missed in our typings 🎉
Like in our past release we'd like to take a moment to thank everybody who contributed, not just code but also made the time to write bug reports. Thank you so much 👍
Bug Fixes
- Cleanup changing
refs
correctly (#2055, thanks @JoviDeCroock) - Ensure
renderCallbacks
are called whensCU
bails out (#2081, thanks @JoviDeCroock) - Handle the stale
ref
forforwardRef
(#2075) (#2076, thanks @cristianbote)
Golf 🏌️♀️
- Simplify
hook
scheduling logic (-17 B) (#2085, thanks @andrewiggins) - Improve tree-shakeability (-13 B) (#2079, thanks @andrewiggins)
- Simplify ternary expressions (-7 B) (#2049, thanks @andrewiggins)
- Remove CSS custom property check from
IS_NON_DIMENSIONAL
(#2046, thanks @jridgewell)
TypeScript
- Add types for
currentTarget
on event handlers forIntrinsicElements
(#2084, thanks @lukeshiru) - Improve
ref
typings forIntrinsicElements
(#2070, thanks @lukeshiru) - Add
as
html attribute to TypeScript defs (#2068, thanks @jakearchibald)
Maintenance
- Add
funding
field to package.json (#2096, thanks @developit) - Upgrade tests to use Babel 7 (#2094, thanks @andrewiggins)
- Rewrite
createContext
tests to no longer import internal data (#2090, thanks @andrewiggins) - Remove
preact-charts
fromREADME
(#2092, thanks @pmkroeker) - Update
README
section aboutpreact/devtools
(#2091, thanks @peterswallow) - In tests, import code under test by name instead of relative path (#2086, thanks @andrewiggins)
- Replace
__p
to__
inmangle.json
(#2044, thanks @38elements) - Make all
.json
files use 2-space (#2078, thanks @developit) - Adding Intergram to the demos list (#2064, thanks @idoco)
- Improve formatting (#2071, thanks @andrewiggins)
- Improve formatting (#2066, thanks @andrewiggins)
- Add automatic formatting via
prettier
(#2065, thanks @marvinhagemeister)