prep v1.9.12

This commit is contained in:
Carson Gross 2024-04-17 10:54:49 -06:00
commit f38e07d4be
39 changed files with 120 additions and 64 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## [1.9.12] - 2024-04-17
* [IE Fixes](https://github.com/bigskysoftware/htmx/commit/e64238dba3113c2eabe26b1e9e9ba7fe29ba3010)
## [1.9.11] - 2024-03-15
* Fix for new issue w/ web sockets & SSE on iOS 17.4 (thanks apple!)

View File

@ -33,7 +33,7 @@ By removing these arbitrary constraints htmx completes HTML as a
## quick start
```html
<script src="https://unpkg.com/htmx.org@1.9.11"></script>
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
<!-- have a button POST a click via AJAX -->
<button hx-post="/clicked" hx-swap="outerHTML">
Click Me

19
dist/htmx.js vendored
View File

@ -89,7 +89,7 @@ return (function () {
sock.binaryType = htmx.config.wsBinaryType;
return sock;
},
version: "1.9.11"
version: "1.9.12"
};
/** @type {import("./htmx").HtmxInternalApi} */
@ -138,12 +138,12 @@ return (function () {
/**
* @param {string} tag
* @param {boolean} global
* @param {boolean} [global]
* @returns {RegExp}
*/
function makeTagRegEx(tag, global = false) {
return new RegExp(`<${tag}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${tag}>`,
global ? 'gim' : 'im');
function makeTagRegEx(tag, global) {
return new RegExp('<' + tag + '(\\s[^>]*>|>)([\\s\\S]*?)<\\/' + tag + '>',
!!global ? 'gim' : 'im')
}
function parseInterval(str) {
@ -1945,6 +1945,9 @@ return (function () {
function shouldProcessHxOn(elt) {
var attributes = elt.attributes
if (!attributes) {
return false
}
for (var j = 0; j < attributes.length; j++) {
var attrName = attributes[j].name
if (startsWith(attrName, "hx-on:") || startsWith(attrName, "data-hx-on:") ||
@ -1967,11 +1970,11 @@ return (function () {
var iter = document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' +
' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', elt)
while (node = iter.iterateNext()) elements.push(node)
} else {
} else if (typeof elt.getElementsByTagName === "function") {
var allElements = elt.getElementsByTagName("*")
for (var i = 0; i < allElements.length; i++) {
if (shouldProcessHxOn(allElements[i])) {
elements.push(allElements[i])
if (shouldProcessHxOn(allElements[i])) {
elements.push(allElements[i])
}
}
}

2
dist/htmx.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/htmx.min.js.gz vendored

Binary file not shown.

View File

@ -5,7 +5,7 @@
"AJAX",
"HTML"
],
"version": "1.9.11",
"version": "1.9.12",
"homepage": "https://htmx.org/",
"bugs": {
"url": "https://github.com/bigskysoftware/htmx/issues"

View File

@ -89,7 +89,7 @@ return (function () {
sock.binaryType = htmx.config.wsBinaryType;
return sock;
},
version: "1.9.11"
version: "1.9.12"
};
/** @type {import("./htmx").HtmxInternalApi} */
@ -138,12 +138,12 @@ return (function () {
/**
* @param {string} tag
* @param {boolean} global
* @param {boolean} [global]
* @returns {RegExp}
*/
function makeTagRegEx(tag, global = false) {
return new RegExp(`<${tag}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${tag}>`,
global ? 'gim' : 'im');
function makeTagRegEx(tag, global) {
return new RegExp('<' + tag + '(\\s[^>]*>|>)([\\s\\S]*?)<\\/' + tag + '>',
!!global ? 'gim' : 'im')
}
function parseInterval(str) {
@ -1945,6 +1945,9 @@ return (function () {
function shouldProcessHxOn(elt) {
var attributes = elt.attributes
if (!attributes) {
return false
}
for (var j = 0; j < attributes.length; j++) {
var attrName = attributes[j].name
if (startsWith(attrName, "hx-on:") || startsWith(attrName, "data-hx-on:") ||
@ -1967,11 +1970,11 @@ return (function () {
var iter = document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' +
' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', elt)
while (node = iter.iterateNext()) elements.push(node)
} else {
} else if (typeof elt.getElementsByTagName === "function") {
var allElements = elt.getElementsByTagName("*")
for (var i = 0; i < allElements.length; i++) {
if (shouldProcessHxOn(allElements[i])) {
elements.push(allElements[i])
if (shouldProcessHxOn(allElements[i])) {
elements.push(allElements[i])
}
}
}

View File

@ -1237,6 +1237,11 @@ describe("Core htmx AJAX Tests", function(){
})
it('properly handles inputs external to form', function () {
if (!supportsFormAttribute()) {
this._runnable.title += " - Skipped as IE11 doesn't support form attribute"
this.skip()
return
}
var values;
this.server.respondWith("Post", "/test", function (xhr) {
values = getParameters(xhr);
@ -1287,6 +1292,11 @@ describe("Core htmx AJAX Tests", function(){
})
it("can associate submit buttons from outside a form with the current version of the form after swap", function(){
if (!supportsFormAttribute()) {
this._runnable.title += " - Skipped as IE11 doesn't support form attribute"
this.skip()
return
}
const template = '<form ' +
'id="hello" ' +
'hx-target="#hello" ' +

View File

@ -246,6 +246,11 @@ describe("Core htmx Regression Tests", function(){
})
it("script tags only execute once using templates", function(done) {
if (!supportsTemplates()) {
this._runnable.title += " - Skipped as IE11 doesn't support templates"
this.skip()
return
}
var oldUseTemplateFragmentsValue = htmx.config.useTemplateFragments
htmx.config.useTemplateFragments = true
@ -267,6 +272,11 @@ describe("Core htmx Regression Tests", function(){
})
it("script tags only execute once when nested using templates", function(done) {
if (!supportsTemplates()) {
this._runnable.title += " - Skipped as IE11 doesn't support templates"
this.skip()
return
}
var oldUseTemplateFragmentsValue = htmx.config.useTemplateFragments
htmx.config.useTemplateFragments = true

View File

@ -1,4 +1,4 @@
base_url = "https://htmx.org"
base_url = "https://v1.htmx.org"
title = "</> htmx - high power tools for html"
theme = "htmx-theme"

View File

@ -37,7 +37,7 @@ By removing these constraints, htmx completes HTML as a [hypertext](https://en.w
<h2>quick start</h2>
```html
<script src="https://unpkg.com/htmx.org@1.9.11"></script>
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
<!-- have a button POST a click via AJAX -->
<button hx-post="/clicked" hx-swap="outerHTML">
Click Me

View File

@ -114,7 +114,7 @@ The fastest way to get going with htmx is to load it via a CDN. You can simply a
and get going:
```html
<script src="https://unpkg.com/htmx.org@1.9.11" integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0" crossorigin="anonymous"></script>
<script src="https://unpkg.com/htmx.org@1.9.12" integrity="sha384-ujb1lZYygJmzgSwoxRggbCHcjc0rB2XoQrxeTUQyRjrOnlCoYta87iKBWq3EsdM2" crossorigin="anonymous"></script>
```
While the CDN approach is extremely simple, you may want to consider [not using CDNs in production](https://blog.wesleyac.com/posts/why-not-javascript-cdn).

View File

@ -50,7 +50,7 @@ against `htmx` in each distribution.
### Installing Extensions {#installing}
You can find the source for the bundled extensions at `https://unpkg.com/browse/htmx.org@1.9.11/dist/ext/`. You will need
You can find the source for the bundled extensions at `https://unpkg.com/browse/htmx.org@1.9.12/dist/ext/`. You will need
to include the javascript file for the extension and then install it using the [hx-ext](@/attributes/hx-ext.md) attributes.
See the individual extension documentation for more details.

View File

@ -9,7 +9,7 @@ This header is commonly used by javascript frameworks to differentiate ajax requ
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/ajax-header.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/ajax-header.js"></script>
```
## Usage

View File

@ -7,7 +7,7 @@ Alpine.js now has a lightweight [morph plugin](https://alpinejs.dev/plugins/morp
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/alpine-morph.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/alpine-morph.js"></script>
```
## Usage

View File

@ -18,7 +18,7 @@ optionally followed by a colon `:` and a time delay.
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/class-tools.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/class-tools.js"></script>
```
## Usage

View File

@ -26,7 +26,7 @@ A second "array" version of each template is now offered, which is particularly
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/client-side-templates.js"></script>
```
## Usage
@ -66,7 +66,7 @@ a [`<template>` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/t
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://unpkg.com/htmx.org"></script>
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/mustache@latest"></script>
</head>
<body>
@ -99,7 +99,7 @@ Here's a working example using the `mustache-array-template` working against an
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://unpkg.com/htmx.org"></script>
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/mustache@latest"></script>
</head>
<body>
@ -140,7 +140,7 @@ Some styling is needed to keep the object visible while not taking any space.
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://unpkg.com/htmx.org"></script>
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/client-side-templates.js"></script>
</head>
<body>
<div hx-ext="client-side-templates">

View File

@ -8,7 +8,7 @@ or through the `console.log` function with a `DEBUG:` prefix.
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/debug.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/debug.js"></script>
```
## Usage

View File

@ -9,7 +9,7 @@ This extension disables an element during an htmx request, when configured on th
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/disable-element.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/disable-element.js"></script>
```
## Usage

View File

@ -9,7 +9,7 @@ request.
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/event-header.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/event-header.js"></script>
```
## Usage

View File

@ -18,7 +18,7 @@ This extension addresses that shortcoming & will likely be integrated into htmx
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/head-support.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/head-support.js"></script>
```
## Usage

View File

@ -9,7 +9,7 @@ will be evaluated as the fields in a javascript object literal.
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/include-vals.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/include-vals.js"></script>
```
## Usage

View File

@ -7,7 +7,7 @@ This extension encodes parameters in JSON format instead of url format.
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/json-enc.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/json-enc.js"></script>
```
## Usage

View File

@ -7,7 +7,7 @@ This extension allows you to easily manage loading states while a request is in
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/loading-states.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/loading-states.js"></script>
```
## Usage

View File

@ -8,7 +8,7 @@ actual HTTP method. This is necessary when dealing with some firewall or proxy
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/method-override.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/method-override.js"></script>
```
### Usage

View File

@ -10,7 +10,7 @@ The `morphdom` library does not support morph element to multiple elements. If t
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/morphdom-swap.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/morphdom-swap.js"></script>
```
### Usage

View File

@ -11,7 +11,7 @@ It is a very powerful tool in conjunction with `hx-boost` and `preload` extensio
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/multi-swap.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/multi-swap.js"></script>
```
## Usage

View File

@ -27,7 +27,7 @@ You can use a `*` to match any path component:
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/path-deps.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/path-deps.js"></script>
```
## Usage

View File

@ -7,7 +7,7 @@ This extension uses request parameters to populate path variables. Used paramete
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/path-params.js">
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/path-params.js">
```
## Usage

View File

@ -9,7 +9,7 @@ The `preload` extension allows you to load HTML fragments into your browser's ca
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/preload.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/preload.js"></script>
```
## Usage

View File

@ -7,7 +7,7 @@ The `remove-me` extension allows you to remove an element after a specified inte
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/remove-me.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/remove-me.js"></script>
```
## Usage

View File

@ -24,7 +24,7 @@ The value of each attribute can be:
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/response-targets.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/response-targets.js"></script>
```
## Configure (optional)

View File

@ -7,7 +7,7 @@ This extension triggers an event ``restored`` whenever a back button even is det
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/restored.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/restored.js"></script>
```
## Usage

View File

@ -18,7 +18,7 @@ Use the following attributes to configure how SSE connections behave:
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/sse.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/sse.js"></script>
```
## Usage

View File

@ -19,7 +19,7 @@ Use the following attributes to configure how WebSockets behave:
## Install
```html
<script src="https://unpkg.com/htmx.org@1.9.11/dist/ext/ws.js"></script>
<script src="https://unpkg.com/htmx.org@1.9.12/dist/ext/ws.js"></script>
```
## Usage

View File

@ -89,7 +89,7 @@ return (function () {
sock.binaryType = htmx.config.wsBinaryType;
return sock;
},
version: "1.9.11"
version: "1.9.12"
};
/** @type {import("./htmx").HtmxInternalApi} */
@ -138,12 +138,12 @@ return (function () {
/**
* @param {string} tag
* @param {boolean} global
* @param {boolean} [global]
* @returns {RegExp}
*/
function makeTagRegEx(tag, global = false) {
return new RegExp(`<${tag}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${tag}>`,
global ? 'gim' : 'im');
function makeTagRegEx(tag, global) {
return new RegExp('<' + tag + '(\\s[^>]*>|>)([\\s\\S]*?)<\\/' + tag + '>',
!!global ? 'gim' : 'im')
}
function parseInterval(str) {
@ -1945,6 +1945,9 @@ return (function () {
function shouldProcessHxOn(elt) {
var attributes = elt.attributes
if (!attributes) {
return false
}
for (var j = 0; j < attributes.length; j++) {
var attrName = attributes[j].name
if (startsWith(attrName, "hx-on:") || startsWith(attrName, "data-hx-on:") ||
@ -1967,11 +1970,11 @@ return (function () {
var iter = document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' +
' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', elt)
while (node = iter.iterateNext()) elements.push(node)
} else {
} else if (typeof elt.getElementsByTagName === "function") {
var allElements = elt.getElementsByTagName("*")
for (var i = 0; i < allElements.length; i++) {
if (shouldProcessHxOn(allElements[i])) {
elements.push(allElements[i])
if (shouldProcessHxOn(allElements[i])) {
elements.push(allElements[i])
}
}
}

View File

@ -1237,6 +1237,11 @@ describe("Core htmx AJAX Tests", function(){
})
it('properly handles inputs external to form', function () {
if (!supportsFormAttribute()) {
this._runnable.title += " - Skipped as IE11 doesn't support form attribute"
this.skip()
return
}
var values;
this.server.respondWith("Post", "/test", function (xhr) {
values = getParameters(xhr);
@ -1287,6 +1292,11 @@ describe("Core htmx AJAX Tests", function(){
})
it("can associate submit buttons from outside a form with the current version of the form after swap", function(){
if (!supportsFormAttribute()) {
this._runnable.title += " - Skipped as IE11 doesn't support form attribute"
this.skip()
return
}
const template = '<form ' +
'id="hello" ' +
'hx-target="#hello" ' +

View File

@ -246,6 +246,11 @@ describe("Core htmx Regression Tests", function(){
})
it("script tags only execute once using templates", function(done) {
if (!supportsTemplates()) {
this._runnable.title += " - Skipped as IE11 doesn't support templates"
this.skip()
return
}
var oldUseTemplateFragmentsValue = htmx.config.useTemplateFragments
htmx.config.useTemplateFragments = true
@ -267,6 +272,11 @@ describe("Core htmx Regression Tests", function(){
})
it("script tags only execute once when nested using templates", function(done) {
if (!supportsTemplates()) {
this._runnable.title += " - Skipped as IE11 doesn't support templates"
this.skip()
return
}
var oldUseTemplateFragmentsValue = htmx.config.useTemplateFragments
htmx.config.useTemplateFragments = true

View File

@ -89,7 +89,7 @@ return (function () {
sock.binaryType = htmx.config.wsBinaryType;
return sock;
},
version: "1.9.11"
version: "1.9.12"
};
/** @type {import("./htmx").HtmxInternalApi} */
@ -138,12 +138,12 @@ return (function () {
/**
* @param {string} tag
* @param {boolean} global
* @param {boolean} [global]
* @returns {RegExp}
*/
function makeTagRegEx(tag, global = false) {
return new RegExp(`<${tag}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${tag}>`,
global ? 'gim' : 'im');
function makeTagRegEx(tag, global) {
return new RegExp('<' + tag + '(\\s[^>]*>|>)([\\s\\S]*?)<\\/' + tag + '>',
!!global ? 'gim' : 'im')
}
function parseInterval(str) {
@ -1945,6 +1945,9 @@ return (function () {
function shouldProcessHxOn(elt) {
var attributes = elt.attributes
if (!attributes) {
return false
}
for (var j = 0; j < attributes.length; j++) {
var attrName = attributes[j].name
if (startsWith(attrName, "hx-on:") || startsWith(attrName, "data-hx-on:") ||
@ -1967,11 +1970,11 @@ return (function () {
var iter = document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' +
' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', elt)
while (node = iter.iterateNext()) elements.push(node)
} else {
} else if (typeof elt.getElementsByTagName === "function") {
var allElements = elt.getElementsByTagName("*")
for (var i = 0; i < allElements.length; i++) {
if (shouldProcessHxOn(allElements[i])) {
elements.push(allElements[i])
if (shouldProcessHxOn(allElements[i])) {
elements.push(allElements[i])
}
}
}