Skip to content

Commit f38e07d

Browse files
committed
prep v1.9.12
2 parents c247cae + 7dd6cd7 commit f38e07d

39 files changed

+120
-64
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [1.9.12] - 2024-04-17
4+
5+
* [IE Fixes](https://github.com/bigskysoftware/htmx/commit/e64238dba3113c2eabe26b1e9e9ba7fe29ba3010)
6+
37
## [1.9.11] - 2024-03-15
48

59
* Fix for new issue w/ web sockets & SSE on iOS 17.4 (thanks apple!)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ By removing these arbitrary constraints htmx completes HTML as a
3333
## quick start
3434

3535
```html
36-
<script src="https://unpkg.com/[email protected].11"></script>
36+
<script src="https://unpkg.com/[email protected].12"></script>
3737
<!-- have a button POST a click via AJAX -->
3838
<button hx-post="/clicked" hx-swap="outerHTML">
3939
Click Me

dist/htmx.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ return (function () {
8989
sock.binaryType = htmx.config.wsBinaryType;
9090
return sock;
9191
},
92-
version: "1.9.11"
92+
version: "1.9.12"
9393
};
9494

9595
/** @type {import("./htmx").HtmxInternalApi} */
@@ -138,12 +138,12 @@ return (function () {
138138

139139
/**
140140
* @param {string} tag
141-
* @param {boolean} global
141+
* @param {boolean} [global]
142142
* @returns {RegExp}
143143
*/
144-
function makeTagRegEx(tag, global = false) {
145-
return new RegExp(`<${tag}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${tag}>`,
146-
global ? 'gim' : 'im');
144+
function makeTagRegEx(tag, global) {
145+
return new RegExp('<' + tag + '(\\s[^>]*>|>)([\\s\\S]*?)<\\/' + tag + '>',
146+
!!global ? 'gim' : 'im')
147147
}
148148

149149
function parseInterval(str) {
@@ -1945,6 +1945,9 @@ return (function () {
19451945

19461946
function shouldProcessHxOn(elt) {
19471947
var attributes = elt.attributes
1948+
if (!attributes) {
1949+
return false
1950+
}
19481951
for (var j = 0; j < attributes.length; j++) {
19491952
var attrName = attributes[j].name
19501953
if (startsWith(attrName, "hx-on:") || startsWith(attrName, "data-hx-on:") ||
@@ -1967,11 +1970,11 @@ return (function () {
19671970
var iter = document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' +
19681971
' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', elt)
19691972
while (node = iter.iterateNext()) elements.push(node)
1970-
} else {
1973+
} else if (typeof elt.getElementsByTagName === "function") {
19711974
var allElements = elt.getElementsByTagName("*")
19721975
for (var i = 0; i < allElements.length; i++) {
1973-
if (shouldProcessHxOn(allElements[i])) {
1974-
elements.push(allElements[i])
1976+
if (shouldProcessHxOn(allElements[i])) {
1977+
elements.push(allElements[i])
19751978
}
19761979
}
19771980
}

dist/htmx.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/htmx.min.js.gz

2 Bytes
Binary file not shown.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"AJAX",
66
"HTML"
77
],
8-
"version": "1.9.11",
8+
"version": "1.9.12",
99
"homepage": "https://htmx.org/",
1010
"bugs": {
1111
"url": "https://github.com/bigskysoftware/htmx/issues"

src/htmx.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ return (function () {
8989
sock.binaryType = htmx.config.wsBinaryType;
9090
return sock;
9191
},
92-
version: "1.9.11"
92+
version: "1.9.12"
9393
};
9494

9595
/** @type {import("./htmx").HtmxInternalApi} */
@@ -138,12 +138,12 @@ return (function () {
138138

139139
/**
140140
* @param {string} tag
141-
* @param {boolean} global
141+
* @param {boolean} [global]
142142
* @returns {RegExp}
143143
*/
144-
function makeTagRegEx(tag, global = false) {
145-
return new RegExp(`<${tag}(\\s[^>]*>|>)([\\s\\S]*?)<\\/${tag}>`,
146-
global ? 'gim' : 'im');
144+
function makeTagRegEx(tag, global) {
145+
return new RegExp('<' + tag + '(\\s[^>]*>|>)([\\s\\S]*?)<\\/' + tag + '>',
146+
!!global ? 'gim' : 'im')
147147
}
148148

149149
function parseInterval(str) {
@@ -1945,6 +1945,9 @@ return (function () {
19451945

19461946
function shouldProcessHxOn(elt) {
19471947
var attributes = elt.attributes
1948+
if (!attributes) {
1949+
return false
1950+
}
19481951
for (var j = 0; j < attributes.length; j++) {
19491952
var attrName = attributes[j].name
19501953
if (startsWith(attrName, "hx-on:") || startsWith(attrName, "data-hx-on:") ||
@@ -1967,11 +1970,11 @@ return (function () {
19671970
var iter = document.evaluate('.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' +
19681971
' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', elt)
19691972
while (node = iter.iterateNext()) elements.push(node)
1970-
} else {
1973+
} else if (typeof elt.getElementsByTagName === "function") {
19711974
var allElements = elt.getElementsByTagName("*")
19721975
for (var i = 0; i < allElements.length; i++) {
1973-
if (shouldProcessHxOn(allElements[i])) {
1974-
elements.push(allElements[i])
1976+
if (shouldProcessHxOn(allElements[i])) {
1977+
elements.push(allElements[i])
19751978
}
19761979
}
19771980
}

test/core/ajax.js

+10
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,11 @@ describe("Core htmx AJAX Tests", function(){
12371237
})
12381238

12391239
it('properly handles inputs external to form', function () {
1240+
if (!supportsFormAttribute()) {
1241+
this._runnable.title += " - Skipped as IE11 doesn't support form attribute"
1242+
this.skip()
1243+
return
1244+
}
12401245
var values;
12411246
this.server.respondWith("Post", "/test", function (xhr) {
12421247
values = getParameters(xhr);
@@ -1287,6 +1292,11 @@ describe("Core htmx AJAX Tests", function(){
12871292
})
12881293

12891294
it("can associate submit buttons from outside a form with the current version of the form after swap", function(){
1295+
if (!supportsFormAttribute()) {
1296+
this._runnable.title += " - Skipped as IE11 doesn't support form attribute"
1297+
this.skip()
1298+
return
1299+
}
12901300
const template = '<form ' +
12911301
'id="hello" ' +
12921302
'hx-target="#hello" ' +

test/core/regressions.js

+10
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ describe("Core htmx Regression Tests", function(){
246246
})
247247

248248
it("script tags only execute once using templates", function(done) {
249+
if (!supportsTemplates()) {
250+
this._runnable.title += " - Skipped as IE11 doesn't support templates"
251+
this.skip()
252+
return
253+
}
249254
var oldUseTemplateFragmentsValue = htmx.config.useTemplateFragments
250255
htmx.config.useTemplateFragments = true
251256

@@ -267,6 +272,11 @@ describe("Core htmx Regression Tests", function(){
267272
})
268273

269274
it("script tags only execute once when nested using templates", function(done) {
275+
if (!supportsTemplates()) {
276+
this._runnable.title += " - Skipped as IE11 doesn't support templates"
277+
this.skip()
278+
return
279+
}
270280
var oldUseTemplateFragmentsValue = htmx.config.useTemplateFragments
271281
htmx.config.useTemplateFragments = true
272282

www/config.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
base_url = "https://htmx.org"
1+
base_url = "https://v1.htmx.org"
22
title = "</> htmx - high power tools for html"
33
theme = "htmx-theme"
44

www/content/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ By removing these constraints, htmx completes HTML as a [hypertext](https://en.w
3737
<h2>quick start</h2>
3838

3939
```html
40-
<script src="https://unpkg.com/[email protected].11"></script>
40+
<script src="https://unpkg.com/[email protected].12"></script>
4141
<!-- have a button POST a click via AJAX -->
4242
<button hx-post="/clicked" hx-swap="outerHTML">
4343
Click Me

www/content/docs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ The fastest way to get going with htmx is to load it via a CDN. You can simply a
114114
and get going:
115115

116116
```html
117-
<script src="https://unpkg.com/[email protected].11" integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0" crossorigin="anonymous"></script>
117+
<script src="https://unpkg.com/[email protected].12" integrity="sha384-ujb1lZYygJmzgSwoxRggbCHcjc0rB2XoQrxeTUQyRjrOnlCoYta87iKBWq3EsdM2" crossorigin="anonymous"></script>
118118
```
119119

120120
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).

