@stacksjs/stx 0.2.124 → 0.2.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +459 -455
- package/dist/craft.js +264 -260
- package/dist/pwa.js +297 -293
- package/dist/signals.js +37 -33
- package/dist/ssg.js +305 -301
- package/dist/variable-extractor.d.ts +13 -0
- package/dist/variable-extractor.js +34 -3
- package/package.json +5 -5
package/dist/signals.js
CHANGED
|
@@ -3782,37 +3782,38 @@ catch (e2) {
|
|
|
3782
3782
|
pick.el.__stx_shown_at = performance.now();
|
|
3783
3783
|
if (!pick.childrenProcessed) {
|
|
3784
3784
|
pick.childrenProcessed = true;
|
|
3785
|
-
//
|
|
3786
|
-
//
|
|
3787
|
-
//
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
n
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3785
|
+
// Hydrate before the outer scope walk can see the inserted branch.
|
|
3786
|
+
// Chromium executes scripts cloned from template.content as soon as
|
|
3787
|
+
// they are connected, so deferring this pass allowed the global walk
|
|
3788
|
+
// to process projected slot expressions without the loop caller
|
|
3789
|
+
// scope. peek() keeps this synchronous pass from subscribing child
|
|
3790
|
+
// reads to the current chain effect.
|
|
3791
|
+
peek(function () {
|
|
3792
|
+
var childScope = { ...globalHelpers, ...capturedComponentScope, ...(pick.capturedElementScope || {}) };
|
|
3793
|
+
// Components compiled inside any branch of an if/else-if/else
|
|
3794
|
+
// chain carry scoped setup scripts with them. Branch nodes are
|
|
3795
|
+
// detached before those scripts can execute, so simply
|
|
3796
|
+
// re-inserting the selected branch leaves component props,
|
|
3797
|
+
// events, directives, and projected slot expressions inert.
|
|
3798
|
+
// Hydrate those scopes before the normal subtree walk, matching
|
|
3799
|
+
// the single-template :if and :for insertion paths.
|
|
3800
|
+
var previouslyTrackedNodes = new Set();
|
|
3801
|
+
pick.nodes.forEach(function (n) {
|
|
3802
|
+
if (n && n.__stx_disposers) previouslyTrackedNodes.add(n);
|
|
3803
|
+
});
|
|
3804
|
+
hydrateComponentScopes(pick.nodes, childScope);
|
|
3805
|
+
pick.nodes.forEach(function (n) {
|
|
3806
|
+
if (n.nodeType !== 1) return; // whitespace/text between template children
|
|
3807
|
+
// A scoped component receives its disposer in the outer scope
|
|
3808
|
+
// walk immediately after processElement returns from binding
|
|
3809
|
+
// this conditional. That first pass intentionally stops at
|
|
3810
|
+
// :if, so a disposer does not mean its children were hydrated.
|
|
3811
|
+
if (previouslyTrackedNodes.has(n) || !n.__stx_disposers)
|
|
3812
|
+
processElement(n, childScope);
|
|
3813
|
+
n.removeAttribute('x-cloak');
|
|
3814
|
+
n.querySelectorAll('[x-cloak]').forEach(function (c) { c.removeAttribute('x-cloak'); });
|
|
3815
|
+
});
|
|
3816
|
+
});
|
|
3816
3817
|
}
|
|
3817
3818
|
}
|
|
3818
3819
|
|
|
@@ -3983,10 +3984,13 @@ else if (!value && isInserted) {
|
|
|
3983
3984
|
else if (value && isInserted && !childrenProcessed) {
|
|
3984
3985
|
// Initial template content is cloned before the effect runs. Process
|
|
3985
3986
|
// it after the condition is confirmed so hidden branches stay inert.
|
|
3987
|
+
// Keep hydration synchronous so the outer scope walk cannot bind
|
|
3988
|
+
// caller-owned slot expressions first, while peek() prevents child
|
|
3989
|
+
// reads from subscribing to this conditional effect.
|
|
3986
3990
|
childrenProcessed = true;
|
|
3987
|
-
|
|
3991
|
+
peek(function() {
|
|
3988
3992
|
if (isInserted) processTemplateNodes(currentNodes);
|
|
3989
|
-
}
|
|
3993
|
+
});
|
|
3990
3994
|
}
|
|
3991
3995
|
}
|
|
3992
3996
|
else {
|