Skip to content

Commit fb68dfb

Browse files
authored
Preload extension: hx-boost, no side effects, HX-Preloaded header, form support, tests and JSDocs (#106)
* Implement form preloading * Implement preload extension tests * Remove redundant elements from tests * Add support for xh-boost and implement request matching tests * Add JSDocs and refactor for readibility * Simplify code * Fix faulty <button> preload * Add test for preload='always' * Adjust version number * Remove side effects (e.g. loading indicator) and add HX-Preload header * Add HX-Preload header to requests preloaded without passing through HTMX.ajax() * Fixed link to documentation in extension description * Renamed preloaded header from HX-Preload to HX-Preloaded * Fix bug of preloading hx-post form and improve documentation * Remove forgotte console.log() * Fix errors and types discovered by @Telroshan in PR review * Add .DS_Store to .gitignore * Fix error of two preload requests when label contains input and added test * Preload button type=submit and add test for it * Add test for and (inverse order) * Add a test checking that click request does not include preloaded header
1 parent a1bfe06 commit fb68dfb

File tree

15 files changed

+1564
-274
lines changed

15 files changed

+1564
-274
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
.idea
3+
.DS_Store

src/preload/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD Zero Clause License
22

3-
Copyright (c) 2023, Alexander Petros
3+
Copyright (c) 2024, Alexander Petros and Mariss Tubelis
44

55
Permission to use, copy, modify, and/or distribute this software for any
66
purpose with or without fee is hereby granted.

src/preload/package-lock.json

Lines changed: 267 additions & 161 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/preload/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "htmx-ext-preload",
33
"main": "preload.js",
4-
"version": "2.0.1",
4+
"version": "2.1.0",
55
"scripts": {
66
"lint": "eslint test/ext test",
77
"lint-fix": "eslint test/ext test --fix",
@@ -19,6 +19,6 @@
1919
"mocha": "10.1.0",
2020
"mocha-chrome": "https://github.com/Telroshan/mocha-chrome",
2121
"sinon": "^9.2.4",
22-
"htmx.org": "^2.0.2"
22+
"htmx.org": "^2.0.3"
2323
}
2424
}

0 commit comments

Comments
 (0)