From 5f72dfead647935b3a3a4464b578548bcb5db402 Mon Sep 17 00:00:00 2001 From: 1cg <469183+1cg@users.noreply.github.com> Date: Fri, 16 Apr 2021 09:50:18 -0600 Subject: [PATCH 1/9] Update docs.md --- www/docs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/docs.md b/www/docs.md index 44e605fc..50b1eb56 100644 --- a/www/docs.md +++ b/www/docs.md @@ -61,17 +61,17 @@ This anchor tag tells a browser: With that in mind, consider the following bit of HTML: ``` html -
Click Me! -
+ ``` This tells htmx: -> "When a user clicks on this div, issue an HTTP POST request to '/clicked' and use the content from the response +> "When a user clicks on this button, issue an HTTP POST request to '/clicked' and use the content from the response > to replace the element with the id `parent-div` in the DOM" Htmx extends and generalizes the core idea of HTML as a hypertext, opening up many more possibilities directly From 81dc9cf27c1054ff1b44d833945d735cb9a47e97 Mon Sep 17 00:00:00 2001 From: Diego Algorta Date: Tue, 20 Apr 2021 00:37:45 -0300 Subject: [PATCH 2/9] Fix throttling to avoid delaying This changes throttling so it doesn't wait to be fired when the event happens, _unless_ it has already been fired and a timeout is waiting to be executed to clean itself. Please note this is a bit of a shoot in the dark as I'm editing this directly in GitHub and haven't tested it, and of course I'm not adding/fixing any automated tests. So it's just an idea. :P --- src/htmx.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/htmx.js b/src/htmx.js index afa5f50b..eebc1c64 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -1016,10 +1016,12 @@ return (function () { } if (triggerSpec.throttle) { - elementData.throttle = setTimeout(function(){ + if(!elementData.throttle) { issueAjaxRequest(verb, path, elt, evt); - elementData.throttle = null; - }, triggerSpec.throttle); + elementData.throttle = setTimeout(function(){ + elementData.throttle = null; + }, triggerSpec.throttle); + } } else if (triggerSpec.delay) { elementData.delayed = setTimeout(function(){ issueAjaxRequest(verb, path, elt, evt); From 6238e6caa0280e8d1f94763a2c07899014381957 Mon Sep 17 00:00:00 2001 From: Eddy Ernesto del Valle Pino Date: Fri, 23 Apr 2021 21:31:53 +0200 Subject: [PATCH 3/9] Fix swap error when using hx-boost or swapping the body tag When hx-boost is swapping the body, in some cases it fails with: ``` htmx:swapError TypeError: Cannot read property 'tasks' of undefined at htmx-1.3.3.js:526 at forEach (htmx-1.3.3.js:222) at handleAttributes (htmx-1.3.3.js:520) at insertNodesBefore (htmx-1.3.3.js:552) at swapInnerHTML (htmx-1.3.3.js:624) at swapOuterHTML (htmx-1.3.3.js:584) at swap (htmx-1.3.3.js:652) at selectAndSwap (htmx-1.3.3.js:715) at doSwap (htmx-1.3.3.js:2284) at handleAjaxResponse (htmx-1.3.3.js:2358) ``` because `swapOuterHTML` is not passing `settleInfo` to `swapInnerHTML` --- src/htmx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/htmx.js b/src/htmx.js index afa5f50b..b6b6ce75 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -581,7 +581,7 @@ return (function () { function swapOuterHTML(target, fragment, settleInfo) { if (target.tagName === "BODY") { - return swapInnerHTML(target, fragment); + return swapInnerHTML(target, fragment, settleInfo); } else { var eltBeforeNewContent = target.previousSibling; insertNodesBefore(parentElt(target), target, fragment, settleInfo); From 5f6fd27335fd4840ee62888ca5c5361d7c50d0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCttler?= Date: Tue, 27 Apr 2021 13:40:54 +0200 Subject: [PATCH 4/9] advertise sponsoring. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 724dcb9d..5c2e4181 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ htmx is the successor to [intercooler.js](http://intercoolerjs.org) * if you are adding a feature, consider doing it as an [extension](https://htmx.org/extensions) instead to keep the core htmx code tidy * development pull requests should be against the `dev` branch, docs fixes can be made directly against `master` +* No time? Then [become a sponsor](https://github.com/sponsors/bigskysoftware#sponsors) ## haiku From f7a48f5a326a83efc998050501f7ce0d4dd563ca Mon Sep 17 00:00:00 2001 From: Landlocked Surfer Date: Wed, 5 May 2021 21:26:39 +0200 Subject: [PATCH 5/9] add withCredentials config option --- src/htmx.js | 2 ++ www/api.md | 1 + 2 files changed, 3 insertions(+) diff --git a/src/htmx.js b/src/htmx.js index afa5f50b..b30ae423 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -49,6 +49,7 @@ return (function () { swappingClass:'htmx-swapping', allowEval:true, attributesToSettle:["class", "style", "width", "height"], + withCredentials:false, wsReconnectDelay: 'full-jitter', disableSelector: "[hx-disable], [data-hx-disable]", }, @@ -2145,6 +2146,7 @@ return (function () { } xhr.overrideMimeType("text/html"); + xhr.withCredentials = htmx.config.withCredentials; // request headers for (var header in headers) { diff --git a/www/api.md b/www/api.md index 1d177c0e..4e7d3e79 100644 --- a/www/api.md +++ b/www/api.md @@ -98,6 +98,7 @@ Note that using a [meta tag](/docs/#config) is the preferred mechanism for setti * `settlingClass:'htmx-settling'` - string: the class to place on target elements when htmx is in the settling phase * `swappingClass:'htmx-swapping'` - string: the class to place on target elements when htmx is in the swapping phase * `allowEval:true` - boolean: allows the use of eval-like functionality in htmx, to enable `hx-vars`, trigger conditions & script tag evaluation. Can be set to `false` for CSP compatibility +* `withCredentials:false` - boolean: allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates * `wsReconnectDelay:full-jitter` - string/function: the default implementation of `getWebSocketReconnectDelay` for reconnecting after unexpected connection loss by the event code `Abnormal Closure`, `Service Restart` or `Try Again Later` ##### Example From 0f554b520ce23638c937644fab0f2c0b91d95c36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 May 2021 22:18:36 +0000 Subject: [PATCH 6/9] Bump ua-parser-js from 0.7.23 to 0.7.28 Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.23 to 0.7.28. - [Release notes](https://github.com/faisalman/ua-parser-js/releases) - [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.23...0.7.28) Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5edadba0..b3179569 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "htmx.org", - "version": "1.2.1", + "version": "1.3.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -6499,9 +6499,9 @@ "dev": true }, "ua-parser-js": { - "version": "0.7.23", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.23.tgz", - "integrity": "sha512-m4hvMLxgGHXG3O3fQVAyyAQpZzDOvwnhOTjYz5Xmr7r/+LpkNy3vJXdVRWgd1TkAb7NGROZuSy96CrlNVjA7KA==", + "version": "0.7.28", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.28.tgz", + "integrity": "sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g==", "dev": true }, "uc.micro": { From af1004c8f6b9c02c93cfb01db71d3314be5cd5d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 May 2021 22:24:19 +0000 Subject: [PATCH 7/9] Bump handlebars from 4.7.6 to 4.7.7 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.7.6...v4.7.7) Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5edadba0..813bc8d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "htmx.org", - "version": "1.2.1", + "version": "1.3.3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2790,9 +2790,9 @@ "dev": true }, "handlebars": { - "version": "4.7.6", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", - "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, "requires": { "minimist": "^1.2.5", From 0483d96a08994f57d8844b509e57aaf44e5d4937 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 15:17:20 +0000 Subject: [PATCH 8/9] Bump hosted-git-info from 2.8.8 to 2.8.9 Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ff1307c..0b79bbc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2906,9 +2906,9 @@ "dev": true }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "http-errors": { From 2ffb3e081f5982853d4378299f78cd04ee845c10 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 15:17:27 +0000 Subject: [PATCH 9/9] Bump lodash from 4.17.19 to 4.17.21 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ff1307c..65705827 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3659,9 +3659,9 @@ } }, "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "lodash.debounce": {