UNPKG

14.8 kBMarkdownView Raw
1# Changelog
2
3## [1.6.1] - 2021-11-22
4
5* A new `HX-Retarget` header allows you to change the default target of returned content
6* The `htmx:beforeSwap` event now includes another configurable property: `detail.isError` which can
7 be used to indicate if a given response should be treated as an error or not
8* The `htmx:afterRequest` event has two new detail properties: `success` and `failed`, allowing you to write
9 trigger filters in htmx or hyperscript:
10 ```applescript
11 on htmx:afterRequest[failed]
12 set #myCheckbox's checked to true
13 ```
14* Fixed the `from:` option in [`hx-trigger`](/attributes/hx-trigger) to support `closest <CSS selector>`
15 and `find <CSS selector>` forms
16* Don't boost anchor tags with an explicit `target` set
17* Don't cancel all events on boosted elements, only the events that naturally trigger them (click for anchors, submit
18 for forms)
19* Persist revealed state in the DOM so that on history navigation, revealed elements are not re-requested
20* Process all [`hx-ext`](/attributes/hx-ext) attributes, even if no other htmx attribute is on the element
21* Snapshot the current URL on load so that history support works properly after a page refresh occurs
22* Many, many documentation updates (thank you to all the contributors!)
23
24
25## [1.6.0] - 2021-10-01
26
27* Completely reworked `<script>` tag support that now supports the `<script src="...'/>` form
28* You can now use the value `unset` to clear a property that would normally be inherited (e.g. hx-confirm)
29* The `htmx-added` class is added to new content before a swap and removed after the settle phase, which allows you
30 more flexibility in writing CSS transitions for added content (rather than relying on the target, as with `htmx-settling`)
31* The `htmx:beforeSwap` event has been updated to allow you to [configure swapping](https://htmx.org/docs/#modifying_swapping_behavior_with_events)
32 behavior
33* Improved `<title>` extraction support
34* You can listen to events on the `window` object using the `from:` modifier in `hx-trigger`
35* The `root` option of the `intersect` event was fixed
36* Boosted forms respect the `enctype` declaration
37* The `HX-Boosted` header will be sent on requests from boosted elements
38* Promises are not returned from the main ajax function unless it is an api call (i.e. `htmx.ajax`)
39
40## [1.5.0] - 2021-7-12
41
42* Support tracking of button clicked during a form submission
43* Conditional polling via the [hx-trigger](https://htmx.org/attributes/hx-trigger) attribute
44* `document` is now a valid pseudo-selector on the [hx-trigger](https://htmx.org/attributes/hx-trigger) `from:` argument, allowing you
45 to listen for events on the document.
46* Added the [hx-request](https://htmx.org/attributes/hx-request) attribute, allowing you to configure the following aspects of the request
47 * `timeout` - the timeout of the request
48 * `credentials` - if the request will send credentials
49 * `noHeaders` - strips all headers from the request
50* Along with the above attribute, you can configure the default values for each of these via the corresponding `htmx.config`
51 properties (e.g. `htmx.config.timeout`)
52* Both the `scroll` and `show` options on [hx-swap](https://htmx.org/attributes/hx-swap) now support extended syntax for selecting the
53 element to scroll or to show, including the pseudo-selectors `window:top` and `window:bottom`.
54
55## [1.4.1] - 2021-6-1
56
57* typo fix
58
59## [1.4.0] - 2021-5-25
60
61* Added the `queue` option to the [hx-trigger](https://htmx.org/attributes/hx-trigger) attribute, allowing you to specify how events
62 should be queued when they are received with a request in flight
63* The `htmx.config.useTemplateFragments` option was added, allowing you to use HTML template tags for parsing content
64 from the server. This allows you to use Out of Band content when returning things like table rows, but it is not
65 IE11 compatible.
66* The `defaultSettleDelay` was dropped to 20ms from 100ms
67* Introduced a new synthetic event, [intersect](https://htmx.org/docs#pecial-events) that allows you to trigger when an item is scrolled into view
68 as specified by the `IntersectionObserver` API
69* Fixed timing issue that caused exceptions in the `reveal` logic when scrolling at incredible speeds - <https://github.com/bigskysoftware/htmx/issues/463>
70* Fixed bug causing SVG titles to be incorrectly used as page title - <https://github.com/bigskysoftware/htmx/issues/459>
71* Boosted forms that issue a GET will now push the URL by default - <https://github.com/bigskysoftware/htmx/issues/485>
72* Better dispatch of request events when an element is removed from the DOM
73* Fixed a bug causing `hx-prompt` to fail
74* The `htmx.config.withCredentials` option was added, to send credentials with ajax requests (default is `false`)
75* The `throttle` option on `hx-trigger` does not delay the initial request any longer
76* The `meta` key is ignored on boosted links
77* `<script>` tags are now evaluated in the global scope
78* `hx-swap` now supports the `none` option
79* Safari text selection bug - <https://github.com/bigskysoftware/htmx/issues/438>
80
81## [1.3.3] - 2021-4-5
82
83* Added the [`hx-disabled`](https://htmx.org/docs#security) attribute to allow htmx to be turned off for parts of the DOM
84* SSE now uses a full-jitter exponential backoff algorithm on reconnection, using the `htmx.config.wsReconnectDelay`
85 setting
86
87## [1.3.2] - 2021-3-9
88
89* Bug fixes
90
91## [1.3.1] - 2021-3-9
92
93* IE11 fixes
94
95## [1.3.0] - 2021-3-6
96
97* Support a `target` modifier on `hx-trigger` to filter based on the element targeted by an event. This allows
98 lazy binding to that target selector.
99* Events are no longer consumed by the first element that might handle them, unless the `consume` keyword is
100 added to the `hx-trigger` specification
101* Added the `htmx:beforeSend` event, fired just before an ajax request begins
102* SSE swaps are properly settled
103* Fixed bug that was improperly cancelling all clicks on anchors
104* `htmx.ajax()` now returns a promise
105
106## [1.2.1] - 2021-2-19
107
108* Fixed an issue with the history cache, where the cache was getting blown out after the first navigation backwards
109* Added the `htmx.config.refreshOnHistoryMiss` option, allowing users to trigger a full page refresh on history cache miss
110 rather than issuing an AJAX request
111
112## [1.2.0] - 2021-2-13
113
114### New Features
115
116* `hx-vars` has been deprecated in favor of `hx-vals`
117* `hx-vals` now supports a `javascript:` prefix to achieve the behavior that `hx-vars` provided
118* The new `hx-headers` attribute allows you to add headers to a request via an attribute. Like `hx-vals` it supports
119 JSON or javascript via the `javascript:` prefix
120* `hx-include` will now include all inputs under an element, even if that element is not a form tag
121* The [preload extension](https://htmx.org/extensions/preload/) now offers a `preload-images="true"` attribute that will aggressively load images in preloaded content
122* On requests driven by a history cache miss, the new `HX-History-Restore-Request` header is included so that the server
123 can differentiate between history requests and normal requests
124
125### Improvements & Bug fixes
126
127* Improved handling of precedence of input values to favor the enclosing form (see [here](https://github.com/bigskysoftware/htmx/commit/a10e43d619dc340aa324d37772c06a69a2f47ec9))
128* Moved event filtering logic *after* `preventDefault` so filtering still allows events to be properly handled
129* No longer trigger after swap events on elements that have been removed via an `outerHTML` swap
130* Properly remove event handlers added to other elements when an element is removed from the DOM
131* Handle the `scroll:` modifier in `hx-swap` properly when an `outerHTML` swap occurs
132* Lots of docs fixes
133
134## [1.1.0] - 2021-1-6
135
136* Newly added [preload extension](https://htmx.org/extensions/preload/) allows you to preload resources for lower
137 latency requests!
138* Support the `ignore:` modifier for extensions
139* Updated form variable order inclusion to include the enclosing form *last* so that, in the presence of multiple
140 values, the most relevant value is the most likely to be selected by the server
141* Support for the [`htmx.ajax()`](https://dev.htmx.org/api/#ajax) javascript function, to issue an htmx-style ajax
142 request from javascript
143* Removed the following htmx request headers for better cache behavior: `HX-Event-Target`, `HX-Active-Element`,
144 `HX-Active-Element-Name`, `HX-Active-Element-Value`
145* Added the [`hx-preserve`](https://dev.htmx.org/attributes/hx-preserve) attribute, which allows
146 you to preserve elements across requests (for example, to keep a video element playing properly)
147* The [path-deps](https://dev.htmx.org/extensions/path-deps/#refresh) now surfaces a small api
148 for refreshing path dependencies manually in javascript
149* Now support the `from:` clause on [`hx-trigger`](https://dev.htmx.org/attributes/hx-trigger) to
150 allow an element to respond to events on other elements.
151* Added the `htmx:beforeProcessNode` event, renamed the (previously undocumented) `htmx:processedNode` to `htmx:afterProcessNode`
152* Added `closest` syntax support for the [`hx-indicator`](https://dev.htmx.org/attributes/hx-indicator) attribute
153* Added `on load` support for the newest version of [hyperscript](https://hyperscript.org)
154* Added the `htmx.config.allowEval` configuration value, for CSP compatibility
155* Bug fixes & improvements
156
157## [1.0.2] - 2020-12-12
158
159* Extend all API methods to take a string selector as well as an element
160* Out of band swap elements need not be top level now
161* [`hx-swap-oob`](https://htmx.org/attributes/hx-swap-oob) now can accept a CSS selector to retarget with
162
163## [1.0.1] - 2020-12-04
164
165* AJAX file upload now correctly fires events, allowing for [a proper progress bar](https://htmx.org/examples/file-upload)
166* htmx api functions that expect an element now can accept a string selector instead:
167 ```js
168 htmx.on('#form', 'htmx:xhr:progress', function(evt) {
169 htmx.find('#progress').setAttribute('value', evt.detail.loaded/evt.detail.total * 100)
170 });
171 ```
172* htmx now properly handles the `multiple` attribute on `<select>` elements
173
174## [1.0.0] - 2020-11-24
175
176* Bumped the release version :)
177
178## [0.4.1] - 2020-11-23
179
180* Fixed bug with title tag support when title tag contained HTML entities
181* Pass properties for the `loadstart`, `loadend`, `progress`, `abort` events through properly to the htmx equivalents
182
183## [0.4.0] - 2020-11-16
184
185* Now support the `HX-Redirect` and `HX-Refresh` response headers for redirecting client side and triggering a page refresh, respectively
186* `hx-vars` now overrides input values
187* `<title>` tags in responses will be used to update page titles
188* All uses of `eval()` have been removed in favor of `Function`
189* [`hx-vals`](https://htmx.org/attributes/hx-vals) is available as a safe alternative to `hx-vars`. It uses `JSON.parse()` rather than evaluation, if you wish to safely pass user-provided values through to htmx.
190
191## [0.3.0] - 2020-10-27
192
193* `hx-trigger` parsing has been rewritten and now supports [trigger filters](https://htmx.org/docs/#trigger-filters) to filter
194 events based on arbitrary javascript expressions
195* htmx now supports two additional response headers `HX-Trigger-After-Swap` and `HX-Trigger-After-Settle` allowing
196 an event to be triggered after a given life cycle event (instead of before the swap)
197* The `requestConfig` is now passed out to events surrounding the AJAX life cycle
198* htmx now evaluates `<script>` tags as javascript when no language is defined on them
199* A new [`event-header`](https://htmx.org/extensions/event-header) extension, which will include a serialized JSON representation of the triggering event in requests
200
201## [0.2.0] - 2020-9-30
202
203* AJAX file upload [support](https://htmx.org/docs#files)
204* The HTML validation API is [respected](https://htmx.org/docs#validation)
205
206## [0.1.0] - 2020-9-18
207
208* *BREAKING CHANGE*: The SSE attribute [`hx-sse`](https://htmx.org/attributes/hx-sse/) and the Web Sockets attribute [`hx-ws`](https://htmx.org/attributes/hx-ws) have changed syntax to now use colon separators: `hx-sse='connect:/chat swap:message'`
209* The SSE attribute [`hx-sse`](https://htmx.org/attributes/hx-sse/) allows for swapping content directly on an event, in addition to triggering an htmx element,
210with the new `swap:<event name>` syntax.
211* [`hx-target`](https://htmx.org/attributes/hx-target) now supports a `find` syntax to find elements below the element by a CSS selector
212* htmx plays better with deferred loading and many package managers
213* All htmx events are dispatched in both camelCase as well as kebab-case, for better compatibility with AlpineJS and other frameworks. (e.g. `htmx:afterOnLoad` will also be triggered as
214`htmx:after-on-load`)
215* [hypeerscript](https://hyperscript.org) is now initialized independently of htmx
216
217## [0.0.8] - 2020-7-8
218
219* The `view` modifier on `hx-swap` has been renamed to `show`: `hx-swap='innerHTML show:top'`
220
221## [0.0.7] - 2020-6-30
222
223* The [`hx-swap`](https://htmx.org/attributes/hx-swap) attribute now supports two new modifiers:
224 * `scroll` - allows you to scroll the target to the `top` or `bottom`
225 * `view` - allows you to scroll the `top` or `bottom` of the target into view
226* The [`hx-push-url`](https://htmx.org/attributes/hx-push-url) attribute now can optionally take a URL to push, in addition to `true` and `false`
227* Added the [`hx-vars`](https://htmx.org/attributes/hx-vars) attribute that allows you to dynamically add to the parameters that will be submitted with a request
228
229## [0.0.6] - 2020-6-20
230
231* Custom request/response headers no longer start with the `X-` prefix, which is no longer recommended
232* empty verb attributes are now allowed and follow the anchor tag semantics (e.g. `<div hx-get></div>`)
233* nunjuks inline rendering is now supported in the `client-side-templates` extension
234* the new `ajax-header` extension includes the `X-Requested-With` header
235* bad JSON is now handled more gracefully
236* `hx-swap="none"` will cause no swap to take place <https://github.com/bigskysoftware/htmx/issues/89>
237* `hx-trigger` now supports a `throttle` modifier <https://github.com/bigskysoftware/htmx/issues/88>
238* the focused element is preserved if possible after a replacement
239* perf improvements for large DOM trees with sparse `hx-` annotations
240
241## [0.0.4] - 2020-5-24
242
243* Extension mechanism added
244* SSE support added
245* WebSocket support added
246
247## [0.0.3] - 2020-5-17
248
249* Renamed to htmx
250* A bug fix for the `hx-prompt` attribute
251* A bug fix for multiple `hx-swap-oob` attributes
252* Moved the default CSS indicator injection into its own sheet to avoid breaking
253* Added the `htmx.config.includeIndicatorStyles` configuration option so people can opt out of injecting the indicator CSS
254
255
256## [0.0.1] - 2020-5-15
257
258* Initial release (originally named kutty)
259
\No newline at end of file