This is a major update with some breaking changes. Expect a few more updates like this as we move closer to our 1.0 release in 2018.
[up-follow]).Promise. We recommend ES6-promise (2.4 KB gzipped).POST method.jQuery.ajax(). If you have been hacking into Unpoly's networking through jQuery.ajaxPrefilter(), you must now use the up:proxy:load event.up.ajax() has been deprecated since its signature is incompatible with native promises. Please use up.request() instead, whose promise fulfills with an up.Response object.up:proxy:received event has been renamed to up:proxy:loaded.up:proxy:load event properties have changed. You can now access request properties through a key { request }, e.g. event.request.url.up:proxy:load event can now be prevented to prevent a request from being sent to the network.up:proxy:load event now allows listeners to change request headers by manipulating the event.request.headers object.up:proxy:fatal will be emitted when an AJAX request encounters fatal error like a timeout or loss of network connectivity.POST are no longer marked as .up-current, even if their [href] matches the current URL.up.link.isSafe(). It returns whether the given link has a safe HTTP method like GET.up:fragment:destroy can no longer be prevented.[up-restore-scroll] attribute will no longer crash if no previous scroll position for given URL is known (#25)up.observe() no longer sends multiple callbacks when a previous callback was slow to respond.X-Up-Location header, sending a X-Up-Method header is now optional. If it is missing, GET is assumed.X-Up-Fail-Target header.up.motion.none() has been removed without replacement. Just pass false or the string 'none' to indicate a animation or transition which has no visual effects and completes instantly.up.motion.finish() is now async. It returns a promise that fulfills when all animations are finished.up.motion.finish() now also finishes animations in ancestors of the given element.up.follow() will now open a modal if the given link has an [up-modal] attribute[up-modal] links can now have an [up-fail-target] attribute to indicate which selector to replace for an non-200 responseup.follow() will now open a popup if the given link has [up-popup] attributeup.popup.attach() now throws an error if neither { url } nor { html } options are given.Error.{ confirm: true } and the user denies confirmation, the async function now rejects with an Error.up.util.setTimer() is now always async, even when called with a delay of 0 (zero). The function is now stable.up.util.isHash() has been removed without replacement. In your code you can replace up.util.isHash(x) with up.util.isObject(x) && !up.util.isFunction(x).up.util.resolvedDeferred() has been removed without replacement. Use Promise.resolve() instead.up.util.resolvedPromise() has been removed without replacement. Use Promise.resolve() instead.up.util.rejectedPromise() has been removed without replacement. Use Promise.reject() instead.up.util.unresolvableDeferred() has been removed without replacement. Use new Promise(function() {}) instead.up.motion.when() has been removed without replacement. Use Promise.all() instead.up.util.isString() now also returns true for String instances (in addition to string literals)up.util.isNumber() now also returns true for Number instances (in addition to number literals)up.fail_target available in controllers, helpers and views. It returns the selector targeted for a failed response.up.fail_target?(target) available in controllers, helpers and views. It returns whether the given selector is targeted for a failed response.up.any_target?(target) available in controllers, helpers and views. It returns whether the given selector is targeted for a either a successful or failed response.
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.