Posted about 1 year ago. Visible to the public. Auto-destruct in 30 days

Unpoly 0.57.0 released: New params API, compiler improvements and scrolling fixes

This is a major rewrite with many bugfixes, performance improvements and some minor breaking API changes.

Request parameters

To prevent confusion with [up-data], Unpoly now uses the word "params" when talking about form values or request parameters:

  • up.request() option { data } has been renamed to { params }.
  • up.replace() option { data } has been renamed to { params }.

Parameters may be passed in one of the following types:

  1. an object like { email: '' }
  2. a FormData object
  3. a query string like
  4. an array of { name, value } objects like [{ name: 'email', value: '' }]

To help working with form values and request parameters, an experimental module up.params has been added. It offers a consistent API to manipulate request parameters independent of their type.

Application layout

  • When Unpoly cannot find the viewport of an element, it now uses the scrolling root element. This is either <body> or <html>, depending on the browser.
  • Fix a bug where linking back and forth between multiple #anchor hashes of the same URL would always reveal the first anchor.
  • Revealing elements below fixed navigation bars now honors the navigation bar's padding, border, margin, top and bottom properties.
  • Fix a bug where revealing elements fixed navigation bars would scroll 1 pixel too short.
  • up.layout.revealHash() no longer retrieves the hash anchor from the current URL. You need to pass in a #hash value as a first argument.
  • Fix a bug where a #hash anchor would not be revealed if it included non-word characters like spaces or dots.


  • To improve performance, Unpoly no longer parses [up-data] attributes when a compiler function does not require a second data argument.
  • Compilers that return destructor functions now run slightly faster.
  • Compilers with { batch: true } now receive an array of [up-data] objects as their second data argument.
  • Compilers with { batch: true } can no longer return destructor functions. Previously the behavior of batch destructors was undefined, now it throws an error.
  • Returning an array of destructor functions from up.compiler() is now deprecated. Please return a single destructor function instead.
  • now returns undefined if the given object has no (or an empty) [up-data] attribute. It previously returned an empty object.

Event listeners

  • To improve performance, Unpoly no longer parses [up-data] attributes when an up.on() listener does not require a third data argument.
  • up.on() now throws an error when the same callback function is registered multiple times.

Fragment update API


makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Henning Koch
Last edit:
30 days ago
by Henning Koch
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Henning Koch to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more