fix(deps): update dependency unpoly to v3.14.1#1971
Open
renovate[bot] wants to merge 2 commits intomainfrom
Open
fix(deps): update dependency unpoly to v3.14.1#1971renovate[bot] wants to merge 2 commits intomainfrom
renovate[bot] wants to merge 2 commits intomainfrom
Conversation
Contributor
Author
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
3.12.1→3.14.1Release Notes
unpoly/unpoly (unpoly)
v3.14.1Compare Source
v3.14.0Compare Source
This release delivers many requested features while filing off some long-standing sharp edges throughout the framework.
Breaking changes are marked with a⚠️ emoji and polyfilled by
unpoly-migrate.js.Global scripting policies
This version introduces settings to globally control whether Unpoly will execute JavaScript on your page.
Script elements
The boolean
up.fragment.config.runScriptshas been replaced with a more flexible settingup.script.config.scriptElementPolicy. This lets you control whether to run scripts in new fragments:<script>that passes your CSP checks, but requires a nonce for viral CSPs withstrict-dynamic.You can configure
up.script.config.scriptElementPolicyto block all script elements, or to only allow scripts with a valid[nonce]attribute:scriptElementPolicystrict-dynamicCSP?auto(default)passblocknonceSee Security for script elements.
Callbacks
Added a new setting
up.script.config.callbackPolicy. This lets you control whether Unpoly will execute string callbacks in attributes or response headers:<meta name="csp-nonce">in your<head>.You can configure
up.script.config.callbackPolicyto block all callbacks, or to only allow callbacks with a valid nonce:evalCallbackPolicy<meta name="csp-nonce">?auto(default)unsafe-evalpassunsafe-evalunsafe-evalblocknonceSee Security for callbacks.
Warnings for dangerous settings
Unpoly will now log warnings for configurations or CSP headers it considers overly permissive (marked with 🔥 above).
You can disable these warnings with
up.script.config.cspWarnings = false.Other changes
up.protocol.config.cspNoncetoup.script.config.cspNonce.It still defaults to reading
<meta name="csp-nonce">.Closing overlays when a fragment matches a selector
You can now auto-close an overlay once it reaches a fragment that matches a CSS selector. This is an alternative close condition similar to observing events or locations.
To wait for a fragment, set an
[up-accept-fragment]attribute on the link that opens an overlay:When an element in the new overlay matches the
.user-profileselector, the overlay is closed automatically. The fragment's data becomes the overlay's acceptance value:See Closing when a fragment is detected.
Overlay peel intent
When a link or form from an overlay targets a background layer, the overlay will dismiss when the parent layer is updated. This behavior is called peeling.
By default, peeled overlays will be dismissed. You can now choose to accept them instead, by setting an
[up-peel="accept"]attributeon the link or form that is targeting a background layer:
When rendering from JavaScript, pass an
{ peel: 'accept' }option for the same effect.Setting overlay callbacks from the server
Servers can send an
X-Up-Open-Layerresponse header to force its response to open a new overlay.Callbacks like
{ onAccepted }or{ onDismissed }can now be passed as a string of JavaScript:With a strict CSP you can prefix your callback with a nonce:
Source maps
The minified source files (like
unpoly.min.js) are now shipped with source maps for easier debugging.Styling revalidating fragments
When rendering content from a stale cache entry, Unpoly automatically reloads the fragment to ensure that the user never sees expired content.
Unpoly will now assign revalidating fragments the
.up-revalidatingclass while the revalidation request is in flight:You can style revalidating fragments to convey that content might be stale:
Note that the
.up-loadingand.up-activeclasses are not set during cache revalidation.You can configure custom revalidation classes in
up.status.config.revalidatingClasses.Setting URL aliases from macros
[up-nav]links can now set[up-alias]from a macro.This can be useful to link nested navigation trees programmatically.
Setting data for multiple fragments
Links and forms can now use an
[up-use-data-map]attribute or{ dataMap }option to map selectors to data objects. When a selector matches any element within an updated fragment, the matching element is compiled with the mapped data:[up-use-data]attribute or{ data }option will only apply to the first fragment.To apply data to multiple fragments, use a data map as shown above.
Keeping current scroll positions
Scroll positions will reset when you insert a new viewport element (as opposed to updating a child element). This is default browser behavior for newly inserted elements.
You can now ask Unpoly to preserve the scroll positions of all viewports around the updated fragment. To do so, set
[up-scroll="keep"]:Internally, Unpoly will measure scroll positions before the update, and restore the same positions after the update.
up.reload()now uses this feature to preserve scroll positions by default.See Keeping current scroll positions.
Scrolling multiple viewports
You can now scroll multiple viewports with a single render pass, by using an
[up-scroll-map]attribute or{ scrollMap }option. Its value is an object mapping selectors to scroll options:Scrolling to a pixel position
To scroll a specific pixel position from the top, you can now use a number value for the
[up-scroll]attribute or{ scroll }option:To scroll to the bottom, but leave a margin of some pixels, set a negative number value:
See Scrolling to a pixel position.
Detecting success or failure from a compiler or event
Compilers now receive a
meta.okargument. It indicates if the fragment is being rendered from a successful response (200 OK).The
up:fragment:insertedevent now includes{ layer, revalidating, ok }properties, matching what compilers receive asmeta:Rendering HTML from a string is always considered successful.
Animations
fade-outanimation now starts from the element's current opacity, rather than always starting from1.0.up.motion.isEnabled()has been deprecated. Useup.motion.config.enabledinstead.Fragment rendering
up.fragment.config.reloadOptions.up.RenderResult#targetproperty now reflects the actual resolved target selector used, rather than the originally requested one (e.g. resolving:mainto the concrete selector).[up-keep]element is not targetable, Unpoly now prints a warning instead of crashing the render pass.Focus and accessibility
#hashfragment from the address bar or a link, Unpoly now also focuses the matching element (#787).up.render()function. Unpoly will still be smart about setting focus when navigating. You can restore the old behavior by settingup.fragment.config.renderOptions.focus = 'keep'.Overlays
<html>does not haveoverflow-x: hidden, particularly on Firefox (#795).{ dismissable }has been renamed to{ dismissible }.[up-dismissable]has been renamed to[up-dismissible].Forms
[up-switch]now switches disabled fields. This is useful when you re-use your (disabled) forms as read-only views, but also rely on[up-switch]to control dependent form sections.[up-switch]effects are now consistently applied before[up-validate]requests.[up-validate][up-watch-event=input][up-keep]to validate a field while the user is typing in it.[form]attribute) are now supported consistently.[up-switch]orup.watch()when another compiler changed the initial value of the observed field.Event utilities
up.event.onClosest(). This runs a callback when an event is observed on an element or its ancestors.up.fragment.onKept(). This runs a callback when an element or its ancestors are kept during a render pass.Frontend assets
up:assets:changedevent now has a{ response }property. This is theup.Responsethat contained new asset versions not found on the current page.History
up:location:changedevent now has a{ previousLocation }property.Utilities
up.util.mapObject(). It creates an object from a given array and mapping function.up.util.reverse(). UseArray#toReversed()instead.up.util.parseNumber(). Parses a string as a number, supporting negative numbers, negative zero, underscores for digit grouping, and floats.Network
up.Request#isSafe(). It returns whether the request uses a safe HTTP method likeGET.up:fragment:offlineshowing"undefined"as the reason.Documentation improvements
up.viewport.rootas a function, when it is really a property.up.Request#loadPage()(it was#navigate()that was deprecated)Rails UJS compatibility
For a long time Unpoly has migrated links with Rails UJS attributes (
[data-method],[data-confirm]) to their Unpoly counterparts.This migration is now also applied to forms and submit buttons, not just links.
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.