octane 0.6.2 → 0.7.0
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/cjs/constants.cjs +3 -0
- package/dist/cjs/dom-binding-handoff.cjs +2 -1
- package/dist/cjs/dom-binding-protocol.cjs +4 -3
- package/dist/cjs/dom-binding-styles.cjs +3 -2
- package/dist/cjs/dom-bindings.cjs +24 -23
- package/dist/cjs/error-codes.client.generated.cjs +7 -1
- package/dist/cjs/error-codes.server.generated.cjs +27 -1
- package/dist/cjs/hydration/event-capture.cjs +2 -1
- package/dist/cjs/independent-hydration-protocol.cjs +3 -2
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/runtime.cjs +866 -370
- package/dist/cjs/runtime.server.cjs +250 -62
- package/dist/cjs/server/index.cjs +2 -0
- package/dist/cjs/server/rpc-stream.cjs +19 -12
- package/dist/cjs/server/streamed-signals.cjs +18 -1
- package/dist/cjs/shared-value-helpers.cjs +24 -2
- package/dist/cjs/signals/control-binding.cjs +7 -6
- package/dist/cjs/signals/derived-facade.cjs +2 -1
- package/dist/cjs/signals/document-owner.cjs +4 -3
- package/dist/cjs/signals/facade.cjs +10 -9
- package/dist/cjs/signals/graph.cjs +5 -4
- package/dist/cjs/signals/native-read-client.cjs +4 -3
- package/dist/cjs/signals/owner-context.cjs +4 -3
- package/dist/cjs/signals/query-attempt-observer.cjs +2 -1
- package/dist/cjs/signals/query-facade.cjs +2 -1
- package/dist/cjs/signals/scalar-computations.cjs +2 -1
- package/dist/cjs/signals/transition-action.cjs +10 -9
- package/dist/cjs/signals/transition-candidate.cjs +2 -1
- package/dist/cjs/version.cjs +1 -1
- package/dist/compiler/arm-exits.js +151 -0
- package/dist/compiler/compile-universal.js +262 -65
- package/dist/compiler/compile.js +1929 -306
- package/dist/compiler/deferred-snapshots.js +791 -0
- package/dist/compiler/strong-mode.js +59 -10
- package/dist/constants.d.ts +5 -1
- package/dist/constants.js +2 -0
- package/dist/error-codes.client.generated.d.ts +1 -0
- package/dist/error-codes.client.generated.js +5 -0
- package/dist/error-codes.server.generated.d.ts +5 -0
- package/dist/error-codes.server.generated.js +25 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/node/aria-diagnostics.js +92 -0
- package/dist/node/behavior-form-submissions.js +228 -0
- package/dist/node/behavior-root-types.js +0 -0
- package/dist/node/behavior-root.js +746 -0
- package/dist/node/class-names.js +25 -0
- package/dist/node/compatibility.js +10 -0
- package/dist/node/component-flags.js +23 -0
- package/dist/node/constants.js +115 -0
- package/dist/node/context-epoch.js +13 -0
- package/dist/node/context-identity.js +46 -0
- package/dist/node/css.js +80 -0
- package/dist/node/data-encoding.js +134 -0
- package/dist/node/devtools-hook.js +229 -0
- package/dist/node/dom-binding-claims.js +4 -0
- package/dist/node/dom-binding-classes.js +152 -0
- package/dist/node/dom-binding-controls.js +6 -0
- package/dist/node/dom-binding-handoff.js +77 -0
- package/dist/node/dom-binding-program.js +1617 -0
- package/dist/node/dom-binding-projections.js +204 -0
- package/dist/node/dom-binding-protocol.js +130 -0
- package/dist/node/dom-binding-signals.js +135 -0
- package/dist/node/dom-binding-styles.js +280 -0
- package/dist/node/dom-bindings.js +1087 -0
- package/dist/node/dom-focused-move.js +46 -0
- package/dist/node/dom-stage.js +878 -0
- package/dist/node/dom-tables.js +382 -0
- package/dist/node/error-codes.client.generated.js +1071 -0
- package/dist/node/error-codes.server.generated.js +761 -0
- package/dist/node/error-message.js +27 -0
- package/dist/node/event-names.js +15 -0
- package/dist/node/form-diagnostics.js +96 -0
- package/dist/node/form-submission.js +43 -0
- package/dist/node/has-own.js +4 -0
- package/dist/node/head-ownership.js +31 -0
- package/dist/node/hook-slot-cache.js +91 -0
- package/dist/node/host-property-diagnostics.js +189 -0
- package/dist/node/html-tree-validation.js +193 -0
- package/dist/node/hydration/condition.js +15 -0
- package/dist/node/hydration/control-capture.js +237 -0
- package/dist/node/hydration/document-lifecycle.js +89 -0
- package/dist/node/hydration/event-capture.js +362 -0
- package/dist/node/hydration/idle.js +23 -0
- package/dist/node/hydration/independent-island.js +317 -0
- package/dist/node/hydration/index.js +74 -0
- package/dist/node/hydration/interaction-config.js +61 -0
- package/dist/node/hydration/interaction.js +35 -0
- package/dist/node/hydration/load.js +15 -0
- package/dist/node/hydration/media.js +33 -0
- package/dist/node/hydration/native-intent.js +68 -0
- package/dist/node/hydration/never.js +12 -0
- package/dist/node/hydration/stream-delivery.js +345 -0
- package/dist/node/hydration/stream-receiver.js +190 -0
- package/dist/node/hydration/stream-result-receiver.js +276 -0
- package/dist/node/hydration/streamed-signals.js +186 -0
- package/dist/node/hydration/types.js +0 -0
- package/dist/node/hydration/visible.js +69 -0
- package/dist/node/hydration-markers.js +44 -0
- package/dist/node/independent-hydration-protocol.js +91 -0
- package/dist/node/index.js +463 -0
- package/dist/node/internal/client.js +7 -0
- package/dist/node/internal/context.js +5 -0
- package/dist/node/internal/server.js +5 -0
- package/dist/node/internal/signal-read.js +4 -0
- package/dist/node/method-dep.js +25 -0
- package/dist/node/profiling.js +432 -0
- package/dist/node/public-types.js +0 -0
- package/dist/node/react/fiber-adapter.js +57 -0
- package/dist/node/react/index.js +397 -0
- package/dist/node/react/react-compat-envelope.js +78 -0
- package/dist/node/react/react-compat-server.js +129 -0
- package/dist/node/react/react-compat-shared.js +104 -0
- package/dist/node/react/react-compat.js +223 -0
- package/dist/node/react/server.js +81 -0
- package/dist/node/react/shared.js +75 -0
- package/dist/node/renderer-bridge.js +35 -0
- package/dist/node/resize-observer.js +105 -0
- package/dist/node/resource-hint-diagnostics.js +67 -0
- package/dist/node/runtime-tags.js +22 -0
- package/dist/node/runtime.js +29364 -0
- package/dist/node/runtime.server.js +8200 -0
- package/dist/node/sanitize-url.js +34 -0
- package/dist/node/server/early-signals.js +54 -0
- package/dist/node/server/index.js +338 -0
- package/dist/node/server/rpc-batch.js +129 -0
- package/dist/node/server/rpc-stream.js +132 -0
- package/dist/node/server/rpc.js +48 -0
- package/dist/node/server/signal-query-observation.js +134 -0
- package/dist/node/server/streamed-region.js +31 -0
- package/dist/node/server/streamed-signals.js +574 -0
- package/dist/node/server-call.js +75 -0
- package/dist/node/server-rpc-batch-client.js +119 -0
- package/dist/node/server-rpc-client.js +108 -0
- package/dist/node/server-rpc-protocol.js +109 -0
- package/dist/node/server-rpc-stream-client.js +98 -0
- package/dist/node/shared-value-helpers.js +60 -0
- package/dist/node/signals/actions.js +463 -0
- package/dist/node/signals/client.js +22 -0
- package/dist/node/signals/computations.js +452 -0
- package/dist/node/signals/control-binding.js +388 -0
- package/dist/node/signals/control-handoff.js +12 -0
- package/dist/node/signals/derived-facade.js +25 -0
- package/dist/node/signals/document-owner.js +48 -0
- package/dist/node/signals/early-values.js +124 -0
- package/dist/node/signals/encoding.js +6 -0
- package/dist/node/signals/engine.js +668 -0
- package/dist/node/signals/errors.js +54 -0
- package/dist/node/signals/facade.js +441 -0
- package/dist/node/signals/graph.js +817 -0
- package/dist/node/signals/handle-protocol.js +11 -0
- package/dist/node/signals/index.js +87 -0
- package/dist/node/signals/native-read-client.js +319 -0
- package/dist/node/signals/native-read-collector.js +132 -0
- package/dist/node/signals/native-read-events.js +45 -0
- package/dist/node/signals/native-read-inspection.js +20 -0
- package/dist/node/signals/native-read-retry.js +30 -0
- package/dist/node/signals/native-read-seeds.js +243 -0
- package/dist/node/signals/native-read-server.js +99 -0
- package/dist/node/signals/owner-context.js +88 -0
- package/dist/node/signals/query-attempt-observer.js +42 -0
- package/dist/node/signals/query-facade.js +41 -0
- package/dist/node/signals/read-protocol.js +125 -0
- package/dist/node/signals/requests.js +716 -0
- package/dist/node/signals/scalar-computations.js +57 -0
- package/dist/node/signals/scope-streams.js +147 -0
- package/dist/node/signals/server.js +22 -0
- package/dist/node/signals/transition-action.js +555 -0
- package/dist/node/signals/transition-candidate.js +101 -0
- package/dist/node/signals/transition-coordinator.js +255 -0
- package/dist/node/signals/transition-state.js +82 -0
- package/dist/node/signals/types.js +20 -0
- package/dist/node/static/index.js +10 -0
- package/dist/node/stream-protocol.js +114 -0
- package/dist/node/streamed-signals-protocol.js +130 -0
- package/dist/node/style-values.js +96 -0
- package/dist/node/sub-slot.js +35 -0
- package/dist/node/testing.js +14 -0
- package/dist/node/trusted-html.js +6 -0
- package/dist/node/tsrx-iterable.js +5 -0
- package/dist/node/tsrx-spread.js +10 -0
- package/dist/node/universal-core.js +10138 -0
- package/dist/node/universal-dom-boundary.js +237 -0
- package/dist/node/universal-native.js +28 -0
- package/dist/node/universal.js +17 -0
- package/dist/node/version.js +4 -0
- package/dist/runtime.d.ts +219 -8
- package/dist/runtime.js +714 -220
- package/dist/runtime.server.d.ts +33 -2
- package/dist/runtime.server.js +217 -29
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +2 -0
- package/dist/server/rpc-stream.js +19 -12
- package/dist/server/streamed-signals.js +18 -1
- package/dist/shared-value-helpers.d.ts +11 -0
- package/dist/shared-value-helpers.js +21 -1
- package/dist/universal-core.d.ts +3 -1
- package/dist/universal-core.js +178 -50
- package/dist/version.js +1 -1
- package/package.json +62 -1
|
@@ -138,6 +138,7 @@ __export(server_exports, {
|
|
|
138
138
|
ssrText: () => import_runtime_server.ssrText,
|
|
139
139
|
ssrTextPre: () => import_runtime_server.ssrTextPre,
|
|
140
140
|
ssrTextSlot: () => import_runtime_server.ssrTextSlot,
|
|
141
|
+
ssrTextareaText: () => import_runtime_server.ssrTextareaText,
|
|
141
142
|
ssrTextareaValue: () => import_runtime_server.ssrTextareaValue,
|
|
142
143
|
ssrTextareaValueSources: () => import_runtime_server.ssrTextareaValueSources,
|
|
143
144
|
ssrTry: () => import_runtime_server.ssrTry,
|
|
@@ -317,6 +318,7 @@ var import_runtime_server = require("../runtime.server.cjs");
|
|
|
317
318
|
ssrText,
|
|
318
319
|
ssrTextPre,
|
|
319
320
|
ssrTextSlot,
|
|
321
|
+
ssrTextareaText,
|
|
320
322
|
ssrTextareaValue,
|
|
321
323
|
ssrTextareaValueSources,
|
|
322
324
|
ssrTry,
|
|
@@ -39,14 +39,29 @@ function createServerResultStream(result, options = {}) {
|
|
|
39
39
|
const cleanup = () => {
|
|
40
40
|
clearTimeout(timer);
|
|
41
41
|
options.signal?.removeEventListener("abort", abort);
|
|
42
|
+
const abandoned = pending;
|
|
43
|
+
pending = void 0;
|
|
44
|
+
if (abandoned === void 0) return;
|
|
45
|
+
void abandoned.then(
|
|
46
|
+
(value) => {
|
|
47
|
+
try {
|
|
48
|
+
if (value !== null && typeof value === "object" && Symbol.asyncIterator in value) {
|
|
49
|
+
closeIterator(value[Symbol.asyncIterator]());
|
|
50
|
+
}
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
() => {
|
|
55
|
+
}
|
|
56
|
+
);
|
|
42
57
|
};
|
|
43
|
-
const closeIterator = () => {
|
|
58
|
+
const closeIterator = (target = iterator) => {
|
|
59
|
+
iterator = void 0;
|
|
44
60
|
try {
|
|
45
|
-
void Promise.resolve(
|
|
61
|
+
void Promise.resolve(target?.return?.()).catch(() => {
|
|
46
62
|
});
|
|
47
63
|
} catch {
|
|
48
64
|
}
|
|
49
|
-
iterator = void 0;
|
|
50
65
|
};
|
|
51
66
|
const write = (frame) => {
|
|
52
67
|
const encoded = (0, import_server_rpc_protocol.encodeServerResultFrame)(sequence, frame);
|
|
@@ -60,7 +75,6 @@ function createServerResultStream(result, options = {}) {
|
|
|
60
75
|
const fail = (message) => {
|
|
61
76
|
if (finished) return;
|
|
62
77
|
finished = true;
|
|
63
|
-
pending = void 0;
|
|
64
78
|
cleanup();
|
|
65
79
|
options.cancel?.();
|
|
66
80
|
closeIterator();
|
|
@@ -93,13 +107,7 @@ function createServerResultStream(result, options = {}) {
|
|
|
93
107
|
if (!initialized) {
|
|
94
108
|
const value = await pending;
|
|
95
109
|
pending = void 0;
|
|
96
|
-
if (finished)
|
|
97
|
-
if (value !== null && typeof value === "object" && Symbol.asyncIterator in value) {
|
|
98
|
-
iterator = value[Symbol.asyncIterator]();
|
|
99
|
-
closeIterator();
|
|
100
|
-
}
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
110
|
+
if (finished) return;
|
|
103
111
|
initialized = true;
|
|
104
112
|
if (value !== null && typeof value === "object" && Symbol.asyncIterator in value) {
|
|
105
113
|
iterator = value[Symbol.asyncIterator]();
|
|
@@ -131,7 +139,6 @@ function createServerResultStream(result, options = {}) {
|
|
|
131
139
|
cancel() {
|
|
132
140
|
if (finished) return;
|
|
133
141
|
finished = true;
|
|
134
|
-
pending = void 0;
|
|
135
142
|
cleanup();
|
|
136
143
|
options.cancel?.();
|
|
137
144
|
closeIterator();
|
|
@@ -82,13 +82,15 @@ async function* produceStreamedSignalResultFrames(identity, result, options, wai
|
|
|
82
82
|
let sequence = 0;
|
|
83
83
|
let resource = "promise";
|
|
84
84
|
let iterator;
|
|
85
|
+
let releaseLateResult = false;
|
|
85
86
|
const run = options.run ?? ((callback) => callback());
|
|
86
87
|
const signal = options.signal;
|
|
87
88
|
const abort = () => waits.interrupt(signal.reason);
|
|
89
|
+
const pendingResult = Promise.resolve(result);
|
|
88
90
|
signal?.addEventListener("abort", abort, { once: true });
|
|
89
91
|
try {
|
|
90
92
|
signal?.throwIfAborted();
|
|
91
|
-
const resolved = await waits.wait(
|
|
93
|
+
const resolved = await waits.wait(pendingResult);
|
|
92
94
|
signal?.throwIfAborted();
|
|
93
95
|
if (isAsyncIterable(resolved)) {
|
|
94
96
|
resource = "stream";
|
|
@@ -126,6 +128,7 @@ async function* produceStreamedSignalResultFrames(identity, result, options, wai
|
|
|
126
128
|
}
|
|
127
129
|
yield { identity, sequence, channel: "result", kind: "complete" };
|
|
128
130
|
} catch (error) {
|
|
131
|
+
releaseLateResult = iterator === void 0 && (error === CANCELLED || signal?.aborted === true);
|
|
129
132
|
if (error === CANCELLED) return;
|
|
130
133
|
if (sequence === 0) {
|
|
131
134
|
yield { identity, sequence: sequence++, channel: "result", kind: "open", resource };
|
|
@@ -133,6 +136,20 @@ async function* produceStreamedSignalResultFrames(identity, result, options, wai
|
|
|
133
136
|
yield { identity, sequence, channel: "result", kind: "error", code: "SERVER_RESULT_FAILED" };
|
|
134
137
|
} finally {
|
|
135
138
|
signal?.removeEventListener("abort", abort);
|
|
139
|
+
if (releaseLateResult) {
|
|
140
|
+
void pendingResult.then(
|
|
141
|
+
async (resolved) => {
|
|
142
|
+
try {
|
|
143
|
+
if (!isAsyncIterable(resolved)) return;
|
|
144
|
+
const lateIterator = run(() => resolved[Symbol.asyncIterator]());
|
|
145
|
+
await run(() => lateIterator.return?.());
|
|
146
|
+
} catch {
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
() => {
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
136
153
|
if (iterator !== void 0) {
|
|
137
154
|
try {
|
|
138
155
|
await run(() => iterator.return?.());
|
|
@@ -21,8 +21,10 @@ __export(shared_value_helpers_exports, {
|
|
|
21
21
|
applyElementDefaultProps: () => applyElementDefaultProps,
|
|
22
22
|
childElementKey: () => childElementKey,
|
|
23
23
|
childrenIterator: () => childrenIterator,
|
|
24
|
+
describeTextareaChild: () => describeTextareaChild,
|
|
24
25
|
escapeMappedElementKey: () => escapeMappedElementKey,
|
|
25
|
-
resolveLazyDefaultProps: () => resolveLazyDefaultProps
|
|
26
|
+
resolveLazyDefaultProps: () => resolveLazyDefaultProps,
|
|
27
|
+
textareaChildText: () => textareaChildText
|
|
26
28
|
});
|
|
27
29
|
module.exports = __toCommonJS(shared_value_helpers_exports);
|
|
28
30
|
function applyElementDefaultProps(type, props) {
|
|
@@ -58,11 +60,31 @@ function childrenIterator(children) {
|
|
|
58
60
|
const iterator = typeof Symbol === "function" && children[Symbol.iterator] || children["@@iterator"];
|
|
59
61
|
return typeof iterator === "function" ? iterator : null;
|
|
60
62
|
}
|
|
63
|
+
function textareaChildText(value, reject) {
|
|
64
|
+
if (value == null || typeof value === "boolean") return "";
|
|
65
|
+
if (typeof value === "string") return value;
|
|
66
|
+
if (typeof value === "number" || typeof value === "bigint") return "" + value;
|
|
67
|
+
let items;
|
|
68
|
+
if (Array.isArray(value)) items = value;
|
|
69
|
+
else {
|
|
70
|
+
const iterator = childrenIterator(value);
|
|
71
|
+
if (iterator === null) return reject(value);
|
|
72
|
+
items = { [Symbol.iterator]: () => iterator.call(value) };
|
|
73
|
+
}
|
|
74
|
+
let text = "";
|
|
75
|
+
for (const item of items) text += textareaChildText(item, reject);
|
|
76
|
+
return text;
|
|
77
|
+
}
|
|
78
|
+
function describeTextareaChild(value, isElement) {
|
|
79
|
+
return isElement(value) ? "an element" : typeof value === "object" ? "an object" : "a " + typeof value;
|
|
80
|
+
}
|
|
61
81
|
// Annotate the CommonJS export names for ESM import in node:
|
|
62
82
|
0 && (module.exports = {
|
|
63
83
|
applyElementDefaultProps,
|
|
64
84
|
childElementKey,
|
|
65
85
|
childrenIterator,
|
|
86
|
+
describeTextareaChild,
|
|
66
87
|
escapeMappedElementKey,
|
|
67
|
-
resolveLazyDefaultProps
|
|
88
|
+
resolveLazyDefaultProps,
|
|
89
|
+
textareaChildText
|
|
68
90
|
});
|
|
@@ -30,6 +30,7 @@ var import_owner_context = require("./owner-context.cjs");
|
|
|
30
30
|
var import_read_protocol = require("./read-protocol.cjs");
|
|
31
31
|
var import_types = require("./types.cjs");
|
|
32
32
|
var import_transition_state = require("./transition-state.cjs");
|
|
33
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
33
34
|
function __octaneNoArgError(code) {
|
|
34
35
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
35
36
|
}
|
|
@@ -62,9 +63,9 @@ function __createBindingControls(owner = (0, import_owner_context.currentSignalO
|
|
|
62
63
|
claim(element, channel, notify) {
|
|
63
64
|
const control = element;
|
|
64
65
|
if (control?.nodeType !== 1 || channel !== "value" && channel !== "checked" || !["input", "textarea", "select"].includes(control.localName) || channel === "checked" && (control.localName !== "input" || !["checkbox", "radio"].includes(control.type)) || channel === "value" && control.localName === "input" && control.type === "file")
|
|
65
|
-
throw new TypeError(
|
|
66
|
+
throw new TypeError(__octaneDev ? "A signal control requires a native value/checked property and a signal." : __octaneNoArgError(116));
|
|
66
67
|
if (import_control_handoff.CONTROL_BINDINGS.get(control)?.has(channel) || (0, import_early_values.hasHydrationControlSignalWriter)(control, channel))
|
|
67
|
-
throw new Error(
|
|
68
|
+
throw new Error(__octaneDev ? "This control property already has a signal binding. Dispose it before rebinding." : __octaneNoArgError(117));
|
|
68
69
|
let channels = import_control_handoff.CONTROL_BINDINGS.get(control);
|
|
69
70
|
if (!channels)
|
|
70
71
|
import_control_handoff.CONTROL_BINDINGS.set(control, channels = /* @__PURE__ */ new Set());
|
|
@@ -156,7 +157,7 @@ function __createBindingControls(owner = (0, import_owner_context.currentSignalO
|
|
|
156
157
|
}, commit() {
|
|
157
158
|
} };
|
|
158
159
|
if ((0, import_handle_protocol.isSignalHandle)(next) && (typeof next[import_types.SIGNAL_BINDING_READ] !== "function" || typeof next[import_types.SIGNAL_BINDING_SUBSCRIBE] !== "function"))
|
|
159
|
-
throw new TypeError(
|
|
160
|
+
throw new TypeError(__octaneDev ? "A signal control requires a native value/checked property and a signal." : __octaneNoArgError(116));
|
|
160
161
|
if (!preview && raw !== next) {
|
|
161
162
|
const ticket2 = ++generation;
|
|
162
163
|
const stop = unsubscribe;
|
|
@@ -182,7 +183,7 @@ function __createBindingControls(owner = (0, import_owner_context.currentSignalO
|
|
|
182
183
|
dispose();
|
|
183
184
|
}));
|
|
184
185
|
if (typeof stopNext !== "function")
|
|
185
|
-
throw new TypeError(
|
|
186
|
+
throw new TypeError(__octaneDev ? "A signal control subscription must return cleanup." : __octaneNoArgError(118));
|
|
186
187
|
if (disposed || generation !== ticket2)
|
|
187
188
|
stopNext();
|
|
188
189
|
else
|
|
@@ -203,7 +204,7 @@ function __createBindingControls(owner = (0, import_owner_context.currentSignalO
|
|
|
203
204
|
} };
|
|
204
205
|
const multiple = control.localName === "select" && control.multiple;
|
|
205
206
|
if (candidate && (channel === "checked" ? typeof value !== "boolean" : multiple ? !Array.isArray(value) : typeof value !== "string"))
|
|
206
|
-
throw new TypeError(channel === "checked" ?
|
|
207
|
+
throw new TypeError(channel === "checked" ? __octaneDev ? "A checked signal must contain a boolean." : __octaneNoArgError(119) : multiple ? __octaneDev ? "A multiple select signal must contain an array." : __octaneNoArgError(120) : __octaneDev ? "A value signal must contain a string." : __octaneNoArgError(121));
|
|
207
208
|
let selected;
|
|
208
209
|
if (multiple && Array.isArray(value)) {
|
|
209
210
|
selected = /* @__PURE__ */ new Set();
|
|
@@ -324,7 +325,7 @@ function controlSignalOwner(owner, document) {
|
|
|
324
325
|
}
|
|
325
326
|
function bindSignalControl(control, channel, handle$) {
|
|
326
327
|
if (!(0, import_handle_protocol.isSignalHandle)(handle$))
|
|
327
|
-
throw new TypeError(
|
|
328
|
+
throw new TypeError(__octaneDev ? "A signal control requires a native value/checked property and a signal." : __octaneNoArgError(116));
|
|
328
329
|
let busy = false;
|
|
329
330
|
let dirty = false;
|
|
330
331
|
let disposed = false;
|
|
@@ -25,12 +25,13 @@ module.exports = __toCommonJS(derived_facade_exports);
|
|
|
25
25
|
var import_computations = require("./computations.cjs");
|
|
26
26
|
var import_facade = require("./facade.cjs");
|
|
27
27
|
var import_owner_context = require("./owner-context.cjs");
|
|
28
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
28
29
|
function __octaneNoArgError(code) {
|
|
29
30
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
30
31
|
}
|
|
31
32
|
function __derivedAt(site, compute, options) {
|
|
32
33
|
if (typeof compute !== "function")
|
|
33
|
-
throw new TypeError(
|
|
34
|
+
throw new TypeError(__octaneDev ? "derived$ requires a function." : __octaneNoArgError(122));
|
|
34
35
|
const explicit = (0, import_facade.signalOptionsKey)(options);
|
|
35
36
|
site ??= explicit;
|
|
36
37
|
const key = (0, import_facade.descriptorKey)(site, explicit);
|
|
@@ -27,6 +27,7 @@ __export(document_owner_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(document_owner_exports);
|
|
28
28
|
var import_early_values = require("./early-values.cjs");
|
|
29
29
|
var import_owner_context = require("./owner-context.cjs");
|
|
30
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
30
31
|
function __octaneNoArgError(code) {
|
|
31
32
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
32
33
|
}
|
|
@@ -37,7 +38,7 @@ let streamedSignalOwnerActivator;
|
|
|
37
38
|
function documentSignalOwner(container) {
|
|
38
39
|
const ownerDocument = container.nodeType === 9 ? container : container.ownerDocument;
|
|
39
40
|
if (ownerDocument === null)
|
|
40
|
-
throw new TypeError(
|
|
41
|
+
throw new TypeError(__octaneDev ? "A signal document owner requires a document." : __octaneNoArgError(123));
|
|
41
42
|
let owner = documentOwners.get(ownerDocument);
|
|
42
43
|
if (owner === void 0) {
|
|
43
44
|
owner = Object.freeze({ scopeKey: "octane:document" });
|
|
@@ -48,7 +49,7 @@ function documentSignalOwner(container) {
|
|
|
48
49
|
}
|
|
49
50
|
function enableSignalDocument(abi = 1) {
|
|
50
51
|
if (abi !== 1)
|
|
51
|
-
throw new TypeError(
|
|
52
|
+
throw new TypeError(__octaneDev ? "Unsupported Octane signal binding ABI." : __octaneNoArgError(74));
|
|
52
53
|
signalDocumentEnabled = true;
|
|
53
54
|
if (defaultInstalled)
|
|
54
55
|
return;
|
|
@@ -57,7 +58,7 @@ function enableSignalDocument(abi = 1) {
|
|
|
57
58
|
}
|
|
58
59
|
function installStreamedSignalOwnerActivator(activate) {
|
|
59
60
|
if (streamedSignalOwnerActivator !== void 0) {
|
|
60
|
-
throw new Error(
|
|
61
|
+
throw new Error(__octaneDev ? "A streamed signal hydration owner is already installed." : __octaneNoArgError(124));
|
|
61
62
|
}
|
|
62
63
|
streamedSignalOwnerActivator = activate;
|
|
63
64
|
return () => {
|
|
@@ -51,6 +51,7 @@ var import_handle_protocol = require("./handle-protocol.cjs");
|
|
|
51
51
|
var import_handle_protocol2 = require("./handle-protocol.cjs");
|
|
52
52
|
var import_owner_context = require("./owner-context.cjs");
|
|
53
53
|
var import_types = require("./types.cjs");
|
|
54
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
54
55
|
function __octaneNoArgError(code) {
|
|
55
56
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
56
57
|
}
|
|
@@ -82,12 +83,12 @@ function resolveIdentity(identity, scopeKey, owner) {
|
|
|
82
83
|
}
|
|
83
84
|
function initializeDocumentSignalOwner(owner, seed) {
|
|
84
85
|
if (isScope(owner) || isRendererOwner(owner)) {
|
|
85
|
-
throw new TypeError(
|
|
86
|
+
throw new TypeError(__octaneDev ? "Initial document signals require an implicit document owner." : __octaneNoArgError(155));
|
|
86
87
|
}
|
|
87
88
|
if (retiredIdentities.has(owner))
|
|
88
89
|
throw new import_errors.ScopeDisposedError(owner.scopeKey);
|
|
89
90
|
if (identityScopes.has(owner)) {
|
|
90
|
-
throw new Error(
|
|
91
|
+
throw new Error(__octaneDev ? "Initial document signals must be installed once, before any signal reads or writes." : __octaneNoArgError(156));
|
|
91
92
|
}
|
|
92
93
|
const scope = (0, import_engine.createScope)({ scopeKey: owner.scopeKey, seed });
|
|
93
94
|
const barrier = frozenDocuments.get(owner);
|
|
@@ -188,7 +189,7 @@ function streamedScope(owner, identity, create) {
|
|
|
188
189
|
});
|
|
189
190
|
function createSignalOwnerLifecycle(owner) {
|
|
190
191
|
if (isRendererOwner(owner))
|
|
191
|
-
throw new TypeError(
|
|
192
|
+
throw new TypeError(__octaneDev ? "A document lifecycle requires its document owner." : __octaneNoArgError(157));
|
|
192
193
|
let barrier;
|
|
193
194
|
let release;
|
|
194
195
|
let disposed = false;
|
|
@@ -258,7 +259,7 @@ function createSignalOwnerLifecycle(owner) {
|
|
|
258
259
|
function requireOwner() {
|
|
259
260
|
const owner = (0, import_owner_context.currentSignalOwner)();
|
|
260
261
|
if (!owner) {
|
|
261
|
-
throw new Error(
|
|
262
|
+
throw new Error(__octaneDev ? "A module signal needs an active signal owner. Render it in an Octane root or use runWithSignalOwner()." : __octaneNoArgError(158));
|
|
262
263
|
}
|
|
263
264
|
return owner;
|
|
264
265
|
}
|
|
@@ -274,7 +275,7 @@ function resolveSignalHandleForScope(handle$, owner) {
|
|
|
274
275
|
function requireSite(site) {
|
|
275
276
|
if (site)
|
|
276
277
|
return site;
|
|
277
|
-
throw new Error(
|
|
278
|
+
throw new Error(__octaneDev ? "Module signal identity is assigned by the Octane compiler. Use an explicit key outside compiled code." : __octaneNoArgError(159));
|
|
278
279
|
}
|
|
279
280
|
class Descriptor {
|
|
280
281
|
constructor(key, kind, create, site) {
|
|
@@ -354,11 +355,11 @@ function descriptorKey(site, explicit) {
|
|
|
354
355
|
}
|
|
355
356
|
function signalOptionsKey(options) {
|
|
356
357
|
if (options != null && typeof options !== "object") {
|
|
357
|
-
throw new TypeError(
|
|
358
|
+
throw new TypeError(__octaneDev ? "Signal declaration options must be an object." : __octaneNoArgError(160));
|
|
358
359
|
}
|
|
359
360
|
const key = options?.key;
|
|
360
361
|
if (key !== void 0 && (typeof key !== "string" || !key.trim())) {
|
|
361
|
-
throw new TypeError(
|
|
362
|
+
throw new TypeError(__octaneDev ? "A signal declaration key must be a nonempty string." : __octaneNoArgError(161));
|
|
362
363
|
}
|
|
363
364
|
return key;
|
|
364
365
|
}
|
|
@@ -379,7 +380,7 @@ function signal$(initial, options) {
|
|
|
379
380
|
}
|
|
380
381
|
function __derivedScalarAt(site, compute, options) {
|
|
381
382
|
if (typeof compute !== "function")
|
|
382
|
-
throw new TypeError(
|
|
383
|
+
throw new TypeError(__octaneDev ? "derived$ requires a function." : __octaneNoArgError(122));
|
|
383
384
|
const explicit = signalOptionsKey(options);
|
|
384
385
|
site ??= explicit;
|
|
385
386
|
const key = descriptorKey(site, explicit);
|
|
@@ -387,7 +388,7 @@ function __derivedScalarAt(site, compute, options) {
|
|
|
387
388
|
}
|
|
388
389
|
function readSignalBinding(handle$) {
|
|
389
390
|
if (!(0, import_handle_protocol.isSignalHandle)(handle$))
|
|
390
|
-
throw new TypeError(
|
|
391
|
+
throw new TypeError(__octaneDev ? "A signal binding requires a signal handle." : __octaneNoArgError(162));
|
|
391
392
|
return handle$[import_types.SIGNAL_BINDING_READ]();
|
|
392
393
|
}
|
|
393
394
|
function __startSignalReads(handles, primitive = false) {
|
|
@@ -60,6 +60,7 @@ var import_errors = require("./errors.cjs");
|
|
|
60
60
|
var import_read_protocol = require("./read-protocol.cjs");
|
|
61
61
|
var import_types = require("./types.cjs");
|
|
62
62
|
var import_transition_state2 = require("./transition-state.cjs");
|
|
63
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
63
64
|
function __octaneNoArgError(code) {
|
|
64
65
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
65
66
|
}
|
|
@@ -385,7 +386,7 @@ class ScopedNode {
|
|
|
385
386
|
nativeSnapshotSource;
|
|
386
387
|
retry(_options) {
|
|
387
388
|
assertAlive(this.owner);
|
|
388
|
-
throw new TypeError(
|
|
389
|
+
throw new TypeError(__octaneDev ? "Only an async signal can be retried." : __octaneNoArgError(163));
|
|
389
390
|
}
|
|
390
391
|
get() {
|
|
391
392
|
return strictValue(readNode(this), this.key);
|
|
@@ -407,7 +408,7 @@ class ScopedNode {
|
|
|
407
408
|
assertAlive(this.owner);
|
|
408
409
|
assertWritable();
|
|
409
410
|
if (this.kind !== "signal")
|
|
410
|
-
throw new TypeError(
|
|
411
|
+
throw new TypeError(__octaneDev ? "Only a writable signal accepts set()." : __octaneNoArgError(164));
|
|
411
412
|
const candidate = import_transition_state.activeCandidate ?? (0, import_read_protocol.getNativeCandidate)();
|
|
412
413
|
if (candidate) {
|
|
413
414
|
candidate.run(() => candidate.write(this, value));
|
|
@@ -445,7 +446,7 @@ class ScopedNode {
|
|
|
445
446
|
assertAlive(this.owner);
|
|
446
447
|
assertWritable();
|
|
447
448
|
if (typeof notify !== "function")
|
|
448
|
-
throw new TypeError(
|
|
449
|
+
throw new TypeError(__octaneDev ? "A signal subscriber must be a function." : __octaneNoArgError(165));
|
|
449
450
|
const state = untrack(() => refreshNode(this));
|
|
450
451
|
return attachObserver(this, notify, false, state);
|
|
451
452
|
}
|
|
@@ -674,7 +675,7 @@ function invalidateNode(node) {
|
|
|
674
675
|
function derivedState(node, read) {
|
|
675
676
|
const value = pure(read);
|
|
676
677
|
if (isThenable(value))
|
|
677
|
-
throw new TypeError(
|
|
678
|
+
throw new TypeError(__octaneDev ? "derived$ requires a synchronous computation." : __octaneNoArgError(166));
|
|
678
679
|
return derivedValueState(node, value);
|
|
679
680
|
}
|
|
680
681
|
function derivedValueState(node, value, activity, additionalDependencies) {
|
|
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(native_read_client_exports);
|
|
|
24
24
|
var import_native_read_collector = require("./native-read-collector.cjs");
|
|
25
25
|
var import_read_protocol = require("./read-protocol.cjs");
|
|
26
26
|
var import_native_read_inspection = require("./native-read-inspection.cjs");
|
|
27
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
27
28
|
function __octaneNoArgError(code) {
|
|
28
29
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
29
30
|
}
|
|
@@ -261,7 +262,7 @@ function createNativeReadDriver(host) {
|
|
|
261
262
|
if (completed) {
|
|
262
263
|
const capture = host.capture();
|
|
263
264
|
if (capture === null)
|
|
264
|
-
throw new Error(
|
|
265
|
+
throw new Error(__octaneDev ? "A completed native render requires a renderer transaction." : __octaneNoArgError(167));
|
|
265
266
|
const destination = target(capture);
|
|
266
267
|
for (const candidate of frame.candidates.values())
|
|
267
268
|
put(destination, candidate);
|
|
@@ -284,7 +285,7 @@ function createNativeReadDriver(host) {
|
|
|
284
285
|
if (collector.isDetached())
|
|
285
286
|
return collector.beginScope(scope);
|
|
286
287
|
if (host.capture() === null)
|
|
287
|
-
throw new Error(
|
|
288
|
+
throw new Error(__octaneDev ? "Native reads require a renderer transaction." : __octaneNoArgError(168));
|
|
288
289
|
if (depth === 0 || frames[depth - 1].block !== block)
|
|
289
290
|
this.beginRender(block);
|
|
290
291
|
const frame = frames[depth - 1];
|
|
@@ -319,7 +320,7 @@ function createNativeReadDriver(host) {
|
|
|
319
320
|
if (candidates === void 0)
|
|
320
321
|
return;
|
|
321
322
|
if (parent === null)
|
|
322
|
-
throw new Error(
|
|
323
|
+
throw new Error(__octaneDev ? "A native capture must be accepted before publication." : __octaneNoArgError(169));
|
|
323
324
|
captures.delete(capture);
|
|
324
325
|
const destination = target(parent);
|
|
325
326
|
for (const candidate of candidates.values())
|
|
@@ -32,6 +32,7 @@ __export(owner_context_exports, {
|
|
|
32
32
|
runWithSignalOwner: () => runWithSignalOwner
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(owner_context_exports);
|
|
35
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
35
36
|
function __octaneNoArgError(code) {
|
|
36
37
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
37
38
|
}
|
|
@@ -41,7 +42,7 @@ let defaultOwner;
|
|
|
41
42
|
let retireOwner;
|
|
42
43
|
function installSignalOwnerEnvironment(environment) {
|
|
43
44
|
if (!environment || typeof environment.current !== "function" || typeof environment.run !== "function" || typeof environment.capture !== "function") {
|
|
44
|
-
throw new TypeError(
|
|
45
|
+
throw new TypeError(__octaneDev ? "A signal owner environment requires current, run, and capture." : __octaneNoArgError(189));
|
|
45
46
|
}
|
|
46
47
|
const previous = installedEnvironment;
|
|
47
48
|
installedEnvironment = environment;
|
|
@@ -60,7 +61,7 @@ function currentExplicitSignalOwner() {
|
|
|
60
61
|
}
|
|
61
62
|
function installDefaultSignalOwner(current) {
|
|
62
63
|
if (typeof current !== "function")
|
|
63
|
-
throw new TypeError(
|
|
64
|
+
throw new TypeError(__octaneDev ? "A default signal owner requires a provider." : __octaneNoArgError(190));
|
|
64
65
|
const previous = defaultOwner;
|
|
65
66
|
defaultOwner = current;
|
|
66
67
|
return () => {
|
|
@@ -70,7 +71,7 @@ function installDefaultSignalOwner(current) {
|
|
|
70
71
|
}
|
|
71
72
|
function runWithSignalOwner(owner, callback) {
|
|
72
73
|
if (typeof callback !== "function")
|
|
73
|
-
throw new TypeError(
|
|
74
|
+
throw new TypeError(__octaneDev ? "A signal owner callback is required." : __octaneNoArgError(191));
|
|
74
75
|
if (installedEnvironment)
|
|
75
76
|
return installedEnvironment.run(owner, callback);
|
|
76
77
|
const previous = synchronousOwner;
|
|
@@ -24,6 +24,7 @@ __export(query_attempt_observer_exports, {
|
|
|
24
24
|
serverSignalQueryAttemptObserver: () => serverSignalQueryAttemptObserver
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(query_attempt_observer_exports);
|
|
27
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
27
28
|
function __octaneNoArgError(code) {
|
|
28
29
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
29
30
|
}
|
|
@@ -46,7 +47,7 @@ function serverSignalQueryAttemptObserver(scopeKey) {
|
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
49
|
if (typeof context.createObservations !== "function") {
|
|
49
|
-
throw new TypeError(
|
|
50
|
+
throw new TypeError(__octaneDev ? "A server signal query observer requires an observation factory." : __octaneNoArgError(192));
|
|
50
51
|
}
|
|
51
52
|
return context;
|
|
52
53
|
}
|
|
@@ -27,6 +27,7 @@ var import_facade = require("./facade.cjs");
|
|
|
27
27
|
var import_owner_context = require("./owner-context.cjs");
|
|
28
28
|
var import_requests = require("./requests.cjs");
|
|
29
29
|
var import_types = require("./types.cjs");
|
|
30
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
30
31
|
function __octaneNoArgError(code) {
|
|
31
32
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
32
33
|
}
|
|
@@ -43,7 +44,7 @@ class QueryDescriptor extends import_facade.Descriptor {
|
|
|
43
44
|
}
|
|
44
45
|
function __queryAt(site, select, load, options) {
|
|
45
46
|
if (typeof select !== "function" || typeof load !== "function") {
|
|
46
|
-
throw new TypeError(
|
|
47
|
+
throw new TypeError(__octaneDev ? "query$ requires selector and loader functions." : __octaneNoArgError(193));
|
|
47
48
|
}
|
|
48
49
|
const explicit = (0, import_facade.signalOptionsKey)(options);
|
|
49
50
|
site ??= explicit;
|
|
@@ -23,6 +23,7 @@ __export(scalar_computations_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(scalar_computations_exports);
|
|
24
24
|
var import_engine = require("./engine.cjs");
|
|
25
25
|
var import_graph = require("./graph.cjs");
|
|
26
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
26
27
|
function __octaneNoArgError(code) {
|
|
27
28
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
28
29
|
}
|
|
@@ -53,7 +54,7 @@ class ScalarBinding {
|
|
|
53
54
|
compute;
|
|
54
55
|
forkCandidate(target) {
|
|
55
56
|
if (this.frozen || this.owner.readBarrier || !this.compute) {
|
|
56
|
-
throw new import_graph.CandidateUnsupportedError(
|
|
57
|
+
throw new import_graph.CandidateUnsupportedError(__octaneDev ? "Frozen scalar candidates are not supported." : __octaneNoArgError(205));
|
|
57
58
|
}
|
|
58
59
|
target.compute = this.node.compute;
|
|
59
60
|
}
|
|
@@ -25,6 +25,7 @@ module.exports = __toCommonJS(transition_action_exports);
|
|
|
25
25
|
var import_errors = require("./errors.cjs");
|
|
26
26
|
var import_read_protocol = require("./read-protocol.cjs");
|
|
27
27
|
var import_transition_state = require("./transition-state.cjs");
|
|
28
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
28
29
|
function __octaneNoArgError(code) {
|
|
29
30
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
30
31
|
}
|
|
@@ -70,9 +71,9 @@ class SignalActionFrame {
|
|
|
70
71
|
demand;
|
|
71
72
|
run(callback) {
|
|
72
73
|
if (!this.active)
|
|
73
|
-
throw new TypeError(
|
|
74
|
+
throw new TypeError(__octaneDev ? "The signal candidate has retired." : __octaneNoArgError(203));
|
|
74
75
|
if (import_transition_state.activeCandidate && import_transition_state.activeCandidate !== this) {
|
|
75
|
-
throw new import_transition_state.CandidateUnsupportedError(
|
|
76
|
+
throw new import_transition_state.CandidateUnsupportedError(__octaneDev ? "Nested signal candidates are not supported." : __octaneNoArgError(206));
|
|
76
77
|
}
|
|
77
78
|
const previous = (0, import_transition_state.swapActiveSignalCandidate)(this);
|
|
78
79
|
try {
|
|
@@ -83,7 +84,7 @@ class SignalActionFrame {
|
|
|
83
84
|
}
|
|
84
85
|
resolve(node) {
|
|
85
86
|
if (!this.active)
|
|
86
|
-
throw new TypeError(
|
|
87
|
+
throw new TypeError(__octaneDev ? "The signal candidate has retired." : __octaneNoArgError(203));
|
|
87
88
|
const original = this.originals?.get(node);
|
|
88
89
|
if (original) {
|
|
89
90
|
this.demand?.add(original);
|
|
@@ -94,7 +95,7 @@ class SignalActionFrame {
|
|
|
94
95
|
if (existing)
|
|
95
96
|
return existing.target;
|
|
96
97
|
if (import_transition_state.candidateGraph.historical() || node.owner.readBarrier || !node.owner.forkCandidate) {
|
|
97
|
-
throw new import_transition_state.CandidateUnsupportedError(
|
|
98
|
+
throw new import_transition_state.CandidateUnsupportedError(__octaneDev ? "Only live candidate-capable owners are supported." : __octaneNoArgError(207));
|
|
98
99
|
}
|
|
99
100
|
import_transition_state.candidateGraph.assertAlive(node.owner);
|
|
100
101
|
this.invalidatePreparation();
|
|
@@ -130,7 +131,7 @@ class SignalActionFrame {
|
|
|
130
131
|
}
|
|
131
132
|
write(node, value) {
|
|
132
133
|
if (!this.validate())
|
|
133
|
-
throw new TypeError(
|
|
134
|
+
throw new TypeError(__octaneDev ? "Rebase the signal candidate before writing." : __octaneNoArgError(208));
|
|
134
135
|
const target = this.resolve(node);
|
|
135
136
|
const current = import_transition_state.candidateGraph.strictValue(import_transition_state.candidateGraph.refreshNode(target), node.key);
|
|
136
137
|
let previous = current;
|
|
@@ -175,7 +176,7 @@ class SignalActionFrame {
|
|
|
175
176
|
/** Only observed candidates allocate forwarding sources; ordinary reads keep their identity. */
|
|
176
177
|
nativeSource(target, read, source) {
|
|
177
178
|
if (!nativeExtension)
|
|
178
|
-
throw new import_transition_state.CandidateUnsupportedError(
|
|
179
|
+
throw new import_transition_state.CandidateUnsupportedError(__octaneDev ? "Native signal presentation is not installed." : __octaneNoArgError(209));
|
|
179
180
|
return nativeExtension.source(this.entries.get(this.originals.get(target)), read, source);
|
|
180
181
|
}
|
|
181
182
|
validate() {
|
|
@@ -259,7 +260,7 @@ class SignalActionFrame {
|
|
|
259
260
|
/** Urgent writes win their own cells without restarting unaffected producer leases. */
|
|
260
261
|
rebase() {
|
|
261
262
|
if (!this.active)
|
|
262
|
-
throw new TypeError(
|
|
263
|
+
throw new TypeError(__octaneDev ? "The signal candidate has retired." : __octaneNoArgError(203));
|
|
263
264
|
const hadWrites = this.hasWrites();
|
|
264
265
|
this.generation++;
|
|
265
266
|
this.invalidatePreparation();
|
|
@@ -267,7 +268,7 @@ class SignalActionFrame {
|
|
|
267
268
|
for (const entry of this.entries?.values() ?? []) {
|
|
268
269
|
import_transition_state.candidateGraph.assertAlive(entry.node.owner);
|
|
269
270
|
if (entry.epoch !== entry.node.owner.epoch || entry.node.owner.readBarrier) {
|
|
270
|
-
throw new TypeError(
|
|
271
|
+
throw new TypeError(__octaneDev ? "The candidate owner changed lifetime." : __octaneNoArgError(210));
|
|
271
272
|
}
|
|
272
273
|
const operations = entry.urgentOperations;
|
|
273
274
|
if (!entry.withdrawn && !operations && entry.revision === entry.node.revision)
|
|
@@ -417,7 +418,7 @@ class SignalActionFrame {
|
|
|
417
418
|
for (let link = target.deps; link; link = link.nextDep) {
|
|
418
419
|
const original = this.originals.get(link.dep);
|
|
419
420
|
if (!original)
|
|
420
|
-
throw new TypeError(
|
|
421
|
+
throw new TypeError(__octaneDev ? "Candidate dependency escaped its frame." : __octaneNoArgError(211));
|
|
421
422
|
import_transition_state.candidateGraph.link(original, node);
|
|
422
423
|
}
|
|
423
424
|
const currentChanged = node.state?.snapshot !== state.snapshot || !import_transition_state.candidateGraph.sameState(node.state, state);
|
|
@@ -23,6 +23,7 @@ __export(transition_candidate_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(transition_candidate_exports);
|
|
24
24
|
var import_transition_state = require("./transition-state.cjs");
|
|
25
25
|
var import_transition_action = require("./transition-action.cjs");
|
|
26
|
+
const __octaneDev = process.env.NODE_ENV !== "production";
|
|
26
27
|
function __octaneNoArgError(code) {
|
|
27
28
|
return "Minified Octane error #" + code + "; visit https://octanejs.dev/errors/" + code + " for the full message or use a development build for full errors and additional helpful warnings.";
|
|
28
29
|
}
|
|
@@ -36,7 +37,7 @@ function createNativeReadCandidateSource(candidate) {
|
|
|
36
37
|
getVersion: () => target === void 0 ? NaN : !accepted ? target.getVersion() : target.getVersion() === canonicalVersion ? acceptedVersion : NaN,
|
|
37
38
|
subscribe(notify) {
|
|
38
39
|
if (target === void 0)
|
|
39
|
-
throw new TypeError(
|
|
40
|
+
throw new TypeError(__octaneDev ? "The native read candidate has retired." : __octaneNoArgError(212));
|
|
40
41
|
const subscription = { notify, dispose: target.subscribe(notify) };
|
|
41
42
|
subscriptions.add(subscription);
|
|
42
43
|
return () => {
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
version: () => version
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const version = "0.
|
|
24
|
+
const version = "0.7.0";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
version
|