14 KiB
14 KiB
Changelog
[1.6.1] - 2021-11-22
- A new
HX-Retargetheader allows you to change the default target of returned content - The
htmx:beforeSwapevent now includes another configurable property:detail.isErrorwhich can be used to indicate if a given response should be treated as an error or not - The
htmx:afterRequestevent has two new detail properties:successandfailed, allowing you to write trigger filters in htmx or hyperscript:on htmx:afterRequest[failed] set #myCheckbox's checked to true - Fixed the
from:option inhx-triggerto supportclosest <CSS selector>andfind <CSS selector>forms - Don't boost anchor tags with an explicit
targetset - Don't cancel all events on boosted elements, only the events that naturally trigger them (click for anchors, submit for forms)
- Persist revealed state in the DOM so that on history navigation, revealed elements are not re-requested
- Process all
hx-extattributes, even if no other htmx attribute is on the element - Snapshot the current URL on load so that history support works properly after a page refresh occurs
- Many, many documentation updates (thank you to all the contributors!)
[1.6.0] - 2021-10-01
- Completely reworked
<script>tag support that now supports the<script src="...'/>form - You can now use the value
unsetto clear a property that would normally be inherited (e.g. hx-confirm) - The
htmx-addedclass is added to new content before a swap and removed after the settle phase, which allows you more flexibility in writing CSS transitions for added content (rather than relying on the target, as withhtmx-settling) - The
htmx:beforeSwapevent has been updated to allow you to configure swapping behavior - Improved
<title>extraction support - You can listen to events on the
windowobject using thefrom:modifier inhx-trigger - The
rootoption of theintersectevent was fixed - Boosted forms respect the
enctypedeclaration - The
HX-Boostedheader will be sent on requests from boosted elements - Promises are not returned from the main ajax function unless it is an api call (i.e.
htmx.ajax)
[1.5.0] - 2021-7-12
- Support tracking of button clicked during a form submission
- Conditional polling via the hx-trigger attribute
documentis now a valid pseudo-selector on the hx-triggerfrom:argument, allowing you to listen for events on the document.- Added the hx-request attribute, allowing you to configure the following aspects of the request
timeout- the timeout of the requestcredentials- if the request will send credentialsnoHeaders- strips all headers from the request
- Along with the above attribute, you can configure the default values for each of these via the corresponding
htmx.configproperties (e.g.htmx.config.timeout) - Both the
scrollandshowoptions on hx-swap now support extended syntax for selecting the element to scroll or to show, including the pseudo-selectorswindow:topandwindow:bottom.
[1.4.1] - 2021-6-1
- typo fix
[1.4.0] - 2021-5-25
- Added the
queueoption to the hx-trigger attribute, allowing you to specify how events should be queued when they are received with a request in flight - The
htmx.config.useTemplateFragmentsoption was added, allowing you to use HTML template tags for parsing content from the server. This allows you to use Out of Band content when returning things like table rows, but it is not IE11 compatible. - The
defaultSettleDelaywas dropped to 20ms from 100ms - Introduced a new synthetic event, intersect that allows you to trigger when an item is scrolled into view
as specified by the
IntersectionObserverAPI - Fixed timing issue that caused exceptions in the
reveallogic when scrolling at incredible speeds - https://github.com/bigskysoftware/htmx/issues/463 - Fixed bug causing SVG titles to be incorrectly used as page title - https://github.com/bigskysoftware/htmx/issues/459
- Boosted forms that issue a GET will now push the URL by default - https://github.com/bigskysoftware/htmx/issues/485
- Better dispatch of request events when an element is removed from the DOM
- Fixed a bug causing
hx-promptto fail - The
htmx.config.withCredentialsoption was added, to send credentials with ajax requests (default isfalse) - The
throttleoption onhx-triggerdoes not delay the initial request any longer - The
metakey is ignored on boosted links <script>tags are now evaluated in the global scopehx-swapnow supports thenoneoption- Safari text selection bug - https://github.com/bigskysoftware/htmx/issues/438
[1.3.3] - 2021-4-5
- Added the
hx-disabledattribute to allow htmx to be turned off for parts of the DOM - SSE now uses a full-jitter exponential backoff algorithm on reconnection, using the
htmx.config.wsReconnectDelaysetting
[1.3.2] - 2021-3-9
- Bug fixes
[1.3.1] - 2021-3-9
- IE11 fixes
[1.3.0] - 2021-3-6
- Support a
targetmodifier onhx-triggerto filter based on the element targeted by an event. This allows lazy binding to that target selector. - Events are no longer consumed by the first element that might handle them, unless the
consumekeyword is added to thehx-triggerspecification - Added the
htmx:beforeSendevent, fired just before an ajax request begins - SSE swaps are properly settled
- Fixed bug that was improperly cancelling all clicks on anchors
htmx.ajax()now returns a promise
[1.2.1] - 2021-2-19
- Fixed an issue with the history cache, where the cache was getting blown out after the first navigation backwards
- Added the
htmx.config.refreshOnHistoryMissoption, allowing users to trigger a full page refresh on history cache miss rather than issuing an AJAX request
[1.2.0] - 2021-2-13
New Features
hx-varshas been deprecated in favor ofhx-valshx-valsnow supports ajavascript:prefix to achieve the behavior thathx-varsprovided- The new
hx-headersattribute allows you to add headers to a request via an attribute. Likehx-valsit supports JSON or javascript via thejavascript:prefix hx-includewill now include all inputs under an element, even if that element is not a form tag- The preload extension now offers a
preload-images="true"attribute that will aggressively load images in preloaded content - On requests driven by a history cache miss, the new
HX-History-Restore-Requestheader is included so that the server can differentiate between history requests and normal requests
Improvements & Bug fixes
- Improved handling of precedence of input values to favor the enclosing form (see here)
- Moved event filtering logic after
preventDefaultso filtering still allows events to be properly handled - No longer trigger after swap events on elements that have been removed via an
outerHTMLswap - Properly remove event handlers added to other elements when an element is removed from the DOM
- Handle the
scroll:modifier inhx-swapproperly when anouterHTMLswap occurs - Lots of docs fixes
[1.1.0] - 2021-1-6
- Newly added preload extension allows you to preload resources for lower latency requests!
- Support the
ignore:modifier for extensions - Updated form variable order inclusion to include the enclosing form last so that, in the presence of multiple values, the most relevant value is the most likely to be selected by the server
- Support for the
htmx.ajax()javascript function, to issue an htmx-style ajax request from javascript - Removed the following htmx request headers for better cache behavior:
HX-Event-Target,HX-Active-Element,HX-Active-Element-Name,HX-Active-Element-Value - Added the
hx-preserveattribute, which allows you to preserve elements across requests (for example, to keep a video element playing properly) - The path-deps now surfaces a small api for refreshing path dependencies manually in javascript
- Now support the
from:clause onhx-triggerto allow an element to respond to events on other elements. - Added the
htmx:beforeProcessNodeevent, renamed the (previously undocumented)htmx:processedNodetohtmx:afterProcessNode - Added
closestsyntax support for thehx-indicatorattribute - Added
on loadsupport for the newest version of hyperscript - Added the
htmx.config.allowEvalconfiguration value, for CSP compatibility - Bug fixes & improvements
[1.0.2] - 2020-12-12
- Extend all API methods to take a string selector as well as an element
- Out of band swap elements need not be top level now
hx-swap-oobnow can accept a CSS selector to retarget with
[1.0.1] - 2020-12-04
- AJAX file upload now correctly fires events, allowing for a proper progress bar
- htmx api functions that expect an element now can accept a string selector instead:
htmx.on('#form', 'htmx:xhr:progress', function(evt) { htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100) }); - htmx now properly handles the
multipleattribute on<select>elements
[1.0.0] - 2020-11-24
- Bumped the release version :)
[0.4.1] - 2020-11-23
- Fixed bug with title tag support when title tag contained HTML entities
- Pass properties for the
loadstart,loadend,progress,abortevents through properly to the htmx equivalents
[0.4.0] - 2020-11-16
- Now support the
HX-RedirectandHX-Refreshresponse headers for redirecting client side and triggering a page refresh, respectively hx-varsnow overrides input values<title>tags in responses will be used to update page titles- All uses of
eval()have been removed in favor ofFunction hx-valsis available as a safe alternative tohx-vars. It usesJSON.parse()rather than evaluation, if you wish to safely pass user-provided values through to htmx.
[0.3.0] - 2020-10-27
hx-triggerparsing has been rewritten and now supports trigger filters to filter events based on arbitrary javascript expressions- htmx now supports two additional response headers
HX-Trigger-After-SwapandHX-Trigger-After-Settleallowing an event to be triggered after a given life cycle event (instead of before the swap) - The
requestConfigis now passed out to events surrounding the AJAX life cycle - htmx now evaluates
<script>tags as javascript when no language is defined on them - A new
event-headerextension, which will include a serialized JSON representation of the triggering event in requests
[0.2.0] - 2020-9-30
[0.1.0] - 2020-9-18
- BREAKING CHANGE: The SSE attribute
hx-sseand the Web Sockets attributehx-wshave changed syntax to now use colon separators:hx-sse='connect:/chat swap:message' - The SSE attribute
hx-sseallows for swapping content directly on an event, in addition to triggering an htmx element, with the newswap:<event name>syntax. hx-targetnow supports afindsyntax to find elements below the element by a CSS selector- htmx plays better with deferred loading and many package managers
- All htmx events are dispatched in both camelCase as well as kebab-case, for better compatibility with AlpineJS and other frameworks. (e.g.
htmx:afterOnLoadwill also be triggered ashtmx:after-on-load) - hypeerscript is now initialized independently of htmx
[0.0.8] - 2020-7-8
- The
viewmodifier onhx-swaphas been renamed toshow:hx-swap='innerHTML show:top'
[0.0.7] - 2020-6-30
- The
hx-swapattribute now supports two new modifiers:scroll- allows you to scroll the target to thetoporbottomview- allows you to scroll thetoporbottomof the target into view
- The
hx-push-urlattribute now can optionally take a URL to push, in addition totrueandfalse - Added the
hx-varsattribute that allows you to dynamically add to the parameters that will be submitted with a request
[0.0.6] - 2020-6-20
- Custom request/response headers no longer start with the
X-prefix, which is no longer recommended - empty verb attributes are now allowed and follow the anchor tag semantics (e.g.
<div hx-get></div>) - nunjuks inline rendering is now supported in the
client-side-templatesextension - the new
ajax-headerextension includes theX-Requested-Withheader - bad JSON is now handled more gracefully
hx-swap="none"will cause no swap to take place https://github.com/bigskysoftware/htmx/issues/89hx-triggernow supports athrottlemodifier https://github.com/bigskysoftware/htmx/issues/88- the focused element is preserved if possible after a replacement
- perf improvements for large DOM trees with sparse
hx-annotations
[0.0.4] - 2020-5-24
- Extension mechanism added
- SSE support added
- WebSocket support added
[0.0.3] - 2020-5-17
- Renamed to htmx
- A bug fix for the
hx-promptattribute - A bug fix for multiple
hx-swap-oobattributes - Moved the default CSS indicator injection into its own sheet to avoid breaking
- Added the
htmx.config.includeIndicatorStylesconfiguration option so people can opt out of injecting the indicator CSS
[0.0.1] - 2020-5-15
- Initial release (originally named kutty)