Skip to content

Releases: preactjs/preact

8.1.0

09 Apr 15:49
Compare
Choose a tag to compare

As of 8.1.0, we're officially out of beta! If you were waiting to upgrade to Preact 8, now's the time.

💁 8.x included a few important backwards-incompatible changes, so we've put together a 8.0 migration guide to help. The guide includes "polyfills" you can use to restore 7.x functionality so your migration goes smoothly.

If you have any issues upgrading, including anything caused by this release, drop us a line!

This release resolves a few issues people have had when upgrading.

  • Remove object check before setting attributes (fixes custom toString, #401 - thanks @NekR!)
  • Cast boolean children to null for component props (fixes rc-animate, #629 - thanks @hassanbazzi!)
  • Call componentDidMount on children before componentDidUpdate on parent (#440, #506 - thanks @robertknight!)
  • Revert 8.0.0 behavior of throwing when encountering undefined components (#627)
    • preact/debug will be released shortly and does a much better job reporting stack traces!

🌈 Also worth noting, the linkstate module is now available.

8.0.1

06 Apr 16:43
Compare
Choose a tag to compare
8.0.1 Pre-release
Pre-release

Quick follow-up to 8.0.0

  • fixes an issue with preact-router (thanks @lukeed & @kbaxter!)
  • Fixes element removal regression in old IE (#625)

8.0.0

06 Apr 03:44
Compare
Choose a tag to compare
8.0.0 Pre-release
Pre-release

8.0.0 (beta)

It's here! 🌈

This release represents a huge step forward for Preact:

  • Significantly increased performance - in some cases by 30%.
  • Better compatibility - key for PFC's, class integrations, capturing events.
  • Fewer edge cases - goodbye to unnecessary mounts and DOM hierarchy errors.
  • Even smaller - Preact had been 3.9kb for a while - now it's 3.3kb (and headed for 2.9kb!)

💁 If you're looking to upgrade, be sure to read the quick guide.

Breaking Changes

  • Pure Functional Components now have backing instances. This means key now works perfectly on PFC's. It also means you could use state and lifecycle methods in Functional Components... (#163, #517, #536, #586, #474)
  • linkState() has been removed from Preact itself. It is being published as a standalone linkstate module shortly.
  • class and className no longer serialize Object values to Strings. Instead, use classnames (#401)
  • preact/aliases is no longer necessary. createElement() is now an alias of h() right out of the box!
  • DOM element recycling has been removed. It was a source of issues for many, and is no longer necessary for great performance thanks to diff optimizations that reduce the number of cases where elements are removed and re-added. (#544, #351, #461, #459, #503, #535, #562)
  • Undefined components references now throw rather than rendering <undefined> (#574)
  • No more Symbol. Instead of try to use Symbol.for('preactattr'), __preactattr_ is always used.
  • Render debouncing now uses setTimeout(0) instead of Promises. It's smaller, doesn't swallow rendering errors in Safari, and was already the fallback (#357)
  • The non-standard componentDidUnmount() lifecycle method is removed. Use componentWillUnmount().
  • onXxxxCapture is now supported for registering capturing event handlers.
  • Events like focus and blur are no longer automatically capturing by default.

Bugs Fixed

  • Hierarchy errors are a thing of the past (thanks to recycler and PFC rewrites) (#380, #391)
  • Fixed edge case that could cause children to be rendered out of order (#581, #603)
  • Unmount lifecycle is always fired when replacing a Component with an empty element (#538, #534)
  • ref functions attached to DOM nodes are no longer invoked for updates, only for mount/unmount.

Other Notable Changes

  • "holes" in JSX children are now preserved and used intelligently by the diff (#580, #540)
  • Re-rendering a compositional child with a different key prop now triggers a remount (#338)
  • JSX children passed to a Component are preserved rather than normalized (#551)
  • Preact no longer relies on the Text or Array constructors for type checks, instead relying on duck typing (#595, #530)
  • Ignore whitespace-only Text nodes during SSR hydration. SSR boot is now significantly faster than cold boot.

Here's the list of changes itemized by commit:
master...8

7.2.1

24 Mar 01:34
Compare
Choose a tag to compare

Just a small bugfix release - DevTools was throwing an exception if components didn't inherit from Component. Preact supports components not inheriting from Component, so we've fixed the DevTools to match 👍

7.2.0

23 Jan 15:10
Compare
Choose a tag to compare

⚛️ Preact 7.2.0 is now available as a regular release!

npm install --save preact

Bugs Squashed

  • Fix IE issues from 7.1 and update test cases (huge thanks to @mkxml for the hard work on this 🙇)
  • Fix TextNode duplication in IE (#430, thanks also to @mkxml)
  • Fix unnececssary diff when swapping from dangerouslySetInnerHTML to children (thanks @harish2704)
  • Fix issue in 7.x with <select> sometimes not applying value prop (#446)
  • Don't stringify true children, instead skip them (#468, thanks @jxodwyer)
  • Fix issue where unmount could be skipped on a top-level component (#493, discovered by @insin)
  • (DevTools Integration) Fix multiple root element issue

New Features

  • Use a shared empty Array for props.children when there are no children. Fixes simple shallow equality-based shouldComponentUpdate for leaf nodes 🎉
  • Remove instanceof SVGElement check in favor of duck typing. Fixes JSDOM compatibility and improves diff performance (#423, thanks @nhunzaker)
  • Better TypeScript Definitions: Component lifecycle methods, setState callback, etc

7.1.0

02 Dec 23:12
Compare
Choose a tag to compare
  • 10x performance boost for initial rendering (#416)
  • Fix edge case when swapping component root (#414)
  • Fix diff reflow when removing leading element (#394)
  • Check existence of firstChild before checking if it is a Text node
  • Performance optimization for element/tree removal
  • Re-add short-circuit for PFC's (fixes compositional PFC triggering constant recycling)
  • Fixed TypeScript definition signature for linkState (#427)
  • Add a whole bunch of explanatory comments to the diff engine 🎉

7.0.3

17 Nov 16:32
Compare
Choose a tag to compare
7.0.3 Pre-release
Pre-release

Bugfix

This release fixes an issue when hydrating from a static server-rendered DOM that could cause Preact to do far more work than it should have been doing. If you're doing SSR, check out this release for a massive performance boost.

7.0.2

17 Nov 16:31
Compare
Choose a tag to compare
7.0.2 Pre-release
Pre-release

7.x

7.x is currently in beta. It should be an entirely safe upgrade for most.

The reason it's a new major version is because Preact now ignores externally created DOM elements when rendering, unless performing hydration from a server-render (ie - the diff is initiated from a render() against an element that was not created by the DOM renderer).

6.4.0

28 Oct 13:23
Compare
Choose a tag to compare

Features

  • Preliminary React DevTools support thanks to the amazing @robertknight! 🙇

Fixes

  • Prevent against reassignment of the same value to TextNodes in Firefox (#368, thanks @zbinlin)
  • When swapping the base of a composed child component, update its parent's base reference (#349)
  • Prevent accidental duplicate recycling of elements when swapping a component's root element (#373, thanks @jakearchibald)

6.3.0

06 Oct 01:12
Compare
Choose a tag to compare

With 6.3.0, the children prop (on a VNode) is now always an Array, even if there are no children. This allows us to skip an existence check when plucking children within render:

// 6.2.1 & prior:
({ children }) => children && children[0];

// As of 6.3.0:
({ children }) => children[0];

This change is backwards compatible since previously an empty array was already being returned for no children in some cases. Now it's just more consistent! 🌈