Preact Versions Save

⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.

10.19.0

5 months ago

Features

  • Support precompiled JSX transform (#4177, thanks @marvinhagemeister)

Fixes

  • Rework children diffing to run in multiple phases (#4180, thanks @andrewiggins)

Performance

  • Inline diffProps function (#4200, thanks @andrewiggins)
  • Do typeof string check before looking for String constructor (#4198, thanks @andrewiggins)
  • Only run unmounting loop if any children remain to unmount (+2 B) (#4199, thanks @andrewiggins)
  • Fix debug throwing in valid nested table (#4193, thanks @marvinhagemeister)

Types

  • Compat PureComponent parity with upstream react type definitions (#4056, thanks @Blufords)

10.18.2

6 months ago

Types

  • Update contentEditable attribute values (#4163, thanks @shoonia)
  • Add elementTiming attribute/property (#4165, thanks @shoonia)
  • Add the exportparts global attribute (#4164, thanks @shoonia)
  • Fix vnode type coercion (#4158, thanks @JoviDeCroock)

Fixes

  • Fix case where parent catches error and switches vnode return type (#4182, thanks @JoviDeCroock)
  • Allow handling errors in getSnapshot of useSyncExternalStore & add more tests (#4175, thanks @andrewiggins)
  • Prevent invalid DOM nesting false positives (#4160, thanks @marvinhagemeister)

Improvements

  • Improve place child (#4172, thanks @andrewiggins)
  • Use copied VNode as newVNode instead of oldVNode when rerendering (#4171, thanks @andrewiggins)
  • Manually track children's index & fix parent pointers when rerendering components (#4170, thanks @andrewiggins)
  • Always clear _nextDom field on VNodes (#4166, thanks @andrewiggins)
  • Switch === to == in a few places where not needed (#4157, thanks @rschristian)
  • Add support for new String() as a child (#4152, thanks @appsforartists)

Maintenance

  • Update deopt script to generate log for usage in DeoptExplorer VSCode extension (#4188, thanks @andrewiggins)
  • Fix benchmark debug action (#4187, thanks @andrewiggins)
  • Add Benchmark Debug workflow (#4185, thanks @andrewiggins)
  • Upgrade workflow actions (#4184, thanks @andrewiggins)
  • Use import.meta.resolve in benchmark setup (#4179, thanks @andrewiggins)
  • Improve code coverage (#4174, thanks @andrewiggins)
  • Improve internal JSDoc types (#4173, thanks @andrewiggins)
  • Upgrade to node@20 for development (#4167, thanks @andrewiggins)

10.18.1

7 months ago

Fixes

  • Avoid crashing when there is no _children (#4147, thanks @JoviDeCroock)
  • Fix regex for "Improper nesting of paragraph" for span under a paragraph (#4144, thanks @cheeaun)

10.18.0

7 months ago

Features

  • Warn for illegal children types in /debug (#4108, thanks @JoviDeCroock)

Types

  • Add missing native attribute JSX types (#4140, thanks @marvinhagemeister)
  • Add SetStateAction & PropsWithoutRef types to compat (#4132, thanks @rschristian)
  • Adds HTMLProps to compat (#4117, thanks @rschristian)

Fixes

  • Cannot read property 'insertBefore' of undefined during suspense (#4141, thanks @zakstucke)
  • Remove role attribute when it's null or undefined (#4137, thanks @DAreRodz)
  • Add timer to event handler so we can check whether it was attached during the current propagation (#4126, thanks @JoviDeCroock)
  • Fix ordering issue with Component re-render (#4125, thanks @JoviDeCroock)

Maintenance

  • Update link & verbiage for reproduction in issue template (#4135, thanks @rschristian)
  • uncomment passing test (#4130, thanks @JoviDeCroock)
  • Replace for-of loop with normal loop (#4110, thanks @Popovkov57)
  • Cleanup unused files (#4107, thanks @JoviDeCroock)

10.17.1

8 months ago

Fixes

  • Fix double unmount (#4105, thanks @developit)
  • Don't rename gotpointercapture and lostpointercapture events (#4096, thanks @rschristian)

Types

  • Ensure all WAI-ARIA 1.2 roles are supported in our types (#4101, thanks @rschristian)

Maintenance

  • Golf size/perf of #4096 (#4102, thanks @developit)

10.17.0

8 months ago

Features

  • Support the isElement function in preact/compat (#4041, thanks @cbbfcd)
  • Support the isFragment function in preact/compat (#4042, thanks @cbbfcd)

Types

  • Support the HTML search element (#4092, thanks @JoviDeCroock)
  • Re-export ComponentChild as ReactNode in the preact/compat types (#4077, thanks @rschristian)
  • Add missing SvgProps and make the generics mandatory (#4071, thanks @JoviDeCroock)
  • Fix dom-event types(#4066, thanks @JoviDeCroock)

Fixes

  • Eagerly unmount placeholders (#4090, thanks @andrewiggins)
  • Avoid skipping re-orders in child diffing (#4088, thanks @JoviDeCroock)
  • reduce stack size of try catch by excluding non components (#4067, thanks @JoviDeCroock)
  • Fix react-frame-component by supporting nullish portals (#3896, thanks @JoviDeCroock)

Maintenance

  • Fix running our benchmarks since the branch rename (#4089, thanks @JoviDeCroock)
  • Fix IE11 attribute test by sorting them (#4070, thanks @marvinhagemeister)
  • Switch default branch to main (#4069, thanks @marvinhagemeister)

10.16.0

9 months ago

Improved child diffing

  • Port skew based child diffing (#4010, thanks @JoviDeCroock)

We have noticed a few scenario's where children would get unmounted and remounted eagerly due to some offset bugs in our child-diffing, with skew-based diffing we plan to address those. This is already part of v11 and has been introduced there by @andrewiggins. This has now been backported to Preact X so we can benefit from the consistency improvements here as well.

Defer setting refs

  • fix: setting ref to null after updating it with new element (#4054, thanks @JoviDeCroock)

We used to set refs as part of the children, synchronously this caused several issues when a ref would go down a level, i.e. the following example

const App = () => {
  return phase === 1 ? <div ref={x}><p>Foo</p></div> : <div><div ref={x}><p>Foo</p></div>
}

In this example when we go from phase 1 to phase 2 we would mount a new ref but only after we bubble back up diffing clean up the outer ref making the ref reset to null.

Fixes

  • fix: incorrect actDepth calculation in test-utils (#4051, thanks @ottomao)
  • Server compat should have a default export (#4047, thanks @MikaFima)
  • Fix forceUpdate edge cases (#4048, thanks @dmitrage)
  • Include HTML above render root for DOM validation (#4043, thanks @marvinhagemeister)

Types

  • Types: add missing aria attributes (#4032, thanks @shoonia)
  • improve VNode typings when generic is passed in (#4050, thanks @JoviDeCroock)

10.15.1

11 months ago

Fixes

  • Fix TS FunctionComponent w/ exactOptionalPropertyTypes (#4025, thanks @rschristian)

Types

  • Add W3C aria attributes (#4026, thanks @shoonia)
  • Adds missing Context and Dispatch types to compat (#4028, thanks @Scott-Fischer)

10.15.0

11 months ago

Revert

  • Revert controlled components (#4009, thanks @JoviDeCroock)

fixes

  • fix: keep hooks index with useEffect (#4016, thanks @1o1w1)

Types

  • Add Missing ForwardRefExoticComponent and RefAttributes types in compat (#3996, thanks @rschristian)
  • Add types for <dialog>'s close & cancel events (#4017, thanks @rschristian)
  • Add missing types of TransitionEvent (#4019, thanks @shoonia)
  • Add types of PictureInPictureEvent (#4020, thanks @shoonia)

10.14.1

11 months ago

Fixes

  • Add microtick delay for restoring the value of controlled inputs (#4006, thanks @JoviDeCroock)