From 3d7ecfb8d8fa9bc17df67cea0f3d69a30c34a7c2 Mon Sep 17 00:00:00 2001 From: srcerer Date: Thu, 25 Apr 2024 09:31:58 -0700 Subject: [PATCH 01/10] Update podcasts.csv (#2500) Add The Collab Lab --- www/content/talk/podcasts.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/www/content/talk/podcasts.csv b/www/content/talk/podcasts.csv index 1ef336fb..1a6304eb 100644 --- a/www/content/talk/podcasts.csv +++ b/www/content/talk/podcasts.csv @@ -23,3 +23,4 @@ PodRocket by LogRocket,https://podrocket.logrocket.com/htmx-carson-gross Backend Banter - Behind htmx: the re-Rise of Hypermedia,https://www.backendbanter.fm/episodes/024-behind-htmx-carson-gross-on-the-re-rise-of-hypermedia Syntax - htmx Web Apps,https://syntax.fm/show/734/htmx-web-apps-with-carson-gross PodRocket - htmx v2,https://podrocket.logrocket.com/htmx-v2-carson-gross +The Collab Lab - Hypermedia - Network Architecture Decoupling,https://www.youtube.com/watch?v=j1XXoeer320 From 577c651871cad7ef84c50e0fc675021b562aa558 Mon Sep 17 00:00:00 2001 From: Goksan Date: Thu, 25 Apr 2024 17:32:15 +0100 Subject: [PATCH 02/10] Add Statusnook to the webring (#2506) --- www/content/webring.md | 1 + 1 file changed, 1 insertion(+) diff --git a/www/content/webring.md b/www/content/webring.md index 35a57a30..9c906627 100644 --- a/www/content/webring.md +++ b/www/content/webring.md @@ -109,6 +109,7 @@ title = "htmx webring" GophemeralShare secrets securely! Signup CasaSimple, convenient sign-up forms. RecipyaA clean, simple and powerful recipe manager your whole family can enjoy. + StatusnookEffortlessly deploy a status page and start monitoring endpoints in minutes. From 5c24e42e46df466a4179374b7899d443bcd20d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schreck?= Date: Thu, 25 Apr 2024 18:32:55 +0200 Subject: [PATCH 03/10] use same ID throughout the example (#2471) --- www/content/essays/rest-explained.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/content/essays/rest-explained.md b/www/content/essays/rest-explained.md index 30dc9669..34b0a2f7 100644 --- a/www/content/essays/rest-explained.md +++ b/www/content/essays/rest-explained.md @@ -91,7 +91,7 @@ Let's go through each of these in turn. #### Identification of Resources The first aspect of Rest is the idea of *resources* that are found somewhere via... well, [Universal Resource Locators](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL), or URLs. Note that the HTML contains additional URLs for the actions that you can perform on this -resource (`contacts/1`), following the conventional hierarchical arrangement of URL paths. +resource (`contacts/42`), following the conventional hierarchical arrangement of URL paths. #### Manipulation of Resources Through Representations From ce5bb337aa6bfa7968941f0ef4ac6748b7c09cd0 Mon Sep 17 00:00:00 2001 From: rafkub <86857272+rafkub@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:33:14 +0100 Subject: [PATCH 04/10] Update hx-indicator.md (#2444) Fix typo: "add this the" -> "add this to the" --- www/content/attributes/hx-indicator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/content/attributes/hx-indicator.md b/www/content/attributes/hx-indicator.md index 42b180e5..9f80813e 100644 --- a/www/content/attributes/hx-indicator.md +++ b/www/content/attributes/hx-indicator.md @@ -81,7 +81,7 @@ This simulates what a spinner might look like in that situation: * `hx-indicator` is inherited and can be placed on a parent element * In the absence of an explicit indicator, the `htmx-request` class will be added to the element triggering the request -* If you want to use your own CSS but still use `htmx-indicator` as class name, then you need to disable `includeIndicatorStyles`. See [Configuring htmx](@/docs.md#config). The easiest way is to add this the `` of your HTML: +* If you want to use your own CSS but still use `htmx-indicator` as class name, then you need to disable `includeIndicatorStyles`. See [Configuring htmx](@/docs.md#config). The easiest way is to add this to the `` of your HTML: ```html ``` From cc9d3f063c1dfcc2c0ad07a4f2b795b161b97b05 Mon Sep 17 00:00:00 2001 From: rafkub <86857272+rafkub@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:33:28 +0100 Subject: [PATCH 05/10] Update confirm.md (#2443) Fix typo - repeated "and the" --- www/content/examples/confirm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/content/examples/confirm.md b/www/content/examples/confirm.md index da3f5606..c0e74546 100644 --- a/www/content/examples/confirm.md +++ b/www/content/examples/confirm.md @@ -9,7 +9,7 @@ applications UX. In this example we will see how to use [sweetalert2](https://sweetalert2.github.io) to implement a custom confirmation dialog. Below are two examples, one using a click+custom event method, and one using the built-in `hx-confirm` attribute and -the and the [`htmx:confirm`](@/events.md#htmx:confirm) event. +the [`htmx:confirm`](@/events.md#htmx:confirm) event. ## Using on click+custom event From c073aa7746bff5f335701ded7795d1424829f24d Mon Sep 17 00:00:00 2001 From: Andrej Ota <12133924+andrejota@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:33:46 +0100 Subject: [PATCH 06/10] Fix a trivial typo in CONTRIBUTING.md. (#2436) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8c52947a..d6e3da44 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ Thank you for your interest in contributing! Because we're a small team, we have 1. All PRs must be made against the `dev` branch, except documentation PRs (that only modify the `www/` directory) which can be made against `master`. 1. Please avoid sending the `dist` files along your PR, only include the `src` ones. 1. Please include test cases in [`/test`](https://github.com/bigskysoftware/htmx/tree/dev/test) and docs in [`/www`](https://github.com/bigskysoftware/htmx/tree/dev/www). -1. We squash all PRs, so you're welcome to submit with as many commits are you like; they will be evaluated as a single, standalone change. +1. We squash all PRs, so you're welcome to submit with as many commits as you like; they will be evaluated as a single, standalone change. ### Review Guidelines 1. Open PRs represent issues that we're actively thinking working on merging (at a pace we can manage). If we think a proposal needs more discussion, or that the existing code would require a lot of back-and-forth to merge, we might close it and suggest you make an issue. From 998bd7cd4cd93a4e9d3547616c88768425afcfbb Mon Sep 17 00:00:00 2001 From: noman <27938023+noman-land@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:34:15 -0400 Subject: [PATCH 07/10] fix(docs): Add missing apostrophes (#2405) Add apostrophes --- www/content/docs.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/www/content/docs.md b/www/content/docs.md index 1b6177da..4612a7fd 100644 --- a/www/content/docs.md +++ b/www/content/docs.md @@ -427,9 +427,9 @@ with any of the following values: | `innerHTML` | the default, puts the content inside the target element | `outerHTML` | replaces the entire target element with the returned content | `afterbegin` | prepends the content before the first child inside the target -| `beforebegin` | prepends the content before the target in the targets parent element +| `beforebegin` | prepends the content before the target in the target's parent element | `beforeend` | appends the content after the last child inside the target -| `afterend` | appends the content after the target in the targets parent element +| `afterend` | appends the content after the target in the target's parent element | `delete` | deletes the target element regardless of the response | `none` | does not append content from response ([Out of Band Swaps](#oob_swaps) and [Response Headers](#response-headers) will still be processed) @@ -485,7 +485,7 @@ The modifiers available on `hx-swap` are: | `settle` | The settle delay to use (e.g. `100ms`) between when new content is inserted and when it is settled | | `ignoreTitle` | If set to `true`, any title found in the new content will be ignored and not update the document title | | `scroll` | `top` or `bottom`, will scroll the target element to its top or bottom | -| `show` | `top` or `bottom`, will scroll the target elements top or bottom into view | +| `show` | `top` or `bottom`, will scroll the target element's top or bottom into view | All swap modifiers appear after the swap style is specified, and are colon-separated. @@ -494,7 +494,7 @@ See the [hx-swap](@/attributes/hx-swap.md) documentation for more details on the ### Synchronization {#synchronization} Often you want to coordinate the requests between two elements. For example, you may want a request from one element -to supersede the request of another element, or to wait until the other elements request has finished. +to supersede the request of another element, or to wait until the other element's request has finished. htmx offers a [`hx-sync`](@/attributes/hx-sync.md) attribute to help you accomplish this. @@ -741,7 +741,7 @@ The anchor tag in this div will issue an AJAX `GET` request to `/blog` and swap A feature of `hx-boost` is that it degrades gracefully if javascript is not enabled: the links and forms continue to work, they simply don't use ajax requests. This is known as [Progressive Enhancement](https://developer.mozilla.org/en-US/docs/Glossary/Progressive_Enhancement), and it allows -a wider audience to use your sites functionality. +a wider audience to use your site's functionality. Other htmx patterns can be adapted to achieve progressive enhancement as well, but they will require more thought. @@ -1014,7 +1014,7 @@ WebSocket sends. Htmx fires events around validation that can be used to hook in custom validation and error handling: -* `htmx:validation:validate` - called before an elements `checkValidity()` method is called. May be used to add in +* `htmx:validation:validate` - called before an element's `checkValidity()` method is called. May be used to add in custom validation logic * `htmx:validation:failed` - called when `checkValidity()` returns false, indicating an invalid input * `htmx:validation:halted` - called when a request is not issued due to validation errors. Specific errors may be found From af50cde1042fe95545ac0c3140bb928fecdc7199 Mon Sep 17 00:00:00 2001 From: Nico Ekkart Date: Thu, 25 Apr 2024 18:34:38 +0200 Subject: [PATCH 08/10] docs: aria-selected true in Tabs HATEOS example (#2404) The `aria-selected` attribute should be set to true in the first tab for consistency with the class `selected` being set. --- www/content/examples/tabs-hateoas.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/content/examples/tabs-hateoas.md b/www/content/examples/tabs-hateoas.md index 9b21f95b..3dc6169b 100644 --- a/www/content/examples/tabs-hateoas.md +++ b/www/content/examples/tabs-hateoas.md @@ -16,7 +16,7 @@ Subsequent tab pages display all tabs and highlight the selected one accordingly ```html
- +
From f9591c9790ee970f8fac46851d570e1d8fdb19ab Mon Sep 17 00:00:00 2001 From: lookbusy1344 <3680611+lookbusy1344@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:36:50 +0100 Subject: [PATCH 09/10] More explicit explanation of htmx.config.getCacheBusterParam (#2376) * More explicit explanation of htmx.config.getCacheBusterParam * Small formatting fixes --- src/htmx.d.ts | 2 +- www/content/api.md | 2 +- www/content/docs.md | 2 +- www/content/reference.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/htmx.d.ts b/src/htmx.d.ts index a545692e..3149f059 100644 --- a/src/htmx.d.ts +++ b/src/htmx.d.ts @@ -411,7 +411,7 @@ export interface HtmxConfig { */ wsBinaryType?: 'blob' | 'arraybuffer'; /** - * If set to true htmx will include a cache-busting parameter in GET requests to avoid caching partial responses by the browser + * If set to true htmx will append the target element to the GET request in the format org.htmx.cache-buster=targetElementId * @default false */ getCacheBusterParam?: boolean; diff --git a/www/content/api.md b/www/content/api.md index 22273f32..0dc6cb6f 100644 --- a/www/content/api.md +++ b/www/content/api.md @@ -128,7 +128,7 @@ Note that using a [meta tag](@/docs.md#config) is the preferred mechanism for se * `disableSelector:"[hx-disable], [data-hx-disable]"` - array of strings: htmx will not process elements with this attribute on it or a parent * `scrollBehavior:'smooth'` - string: the behavior for a boosted link on page transitions. The allowed values are `auto` and `smooth`. Smooth will smoothscroll to the top of the page while auto will behave like a vanilla link. * `defaultFocusScroll:false` - boolean: if the focused element should be scrolled into view, can be overridden using the [focus-scroll](@/attributes/hx-swap.md#focus-scroll) swap modifier -* `getCacheBusterParam:false` - boolean: if set to true htmx will include a cache-busting parameter in `GET` requests to avoid caching partial responses by the browser +* `getCacheBusterParam:false` - boolean: if set to true htmx will append the target element to the `GET` request in the format `org.htmx.cache-buster=targetElementId` * `globalViewTransitions:false` - boolean: if set to `true`, htmx will use the [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) API when swapping in new content. * `methodsThatUseUrlParams:["get"]` - array of strings: htmx will format requests with these methods by encoding their parameters in the URL, not the request body * `selfRequestsOnly:false` - boolean: if set to `true` will only allow AJAX requests to the same domain as the current document diff --git a/www/content/docs.md b/www/content/docs.md index 4612a7fd..7a3c3c0a 100644 --- a/www/content/docs.md +++ b/www/content/docs.md @@ -1608,7 +1608,7 @@ listed below: | `htmx.config.timeout` | defaults to 0, the number of milliseconds a request can take before automatically being terminated | | `htmx.config.scrollBehavior` | defaults to 'smooth', the behavior for a boosted link on page transitions. The allowed values are `auto` and `smooth`. Smooth will smoothscroll to the top of the page while auto will behave like a vanilla link. | | `htmx.config.defaultFocusScroll` | if the focused element should be scrolled into view, defaults to false and can be overridden using the [focus-scroll](@/attributes/hx-swap.md#focus-scroll) swap modifier. | -| `htmx.config.getCacheBusterParam` | defaults to false, if set to true htmx will include a cache-busting parameter in `GET` requests to avoid caching partial responses by the browser | +| `htmx.config.getCacheBusterParam` | defaults to false, if set to true htmx will append the target element to the `GET` request in the format `org.htmx.cache-buster=targetElementId` | | `htmx.config.globalViewTransitions` | if set to `true`, htmx will use the [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) API when swapping in new content. | | `htmx.config.methodsThatUseUrlParams` | defaults to `["get"]`, htmx will format requests with these methods by encoding their parameters in the URL, not the request body | | `htmx.config.selfRequestsOnly` | defaults to `false`, if set to `true` will only allow AJAX requests to the same domain as the current document | diff --git a/www/content/reference.md b/www/content/reference.md index a50d6cf6..d9a98e89 100644 --- a/www/content/reference.md +++ b/www/content/reference.md @@ -242,7 +242,7 @@ listed below: | `htmx.config.timeout` | defaults to 0, the number of milliseconds a request can take before automatically being terminated | | `htmx.config.scrollBehavior` | defaults to 'smooth', the behavior for a boosted link on page transitions. The allowed values are `auto` and `smooth`. Smooth will smoothscroll to the top of the page while auto will behave like a vanilla link. | | `htmx.config.defaultFocusScroll` | if the focused element should be scrolled into view, defaults to false and can be overridden using the [focus-scroll](@/attributes/hx-swap.md#focus-scroll) swap modifier. | -| `htmx.config.getCacheBusterParam` | defaults to false, if set to true htmx will include a cache-busting parameter in `GET` requests to avoid caching partial responses by the browser | +| `htmx.config.getCacheBusterParam` | defaults to false, if set to true htmx will append the target element to the `GET` request in the format `org.htmx.cache-buster=targetElementId` | | `htmx.config.globalViewTransitions` | if set to `true`, htmx will use the [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) API when swapping in new content. | | `htmx.config.methodsThatUseUrlParams` | defaults to `["get"]`, htmx will format requests with these methods by encoding their parameters in the URL, not the request body | | `htmx.config.selfRequestsOnly` | defaults to `false`, if set to `true` will only allow AJAX requests to the same domain as the current document | From b176784f31a7bc4b55e40cec368dff571c4fb991 Mon Sep 17 00:00:00 2001 From: Lloyd Lobo Date: Thu, 25 Apr 2024 22:17:21 +0530 Subject: [PATCH 10/10] docs: fix `this` binding in `onClick .then` handler with arrow function (#2373) docs: fix `this` binding in onClick .then handler with arrow fn Update the `.then()` handler in the `onClick` attribute to use an arrow function instead of a traditional `function(arg)` expression. This fixes the `this` binding within the lexical scope, ensuring that `this` is bound to the `button` instead of the `window` and resolving the issue. Fixes/Closes issue #2257 --- www/content/examples/confirm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/content/examples/confirm.md b/www/content/examples/confirm.md index c0e74546..96e7b665 100644 --- a/www/content/examples/confirm.md +++ b/www/content/examples/confirm.md @@ -17,7 +17,7 @@ the [`htmx:confirm`](@/events.md#htmx:confirm) event.