Revision code

Changes Version 0.56.0
Released on May 14, 2018 with 31 commits

This release includes major performance improvements and a new animation engine.

Beware of the breaking change with .up-current!

Maintaining the .up-current on all links turned out to be a major performance bottleneck, so we had to make some breaking changes:

  • The .up-current class is now only assigned to links with an [up-nav] attribute, or to links within a container with an [up-nav] attribute. You should assign the [up-nav] attribute to all navigational elements that rely on .up-current for styling`.
  • You can also globally configure selectors for your navigational elements in up.feedback.config.navs:

    up.feedback.config.navs.push('.my-nav-bar')
    
  • The normalized URLs of [up-nav] links are now cached for performance reasons.
  • [up-nav] links are only updated once when multiple fragments are updated in a single replacement.

Animation

  • When performing an animated page transition Unpoly will no longer create copies of the old and new fragment versions. The animation will instead be performed on the fragment elements themselves.
  • When animating an element with an existing CSS transition, Unpoly will now pause the CSS transition in its current state, perform the animation, then resume the CSS transition.
  • Unpoly now does less work when animation is disabled globally through up.motion.config.enabled = false.
  • up.morph() will now expect the new fragment version to be detached from the DOM before morphing.
  • up.morph() will now detach the old fragment version from the DOM after morphing.
  • The up.morph() function has been demoted from stable to experimental.
  • up.motion.finish() now longer queries the DOM when there are no active animations.

Application layout

  • When Unpoly cannot find the viewport of an element, it will now always considers document to be the viewport.

Fragment updates

  • The up:fragment:destroyed event is now emitted after the fragment has been removed from the DOM. The event is emitted on the former parent of the removed fragment.

Utility functions

General

  • Partially remove jQuery from internal code for performance reasons. We want to eventually remove jQuery as a dependency.
  • Cache the results of feature detection for performance reasons.
  • Unpoly is now more efficient when selecting elements from the DOM.
  • Unpoly is now more efficient when reacting to mouse events.

Upgrading

If you're upgrading from an older Unpoly version you should load unpoly-migrate.js to polyfill deprecated APIs. Changes handled by unpoly-migrate.js are not considered breaking changes.

See our upgrading guide for details.