Skip to content

Commit

Permalink
Revert "alpinejs: Patch for mutator body removal"
Browse files Browse the repository at this point in the history
That patch was a mistake.

This reverts commit 25550c6.
  • Loading branch information
bep committed Oct 13, 2021
1 parent 25550c6 commit d49f875
Show file tree
Hide file tree
Showing 170 changed files with 106 additions and 30,292 deletions.
7 changes: 0 additions & 7 deletions alpinejs/packages/alpinejs/builds/cdn.js

This file was deleted.

3 changes: 0 additions & 3 deletions alpinejs/packages/alpinejs/builds/module.js

This file was deleted.

42 changes: 17 additions & 25 deletions alpinejs/packages/alpinejs/dist/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,6 @@
}];
}

// packages/alpinejs/src/utils/walk.js
function walk(el, callback) {
if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
Array.from(el.children).forEach((el2) => walk(el2, callback));
return;
}
let skip = false;
callback(el, () => skip = true);
if (skip)
return;
let node = el.firstElementChild;
while (node) {
walk(node, callback, false);
node = node.nextElementSibling;
}
}

// packages/alpinejs/src/mutation.js
var onAttributeAddeds = [];
var onElRemoveds = [];
Expand Down Expand Up @@ -224,14 +207,6 @@
if (addedNodes.includes(node))
continue;
onElRemoveds.forEach((i) => i(node));
if (node.localName === "body") {
node.querySelectorAll("[x-data]").forEach((el) => {
walk(el, (el2) => {
onElRemoveds.forEach((i) => i(el2));
el2.remove();
});
});
}
}
addedNodes = null;
removedNodes = null;
Expand Down Expand Up @@ -642,6 +617,23 @@ Expression: "${expression}"
isHolding = true;
}

// packages/alpinejs/src/utils/walk.js
function walk(el, callback) {
if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) {
Array.from(el.children).forEach((el2) => walk(el2, callback));
return;
}
let skip = false;
callback(el, () => skip = true);
if (skip)
return;
let node = el.firstElementChild;
while (node) {
walk(node, callback, false);
node = node.nextElementSibling;
}
}

// packages/alpinejs/src/utils/warn.js
function warn(message, ...args) {
console.warn(`Alpine Warning: ${message}`, ...args);
Expand Down
4 changes: 2 additions & 2 deletions alpinejs/packages/alpinejs/dist/cdn.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit d49f875

Please sign in to comment.