Skip to content

Releases: preactjs/preact

4.7.1

19 Apr 04:26
Compare
Choose a tag to compare
  • Fix regression in 4.6.2 related to recycled component DOM not being treated as first render
  • A few small optimizations

4.7.0

18 Apr 13:20
Compare
Choose a tag to compare
  • Merge #106: removes some unnecessary code, drops ~50 bytes

  • Lazy-instantiate the internal mapping for linkState() and setState's callback queue.

    This reduces allocation cost for components. It also reduces overall memory consumption for classful components that don't make use of those given features (certainly the common case for setState callback)

4.6.3

18 Apr 13:17
Compare
Choose a tag to compare
  • Don't attempt to append a child to a parentNode if the child is the parentNode. Fixes Issue #126.

4.6.2

13 Apr 14:01
Compare
Choose a tag to compare
  • Optimize serialization of Objects to CSS strings to be about 5x faster (benchmark: https://esbench.com/bench/570daee0db965b9a009659f7)

  • Rethink solution to #120. TL;DR: fresh instances, cached DOM. Long version:

    Re-invoking the constructor on a class was not a great idea. Babel's transpiled constructors
    (and basically anything else) re-assign to the prototype, which is slow and a fairly bad idea.
    Also, and more importantly, it was assigning this.base to null, completely ignoring the
    main reason for caching components (caching their generated DOM using the component itself
    as a cache key). This commit changes the behavior to discard the cached component instance
    itself, re-using only the base by copying it to a fresh instance. Best of both worlds!

4.6.1

12 Apr 13:09
Compare
Choose a tag to compare
  • Fix for #122: don't assume Function.prototype exists, as it does not for Arrow Functions (thanks @LinusU!)

4.6.0

12 Apr 02:57
Compare
Choose a tag to compare
  • Fix regression since 4.5.0 where key tracking for components would fail in some cases, causing components not to be recycled. Relates to #98 and the second issue noted in #120.
  • Switch to a global/named symbol Symbol.for('preactattr') for the prop cache key (still falling back to __preactattr_).
  • Address the state re-use issue noted in Issue #120 by manually re-invoking component constructors when re-using components from the recycler.

4.5.1

07 Apr 15:25
Compare
Choose a tag to compare
  • Updated ESLint, announced preactjs.com website.

4.5.0

19 Mar 16:42
Compare
Choose a tag to compare

Bug Fixes

  • Fix context being null/undefined when unset. It should be an empty object.
  • Fix issue where ref (and key) were not being removed from props prior to being passed into component render (Issue #98)

Optimizations

  • Drop unnecessary cloning of props/context
  • Ship a more optimized default build by applying uglify-js without name mangling and with beautification (removes comments and applies dead code elimination)

4.4.0

18 Mar 02:31
Compare
Choose a tag to compare

Bug Fixes

  • When reclaiming externally created elements (such as via dangerouslySetInnerHTML), copy their attributes into the prop cache so they are properly diffed on subsequent render (Issue #97)
  • Fix cached unmount behavior: lifecycle events should be invoked for nested components, but only the top-level component should be physically removed from the DOM. The rest remain cached within that component's DOM + VDOM tree (Issue #94)

4.3.2

14 Mar 01:04
Compare
Choose a tag to compare
  • Fix exception thrown when removing/unsetting dangerouslySetInnerHTML