Skip to content

Commit

Permalink
prep v1.9.12
Browse files Browse the repository at this point in the history
  • Loading branch information
1cg committed Apr 17, 2024
2 parents c247cae + 7dd6cd7 commit f38e07d
Show file tree
Hide file tree
Showing 39 changed files with 120 additions and 64 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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!)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ By removing these arbitrary constraints htmx completes HTML as a
## quick start

```html
<script src="https://unpkg.com/[email protected].11"></script>
<script src="https://unpkg.com/[email protected].12"></script>
<!-- have a button POST a click via AJAX -->
<button hx-post="/clicked" hx-swap="outerHTML">
Click Me
Expand Down
19 changes: 11 additions & 8 deletions dist/htmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -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} */
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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:") ||
Expand All @@ -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])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/htmx.min.js

Large diffs are not rendered by default.

Binary file modified dist/htmx.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 11 additions & 8 deletions src/htmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -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} */
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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:") ||
Expand All @@ -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])
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions test/core/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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" ' +
Expand Down
10 changes: 10 additions & 0 deletions test/core/regressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion www/config.toml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
2 changes: 1 addition & 1 deletion www/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].11"></script>
<script src="https://unpkg.com/[email protected].12"></script>
<!-- have a button POST a click via AJAX -->
<button hx-post="/clicked" hx-swap="outerHTML">
Click Me
Expand Down
2 changes: 1 addition & 1 deletion www/content/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].11" integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0" crossorigin="anonymous"></script>
<script src="https://unpkg.com/[email protected].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).
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].11/dist/ext/`. You will need
You can find the source for the bundled extensions at `https://unpkg.com/browse/[email protected].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.
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/ajax-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This header is commonly used by javascript frameworks to differentiate ajax requ
## Install

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

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/alpine-morph.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Alpine.js now has a lightweight [morph plugin](https://alpinejs.dev/plugins/morp
## Install

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

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/class-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ optionally followed by a colon `:` and a time delay.
## Install

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

## Usage
Expand Down
8 changes: 4 additions & 4 deletions www/content/extensions/client-side-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A second "array" version of each template is now offered, which is particularly
## Install

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

## Usage
Expand Down Expand Up @@ -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/[email protected].11/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/[email protected].12/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/mustache@latest"></script>
</head>
<body>
Expand Down Expand Up @@ -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/[email protected].11/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/[email protected].12/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/mustache@latest"></script>
</head>
<body>
Expand Down Expand Up @@ -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/[email protected].11/dist/ext/client-side-templates.js"></script>
<script src="https://unpkg.com/[email protected].12/dist/ext/client-side-templates.js"></script>
</head>
<body>
<div hx-ext="client-side-templates">
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ or through the `console.log` function with a `DEBUG:` prefix.
## Install

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

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/disable-element.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This extension disables an element during an htmx request, when configured on th
## Install

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

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/event-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ request.
## Install

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

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/head-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This extension addresses that shortcoming & will likely be integrated into htmx
## Install

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

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/include-vals.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ will be evaluated as the fields in a javascript object literal.
## Install

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

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/json-enc.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This extension encodes parameters in JSON format instead of url format.
## Install

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

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/loading-states.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].11/dist/ext/loading-states.js"></script>
<script src="https://unpkg.com/[email protected].12/dist/ext/loading-states.js"></script>
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/method-override.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ actual HTTP method. This is necessary when dealing with some firewall or proxy
## Install

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

### Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/morphdom-swap.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The `morphdom` library does not support morph element to multiple elements. If t
## Install

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

### Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/multi-swap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].11/dist/ext/multi-swap.js"></script>
<script src="https://unpkg.com/[email protected].12/dist/ext/multi-swap.js"></script>
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/path-deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ You can use a `*` to match any path component:
## Install

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

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/path-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This extension uses request parameters to populate path variables. Used paramete
## Install

```html
<script src="https://unpkg.com/[email protected].11/dist/ext/path-params.js">
<script src="https://unpkg.com/[email protected].12/dist/ext/path-params.js">
```
## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/preload.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].11/dist/ext/preload.js"></script>
<script src="https://unpkg.com/[email protected].12/dist/ext/preload.js"></script>
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion www/content/extensions/remove-me.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].11/dist/ext/remove-me.js"></script>
<script src="https://unpkg.com/[email protected].12/dist/ext/remove-me.js"></script>
```

## Usage
Expand Down
Loading

0 comments on commit f38e07d

Please sign in to comment.