Skip to content

Commit bdc7d7d

Browse files
committed
2.10 release prep
1 parent 20951cc commit bdc7d7d

22 files changed

Lines changed: 57 additions & 60 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [2.0.10] - 2026-04-21
4+
5+
* [Fixed](https://github.com/bigskysoftware/htmx/issues/3757) restored missing TypeScript type definitions (`htmx.esm.d.ts`) accidentally removed in 2.0.9
6+
* [Fixed](https://github.com/bigskysoftware/htmx/pull/3752) improved escaping of tag and id in settle lookup using `CSS.escape()` (thanks @MichaelWest22)
7+
38
## [2.0.9] - 2026-04-15
49

510
* [Fixed](https://github.com/bigskysoftware/htmx/commit/a706897e84ed271528658c84a0b73eb5e3f2fe57) `HX-Location` to correctly honor `replace` when `push` is `false` (thanks @MichaelWest22)

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ By removing these arbitrary constraints htmx completes HTML as a
3232
## quick start
3333

3434
```html
35-
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.9/dist/htmx.min.js"></script>
35+
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.10/dist/htmx.min.js"
36+
integrity="sha384-H5SrcfygHmAuTDZphMHqBJLc3FhssKjG7w/CeCpFReSfwBWDTKpkzPP8c+cLsK+V"
37+
crossorigin="anonymous"></script>
3638
<!-- have a button POST a click via AJAX -->
3739
<button hx-post="/clicked" hx-swap="outerHTML">
3840
Click Me

dist/htmx.amd.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ var htmx = (function() {
297297
location,
298298
/** @type {typeof internalEval} */
299299
_: null,
300-
version: '2.0.9'
300+
version: '2.0.10'
301301
}
302302
// Tsc madness part 2
303303
htmx.onLoad = onLoadHelper
@@ -1561,10 +1561,8 @@ var htmx = (function() {
15611561
forEach(fragment.querySelectorAll('[id]'), function(newNode) {
15621562
const id = getRawAttribute(newNode, 'id')
15631563
if (id && id.length > 0) {
1564-
const normalizedId = id.replace("'", "\\'")
1565-
const normalizedTag = newNode.tagName.replace(':', '\\:')
15661564
const parentElt = asParentNode(parentNode)
1567-
const oldNode = parentElt && parentElt.querySelector(normalizedTag + "[id='" + normalizedId + "']")
1565+
const oldNode = parentElt && parentElt.querySelector(CSS.escape(newNode.tagName) + '#' + CSS.escape(id))
15681566
if (oldNode && oldNode !== parentElt) {
15691567
const newAttributes = newNode.cloneNode()
15701568
cloneAttributes(newNode, oldNode)
@@ -1980,7 +1978,7 @@ var htmx = (function() {
19801978
removeClassFromElement(target, htmx.config.swappingClass)
19811979
forEach(settleInfo.elts, function(elt) {
19821980
if (elt.classList) {
1983-
elt.classList.add(htmx.config.settlingClass)
1981+
addClassToElement(elt, htmx.config.settlingClass)
19841982
}
19851983
triggerEvent(elt, 'htmx:afterSwap', swapOptions.eventInfo)
19861984
})
@@ -3379,7 +3377,7 @@ var htmx = (function() {
33793377
forEach(indicators, function(ic) {
33803378
const internalData = getInternalData(ic)
33813379
internalData.requestCount = (internalData.requestCount || 0) + 1
3382-
ic.classList.add.call(ic.classList, htmx.config.requestClass)
3380+
addClassToElement(ic, htmx.config.requestClass)
33833381
})
33843382
return indicators
33853383
}
@@ -4916,7 +4914,7 @@ var htmx = (function() {
49164914
swapSpec.ignoreTitle = ignoreTitle
49174915
}
49184916

4919-
target.classList.add(htmx.config.swappingClass)
4917+
addClassToElement(target, htmx.config.swappingClass)
49204918

49214919
if (responseInfoSelect) {
49224920
selectOverride = responseInfoSelect

dist/htmx.cjs.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ var htmx = (function() {
296296
location,
297297
/** @type {typeof internalEval} */
298298
_: null,
299-
version: '2.0.9'
299+
version: '2.0.10'
300300
}
301301
// Tsc madness part 2
302302
htmx.onLoad = onLoadHelper
@@ -1560,10 +1560,8 @@ var htmx = (function() {
15601560
forEach(fragment.querySelectorAll('[id]'), function(newNode) {
15611561
const id = getRawAttribute(newNode, 'id')
15621562
if (id && id.length > 0) {
1563-
const normalizedId = id.replace("'", "\\'")
1564-
const normalizedTag = newNode.tagName.replace(':', '\\:')
15651563
const parentElt = asParentNode(parentNode)
1566-
const oldNode = parentElt && parentElt.querySelector(normalizedTag + "[id='" + normalizedId + "']")
1564+
const oldNode = parentElt && parentElt.querySelector(CSS.escape(newNode.tagName) + '#' + CSS.escape(id))
15671565
if (oldNode && oldNode !== parentElt) {
15681566
const newAttributes = newNode.cloneNode()
15691567
cloneAttributes(newNode, oldNode)
@@ -1979,7 +1977,7 @@ var htmx = (function() {
19791977
removeClassFromElement(target, htmx.config.swappingClass)
19801978
forEach(settleInfo.elts, function(elt) {
19811979
if (elt.classList) {
1982-
elt.classList.add(htmx.config.settlingClass)
1980+
addClassToElement(elt, htmx.config.settlingClass)
19831981
}
19841982
triggerEvent(elt, 'htmx:afterSwap', swapOptions.eventInfo)
19851983
})
@@ -3378,7 +3376,7 @@ var htmx = (function() {
33783376
forEach(indicators, function(ic) {
33793377
const internalData = getInternalData(ic)
33803378
internalData.requestCount = (internalData.requestCount || 0) + 1
3381-
ic.classList.add.call(ic.classList, htmx.config.requestClass)
3379+
addClassToElement(ic, htmx.config.requestClass)
33823380
})
33833381
return indicators
33843382
}
@@ -4915,7 +4913,7 @@ var htmx = (function() {
49154913
swapSpec.ignoreTitle = ignoreTitle
49164914
}
49174915

4918-
target.classList.add(htmx.config.swappingClass)
4916+
addClassToElement(target, htmx.config.swappingClass)
49194917

49204918
if (responseInfoSelect) {
49214919
selectOverride = responseInfoSelect

dist/htmx.esm.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ var htmx = (function() {
296296
location,
297297
/** @type {typeof internalEval} */
298298
_: null,
299-
version: '2.0.9'
299+
version: '2.0.10'
300300
}
301301
// Tsc madness part 2
302302
htmx.onLoad = onLoadHelper
@@ -1560,10 +1560,8 @@ var htmx = (function() {
15601560
forEach(fragment.querySelectorAll('[id]'), function(newNode) {
15611561
const id = getRawAttribute(newNode, 'id')
15621562
if (id && id.length > 0) {
1563-
const normalizedId = id.replace("'", "\\'")
1564-
const normalizedTag = newNode.tagName.replace(':', '\\:')
15651563
const parentElt = asParentNode(parentNode)
1566-
const oldNode = parentElt && parentElt.querySelector(normalizedTag + "[id='" + normalizedId + "']")
1564+
const oldNode = parentElt && parentElt.querySelector(CSS.escape(newNode.tagName) + '#' + CSS.escape(id))
15671565
if (oldNode && oldNode !== parentElt) {
15681566
const newAttributes = newNode.cloneNode()
15691567
cloneAttributes(newNode, oldNode)
@@ -1979,7 +1977,7 @@ var htmx = (function() {
19791977
removeClassFromElement(target, htmx.config.swappingClass)
19801978
forEach(settleInfo.elts, function(elt) {
19811979
if (elt.classList) {
1982-
elt.classList.add(htmx.config.settlingClass)
1980+
addClassToElement(elt, htmx.config.settlingClass)
19831981
}
19841982
triggerEvent(elt, 'htmx:afterSwap', swapOptions.eventInfo)
19851983
})
@@ -3378,7 +3376,7 @@ var htmx = (function() {
33783376
forEach(indicators, function(ic) {
33793377
const internalData = getInternalData(ic)
33803378
internalData.requestCount = (internalData.requestCount || 0) + 1
3381-
ic.classList.add.call(ic.classList, htmx.config.requestClass)
3379+
addClassToElement(ic, htmx.config.requestClass)
33823380
})
33833381
return indicators
33843382
}
@@ -4915,7 +4913,7 @@ var htmx = (function() {
49154913
swapSpec.ignoreTitle = ignoreTitle
49164914
}
49174915

4918-
target.classList.add(htmx.config.swappingClass)
4916+
addClassToElement(target, htmx.config.swappingClass)
49194917

49204918
if (responseInfoSelect) {
49214919
selectOverride = responseInfoSelect

dist/htmx.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ var htmx = (function() {
296296
location,
297297
/** @type {typeof internalEval} */
298298
_: null,
299-
version: '2.0.9'
299+
version: '2.0.10'
300300
}
301301
// Tsc madness part 2
302302
htmx.onLoad = onLoadHelper
@@ -1560,10 +1560,8 @@ var htmx = (function() {
15601560
forEach(fragment.querySelectorAll('[id]'), function(newNode) {
15611561
const id = getRawAttribute(newNode, 'id')
15621562
if (id && id.length > 0) {
1563-
const normalizedId = id.replace("'", "\\'")
1564-
const normalizedTag = newNode.tagName.replace(':', '\\:')
15651563
const parentElt = asParentNode(parentNode)
1566-
const oldNode = parentElt && parentElt.querySelector(normalizedTag + "[id='" + normalizedId + "']")
1564+
const oldNode = parentElt && parentElt.querySelector(CSS.escape(newNode.tagName) + '#' + CSS.escape(id))
15671565
if (oldNode && oldNode !== parentElt) {
15681566
const newAttributes = newNode.cloneNode()
15691567
cloneAttributes(newNode, oldNode)
@@ -1979,7 +1977,7 @@ var htmx = (function() {
19791977
removeClassFromElement(target, htmx.config.swappingClass)
19801978
forEach(settleInfo.elts, function(elt) {
19811979
if (elt.classList) {
1982-
elt.classList.add(htmx.config.settlingClass)
1980+
addClassToElement(elt, htmx.config.settlingClass)
19831981
}
19841982
triggerEvent(elt, 'htmx:afterSwap', swapOptions.eventInfo)
19851983
})
@@ -3378,7 +3376,7 @@ var htmx = (function() {
33783376
forEach(indicators, function(ic) {
33793377
const internalData = getInternalData(ic)
33803378
internalData.requestCount = (internalData.requestCount || 0) + 1
3381-
ic.classList.add.call(ic.classList, htmx.config.requestClass)
3379+
addClassToElement(ic, htmx.config.requestClass)
33823380
})
33833381
return indicators
33843382
}
@@ -4915,7 +4913,7 @@ var htmx = (function() {
49154913
swapSpec.ignoreTitle = ignoreTitle
49164914
}
49174915

4918-
target.classList.add(htmx.config.swappingClass)
4916+
addClassToElement(target, htmx.config.swappingClass)
49194917

49204918
if (responseInfoSelect) {
49214919
selectOverride = responseInfoSelect

dist/htmx.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/htmx.min.js.gz

-36 Bytes
Binary file not shown.

editors/jetbrains/htmx.web-types.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/web-types",
33
"name": "htmx",
4-
"version": "2.0.9",
4+
"version": "2.0.10",
55
"default-icon": "./htmx.svg",
66
"js-types-syntax": "typescript",
77
"description-markup": "markdown",

package.json

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

0 commit comments

Comments
 (0)