octane 0.3.4 → 0.3.6
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/runtime.cjs +15 -6
- package/dist/cjs/version.cjs +1 -1
- package/dist/compiler/vite.js +1 -1
- package/dist/hydration/stream-result-receiver.d.ts +1 -0
- package/dist/hydration/stream-result-receiver.js +14 -2
- package/dist/runtime.js +15 -6
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/cjs/runtime.cjs
CHANGED
|
@@ -23278,6 +23278,7 @@ function commitResume(state) {
|
|
|
23278
23278
|
}
|
|
23279
23279
|
function commitResumeInner(state) {
|
|
23280
23280
|
if (state.parentBlock.disposed) return;
|
|
23281
|
+
let deferredNativeAcceptance = false;
|
|
23281
23282
|
if (NATIVE_READ_DRIVER !== null && state.hiddenDom !== null) {
|
|
23282
23283
|
const staged = state.stagedCapture;
|
|
23283
23284
|
if (staged === null || !NATIVE_READ_DRIVER.validateCapture(staged)) {
|
|
@@ -23293,7 +23294,8 @@ function commitResumeInner(state) {
|
|
|
23293
23294
|
}
|
|
23294
23295
|
return;
|
|
23295
23296
|
}
|
|
23296
|
-
if (WIP_CAPTURE === null)
|
|
23297
|
+
if (WIP_CAPTURE === null)
|
|
23298
|
+
deferredNativeAcceptance = acceptNativeCapture(staged, state.parentBlock.idState.renderOwner);
|
|
23297
23299
|
}
|
|
23298
23300
|
const wasPending = state.branch === 2;
|
|
23299
23301
|
const hiddenActivity = findHiddenActivity(state.parentBlock);
|
|
@@ -23330,7 +23332,7 @@ function commitResumeInner(state) {
|
|
|
23330
23332
|
tryBlock2.pendingMode = null;
|
|
23331
23333
|
tryBlock2.pendingDeferred = false;
|
|
23332
23334
|
if (state.detachedRefs !== null) stagedCapture.refs.length = 0;
|
|
23333
|
-
spliceOffscreenCapture(stagedCapture);
|
|
23335
|
+
spliceOffscreenCapture(stagedCapture, deferredNativeAcceptance);
|
|
23334
23336
|
state.hasResolved = true;
|
|
23335
23337
|
} else {
|
|
23336
23338
|
const journalCheckpoint = armTransitionJournal(state);
|
|
@@ -23353,7 +23355,10 @@ function commitResumeInner(state) {
|
|
|
23353
23355
|
if (NATIVE_READ_DRIVER !== null) {
|
|
23354
23356
|
invalidNativeReads = !NATIVE_READ_DRIVER.validateCapture(resumeCapture);
|
|
23355
23357
|
if (!invalidNativeReads && previousCapture === null)
|
|
23356
|
-
acceptNativeCapture(
|
|
23358
|
+
deferredNativeAcceptance = acceptNativeCapture(
|
|
23359
|
+
resumeCapture,
|
|
23360
|
+
state.parentBlock.idState.renderOwner
|
|
23361
|
+
);
|
|
23357
23362
|
}
|
|
23358
23363
|
} catch (err) {
|
|
23359
23364
|
didThrow = true;
|
|
@@ -23386,7 +23391,7 @@ function commitResumeInner(state) {
|
|
|
23386
23391
|
refDetachQueue.splice(refDetachCheckpoint);
|
|
23387
23392
|
resumeCapture.refs.length = 0;
|
|
23388
23393
|
}
|
|
23389
|
-
spliceOffscreenCapture(resumeCapture);
|
|
23394
|
+
spliceOffscreenCapture(resumeCapture, deferredNativeAcceptance);
|
|
23390
23395
|
state.hasResolved = true;
|
|
23391
23396
|
} else {
|
|
23392
23397
|
try {
|
|
@@ -23657,6 +23662,7 @@ function attemptHiddenRevealInner(state, scheduledMode, reason = "update") {
|
|
|
23657
23662
|
const retryMode = scheduledMode ?? tryBlock2.pendingMode ?? CURRENT_BLOCK?.currentRenderMode ?? "urgent";
|
|
23658
23663
|
const stagesHeldTransition = retryMode === "transition" && HELD_TRANSITIONS.has(state);
|
|
23659
23664
|
const hiddenCapture = createOffscreenCapture();
|
|
23665
|
+
let deferredNativeAcceptance = false;
|
|
23660
23666
|
const previousCapture = WIP_CAPTURE;
|
|
23661
23667
|
const refDetachCheckpoint = refDetachQueue.length;
|
|
23662
23668
|
WIP_CAPTURE = hiddenCapture;
|
|
@@ -23717,7 +23723,10 @@ function attemptHiddenRevealInner(state, scheduledMode, reason = "update") {
|
|
|
23717
23723
|
return;
|
|
23718
23724
|
}
|
|
23719
23725
|
if (WIP_CAPTURE === null)
|
|
23720
|
-
acceptNativeCapture(
|
|
23726
|
+
deferredNativeAcceptance = acceptNativeCapture(
|
|
23727
|
+
hiddenCapture,
|
|
23728
|
+
state.parentBlock.idState.renderOwner
|
|
23729
|
+
);
|
|
23721
23730
|
}
|
|
23722
23731
|
try {
|
|
23723
23732
|
if (state.block !== null && state.block !== tryBlock2) {
|
|
@@ -23733,7 +23742,7 @@ function attemptHiddenRevealInner(state, scheduledMode, reason = "update") {
|
|
|
23733
23742
|
setTryBranch(state, 1);
|
|
23734
23743
|
state.hasResolved = true;
|
|
23735
23744
|
state.pendingThenable = null;
|
|
23736
|
-
spliceOffscreenCapture(hiddenCapture);
|
|
23745
|
+
spliceOffscreenCapture(hiddenCapture, deferredNativeAcceptance);
|
|
23737
23746
|
recordSuspenseCommit(state);
|
|
23738
23747
|
publishHiddenRevealActions(state);
|
|
23739
23748
|
queueCurrentHiddenRefs(state);
|
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.3.
|
|
24
|
+
const version = "0.3.6";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
version
|
package/dist/compiler/vite.js
CHANGED
|
@@ -931,7 +931,7 @@ export function octane(options = {}) {
|
|
|
931
931
|
const runtimeRequest = compiler.resolveRuntimeRequest(source, 'server');
|
|
932
932
|
if (runtimeRequest === null || runtimeRequest === source) return null;
|
|
933
933
|
const resolved = await this.resolve(runtimeRequest, importer, { skipSelf: true });
|
|
934
|
-
return resolved
|
|
934
|
+
return resolved ?? null;
|
|
935
935
|
},
|
|
936
936
|
transform(code, id, transformOptions) {
|
|
937
937
|
const server =
|
|
@@ -14,6 +14,7 @@ class StreamedReceiverError extends Error {
|
|
|
14
14
|
function retainCompletedResult(result) {
|
|
15
15
|
if (result.frames.at(-1)?.kind === "complete" && result.consumer?.retainCompleted?.(result.frames) === true) {
|
|
16
16
|
result.frames = [];
|
|
17
|
+
result.frameSizes.length = 0;
|
|
17
18
|
result.bytes = 0;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -54,6 +55,7 @@ function createStreamedResultReceiverState(options, commitPlacement) {
|
|
|
54
55
|
} catch {
|
|
55
56
|
}
|
|
56
57
|
state.result.frames.length = 0;
|
|
58
|
+
state.result.frameSizes.length = 0;
|
|
57
59
|
state.result.bytes = 0;
|
|
58
60
|
}
|
|
59
61
|
if (state.result.timer !== void 0) clearTimeout(state.result.timer);
|
|
@@ -96,7 +98,15 @@ function createStreamedResultReceiverState(options, commitPlacement) {
|
|
|
96
98
|
}
|
|
97
99
|
const state = {
|
|
98
100
|
identity,
|
|
99
|
-
result: {
|
|
101
|
+
result: {
|
|
102
|
+
sequence: 0,
|
|
103
|
+
opened: false,
|
|
104
|
+
values: 0,
|
|
105
|
+
terminal: false,
|
|
106
|
+
frames: [],
|
|
107
|
+
frameSizes: [],
|
|
108
|
+
bytes: 0
|
|
109
|
+
},
|
|
100
110
|
placementSequence: 0,
|
|
101
111
|
contentRevision
|
|
102
112
|
};
|
|
@@ -128,10 +138,11 @@ function createStreamedResultReceiverState(options, commitPlacement) {
|
|
|
128
138
|
if (accepted === state.result.frames.length) state.result.bytes = 0;
|
|
129
139
|
else {
|
|
130
140
|
for (let index = 0; index < accepted; index++) {
|
|
131
|
-
state.result.bytes -=
|
|
141
|
+
state.result.bytes -= state.result.frameSizes[index];
|
|
132
142
|
}
|
|
133
143
|
}
|
|
134
144
|
state.result.frames.splice(0, accepted);
|
|
145
|
+
state.result.frameSizes.splice(0, accepted);
|
|
135
146
|
}
|
|
136
147
|
retainCompletedResult(state.result);
|
|
137
148
|
return () => {
|
|
@@ -174,6 +185,7 @@ function createStreamedResultReceiverState(options, commitPlacement) {
|
|
|
174
185
|
throw new StreamedReceiverError("overflow", "Streamed result mailbox exceeded its bound.");
|
|
175
186
|
}
|
|
176
187
|
result.frames.push(frame);
|
|
188
|
+
result.frameSizes.push(bytes);
|
|
177
189
|
result.bytes += bytes;
|
|
178
190
|
}
|
|
179
191
|
if (frame.kind === "complete" || frame.kind === "error") {
|
package/dist/runtime.js
CHANGED
|
@@ -23140,6 +23140,7 @@ function commitResume(state) {
|
|
|
23140
23140
|
}
|
|
23141
23141
|
function commitResumeInner(state) {
|
|
23142
23142
|
if (state.parentBlock.disposed) return;
|
|
23143
|
+
let deferredNativeAcceptance = false;
|
|
23143
23144
|
if (NATIVE_READ_DRIVER !== null && state.hiddenDom !== null) {
|
|
23144
23145
|
const staged = state.stagedCapture;
|
|
23145
23146
|
if (staged === null || !NATIVE_READ_DRIVER.validateCapture(staged)) {
|
|
@@ -23155,7 +23156,8 @@ function commitResumeInner(state) {
|
|
|
23155
23156
|
}
|
|
23156
23157
|
return;
|
|
23157
23158
|
}
|
|
23158
|
-
if (WIP_CAPTURE === null)
|
|
23159
|
+
if (WIP_CAPTURE === null)
|
|
23160
|
+
deferredNativeAcceptance = acceptNativeCapture(staged, state.parentBlock.idState.renderOwner);
|
|
23159
23161
|
}
|
|
23160
23162
|
const wasPending = state.branch === 2;
|
|
23161
23163
|
const hiddenActivity = findHiddenActivity(state.parentBlock);
|
|
@@ -23192,7 +23194,7 @@ function commitResumeInner(state) {
|
|
|
23192
23194
|
tryBlock2.pendingMode = null;
|
|
23193
23195
|
tryBlock2.pendingDeferred = false;
|
|
23194
23196
|
if (state.detachedRefs !== null) stagedCapture.refs.length = 0;
|
|
23195
|
-
spliceOffscreenCapture(stagedCapture);
|
|
23197
|
+
spliceOffscreenCapture(stagedCapture, deferredNativeAcceptance);
|
|
23196
23198
|
state.hasResolved = true;
|
|
23197
23199
|
} else {
|
|
23198
23200
|
const journalCheckpoint = armTransitionJournal(state);
|
|
@@ -23215,7 +23217,10 @@ function commitResumeInner(state) {
|
|
|
23215
23217
|
if (NATIVE_READ_DRIVER !== null) {
|
|
23216
23218
|
invalidNativeReads = !NATIVE_READ_DRIVER.validateCapture(resumeCapture);
|
|
23217
23219
|
if (!invalidNativeReads && previousCapture === null)
|
|
23218
|
-
acceptNativeCapture(
|
|
23220
|
+
deferredNativeAcceptance = acceptNativeCapture(
|
|
23221
|
+
resumeCapture,
|
|
23222
|
+
state.parentBlock.idState.renderOwner
|
|
23223
|
+
);
|
|
23219
23224
|
}
|
|
23220
23225
|
} catch (err) {
|
|
23221
23226
|
didThrow = true;
|
|
@@ -23248,7 +23253,7 @@ function commitResumeInner(state) {
|
|
|
23248
23253
|
refDetachQueue.splice(refDetachCheckpoint);
|
|
23249
23254
|
resumeCapture.refs.length = 0;
|
|
23250
23255
|
}
|
|
23251
|
-
spliceOffscreenCapture(resumeCapture);
|
|
23256
|
+
spliceOffscreenCapture(resumeCapture, deferredNativeAcceptance);
|
|
23252
23257
|
state.hasResolved = true;
|
|
23253
23258
|
} else {
|
|
23254
23259
|
try {
|
|
@@ -23519,6 +23524,7 @@ function attemptHiddenRevealInner(state, scheduledMode, reason = "update") {
|
|
|
23519
23524
|
const retryMode = scheduledMode ?? tryBlock2.pendingMode ?? CURRENT_BLOCK?.currentRenderMode ?? "urgent";
|
|
23520
23525
|
const stagesHeldTransition = retryMode === "transition" && HELD_TRANSITIONS.has(state);
|
|
23521
23526
|
const hiddenCapture = createOffscreenCapture();
|
|
23527
|
+
let deferredNativeAcceptance = false;
|
|
23522
23528
|
const previousCapture = WIP_CAPTURE;
|
|
23523
23529
|
const refDetachCheckpoint = refDetachQueue.length;
|
|
23524
23530
|
WIP_CAPTURE = hiddenCapture;
|
|
@@ -23579,7 +23585,10 @@ function attemptHiddenRevealInner(state, scheduledMode, reason = "update") {
|
|
|
23579
23585
|
return;
|
|
23580
23586
|
}
|
|
23581
23587
|
if (WIP_CAPTURE === null)
|
|
23582
|
-
acceptNativeCapture(
|
|
23588
|
+
deferredNativeAcceptance = acceptNativeCapture(
|
|
23589
|
+
hiddenCapture,
|
|
23590
|
+
state.parentBlock.idState.renderOwner
|
|
23591
|
+
);
|
|
23583
23592
|
}
|
|
23584
23593
|
try {
|
|
23585
23594
|
if (state.block !== null && state.block !== tryBlock2) {
|
|
@@ -23595,7 +23604,7 @@ function attemptHiddenRevealInner(state, scheduledMode, reason = "update") {
|
|
|
23595
23604
|
setTryBranch(state, 1);
|
|
23596
23605
|
state.hasResolved = true;
|
|
23597
23606
|
state.pendingThenable = null;
|
|
23598
|
-
spliceOffscreenCapture(hiddenCapture);
|
|
23607
|
+
spliceOffscreenCapture(hiddenCapture, deferredNativeAcceptance);
|
|
23599
23608
|
recordSuspenseCommit(state);
|
|
23600
23609
|
publishHiddenRevealActions(state);
|
|
23601
23610
|
queueCurrentHiddenRefs(state);
|
package/dist/version.js
CHANGED