www/content/extensions/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ against `htmx` in each distribution.
5050

5151
### Installing Extensions {#installing}
5252

53-
You can find the source for the bundled extensions at `https://unpkg.com/browse/[email protected].11/dist/ext/`. You will need
53+
You can find the source for the bundled extensions at `https://unpkg.com/browse/[email protected].12/dist/ext/`. You will need
5454
to include the javascript file for the extension and then install it using the [hx-ext](@/attributes/hx-ext.md) attributes.
5555

5656
See the individual extension documentation for more details.

www/content/extensions/ajax-header.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This header is commonly used by javascript frameworks to differentiate ajax requ
99
## Install
1010

1111
```html
12-
<script src="https://unpkg.com/[email protected].11/dist/ext/ajax-header.js"></script>
12+
<script src="https://unpkg.com/[email protected].12/dist/ext/ajax-header.js"></script>
1313
```
1414

1515
## Usage

www/content/extensions/alpine-morph.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Alpine.js now has a lightweight [morph plugin](https://alpinejs.dev/plugins/morp
77
## Install
88

99
```html
10-
<script src="https://unpkg.com/[email protected].11/dist/ext/alpine-morph.js"></script>
10+
<script src="https://unpkg.com/[email protected].12/dist/ext/alpine-morph.js"></script>
1111
```
1212

1313
## Usage

www/content/extensions/class-tools.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ optionally followed by a colon `:` and a time delay.
1818
## Install
1919

2020
```html
21-
<script src="https://unpkg.com/[email protected].11/dist/ext/class-tools.js"></script>
21+
<script src="https://unpkg.com/[email protected].12/dist/ext/class-tools.js"></script>
2222
```
2323

2424
## Usage

www/content/extensions/client-side-templates.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A second "array" version of each template is now offered, which is particularly
2626
## Install
2727

2828
```html
29-
<script src="https://unpkg.com/[email protected].11/dist/ext/client-side-templates.js"></script>
29+
<script src="https://unpkg.com/[email protected].12/dist/ext/client-side-templates.js"></script>
3030
```
3131

3232
## Usage
@@ -66,7 +66,7 @@ a [`<template>` tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/t
6666
<meta name="viewport" content="width=device-width">
6767
<title>JS Bin</title>
6868
<script src="https://unpkg.com/htmx.org"></script>
69-
<script src="https://unpkg.com/[email protected].11/dist/ext/client-side-templates.js"></script>
69+
<script src="https://unpkg.com/[email protected].12/dist/ext/client-side-templates.js"></script>
7070
<script src="https://unpkg.com/mustache@latest"></script>
7171
</head>
7272
<body>
@@ -99,7 +99,7 @@ Here's a working example using the `mustache-array-template` working against an
9999
<meta name="viewport" content="width=device-width">
100100
<title>JS Bin</title>
101101
<script src="https://unpkg.com/htmx.org"></script>
102-
<script src="https://unpkg.com/[email protected].11/dist/ext/client-side-templates.js"></script>
102+
<script src="https://unpkg.com/[email protected].12/dist/ext/client-side-templates.js"></script>
103103
<script src="https://unpkg.com/mustache@latest"></script>
104104
</head>
105105
<body>
@@ -140,7 +140,7 @@ Some styling is needed to keep the object visible while not taking any space.
140140
<meta name="viewport" content="width=device-width">
141141
<title>JS Bin</title>
142142
<script src="https://unpkg.com/htmx.org"></script>
143-
<script src="https://unpkg.com/[email protected].11/dist/ext/client-side-templates.js"></script>
143+
<script src="https://unpkg.com/[email protected].12/dist/ext/client-side-templates.js"></script>
144144
</head>
145145
<body>
146146
<div hx-ext="client-side-templates">

www/content/extensions/debug.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ or through the `console.log` function with a `DEBUG:` prefix.
88
## Install
99

1010
```html
11-
<script src="https://unpkg.com/[email protected].11/dist/ext/debug.js"></script>
11+
<script src="https://unpkg.com/[email protected].12/dist/ext/debug.js"></script>
1212
```
1313

1414
## Usage

www/content/extensions/disable-element.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This extension disables an element during an htmx request, when configured on th
99
## Install
1010

1111
```html
12-
<script src="https://unpkg.com/[email protected].11/dist/ext/disable-element.js"></script>
12+
<script src="https://unpkg.com/[email protected].12/dist/ext/disable-element.js"></script>
1313
```
1414

1515
## Usage

www/content/extensions/event-header.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ request.
99
## Install
1010

1111
```html
12-
<script src="https://unpkg.com/[email protected].11/dist/ext/event-header.js"></script>
12+
<script src="https://unpkg.com/[email protected].12/dist/ext/event-header.js"></script>
1313
```
1414

1515
## Usage

www/content/extensions/head-support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This extension addresses that shortcoming & will likely be integrated into htmx
1818
## Install
1919

2020
```html
21-
<script src="https://unpkg.com/[email protected].11/dist/ext/head-support.js"></script>
21+
<script src="https://unpkg.com/[email protected].12/dist/ext/head-support.js"></script>
2222
```
2323

2424
## Usage

www/content/extensions/include-vals.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ will be evaluated as the fields in a javascript object literal.
99
## Install
1010

1111
```html
12-
<script src="https://unpkg.com/[email protected].11/dist/ext/include-vals.js"></script>
12+
<script src="https://unpkg.com/[email protected].12/dist/ext/include-vals.js"></script>
1313
```
1414

1515
## Usage

www/content/extensions/json-enc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This extension encodes parameters in JSON format instead of url format.
77
## Install
88

99
```html
10-
<script src="https://unpkg.com/[email protected].11/dist/ext/json-enc.js"></script>
10+
<script src="https://unpkg.com/[email protected].12/dist/ext/json-enc.js"></script>
1111
```
1212

1313
## Usage

www/content/extensions/loading-states.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This extension allows you to easily manage loading states while a request is in
77
## Install
88

99
```html
10-
<script src="https://unpkg.com/[email protected].11/dist/ext/loading-states.js"></script>
10+
<script src="https://unpkg.com/[email protected].12/dist/ext/loading-states.js"></script>
1111
```
1212

1313
## Usage

www/content/extensions/method-override.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ actual HTTP method. This is necessary when dealing with some firewall or proxy
88
## Install
99

1010
```html
11-
<script src="https://unpkg.com/[email protected].11/dist/ext/method-override.js"></script>
11+
<script src="https://unpkg.com/[email protected].12/dist/ext/method-override.js"></script>
1212
```
1313

1414
### Usage

www/content/extensions/morphdom-swap.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The `morphdom` library does not support morph element to multiple elements. If t
1010
## Install
1111

1212
```html
13-
<script src="https://unpkg.com/[email protected].11/dist/ext/morphdom-swap.js"></script>
13+
<script src="https://unpkg.com/[email protected].12/dist/ext/morphdom-swap.js"></script>
1414
```
1515

1616
### Usage

www/content/extensions/multi-swap.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It is a very powerful tool in conjunction with `hx-boost` and `preload` extensio
1111
## Install
1212

1313
```html
14-
<script src="https://unpkg.com/[email protected].11/dist/ext/multi-swap.js"></script>
14+
<script src="https://unpkg.com/[email protected].12/dist/ext/multi-swap.js"></script>
1515
```
1616

1717
## Usage

www/content/extensions/path-deps.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ You can use a `*` to match any path component:
2727
## Install
2828

2929
```html
30-
<script src="https://unpkg.com/[email protected].11/dist/ext/path-deps.js"></script>
30+
<script src="https://unpkg.com/[email protected].12/dist/ext/path-deps.js"></script>
3131
```
3232

3333
## Usage

www/content/extensions/path-params.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This extension uses request parameters to populate path variables. Used paramete
77
## Install
88

99
```html
10-
<script src="https://unpkg.com/[email protected].11/dist/ext/path-params.js">
10+
<script src="https://unpkg.com/[email protected].12/dist/ext/path-params.js">
1111
```
1212
1313
## Usage

www/content/extensions/preload.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The `preload` extension allows you to load HTML fragments into your browser's ca
99
## Install
1010

1111
```html
12-
<script src="https://unpkg.com/[email protected].11/dist/ext/preload.js"></script>
12+
<script src="https://unpkg.com/[email protected].12/dist/ext/preload.js"></script>
1313
```
1414

1515
## Usage

www/content/extensions/remove-me.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The `remove-me` extension allows you to remove an element after a specified inte
77
## Install
88

99
```html
10-
<script src="https://unpkg.com/[email protected].11/dist/ext/remove-me.js"></script>
10+
<script src="https://unpkg.com/[email protected].12/dist/ext/remove-me.js"></script>
1111
```
1212

1313
## Usage

0 commit comments

Comments
 (0)