mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-27 04:50:43 +00:00
remove only top level files to keep the legacy extensions
This commit is contained in:
parent
ee13ae744a
commit
f751aba86f
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [2.0.1] - 2024-07-12
|
||||||
|
|
||||||
|
* Make the `/dist/htmx.esm.js` file the `main` file in `package.json` to make installing htmx smoother
|
||||||
|
* Update `htmx.d.ts` & include it in the distribution
|
||||||
|
|
||||||
|
|
||||||
## [2.0.0] - 2024-06-17
|
## [2.0.0] - 2024-06-17
|
||||||
|
|
||||||
* Removed extensions and moved to their own repos linked off of <https://extensions.htmx.org>
|
* Removed extensions and moved to their own repos linked off of <https://extensions.htmx.org>
|
||||||
|
@ -32,7 +32,7 @@ By removing these arbitrary constraints htmx completes HTML as a
|
|||||||
## quick start
|
## quick start
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://unpkg.com/htmx.org@2.0.0"></script>
|
<script src="https://unpkg.com/htmx.org@2.0.1"></script>
|
||||||
<!-- have a button POST a click via AJAX -->
|
<!-- have a button POST a click via AJAX -->
|
||||||
<button hx-post="/clicked" hx-swap="outerHTML">
|
<button hx-post="/clicked" hx-swap="outerHTML">
|
||||||
Click Me
|
Click Me
|
||||||
|
@ -5,7 +5,7 @@ set -euo pipefail
|
|||||||
HTMX_SRC="src/htmx.js"
|
HTMX_SRC="src/htmx.js"
|
||||||
|
|
||||||
# Clean the dist directory
|
# Clean the dist directory
|
||||||
rm -rf dist/*
|
rm -rf dist/*.js dist/*.ts dist/*.gz
|
||||||
|
|
||||||
# Regular IIFE script
|
# Regular IIFE script
|
||||||
cp $HTMX_SRC dist/htmx.js
|
cp $HTMX_SRC dist/htmx.js
|
||||||
@ -35,3 +35,4 @@ cat > dist/htmx.esm.js << EOF
|
|||||||
$(cat $HTMX_SRC)
|
$(cat $HTMX_SRC)
|
||||||
export default htmx
|
export default htmx
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ var htmx = (function() {
|
|||||||
parseInterval: null,
|
parseInterval: null,
|
||||||
/** @type {typeof internalEval} */
|
/** @type {typeof internalEval} */
|
||||||
_: null,
|
_: null,
|
||||||
version: '2.0.0'
|
version: '2.0.1'
|
||||||
}
|
}
|
||||||
// Tsc madness part 2
|
// Tsc madness part 2
|
||||||
htmx.onLoad = onLoadHelper
|
htmx.onLoad = onLoadHelper
|
||||||
|
@ -119,7 +119,7 @@ By removing these constraints, htmx completes HTML as a [hypertext](https://en.w
|
|||||||
<h2>quick start</h2>
|
<h2>quick start</h2>
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://unpkg.com/htmx.org@2.0.0"></script>
|
<script src="https://unpkg.com/htmx.org@2.0.1"></script>
|
||||||
<!-- have a button POST a click via AJAX -->
|
<!-- have a button POST a click via AJAX -->
|
||||||
<button hx-post="/clicked" hx-swap="outerHTML">
|
<button hx-post="/clicked" hx-swap="outerHTML">
|
||||||
Click Me
|
Click Me
|
||||||
|
@ -121,13 +121,13 @@ The fastest way to get going with htmx is to load it via a CDN. You can simply a
|
|||||||
your head tag and get going:
|
your head tag and get going:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://unpkg.com/htmx.org@2.0.0" integrity="sha384-wS5l5IKJBvK6sPTKa2WZ1js3d947pvWXbPJ1OmWfEuxLgeHcEbjUUA5i9V5ZkpCw" crossorigin="anonymous"></script>
|
<script src="https://unpkg.com/htmx.org@2.0.1" integrity="sha384-Kuy3zzgrd0iLfD2M/Bid8+jwLls454XKE9xFQE7OPj4VIwd1vlTS/4oNMxjpTtOw" crossorigin="anonymous"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
An unminified version is also available for debugging as well:
|
An unminified version is also available for debugging as well:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://unpkg.com/htmx.org@2.0.0/dist/htmx.js" integrity="sha384-Xh+GLLi0SMFPwtHQjT72aPG19QvKB8grnyRbYBNIdHWc2NkCrz65jlU7YrzO6qRp" crossorigin="anonymous"></script>
|
<script src="https://unpkg.com/htmx.org@2.0.1/dist/htmx.js" integrity="sha384-ELJB0CrwJPIruxvwhqogOAeh84D/QrihzCpaCO63RB/OlBPyezKvFpceNNOra4PG" crossorigin="anonymous"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
While the CDN approach is extremely simple, you may want to consider
|
While the CDN approach is extremely simple, you may want to consider
|
||||||
@ -149,7 +149,7 @@ and include it where necessary with a `<script>` tag:
|
|||||||
For npm-style build systems, you can install htmx via [npm](https://www.npmjs.com/):
|
For npm-style build systems, you can install htmx via [npm](https://www.npmjs.com/):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install htmx.org
|
npm install htmx.org@2.0.1
|
||||||
```
|
```
|
||||||
|
|
||||||
After installing, you’ll need to use appropriate tooling to use `node_modules/htmx.org/dist/htmx.js` (or `.min.js`).
|
After installing, you’ll need to use appropriate tooling to use `node_modules/htmx.org/dist/htmx.js` (or `.min.js`).
|
||||||
|
2
www/static/src/htmx.d.ts
vendored
2
www/static/src/htmx.d.ts
vendored
@ -113,7 +113,7 @@ type HtmxAjaxHelperContext = {
|
|||||||
source?: Element | string;
|
source?: Element | string;
|
||||||
event?: Event;
|
event?: Event;
|
||||||
handler?: HtmxAjaxHandler;
|
handler?: HtmxAjaxHandler;
|
||||||
target: Element | string;
|
target?: Element | string;
|
||||||
swap?: HtmxSwapStyle;
|
swap?: HtmxSwapStyle;
|
||||||
values?: any | FormData;
|
values?: any | FormData;
|
||||||
headers?: Record<string, string>;
|
headers?: Record<string, string>;
|
||||||
|
@ -277,7 +277,7 @@ var htmx = (function() {
|
|||||||
parseInterval: null,
|
parseInterval: null,
|
||||||
/** @type {typeof internalEval} */
|
/** @type {typeof internalEval} */
|
||||||
_: null,
|
_: null,
|
||||||
version: '2.0.0'
|
version: '2.0.1'
|
||||||
}
|
}
|
||||||
// Tsc madness part 2
|
// Tsc madness part 2
|
||||||
htmx.onLoad = onLoadHelper
|
htmx.onLoad = onLoadHelper
|
||||||
@ -1626,6 +1626,9 @@ var htmx = (function() {
|
|||||||
* @param {HtmxSettleInfo} settleInfo
|
* @param {HtmxSettleInfo} settleInfo
|
||||||
*/
|
*/
|
||||||
function swapOuterHTML(target, fragment, settleInfo) {
|
function swapOuterHTML(target, fragment, settleInfo) {
|
||||||
|
if (target instanceof Element && target.tagName === 'BODY') { // special case the body to innerHTML because DocumentFragments can't contain a body elt unfortunately
|
||||||
|
return swapInnerHTML(target, fragment, settleInfo)
|
||||||
|
}
|
||||||
/** @type {Node} */
|
/** @type {Node} */
|
||||||
let newElt
|
let newElt
|
||||||
const eltBeforeNewContent = target.previousSibling
|
const eltBeforeNewContent = target.previousSibling
|
||||||
@ -1851,7 +1854,7 @@ var htmx = (function() {
|
|||||||
findAndSwapOobElements(fragment, settleInfo)
|
findAndSwapOobElements(fragment, settleInfo)
|
||||||
forEach(findAll(fragment, 'template'), /** @param {HTMLTemplateElement} template */function(template) {
|
forEach(findAll(fragment, 'template'), /** @param {HTMLTemplateElement} template */function(template) {
|
||||||
findAndSwapOobElements(template.content, settleInfo)
|
findAndSwapOobElements(template.content, settleInfo)
|
||||||
if (template.content.childElementCount === 0) {
|
if (template.content.childElementCount === 0 && template.content.textContent.trim() === '') {
|
||||||
// Avoid polluting the DOM with empty templates that were only used to encapsulate oob swap
|
// Avoid polluting the DOM with empty templates that were only used to encapsulate oob swap
|
||||||
template.remove()
|
template.remove()
|
||||||
}
|
}
|
||||||
@ -5033,7 +5036,7 @@ var htmx = (function() {
|
|||||||
* @property {Element|string} [source]
|
* @property {Element|string} [source]
|
||||||
* @property {Event} [event]
|
* @property {Event} [event]
|
||||||
* @property {HtmxAjaxHandler} [handler]
|
* @property {HtmxAjaxHandler} [handler]
|
||||||
* @property {Element|string} target
|
* @property {Element|string} [target]
|
||||||
* @property {HtmxSwapStyle} [swap]
|
* @property {HtmxSwapStyle} [swap]
|
||||||
* @property {Object|FormData} [values]
|
* @property {Object|FormData} [values]
|
||||||
* @property {Record<string,string>} [headers]
|
* @property {Record<string,string>} [headers]
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
<li><a href="poll-condition-test.html">Poll Conditionals</a></li>
|
<li><a href="poll-condition-test.html">Poll Conditionals</a></li>
|
||||||
<li><a href="poll-clears-on-reinit-test.html">Polling Cancels On Reprocessing</a></li>
|
<li><a href="poll-clears-on-reinit-test.html">Polling Cancels On Reprocessing</a></li>
|
||||||
<li><a href="cache-buster">Cache Busting Test</a></li>
|
<li><a href="cache-buster">Cache Busting Test</a></li>
|
||||||
|
<li><a href="body-swap">Body Swap Test</a></li>
|
||||||
<li>Scroll Tests
|
<li>Scroll Tests
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="scroll-test-eventHandler.html">Scroll Event Handler</a></li>
|
<li><a href="scroll-test-eventHandler.html">Scroll Event Handler</a></li>
|
||||||
|
@ -277,7 +277,7 @@ var htmx = (function() {
|
|||||||
parseInterval: null,
|
parseInterval: null,
|
||||||
/** @type {typeof internalEval} */
|
/** @type {typeof internalEval} */
|
||||||
_: null,
|
_: null,
|
||||||
version: '2.0.0'
|
version: '2.0.1'
|
||||||
}
|
}
|
||||||
// Tsc madness part 2
|
// Tsc madness part 2
|
||||||
htmx.onLoad = onLoadHelper
|
htmx.onLoad = onLoadHelper
|
||||||
@ -1626,6 +1626,9 @@ var htmx = (function() {
|
|||||||
* @param {HtmxSettleInfo} settleInfo
|
* @param {HtmxSettleInfo} settleInfo
|
||||||
*/
|
*/
|
||||||
function swapOuterHTML(target, fragment, settleInfo) {
|
function swapOuterHTML(target, fragment, settleInfo) {
|
||||||
|
if (target instanceof Element && target.tagName === 'BODY') { // special case the body to innerHTML because DocumentFragments can't contain a body elt unfortunately
|
||||||
|
return swapInnerHTML(target, fragment, settleInfo)
|
||||||
|
}
|
||||||
/** @type {Node} */
|
/** @type {Node} */
|
||||||
let newElt
|
let newElt
|
||||||
const eltBeforeNewContent = target.previousSibling
|
const eltBeforeNewContent = target.previousSibling
|
||||||
@ -1851,7 +1854,7 @@ var htmx = (function() {
|
|||||||
findAndSwapOobElements(fragment, settleInfo)
|
findAndSwapOobElements(fragment, settleInfo)
|
||||||
forEach(findAll(fragment, 'template'), /** @param {HTMLTemplateElement} template */function(template) {
|
forEach(findAll(fragment, 'template'), /** @param {HTMLTemplateElement} template */function(template) {
|
||||||
findAndSwapOobElements(template.content, settleInfo)
|
findAndSwapOobElements(template.content, settleInfo)
|
||||||
if (template.content.childElementCount === 0) {
|
if (template.content.childElementCount === 0 && template.content.textContent.trim() === '') {
|
||||||
// Avoid polluting the DOM with empty templates that were only used to encapsulate oob swap
|
// Avoid polluting the DOM with empty templates that were only used to encapsulate oob swap
|
||||||
template.remove()
|
template.remove()
|
||||||
}
|
}
|
||||||
@ -5033,7 +5036,7 @@ var htmx = (function() {
|
|||||||
* @property {Element|string} [source]
|
* @property {Element|string} [source]
|
||||||
* @property {Event} [event]
|
* @property {Event} [event]
|
||||||
* @property {HtmxAjaxHandler} [handler]
|
* @property {HtmxAjaxHandler} [handler]
|
||||||
* @property {Element|string} target
|
* @property {Element|string} [target]
|
||||||
* @property {HtmxSwapStyle} [swap]
|
* @property {HtmxSwapStyle} [swap]
|
||||||
* @property {Object|FormData} [values]
|
* @property {Object|FormData} [values]
|
||||||
* @property {Record<string,string>} [headers]
|
* @property {Record<string,string>} [headers]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user