octane 0.16.0 → 0.16.2
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/behavior-root.js +12 -13
- package/dist/cjs/behavior-root.cjs +12 -13
- package/dist/cjs/data-encoding.cjs +18 -0
- package/dist/cjs/dom-tables.cjs +14 -0
- package/dist/cjs/error-codes.client.generated.cjs +43 -0
- package/dist/cjs/error-codes.server.generated.cjs +43 -0
- package/dist/cjs/independent-hydration-protocol.cjs +7 -20
- package/dist/cjs/radio-group.cjs +7 -2
- package/dist/cjs/runtime/block.cjs +5 -5
- package/dist/cjs/runtime/branches.cjs +2 -21
- package/dist/cjs/runtime/child-slots.cjs +29 -16
- package/dist/cjs/runtime/commit.cjs +3 -1
- package/dist/cjs/runtime/component-slots.cjs +26 -15
- package/dist/cjs/runtime/context.cjs +14 -9
- package/dist/cjs/runtime/deopt.cjs +78 -82
- package/dist/cjs/runtime/drivers.cjs +25 -0
- package/dist/cjs/runtime/elements.cjs +5 -5
- package/dist/cjs/runtime/forms.cjs +12 -13
- package/dist/cjs/runtime/hydrate-boundary.cjs +1 -1
- package/dist/cjs/runtime/hydration-presentation.cjs +3 -2
- package/dist/cjs/runtime/hydration.cjs +24 -21
- package/dist/cjs/runtime/lists.cjs +5 -4
- package/dist/cjs/runtime/portals.cjs +2 -2
- package/dist/cjs/runtime/refs.cjs +4 -0
- package/dist/cjs/runtime/render.cjs +3 -3
- package/dist/cjs/runtime/roots.cjs +1 -1
- package/dist/cjs/runtime/signal-bindings.cjs +29 -38
- package/dist/cjs/runtime/signal-owners.cjs +3 -3
- package/dist/cjs/runtime/suspense.cjs +36 -97
- package/dist/cjs/runtime/templates.cjs +4 -3
- package/dist/cjs/runtime.cjs +2 -0
- package/dist/cjs/runtime.server.cjs +1 -13
- package/dist/cjs/signals/actions.cjs +3 -2
- package/dist/cjs/signals/computations.cjs +4 -3
- package/dist/cjs/signals/control-binding.cjs +2 -5
- package/dist/cjs/signals/engine.cjs +2 -1
- package/dist/cjs/signals/facade.cjs +1 -1
- package/dist/cjs/signals/graph.cjs +3 -7
- package/dist/cjs/signals/handle-protocol.cjs +5 -0
- package/dist/cjs/signals/requests.cjs +2 -1
- package/dist/cjs/signals/scalar-computations.cjs +2 -1
- package/dist/cjs/stream-protocol.cjs +5 -3
- package/dist/cjs/streamed-signals-protocol.cjs +7 -20
- package/dist/cjs/version.cjs +1 -1
- package/dist/compiler/compile.js +62 -58
- package/dist/compiler/template-ir.js +102 -0
- package/dist/data-encoding.d.ts +4 -0
- package/dist/data-encoding.js +16 -0
- package/dist/dom-binding-program.js +1 -3
- package/dist/dom-binding-signals.d.ts +2 -2
- package/dist/dom-binding-signals.js +3 -4
- package/dist/dom-tables.d.ts +1 -0
- package/dist/dom-tables.js +13 -0
- package/dist/error-codes.client.generated.d.ts +11 -0
- package/dist/error-codes.client.generated.js +43 -0
- package/dist/error-codes.server.generated.d.ts +11 -0
- package/dist/error-codes.server.generated.js +43 -0
- package/dist/independent-hydration-protocol.js +5 -18
- package/dist/node/behavior-root.js +12 -13
- package/dist/node/data-encoding.js +16 -0
- package/dist/node/dom-binding-program.js +1 -3
- package/dist/node/dom-binding-signals.js +3 -4
- package/dist/node/dom-tables.js +13 -0
- package/dist/node/error-codes.client.generated.js +43 -0
- package/dist/node/error-codes.server.generated.js +43 -0
- package/dist/node/independent-hydration-protocol.js +5 -18
- package/dist/node/owner-kernel/hooks.js +0 -4
- package/dist/node/radio-group.js +5 -1
- package/dist/node/runtime/block.js +5 -5
- package/dist/node/runtime/branches.js +2 -21
- package/dist/node/runtime/child-slots.js +31 -22
- package/dist/node/runtime/commit.js +3 -1
- package/dist/node/runtime/component-slots.js +32 -24
- package/dist/node/runtime/context.js +19 -9
- package/dist/node/runtime/deopt.js +77 -82
- package/dist/node/runtime/drivers.js +29 -0
- package/dist/node/runtime/elements.js +4 -6
- package/dist/node/runtime/forms.js +4 -5
- package/dist/node/runtime/hydrate-boundary.js +2 -5
- package/dist/node/runtime/hydration-presentation.js +1 -2
- package/dist/node/runtime/hydration.js +14 -10
- package/dist/node/runtime/lists.js +5 -4
- package/dist/node/runtime/portals.js +3 -3
- package/dist/node/runtime/refs.js +3 -0
- package/dist/node/runtime/render.js +11 -7
- package/dist/node/runtime/roots.js +1 -1
- package/dist/node/runtime/signal-bindings.js +3 -11
- package/dist/node/runtime/signal-owners.js +3 -3
- package/dist/node/runtime/suspense.js +36 -97
- package/dist/node/runtime/templates.js +2 -1
- package/dist/node/runtime.js +2 -0
- package/dist/node/runtime.server.js +1 -13
- package/dist/node/signals/actions.js +2 -9
- package/dist/node/signals/computations.js +1 -1
- package/dist/node/signals/control-binding.js +3 -6
- package/dist/node/signals/engine.js +1 -1
- package/dist/node/signals/facade.js +1 -2
- package/dist/node/signals/graph.js +1 -4
- package/dist/node/signals/handle-protocol.js +4 -0
- package/dist/node/signals/requests.js +1 -1
- package/dist/node/signals/scalar-computations.js +1 -1
- package/dist/node/stream-protocol.js +4 -3
- package/dist/node/streamed-signals-protocol.js +1 -14
- package/dist/node/universal-core.js +1 -1
- package/dist/node/version.js +1 -1
- package/dist/owner-kernel/hooks.d.ts +0 -1
- package/dist/owner-kernel/hooks.js +0 -4
- package/dist/radio-group.d.ts +2 -0
- package/dist/radio-group.js +5 -1
- package/dist/runtime/block.js +5 -5
- package/dist/runtime/branches.js +2 -21
- package/dist/runtime/child-slots.js +31 -22
- package/dist/runtime/commit.d.ts +5 -4
- package/dist/runtime/commit.js +3 -1
- package/dist/runtime/component-slots.d.ts +3 -0
- package/dist/runtime/component-slots.js +32 -24
- package/dist/runtime/context.d.ts +9 -1
- package/dist/runtime/context.js +19 -9
- package/dist/runtime/deopt.d.ts +16 -5
- package/dist/runtime/deopt.js +77 -82
- package/dist/runtime/drivers.d.ts +32 -0
- package/dist/runtime/drivers.js +29 -0
- package/dist/runtime/elements.d.ts +4 -0
- package/dist/runtime/elements.js +4 -6
- package/dist/runtime/forms.js +4 -5
- package/dist/runtime/hydrate-boundary.js +2 -5
- package/dist/runtime/hydration-presentation.js +1 -2
- package/dist/runtime/hydration.d.ts +1 -3
- package/dist/runtime/hydration.js +14 -10
- package/dist/runtime/lists.js +5 -4
- package/dist/runtime/portals.js +3 -3
- package/dist/runtime/refs.d.ts +1 -0
- package/dist/runtime/refs.js +3 -0
- package/dist/runtime/render.js +11 -7
- package/dist/runtime/roots.js +1 -1
- package/dist/runtime/signal-bindings.d.ts +1 -3
- package/dist/runtime/signal-bindings.js +3 -11
- package/dist/runtime/signal-owners.js +3 -3
- package/dist/runtime/suspense.js +36 -97
- package/dist/runtime/templates.js +2 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +2 -0
- package/dist/runtime.server.js +1 -13
- package/dist/signals/actions.js +2 -9
- package/dist/signals/computations.js +1 -1
- package/dist/signals/control-binding.js +3 -6
- package/dist/signals/engine.js +1 -1
- package/dist/signals/facade.js +1 -2
- package/dist/signals/graph.d.ts +0 -1
- package/dist/signals/graph.js +1 -4
- package/dist/signals/handle-protocol.d.ts +1 -1
- package/dist/signals/handle-protocol.js +4 -0
- package/dist/signals/requests.js +1 -1
- package/dist/signals/scalar-computations.js +1 -1
- package/dist/stream-protocol.d.ts +2 -0
- package/dist/stream-protocol.js +4 -3
- package/dist/streamed-signals-protocol.js +1 -14
- package/dist/universal-core.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -53,11 +53,13 @@ var import_engine = require("./engine.cjs");
|
|
|
53
53
|
var import_use = require("./use.cjs");
|
|
54
54
|
var import_context = require("./context.cjs");
|
|
55
55
|
var import_hydration = require("./hydration.cjs");
|
|
56
|
+
var import_stream_protocol = require("../stream-protocol.cjs");
|
|
56
57
|
var import_portals = require("./portals.cjs");
|
|
57
58
|
var import_block = require("./block.cjs");
|
|
58
59
|
var import_render = require("./render.cjs");
|
|
59
60
|
var import_hydration_presentation = require("./hydration-presentation.cjs");
|
|
60
61
|
var import_signal_bindings = require("./signal-bindings.cjs");
|
|
62
|
+
var import_handle_protocol = require("../signals/handle-protocol.cjs");
|
|
61
63
|
var import_host_props = require("./host-props.cjs");
|
|
62
64
|
var import_elements = require("./elements.cjs");
|
|
63
65
|
var import_diagnostics = require("./diagnostics.cjs");
|
|
@@ -388,6 +390,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
388
390
|
break;
|
|
389
391
|
}
|
|
390
392
|
const elementType = (0, import_elements.isElementDescriptor)(value) ? value.type : void 0;
|
|
393
|
+
const hostDriver = typeof elementType === "string" && import_drivers.HOST_DESCRIPTORS ? import_drivers.HOST_DESCRIPTORS : null;
|
|
391
394
|
const valueComponent = typeof value === "function" ? value : typeof elementType === "function" ? elementType : null;
|
|
392
395
|
const hydrationTransparent = hydration?.passthroughRanges === true && valueComponent?.[import_constants.HYDRATION_RANGE_BOUNDARY] !== "owner";
|
|
393
396
|
const passthroughOwner = hydration?.passthroughRanges === true && !hydrationTransparent;
|
|
@@ -396,10 +399,10 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
396
399
|
if (iterable !== null) value = iterable;
|
|
397
400
|
const preparedList = compiledMapBody !== void 0 ? { items: value, keys: null } : (0, import_deopt.prepareDeoptList)(value, false, includeKeyedSingle, elementType);
|
|
398
401
|
let state = parentScope.slots[slotKey];
|
|
399
|
-
const pureHost = preparedList === null &&
|
|
402
|
+
const pureHost = preparedList === null && hostDriver !== null && state?.currentComp !== hostDriver.body && !(0, import_deopt.descNeedsBlocks)(value.children);
|
|
400
403
|
let rootShapeChanged = false;
|
|
401
404
|
if (state !== void 0 && import_render.ROOT_RENDER_TRANSACTION !== null) {
|
|
402
|
-
const component = pureHost || preparedList !== null ? null :
|
|
405
|
+
const component = pureHost || preparedList !== null ? null : hostDriver !== null ? hostDriver.body : valueComponent;
|
|
403
406
|
const unchangedList = preparedList !== null && state.forSlot !== null;
|
|
404
407
|
const unchangedComponent = state.block !== null && component !== null && (component === state.currentComp || typeof value === "function" && state.currentIsBodyFn && (0, import_component_slots.sameRenderBody)(state.currentComp, component));
|
|
405
408
|
const unchangedHost = pureHost && state.hostNode !== null && state.block === null && state.hostNode.nodeType === 1 && (0, import_host_props.isHostElementOfType)(state.hostNode, elementType);
|
|
@@ -431,13 +434,13 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
431
434
|
start = parentBlock.startMarker;
|
|
432
435
|
end = parentBlock.endMarker;
|
|
433
436
|
adoptedRange = hydration !== null;
|
|
434
|
-
} else if (hydration !== null && (0,
|
|
437
|
+
} else if (hydration !== null && (0, import_stream_protocol.isBlockOpen)(anchor ?? null)) {
|
|
435
438
|
start = anchor;
|
|
436
439
|
end = hydration.close(start);
|
|
437
440
|
if (parentBlock === hydration.rootBlock) hydration.rootClaimed = true;
|
|
438
441
|
hydration.node = (0, import_templates.getNextSibling)(start);
|
|
439
442
|
adoptedRange = true;
|
|
440
|
-
} else if (hydration !== null && (0,
|
|
443
|
+
} else if (hydration !== null && (0, import_stream_protocol.isBlockOpen)(hydration.node)) {
|
|
441
444
|
start = hydration.node;
|
|
442
445
|
end = hydration.close(hydration.node);
|
|
443
446
|
if (parentBlock === hydration.rootBlock) hydration.rootClaimed = true;
|
|
@@ -524,7 +527,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
524
527
|
const end = document.createComment("");
|
|
525
528
|
const host = state.hostNode;
|
|
526
529
|
const p = host === null ? null : host.parentNode;
|
|
527
|
-
const adopts = hydration === null && preparedList === null && host !== null &&
|
|
530
|
+
const adopts = hydration === null && preparedList === null && host !== null && hostDriver !== null && hostDriver.adopts(host, value, domParent);
|
|
528
531
|
if (p !== null && !adopts && import_render.ROOT_RENDER_TRANSACTION !== null && (0, import_commit.usesFrontier)(parentBlock, p)) {
|
|
529
532
|
const frag = (0, import_commit.slotFrontier)(state, parentBlock, p, null);
|
|
530
533
|
frag.append(start, end);
|
|
@@ -536,7 +539,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
536
539
|
state.hostNode = null;
|
|
537
540
|
domParent = frag;
|
|
538
541
|
} else if (p !== null && adopts && import_render.ROOT_RENDER_TRANSACTION !== null && (0, import_commit.usesFrontier)(parentBlock, p)) {
|
|
539
|
-
import_render.ROOT_RENDER_TRANSACTION.ops.push(
|
|
542
|
+
import_render.ROOT_RENDER_TRANSACTION.ops.push(hostDriver.landPair, [host, start, end, parentBlock]);
|
|
540
543
|
} else if (p !== null) {
|
|
541
544
|
p.insertBefore(start, host);
|
|
542
545
|
p.insertBefore(end, (0, import_templates.getNextSibling)(host));
|
|
@@ -611,12 +614,17 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
611
614
|
let isBodyFn = false;
|
|
612
615
|
let invocationSite;
|
|
613
616
|
let componentDescriptor = null;
|
|
614
|
-
if (
|
|
617
|
+
if (hostDriver !== null) {
|
|
615
618
|
if (pureHost) {
|
|
616
619
|
if (state.block !== null || state.text !== null) (0, import_component_slots.clearChildContent)(state);
|
|
617
620
|
if (state.end === null) {
|
|
618
621
|
const prev2 = state.hostNode;
|
|
619
|
-
const node2 =
|
|
622
|
+
const node2 = hostDriver.reconcile(
|
|
623
|
+
prev2,
|
|
624
|
+
value,
|
|
625
|
+
parentBlock,
|
|
626
|
+
(0, import_host_props.deoptChildNamespace)(domParent)
|
|
627
|
+
);
|
|
620
628
|
if (node2 !== prev2) {
|
|
621
629
|
const parent = prev2 === null ? null : prev2.parentNode;
|
|
622
630
|
if (import_render.ROOT_RENDER_TRANSACTION !== null && (0, import_commit.usesFrontier)(parentBlock, parent ?? domParent)) {
|
|
@@ -652,7 +660,12 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
652
660
|
prev = (0, import_templates.getNextSibling)(state.start);
|
|
653
661
|
if (prev === state.end) prev = null;
|
|
654
662
|
}
|
|
655
|
-
const node =
|
|
663
|
+
const node = hostDriver.reconcile(
|
|
664
|
+
prev,
|
|
665
|
+
value,
|
|
666
|
+
parentBlock,
|
|
667
|
+
(0, import_host_props.deoptChildNamespace)(domParent)
|
|
668
|
+
);
|
|
656
669
|
if (node !== prev) {
|
|
657
670
|
if (prev != null && prev !== node && prev.parentNode !== null) {
|
|
658
671
|
if (import_render.ROOT_RENDER_TRANSACTION !== null) {
|
|
@@ -678,7 +691,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
678
691
|
state.hostNode = node;
|
|
679
692
|
return;
|
|
680
693
|
}
|
|
681
|
-
comp =
|
|
694
|
+
comp = hostDriver.body;
|
|
682
695
|
props = value;
|
|
683
696
|
invocationSite = import_signal_owners.RENDERER_INVOCATION_SITE;
|
|
684
697
|
} else if (typeof value === "function") {
|
|
@@ -712,10 +725,10 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
712
725
|
return;
|
|
713
726
|
}
|
|
714
727
|
if (state.block !== null && comp === state.currentComp) {
|
|
715
|
-
if ((0,
|
|
728
|
+
if (import_drivers.MEMO_BAIL && (0, import_drivers.MEMO_BAIL)(state.block, comp, props)) return;
|
|
716
729
|
if (props === state.block.props && // Deferred host shells can change their complete record or children.
|
|
717
730
|
// Compare the accepted resolution before accepting the shell's identity.
|
|
718
|
-
(
|
|
731
|
+
(hostDriver === null || hostDriver.unchanged(state.block, props)) && (0, import_component_slots.tryImplicitBail)(state.block))
|
|
719
732
|
return;
|
|
720
733
|
if (state.block.props !== props) (0, import_engine.journalRootProperty)(state.block, "props", state.block.props);
|
|
721
734
|
state.block.props = props;
|
|
@@ -741,7 +754,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
741
754
|
component: isBodyFn ? void 0 : comp,
|
|
742
755
|
key: void 0
|
|
743
756
|
};
|
|
744
|
-
if (hydration === null && import_render.ROOT_RENDER_TRANSACTION !== null &&
|
|
757
|
+
if (hydration === null && import_render.ROOT_RENDER_TRANSACTION !== null && hostDriver !== null && state.block === null && state.hostNode !== null && hostDriver.adopts(state.hostNode, props, domParent)) {
|
|
745
758
|
const el = state.hostNode;
|
|
746
759
|
state.hostNode = null;
|
|
747
760
|
state.currentComp = comp;
|
|
@@ -850,7 +863,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
850
863
|
import_block.renderReturnedValue
|
|
851
864
|
);
|
|
852
865
|
if (signalInstanceKey !== void 0) (0, import_signal_owners.stampSignalInstanceKey)(b, signalInstanceKey);
|
|
853
|
-
if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__ &&
|
|
866
|
+
if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__ && hostDriver === null)
|
|
854
867
|
(0, import_profiling.__profileTrackComponent)(b, !isBodyFn || (0, import_profiling.__profileHasComponentMetadata)(comp) ? comp : null);
|
|
855
868
|
if (state.borrowed) b.exclusiveMarkers = true;
|
|
856
869
|
if (!isBodyFn || (0, import_component_slots.isChildrenBlock)(comp)) {
|
|
@@ -860,7 +873,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
|
|
|
860
873
|
state.block = b;
|
|
861
874
|
if (hydratingUpdate) {
|
|
862
875
|
hydration.renderUpdate(b);
|
|
863
|
-
} else if (adoptedRange && !passthroughOwner &&
|
|
876
|
+
} else if (adoptedRange && !passthroughOwner && hostDriver === null) {
|
|
864
877
|
hydration.renderClaimed(b, parentScope, slotKey);
|
|
865
878
|
} else {
|
|
866
879
|
(0, import_signal_owners.renderBlock)(b);
|
|
@@ -1047,7 +1060,7 @@ function childTextHole(parentScope, slotKey, domParent, value, cachedNode) {
|
|
|
1047
1060
|
if ((0, import_host_props.dangerouslySetInnerHTMLOwnsChild)(domParent, value)) return null;
|
|
1048
1061
|
let vt = typeof value;
|
|
1049
1062
|
const state = parentScope.slots[slotKey];
|
|
1050
|
-
if (state === void 0 && (vt === "object" || vt === "function") && domParent.nodeType === 1 && domParent.localName === "textarea" && domParent.namespaceURI === import_host_props.HTML_NS && !(0,
|
|
1063
|
+
if (state === void 0 && (vt === "object" || vt === "function") && domParent.nodeType === 1 && domParent.localName === "textarea" && domParent.namespaceURI === import_host_props.HTML_NS && !(0, import_handle_protocol.isSignalHandle)(value)) {
|
|
1051
1064
|
value = (0, import_shared_value_helpers.textareaChildText)(value, import_templates.rejectTextareaChild);
|
|
1052
1065
|
vt = "string";
|
|
1053
1066
|
}
|
|
@@ -794,7 +794,9 @@ function activeElementForDocument(doc) {
|
|
|
794
794
|
if (focused.localName === "iframe") {
|
|
795
795
|
let nested;
|
|
796
796
|
try {
|
|
797
|
-
|
|
797
|
+
const frameWindow = focused.contentWindow;
|
|
798
|
+
if (frameWindow === null || typeof frameWindow.location.href !== "string") break;
|
|
799
|
+
nested = frameWindow.document;
|
|
798
800
|
} catch {
|
|
799
801
|
break;
|
|
800
802
|
}
|
|
@@ -34,6 +34,7 @@ __export(component_slots_exports, {
|
|
|
34
34
|
componentSlotFunction: () => componentSlotFunction,
|
|
35
35
|
componentSlotImpl: () => componentSlotImpl,
|
|
36
36
|
componentSlotVoid: () => componentSlotVoid,
|
|
37
|
+
ctxBailDepsClean: () => ctxBailDepsClean,
|
|
37
38
|
ctxDirectChanged: () => ctxDirectChanged,
|
|
38
39
|
descriptorChildren: () => descriptorChildren,
|
|
39
40
|
discardOffscreenCapture: () => discardOffscreenCapture,
|
|
@@ -51,6 +52,8 @@ __export(component_slots_exports, {
|
|
|
51
52
|
refreshBlockForContext: () => refreshBlockForContext,
|
|
52
53
|
renderFrontierBlock: () => renderFrontierBlock,
|
|
53
54
|
restampCachedContextScope: () => restampCachedContextScope,
|
|
55
|
+
restampCachedSlotContext: () => restampCachedSlotContext,
|
|
56
|
+
restampCtxDeps: () => restampCtxDeps,
|
|
54
57
|
sameRenderBody: () => sameRenderBody,
|
|
55
58
|
spliceOffscreenCapture: () => spliceOffscreenCapture,
|
|
56
59
|
tryImplicitBail: () => tryImplicitBail,
|
|
@@ -388,7 +391,6 @@ function componentSlot(parentScope, slotKey, domParent, comp, props, invocationS
|
|
|
388
391
|
if (!activity && typeof comp !== "function" && typeof comp !== "string") {
|
|
389
392
|
throw (0, import_elements.invalidElementTypeError)(comp);
|
|
390
393
|
}
|
|
391
|
-
if (typeof comp === "string" && !import_deopt.DESCRIPTOR_HOST_PROPS) (0, import_deopt.enableHostDescriptors)();
|
|
392
394
|
const body = activity ? dispatch.body : typeof comp === "string" ? import_deopt.hostStringTagBody : comp;
|
|
393
395
|
if (activity) {
|
|
394
396
|
singleRoot = false;
|
|
@@ -721,7 +723,7 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
|
|
|
721
723
|
else (0, import_signal_owners.renderBlock)(b);
|
|
722
724
|
}
|
|
723
725
|
} else if (state.block) {
|
|
724
|
-
if (
|
|
726
|
+
if (import_drivers.MEMO_BAIL && (0, import_drivers.MEMO_BAIL)(state.block, identity, props)) return;
|
|
725
727
|
if (state.block.props !== renderProps)
|
|
726
728
|
(0, import_engine.journalRootProperty)(state.block, "props", state.block.props);
|
|
727
729
|
state.block.props = renderProps;
|
|
@@ -1092,8 +1094,10 @@ function tryMemoBail(block, comp, props) {
|
|
|
1092
1094
|
const compare = comp.__compare;
|
|
1093
1095
|
const equal = compare ? comp[LAZY_BODY_CHECK] !== void 0 ? compare(block.props, props, block) : compare(block.props, props) : shallowEqualProps(block.props, props);
|
|
1094
1096
|
if (!equal) return false;
|
|
1095
|
-
if (
|
|
1096
|
-
|
|
1097
|
+
if (import_context.CONTEXT_DEPENDENCIES) {
|
|
1098
|
+
if (!import_context.CONTEXT_DEPENDENCIES.clean(block)) return false;
|
|
1099
|
+
import_context.CONTEXT_DEPENDENCIES.restamp(block);
|
|
1100
|
+
}
|
|
1097
1101
|
(0, import_render.reconnectBailedEffects)(block);
|
|
1098
1102
|
if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
|
|
1099
1103
|
(0, import_profiling.__profileBail)(block, comp, "memo-bailout");
|
|
@@ -1104,8 +1108,10 @@ function tryImplicitBail(block) {
|
|
|
1104
1108
|
if (!block.mounted || block.renderStatus !== import_block.RENDER_VALID) return false;
|
|
1105
1109
|
const checkLazyBody = block.body[LAZY_BODY_CHECK];
|
|
1106
1110
|
if (checkLazyBody !== void 0 && !checkLazyBody(block)) return false;
|
|
1107
|
-
if (
|
|
1108
|
-
|
|
1111
|
+
if (import_context.CONTEXT_DEPENDENCIES) {
|
|
1112
|
+
if (!import_context.CONTEXT_DEPENDENCIES.clean(block)) return false;
|
|
1113
|
+
import_context.CONTEXT_DEPENDENCIES.restamp(block);
|
|
1114
|
+
}
|
|
1109
1115
|
(0, import_render.reconnectBailedEffects)(block);
|
|
1110
1116
|
if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
|
|
1111
1117
|
(0, import_profiling.__profileBail)(block, block.body, "implicit-bailout");
|
|
@@ -1202,7 +1208,7 @@ function refreshBlockForContext(block) {
|
|
|
1202
1208
|
}
|
|
1203
1209
|
function refreshCachedBlock(block, contextChanged) {
|
|
1204
1210
|
if (block.renderStatus !== import_block.RENDER_VALID) (0, import_signal_owners.renderBlock)(block);
|
|
1205
|
-
else if (contextChanged)
|
|
1211
|
+
else if (import_context.CONTEXT_DEPENDENCIES && contextChanged) import_context.CONTEXT_DEPENDENCIES.refresh(block);
|
|
1206
1212
|
}
|
|
1207
1213
|
function compilerCacheContext(scope, slotKey, previous, restampMemoAncestors = false) {
|
|
1208
1214
|
const current = import_context_epoch.EPOCH_CELL.value;
|
|
@@ -1232,22 +1238,23 @@ function compilerCacheContext(scope, slotKey, previous, restampMemoAncestors = f
|
|
|
1232
1238
|
if (reconnect) (0, import_render.reconnectBailedEffects)(block);
|
|
1233
1239
|
}
|
|
1234
1240
|
}
|
|
1235
|
-
if (restamp)
|
|
1241
|
+
if (import_context.CONTEXT_DEPENDENCIES && restamp) import_context.CONTEXT_DEPENDENCIES.restampSlot(slot);
|
|
1236
1242
|
return current;
|
|
1237
1243
|
}
|
|
1238
|
-
if (previous !== current) {
|
|
1244
|
+
if (import_context.CONTEXT_DEPENDENCIES && previous !== current) {
|
|
1245
|
+
const refresh = import_context.CONTEXT_DEPENDENCIES.refresh;
|
|
1239
1246
|
if (slot.__kind === "forBlockSlot") {
|
|
1240
|
-
for (const item of slot.items.values())
|
|
1241
|
-
if (slot.emptyBlock)
|
|
1247
|
+
for (const item of slot.items.values()) refresh(item);
|
|
1248
|
+
if (slot.emptyBlock) refresh(slot.emptyBlock);
|
|
1242
1249
|
} else if (slot.block) {
|
|
1243
|
-
|
|
1250
|
+
refresh(slot.block);
|
|
1244
1251
|
} else if (slot.__kind === "childSlot" && slot.forSlot) {
|
|
1245
|
-
for (const item of slot.forSlot.items.values())
|
|
1252
|
+
for (const item of slot.forSlot.items.values()) refresh(item);
|
|
1246
1253
|
} else if (slot.__kind === "childSlot" && slot.portal?.block) {
|
|
1247
|
-
|
|
1254
|
+
refresh(slot.portal.block);
|
|
1248
1255
|
}
|
|
1249
1256
|
}
|
|
1250
|
-
if (restamp)
|
|
1257
|
+
if (import_context.CONTEXT_DEPENDENCIES && restamp) import_context.CONTEXT_DEPENDENCIES.restampSlot(slot);
|
|
1251
1258
|
return current;
|
|
1252
1259
|
}
|
|
1253
1260
|
function compilerOpaqueTag(scope, tag) {
|
|
@@ -1306,6 +1313,7 @@ const MEMO_DEFAULT_PROPS_DESCRIPTOR = {
|
|
|
1306
1313
|
};
|
|
1307
1314
|
// @__NO_SIDE_EFFECTS__
|
|
1308
1315
|
function memo(component, arePropsEqual) {
|
|
1316
|
+
(0, import_drivers.installMemoBail)(tryMemoBail);
|
|
1309
1317
|
function memoWrapper(props, scope, extra) {
|
|
1310
1318
|
if (scope === import_render.CURRENT_SCOPE && scope !== null && !scope.block.memoInChain && scope.block.body === memoWrapper)
|
|
1311
1319
|
(0, import_context.promoteMemoAncestry)(scope);
|
|
@@ -1408,6 +1416,7 @@ function hmr(fn) {
|
|
|
1408
1416
|
componentSlotFunction,
|
|
1409
1417
|
componentSlotImpl,
|
|
1410
1418
|
componentSlotVoid,
|
|
1419
|
+
ctxBailDepsClean,
|
|
1411
1420
|
ctxDirectChanged,
|
|
1412
1421
|
descriptorChildren,
|
|
1413
1422
|
discardOffscreenCapture,
|
|
@@ -1425,6 +1434,8 @@ function hmr(fn) {
|
|
|
1425
1434
|
refreshBlockForContext,
|
|
1426
1435
|
renderFrontierBlock,
|
|
1427
1436
|
restampCachedContextScope,
|
|
1437
|
+
restampCachedSlotContext,
|
|
1438
|
+
restampCtxDeps,
|
|
1428
1439
|
sameRenderBody,
|
|
1429
1440
|
spliceOffscreenCapture,
|
|
1430
1441
|
tryImplicitBail,
|
|
@@ -19,11 +19,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var context_exports = {};
|
|
20
20
|
__export(context_exports, {
|
|
21
21
|
CONTEXT_CHILD: () => CONTEXT_CHILD,
|
|
22
|
+
CONTEXT_DEPENDENCIES: () => CONTEXT_DEPENDENCIES,
|
|
22
23
|
CompiledContext: () => CompiledContext,
|
|
23
24
|
DEFAULT_CTX: () => DEFAULT_CTX,
|
|
24
25
|
RENDERER_REGION_OWNER_COUNT: () => RENDERER_REGION_OWNER_COUNT,
|
|
25
26
|
SHARED_BODY_SCOPE: () => SHARED_BODY_SCOPE,
|
|
26
|
-
SKIPPED_ROW_REFRESH: () => SKIPPED_ROW_REFRESH,
|
|
27
27
|
__createCompiledContext: () => __createCompiledContext,
|
|
28
28
|
bindRendererRegionOwner: () => bindRendererRegionOwner,
|
|
29
29
|
compilerOwnsContextProvider: () => compilerOwnsContextProvider,
|
|
@@ -71,7 +71,7 @@ var import_lists = require("./lists.cjs");
|
|
|
71
71
|
var import_commit = require("./commit.cjs");
|
|
72
72
|
var import_templates = require("./templates.cjs");
|
|
73
73
|
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
74
|
-
let
|
|
74
|
+
let CONTEXT_DEPENDENCIES = null;
|
|
75
75
|
let CONTEXT_CHILD = null;
|
|
76
76
|
const RENDERER_REGION_DOM_OWNERS = /* @__PURE__ */ new WeakMap();
|
|
77
77
|
let RENDERER_REGION_OWNER_COUNT = 0;
|
|
@@ -275,7 +275,7 @@ function use(usable) {
|
|
|
275
275
|
}
|
|
276
276
|
function useForeignContext(usable, api) {
|
|
277
277
|
if (usable !== null && typeof usable === "object") {
|
|
278
|
-
const bridge = rendererRegionOwnerForBlock(import_render.CURRENT_BLOCK);
|
|
278
|
+
const bridge = RENDERER_REGION_OWNER_COUNT ? rendererRegionOwnerForBlock(import_render.CURRENT_BLOCK) : null;
|
|
279
279
|
const mirror = bridge?.resolveForeignContext?.(usable);
|
|
280
280
|
if (mirror != null) return useContextInternal(mirror);
|
|
281
281
|
if (usable.$$typeof === import_runtime_tags.REACT_CONTEXT_TAG) {
|
|
@@ -295,7 +295,6 @@ function useContext(context) {
|
|
|
295
295
|
}
|
|
296
296
|
const DEFAULT_CTX = /* @__PURE__ */ Symbol("octane.ctx.default");
|
|
297
297
|
function rendererRegionOwnerForBlock(block) {
|
|
298
|
-
if (RENDERER_REGION_OWNER_COUNT === 0) return null;
|
|
299
298
|
let current = block;
|
|
300
299
|
while (current !== null && current.parentBlock !== null) current = current.parentBlock;
|
|
301
300
|
if (current === null) return null;
|
|
@@ -303,7 +302,6 @@ function rendererRegionOwnerForBlock(block) {
|
|
|
303
302
|
return bridge !== void 0 && bridge.active ? bridge : null;
|
|
304
303
|
}
|
|
305
304
|
function rendererRegionTryHandler(block) {
|
|
306
|
-
if (RENDERER_REGION_OWNER_COUNT === 0) return null;
|
|
307
305
|
const bridge = rendererRegionOwnerForBlock(block);
|
|
308
306
|
if (bridge === null) return null;
|
|
309
307
|
return (error) => {
|
|
@@ -378,7 +376,14 @@ function findDirectContextRead(direct, context) {
|
|
|
378
376
|
}
|
|
379
377
|
function recordContextDependency(block, context) {
|
|
380
378
|
if (block === null || !block.memoInChain) return;
|
|
381
|
-
|
|
379
|
+
CONTEXT_DEPENDENCIES ??= {
|
|
380
|
+
clean: import_component_slots.ctxBailDepsClean,
|
|
381
|
+
restamp: import_component_slots.restampCtxDeps,
|
|
382
|
+
directChanged: import_component_slots.ctxDirectChanged,
|
|
383
|
+
refresh: import_component_slots.refreshBlockForContext,
|
|
384
|
+
restampSlot: import_component_slots.restampCachedSlotContext,
|
|
385
|
+
skippedRows: import_lists.refreshSkippedRows
|
|
386
|
+
};
|
|
382
387
|
const direct = findDirectContextRead(block.$$ctxDirect, context);
|
|
383
388
|
const previous = direct?.read;
|
|
384
389
|
if (direct === null) {
|
|
@@ -532,7 +537,7 @@ function readContextFrom(reader, block, context) {
|
|
|
532
537
|
const hit = cache === context ? reader.$$ctxCacheOwner : cache !== null && reader.$$ctxCacheOwner === null ? cache.get(context) : void 0;
|
|
533
538
|
if (hit !== null && hit !== void 0) {
|
|
534
539
|
if (hit === DEFAULT_CTX) {
|
|
535
|
-
const bridge2 = rendererRegionOwnerForBlock(block);
|
|
540
|
+
const bridge2 = RENDERER_REGION_OWNER_COUNT ? rendererRegionOwnerForBlock(block) : null;
|
|
536
541
|
return bridge2 === null ? context.defaultValue : bridge2.readContext(context);
|
|
537
542
|
}
|
|
538
543
|
return hit.$$ctxValues.get(context);
|
|
@@ -556,7 +561,7 @@ function readContextFrom(reader, block, context) {
|
|
|
556
561
|
}
|
|
557
562
|
current = current.parentBlock;
|
|
558
563
|
}
|
|
559
|
-
const bridge = rendererRegionOwnerForBlock(block);
|
|
564
|
+
const bridge = RENDERER_REGION_OWNER_COUNT ? rendererRegionOwnerForBlock(block) : null;
|
|
560
565
|
if (bridge !== null) return bridge.readContext(context);
|
|
561
566
|
cacheContextOwner(reader, context, DEFAULT_CTX);
|
|
562
567
|
return context.defaultValue;
|
|
@@ -591,11 +596,11 @@ function useContextInternal(context) {
|
|
|
591
596
|
// Annotate the CommonJS export names for ESM import in node:
|
|
592
597
|
0 && (module.exports = {
|
|
593
598
|
CONTEXT_CHILD,
|
|
599
|
+
CONTEXT_DEPENDENCIES,
|
|
594
600
|
CompiledContext,
|
|
595
601
|
DEFAULT_CTX,
|
|
596
602
|
RENDERER_REGION_OWNER_COUNT,
|
|
597
603
|
SHARED_BODY_SCOPE,
|
|
598
|
-
SKIPPED_ROW_REFRESH,
|
|
599
604
|
__createCompiledContext,
|
|
600
605
|
bindRendererRegionOwner,
|
|
601
606
|
compilerOwnsContextProvider,
|