chore(deps): update dependency unpoly to v3 #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^2.7.2
->^3.0.0
Release Notes
unpoly/unpoly (unpoly)
v3.9.3
Compare Source
This is a maintenance release that addresses some bugs while we're working on the next major feature update.
Changes
up.layer.config.overlay.trapFocus = false
.v3.9.2
Compare Source
up:fragment:loaded
listeners could not open a new layer by settingevent.renderOptions.layer = "new"
.v3.9.1
Compare Source
form[up-target]
would receive a[role=button]
attribute (issue #668).v3.9.0
Compare Source
This release brings many fixes and quality-of-life improvements that were requested by the community.
The vast majority of these changes are backward compatible. One breaking change can be found with making links followable. Existing usage is polyfilled by
unpoly-migrate.js
.Emitting events on buttons
[up-emit]
to emit an event when any element is clicked. In particular this works with a<button>
or any faux-interactive element (issue #416).Improvements to faux-interactive elements
Sometimes you need to add a
click
listener to non-interactive elements (like<span>
). Unpoly helps you prevent accessibility issues with such "faux-interactive" elements, by offering the[up-clickable]
attribute andup.link.config.clickableSelectors
configuration.Unpoly also leverages this for its own faux-interactive elements, such as
[up-emit]
or[up-dismiss]
.This release improves the handling of faux-interactive elements:
<span>
or<div>
.up.link.config.clickableSelectors
, by setting an[up-clickable=false]
attribute or configuringup.link.config.noClickableSelectors
.Space
andEnter
keys. Faux-interactive elements with a[role=link]
can only be activated with theEnter
key.[up-follow]
attribute now default to[role=link]
(instead of the default[role=button]
).Making links followable
[up-href]
attribute are no longer followable by default. They also require an[up-follow]
attribute or a match inup.link.config.followSelectors
. This change was made to remove confusion with other features that use[up-href]
, such as[up-defer]
and (since this release)[up-poll]
.[up-instant]
attribute are no longer followable by default. They also require an[up-follow]
attribute or a match inup.link.config.followSelectors
. This change was made to remove confusion with other features that use[up-instant]
, in particularup:click
on faux-interactive elements.Polling
up:fragment:poll
event can now inspect or mutateevent.renderOptions
. This allows more control over the polling request and sub-sequent render passes.[up-poll]
elements can now use the[up-href]
attribute to poll from a different URL. By default Unpoly will poll the URL from which the element was originally loaded. The old method over overriding[up-source]
is still supported, but[up-href]
is the preferred way of doing this going forward.[up-poll]
elements can now use the[up-method]
attribute to choose a different HTTP method for polling requests.[up-poll]
elements can now use the[up-params]
attribute to add custom params to polling requests.[up-poll]
elements can now use the[up-headers]
attribute to add custom headers to polling requests.Forms
Enter
from a focused field (discussion #658).up.submit()
now includes the[name]
and[value]
of the default submit button in the submitted params. By default the form's first submit button will be assumed. You can prevent this with{ submitButton: false }
, or pass a different button element as{ submitButton }
.<sl-button>
(discussion #643).Smooth scrolling
Various
[up-defer]
elements no longer have a hand cursorup:link:follow
can now open a layer with a given mode using the shorthand notationevent.renderOptions.layer = "new drawer"
.Uncaught AbortError
when the user presses the back button, but a script prevents theup:location:restore
event.Uncaught AbortError
when the user closes the overlay, but a script prevents theup:layer:dismiss
orup:layer:accept
event.v3.8.0
Compare Source
This release brings many improvements that were requested by the community.
The vast majority of these changes are backward compatible. Some breaking changes can be found with the Reworked style helpers. Existing calls are polyfilled by
unpoly-migrate.js
.Lazy loading content
You can now lazy load additional fragments when a placeholder enters the DOM or viewport. By deferring the loading of non-critical fragments with a separate URL, you can paint important content earlier.
For example, you may have a large navigation menu that only appears once the user clicks a menu icon:
To remove the menu from the initial render pass, extract its contents to its own route, like
/menu
.In the initial view, only leave a placeholder element and mark it with an
[up-defer]
attribute. Also set an[up-href]
attribute with the URL from which to load the deferred content:When the
[up-defer]
placeholder is rendered, it will immediately make a request to fetch its content from/menu
. You may also delay the request until the placeholder is scrolled into the viewport or control the timing from JavaScript.See lazy loading content for a full example and more details.
Preloading links eagerly or lazily
For many years Unpoly has supported the
[up-preload]
attribute. This would preload a link when the user hovers over it:You can now preload a link as soon as it appears in the DOM, by setting an
[up-preload="insert"]
attribute. This is useful for links with a high probability of being clicked, like a navigation menu:To "lazy preload" a link when it is scrolled into the viewport, you can now set an
[up-preload="reveal"]
attribute. This is useful when an element is below the fold and is unlikely to be clicked until the the user scrolls:Infinite scrolling
Deferred fragments that load when revealed can implement infinite scrolling without custom JavaScript.
All you need is an HTML structure like this:
See infinite scrolling for a full example and more details.
Enabling or disabling Unpoly features with boolean attributes
Most Unpoly attributes can now be enabled with a value
"true"
and be disabled with a value"false"
:Instead of setting a
true
you can also set an empty value:Boolean values can be helpful with a server-side templating language like ERB, Liquid or Haml, when the attribute value is set from a boolean variable:
This can also help when you're generating HTML from a different programming language and want to pass a
true
literal as an attribute value:This behavior is available for most attributes:
[up-follow]
[up-submit]
[up-instant]
[up-preload]
[up-nav]
[up-expand]
[up-keep]
[up-hungry]
[up-poll]
[up-defer]
[up-validate]
[up-autosubmit]
[up-watch]
Request batching
When queueing multiple requests to the same URL, Unpoly will now send a single request with a merged
X-Up-Target
header.For example, these two render passes render different selectors from
/path
:Unpoly will send a single request with both targets:
This allows you to have multiple deferred placeholders that load from the same URL efficiently.
More cache hits for tailored responses
The following is a change for server routes that use the
Vary
header to optimize their responses to only include the requestedX-Up-Target
.When requests target multiple fragments and the server responds with a
Vary
header, that response is now a cache hit for each individual selector:X-Up-Target: .foo, .bar
🠤
Vary: X-Up-Target
X-Up-Target: .foo
X-Up-Target: .bar
X-Up-Target: .foo, .bar
X-Up-Target: .bar, .foo
X-Up-Target: .baz
X-Up-Target: .foo, .baz
X-Up-Target
See how cache entries are matched for a detailed example.
Cached content is retained while offline
This release fixes some long-standing issues where the cache was evicted when a request failed due to network issues, or when the server responds with an empty response.
This fix restores the indented behavior that, even without a connection, cached content will remain navigatable for 90 minutes. This means that an offline user can instantly access pages that they already visited this session.
Quick access to the form element in form events
Form-related events like
up:form:submit
andup:form:validate
are emitted on the element that caused the event. For example,up:form:submit
is emitted on the submit button that was pressed.This made it somewhat inconvenient to access the form element:
You can now access the form element through a
{ form }
property on the event object:Improvements to history restoration
Several improvements have been made to the way Unpoly handles the browser's "back" button.
Ensuring fresh content
In earlier versions, when the user pressed the back button, Unpoly would sometimes restore the page with stale content.
Starting with 3.8.0, restored content is now revalidated with the server. This ensures that content is shown with the most recent data.
Custom restoration behavior
Listeners to
up:location:restore
may now mutate theevent.renderOptions
event to customize the render pass that is about to restore content:As a reminder, you can also completely substitute Unpoly's render pass with your own restoration behavior, by preventing
up:location:restore
. This will prevent Unpoly from changing any element. Your event handler can then restore the page with your own custom code:Reworked style helpers
This release reworks all functions that work with CSS properties:
up.element.setStyle(element, props)
up.element.styleNumber(element, prop)
up.element.style(element, propOrProps)
up.element.createFromSelector(selector, { style })
up.element.affix(container, selector, { style })
up.animate(element, lastFrameProps)
Support for custom properties
All functions that work with CSS properties now also support custom properties ("CSS variables"):
Property names must be in kebab-case
In earlier versions Unpoly functions accepted property names in either camelCase or kebab-case.
As custom properties don't have a camelCase equivalent, now only kebab-case is supported:
To help with upgrading,
unpoly-migrate.js
Unpoly will rename camelCase keys for you.Length values must have a unit
CSS requires length values (like
width
,top
ormargin
) to have a unit, e.g.width: 200px
. In earlier versions Unpoly silently added apx
unit to length values that were missing a unit.This approach required Unpoly to keep a list of CSS properties that denote lengths, which was unsustainable. You now always need to pass length values with a unit:
To help with upgrading,
unpoly-migrate.js
Unpoly will addpx
units to unit-less length values.Rebrushed unpoly.com
The design of unpoly.com was reworked with fresh colors, better spacing and clearer fonts.
All documentation pages now have a table of contents to quickly find the section you're looking for.
Several new guides were also added:
Other changes
up.element.numberAttr()
now parses negative numbers.html[lang]
is now also updated. This can be prevented by setting an[up-lang=false]
attribute or passing a{ lang: false }
option.up.util.microtask()
was deprecated. Use the browser's built-inqueueMicrotask()
instead..up-scrollbar-away
class.button
. In earlier versions these elements received a linklink
role.{ duration: 0 }
would apply the default duration instead of skipping the animation (fixes #588)..up-current
by adding a selector toup.feedback.config.noNavSelectors
.v3.7.3
Compare Source
This also affected render passes with
[up-hungry]
fragments..parent .foo, .parent .bar
.v3.7.2
Compare Source
Validation
This change addresses multiple edge cases with concurrent user input during form validations:
<form>
element is aborted. Previously individual validations were aborted when their target was aborted.up.validate()
now rejects with anup.Aborted
error if a debounce delay was aborted (by aborting the<form>
element).Autosubmit fixes
This change fixes two more regressions for
[up-autosubmit]
, introduced by 3.7.0:<form>
element is aborted. It no longer aborts the delay when the form's target is aborted.Fragment API
:maybe
suffix) are now included in theX-Up-Target
header if they match in the current page. Previously optional selector parts were always omitted fromX-Up-Target
.up:fragment:aborted
now has a new{ reason }
property. Its a value is a string describing the reason for the fragment being aborted.v3.7.1
Compare Source
This change fixes two regressions for form field watchers, introduced by 3.7.0:
Cannot destructure property { disable } of null
.v3.7.0
Compare Source
Focus ring visibility
You can now control whether a focused fragment shows a visible focus ring.
Because Unpoly often focuses new content, you may see focus outline appear in unexpected places.
Focus rings are important for users of keyboards and screen readers to be able to orient themselves
as the focus moves on the page. However, mouse and touch users often dislike the visual effect of a focus ring.
To help your CSS show or hide focus rings in the right situation, Unpoly assigns CSS classes
to the elements it focuses:
an
.up-focus-visible
class.via mouse, touch or stylus, Unpoly will set an
.up-focus-hidden
class instead.You can use these classes to hide unwanted focus rings, or style focus rings on new components.
The following supporting changes have also been made:
up.viewport.config.autoFocusVisible
to a function that decides if an element should get a.up-focus-visible
or.up-focus-hidden
class.up.event.inputDevice
. Its value is a string describing the class of input device used for the current task.:focus-visible
as it sets focus classes, but can only do so in some browsers.up.focus()
function accepts a new{ focusVisible }
option to control whether.up-focus-hidden
or.up-focus-visible
is set on a focused element.See Focus ring visibility for more details and examples.
Reacting to form changes
This release addresses many edge cases with features that watch form fields for changes, in particular
[up-watch]
,[up-autosubmit]
andup.watch()
:[up-autosubmit]
would not work on forms that also have dependent fields using[up-validate]
.[up-autosubmit]
now aborts a debounce delay if either the form element or the form's target are aborted. It no longer aborts the delay if any watched field is aborted.Other changes
up.on()
takes a{ capture: true }
option to register a listener that runs before the event is emitted on the element.{ behavior: 'instant' }
to prevent picking up ascroll-behavior
CSS property. To do pick up the property, pass{ behavior: 'auto' }
.up.form.isField()
. It returns whether the given element is a form field.v3.6.1
Compare Source
[up-main=modal]
.v3.6.0
Compare Source
Targeting fragments
:main
or:layer
can now be used in a compound target, e.g.:main .child
.:main
will no longer match in the region of the interaction origin). It will now always use the first matching selector inup.fragment.config.mainTargets
.<body>
instead of the main element.Performance improvements
:has()
selector where available. Unpoly's polyfill for:has()
will remain included for the time being. It will be removed as Firefox':has()
support has reached the majority of users (available on Nightly now).Support for structured data markup
script[type="application/ld+json"]
elements is considered a meta tag that will be updated with history changes.script[type="application/ld+json"]
elements in are now preserved in new fragments withup.fragment.config.runScripts = false
.Bugfixes and minor improvements
Content-Security-Policy-Report-Only
.X-Up-Validate
header value exceeds 2048 characters, it is now set to:unknown
.This is to prevent web infrastructure from rejecting an overly long request line with an
413 Entity Too Large
error.up:assets:changed
would be emitted for every response when configuringup.fragment.config.runScripts = false
.up.form.isSubmittable()
now returnsfalse
for forms with a cross-origin URL in their[action]
attribute.up.util.contains()
now works onNodeList
objects.up.fragment.config.runScripts = false
.v3.5.2
Compare Source
Continuing our focus on stability, this release addresses some long-standing issues:
<video>
and<audio>
elements would render incorrectly in Safari (#432).<script up-keep>
elements would re-run during subsequent render passes.<script>
elements would not run when targeted directly.<noscript up-keep>
elements would not be persisted during fragment updated.<noscript>
elements would lose their text content when targeted directly.v3.5.1
Compare Source
This releases fixes two regressions introduced by 3.5.0:
happened to match the overlay's location-based close condition.
the overlay again immediately closes without rendering its initial content.
v3.5.0
Compare Source
Unpoly 3.5 brings major quality-of-life improvements and addresses numerous edge cases in existing functionality.
Notification flashes
You can now use an
[up-flashes]
element to render confirmations, alerts or warnings:{:width='480'}
To render a flash message, include an
[up-flashes]
element in your response.The element's content should be the messages you want to render:
An
[up-flashes]
element comes with useful default behavior for rendering notifications:[up-hungry]
).[up-flashes]
container.You can use a compiler to clear messages after a delay.
will be shown on a parent layer.
See notification flashes for more details and examples.
Detection of changed scripts and styles
Unpoly now detects changes in your JavaScripts and stylesheets after deploying a new version of your application.
While rendering new content, Unpoly compares script and style elements in the
<head>
and emits anup:assets:changed
event if anything changed.It is up to you to handle new frontend code revisions, e.g. by loading new assets or notifying the user:
{:width='305'}
See handling asset changes for more details and examples.
Automatic update of meta tags {#meta-tags}
Render passes that update history now synchronize meta tags in the
<head>
, such asmeta[name=description]
orlink[rel=canonical]
.In the document below, the highlighted elements will be updated when history is changed, in additional to the location URL:
The linked JavaScript and stylesheet are not part of history state and will not be updated.
Consistent behavior in overlays
Overlays with history now update meta tags when opening. When the overlay closes the parent layer's meta tags are restored.
Deprecating
[up-hungry]
in the<head>
Existing solutions using
[up-hungry]
to update meta tags can be removed from your application code.Other than
[up-hungry]
the new implementation can deal with meta tags that only exist on some pages.Opting in or out
See
[up-meta]
for ways to include or exclude head elements from synchronization.You can disable the synchronization of meta tags globally or per render pass:
Forgiving error handling
In earlier versions, errors in user code would often crash Unpoly. This would sometimes leave the page in a corrupted state. For example,
a render pass would only update some fragments, fail to scroll, or fail to run destuctors.
This version changes how Unpoly handles exceptions thrown from user code, like compilers, transition functions or callbacks like
{ onAccepted }
.User errors are no longer thrown
Starting with this version, Unpoly functions generally succeed despite exceptions from user code.
The code below will successfully compile an element despite a broken compiler:
Instead an
error
event onwindow
is emitted:This behavior is consistent with how the web platform handles errors in event listeners
and custom elements.
Debugging and testing
Exceptions in user code are also logged to the browser's error console.
This way you can still access the stack trace or detect JavaScript errors in E2E tests.
Some test runners like Jasmine already listen to the
error
event and fail your test if any uncaught exception is observed.In Jasmine you may use
jasmine.spyOnGlobalErrorsAsync()
to make assertions on the unhandled error.Hungry elements
Element with an
[up-hungry]
attribute are updated whenever the serversends a matching element, even if the element isn't targeted.
This release addresses many issues and requests concerning hungry elements:
Conflict resolution
There is now defined behavior when multiple targets want to render the same new fragments from a server response:
Rendering in multiple layers
Many edge cases have been addressed for render passes that affect multiple layers:
the discarded response can now be rendered into matching hungry elements on other layers.
the layer closest to the rendering layer will be chosen.
[up-if-layer]
.For example,
[up-if-layer="current child"]
would only piggy-back on render passes for the current layer or its direct overlay.More control over updates
You can now freely control when an hungry element is updated:
Before a hungry element is added to a render pass, a new event
up:fragment:hungry
is now emitted on the element.The event has properties for the old and new element, and information about the current render pass.
You may prevent this event to exclude the hungry element from the render pass. Use this to define arbitrary conditions
for when an hungry element should be updated:
Hungry elements can now set an
[up-on-hungry]
attribute. It contains a code snippet that receives anup:fragment:hungry
event.Calling
event.preventDefault()
will prevent the hungry fragment from being updated.Deprecated the
[up-if-history]
modifier for hungry elements.This functionality is now covered by the more generic
[up-on-hungry]
attribute. Also its main use case was synchronizing meta tags,and that is now supported out of the box.
Animation
Some improvements have been to hungry elements with animated transitions:
[up-duration]
and[up-easing]
attributes.up.render().finished
promise.Polling
This release ships many improvements for the
[up-poll]
attribute.Pausing and resuming
Unpoly has always paused polling when the user minimizes the window or switches to another tab.
This behavior has been improved by the following:
When at least one poll interval was spent paused in the background and the user then returns to the tab, Unpoly will now immediately reload the fragment.
You can use this to load recent data when the user returns to your app after working on something else for a while. For example, the following
would reload your main element after an absence of 5 minutes or more:
Polling now unschedules all JavaScript timers while polling is paused. This allows browser to keep the inactive window suspended, saving battery life.
Unpoly also pauses polling for fragments that are covered by an overlay. This behavior has been improved by the following:
Unpoly will now immediately reload the fragment.
[up-if-layer="any"]
attribute on an[up-poll]
fragment.Disabling polling
[up-poll=false]
. The previous method of omitting the[up-poll]
attribute remains supported.up.radio.config.pollEnabled
. To disable polling, prevent theup:fragment:poll
event instead.Rendering
Unpoly's rendering engine has been reworked to address many edge cases found in production use.
More practical callback order
.up-current
classes are updated before compilers are called.{ onAccepted }
and{ onDismissed }
callbacks fire.This allows callbacks to observe all fragment changes made by a closing overlay.
Matching in destroyed elements
This release addresses many many errors when matching fragments in closed layers, detached elements or destroyed elements in their exit animation:
{ failTarget }
or{ failLayer }
cannot be resolved.up.fragment.toTarget()
no longer crashes when deriving targets for destroyed elements that are still in their exit animation.{ layer }
does not exist or has been closed.{ failLayer }
is no longer open.General improvements
This allows to use
[up-validate]
in forms that are not submitted through Unpoly.[up-keep]
no longer need to also be[up-keep]
. You can prevent keeping by setting[up-keep=false]
. This allows you to set[up-keep]
via a macro."/true"
(sic)."revalidating undefined"
Network quality is no longer measured
Previous versions of Unpoly adapted the behavior some features when it detected high latency or low network throughput.
Due to cross-browser support for the Network Information API,
measuring of network quality was removed:
Unpoly no longer doubles poll intervals on slow connections. The configuration
up.radio.config.stretchPollInterval
was removed.Unpoly no longer prevents preloading on slow connections. The configuration
up.link.config.preloadEnabled = 'auto'
was removed.To disable preloading based on your own metrics, you can still prevent the
up:link:preload
event.The configuration
up.network.config.badDownlink
was removed.The configuration
up.network.config.badRTT
was removed.The function
up.network.shouldReduceRequests()
was removed.Unpoly retains all other functionality for dealing with network issues.
Fragment API
More control over region-aware fragment matching
When targeting fragments, Unpoly will prefer to
match fragments in the region of the user interaction. For example, when
a link's
[up-target]
could match multiple fragments, the fragment closest to the link is updated.In cases where you don't want this behavior, you now have more options:
{ match: 'first' }
option to any function that matches or renders a fragment.[up-match=first]
option on a link or form that matches or renders a fragment.up.fragment.config.matchAroundOrigin
has been replaced byup.fragment.config.match
. Its values are'region'
(default) and'first'
.General improvements
New experimental function
up.fragment.contains()
. It returns whether the givenroot
matches or contains the given selector or element.Other than
Element#contains()
it only matches fragments on the same layer. It also ignores destroyed fragments in an exit animation.The event
up:fragment:keep
received a new property{ renderOptions }
. It contains the render options for the current render pass.The event
up:fragment:aborted
received new experimental property{ newLayer }
. It returns whether the fragment was aborted by a new overlay opening.Many functions in the fragment API now also support a
Document
as the search root:up.fragment.get()
up.fragment.all()
up.fragment.contains()
Passing an element to
up.fragment.get()
now returns that element unchanged.Scripting
Destructors are now called with the element being destroyed.
This allows you to reuse the same destructor function for multiple elements:
Unpoly 3.0.0 introduced a third
meta
argument for compilerscontaining information about the current render pass:
Unfortunately we realized that access to the response this would to bad patterns where fragments would compile
differently for the initial page load vs. subsequent fragment updates.
In Unpoly 3.5 compilers can no longer access the current response via the
{ response }
of thatmeta
argument.The
{ layer }
and{ revalidating }
property remains available.The
up.syntax
package has been renamed toup.script
.Layers
subtree
in your{ layer }
options or[up-layer]
attributes.This matches fragments in either the current layer or its descendant overlays.
up.Layer
objects now support a new method#subtree()
. It returns an array ofup.Layer
containing this layer and its descendant overlays.Links
up:link:preload
event received a new property{ renderOptions }
. It contains the render options for the current render pass.[up-on-offline]
attribute now supports a CSP nonce.up.link.followOptions()
now takes anObject
as a second argument. It will override any options parsed from the link attributes.up.link.config.preloadEnabled
was deprecated. To disable preloading, preventup:link:preload
.DOM helpers
up.element.isEmpty()
was added. It returns whether an element has neither child elements nor non-whitespace text.Viewports
up.viewport.config.anchoredRight
toup.viewport.config.anchoredRightSelectors
up.viewport.config.fixedTop
toup.viewport.config.fixedTopSelectors
up.viewport.config.fixedBottom
toup.viewport.config.fixedBottomSelectors
unpoly-migrate.js
up.element.isAttached()
andup.element.isDetached()
functions were changed so they behavelike their implementation in Unpoly 2.x. In particular the functions now only consider attachment in
window.document
, but not to otherDocument
instances.Build
unpoly.js
is now compiled using ES2021 (up from ES2020). The ES6 build for legacy browsers remains available.Improve compression of minified builds. In particular private object properties are now prefixed with an underscore (
_
) so they can be mangled safely.If you are re-bundling the unminified build of Unpoly you can configure your minifier
to do the same.
v3.3.0
Compare Source
Elements with an
[up-hungry]
attribute are updated whenever the server sends a matching element, even if the element isn't targeted explicitly.By default hungry elements only update from responses that target their own layer. Unpoly 3.0 introduced a modifying attribute
[up-if-layer="any"]
that tells the element to also update from responses from other layers. Unpoly 3.3.0 addresses two edge cases:[up-if-layer="any"]
are also updated from responses that open an overlay.[up-if-layer="any"]
are also updated from responses that cause an overlay to close.v3.2.2
Compare Source
Fix a bug where rendering on the root layer while a focused overlay is closing would crash with an error like this:
v3.2.1
Compare Source
This is a bugfix release with many contributions from the community.
up.on()
no longer fire when clicking on a child of a disabled button. By @adam12."contains"
could not be submitted. By @adam12.{ location }
property of theup:location:changed
would sometimes beLocation
object instead of a string. By @triskweline.move-from-top
,move-from-left
, etc.) no longer leave atransform
style on the animated element. By @triskweline.{ history: false }
for all functions that close layers. This prevents Unpoly from restoring history from the revealed parent layer. By @triskweline.v3.2.0
Compare Source
Addressing an important caching issue
Unpoly 3.2.0 no longer cache responses with an empty body (fixes #497). In particular responses with
304 Not Modified
are no longer cached when using conditional requests.As this issue could cause errors when rendering, we recommend all Unpoly 3 users to upgrade.
Using the server response that closed an overlay
When an overlay closes in reaction to a server response, no content from that response is rendered.
Sometimes you do need to access the discarded response, e.g. to render its content in another layer.
For this you can now access response via the
{ response }
property of theup:layer:accepted
andup:layer:dismissed
events.For example, the link link opens an overlay with a form to create a new company (
/companies/new
).After successful creation the form redirects to the list of companies (
/companies
). In that casewe can use the HTML from the response and render it into the parent layer:
The
{ response }
property is available whenever a server response causes an overlay to close:Rendering
up.Response
objectsIf you have manually fetched content from the server, you can now pass an
up.Response
object as a{ response }
option to render its contents:The various ways to provide HTML to rendering functions are now summarized on a new documentation page.
Other changes
You can now use
[up-href]
without also setting[up-follow]
or[up-target]
(fixes #489).Date inputs are again validated on
change
instead ofblur
.In Unpoly 3.0 this defaulted to
blur
because desktop date pickers emit achange
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.