octane 0.1.46 → 0.1.47
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 +53 -26
- package/dist/cjs/behavior-root.cjs +53 -26
- package/dist/cjs/runtime.cjs +55 -12
- package/dist/cjs/runtime.server.cjs +20 -8
- package/dist/cjs/version.cjs +1 -1
- package/dist/compiler/compile-renderer-boundaries.js +4 -4
- package/dist/compiler/compile.js +243 -82
- package/dist/compiler/volar.LICENSES.txt +1 -1
- package/dist/compiler/volar.js +37 -37
- package/dist/runtime.js +55 -12
- package/dist/runtime.server.js +20 -8
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/dist/behavior-root.js
CHANGED
|
@@ -131,9 +131,15 @@ function adoptionContext(adoption, event) {
|
|
|
131
131
|
};
|
|
132
132
|
return context;
|
|
133
133
|
}
|
|
134
|
+
function finishPendingAdoption(adoption) {
|
|
135
|
+
if (!adoption.pending) return;
|
|
136
|
+
adoption.pending = false;
|
|
137
|
+
adoption.entry.pendingAdoptionCount--;
|
|
138
|
+
}
|
|
134
139
|
function disposeAdoption(adoption) {
|
|
135
140
|
if (adoption.disposed) return;
|
|
136
141
|
adoption.disposed = true;
|
|
142
|
+
finishPendingAdoption(adoption);
|
|
137
143
|
adoption.entry.adoptions.delete(adoption.element);
|
|
138
144
|
adoption.controller.abort();
|
|
139
145
|
for (const unlink of adoption.unlinks) unlink();
|
|
@@ -144,29 +150,47 @@ function disposeAdoption(adoption) {
|
|
|
144
150
|
}
|
|
145
151
|
function flushQueuedEvents(record) {
|
|
146
152
|
if (record.status !== "active") return;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
const queue = record.queuedEvents;
|
|
154
|
+
record.queuedEventFlushDepth++;
|
|
155
|
+
try {
|
|
156
|
+
while (record.queuedEventHead < queue.length) {
|
|
157
|
+
const index = record.queuedEventHead;
|
|
158
|
+
const queued = queue[index];
|
|
159
|
+
if (!contains(record.root, queued.element)) {
|
|
160
|
+
record.queuedEventHead = index + 1;
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
const range = nearestRange(record.root, queued.element);
|
|
164
|
+
if (range !== queued.range || !rangeMatches(record, range)) {
|
|
165
|
+
record.queuedEventHead = index + 1;
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if (range?.status === "pending") return;
|
|
169
|
+
let adoption = record.adoptions.get(queued.element);
|
|
170
|
+
if (adoption === void 0) {
|
|
171
|
+
adoption = adoptElement(record, queued.element, range, queued.event);
|
|
172
|
+
}
|
|
173
|
+
if (adoption === void 0 || adoption.pending) return;
|
|
174
|
+
if (record.queuedEventHead !== index || queue[index] !== queued) continue;
|
|
175
|
+
record.queuedEventHead = index + 1;
|
|
176
|
+
record.entry.handleEvent?.(
|
|
177
|
+
queued.event,
|
|
178
|
+
queued.element,
|
|
179
|
+
adoptionContext(adoption, queued.event)
|
|
180
|
+
);
|
|
157
181
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (
|
|
161
|
-
|
|
182
|
+
} finally {
|
|
183
|
+
record.queuedEventFlushDepth--;
|
|
184
|
+
if (record.queuedEventFlushDepth === 0 && record.queuedEventHead !== 0) {
|
|
185
|
+
const consumed = record.queuedEventHead;
|
|
186
|
+
if (consumed >= queue.length) {
|
|
187
|
+
queue.length = 0;
|
|
188
|
+
record.queuedEventHead = 0;
|
|
189
|
+
} else if (consumed >= queue.length - consumed) {
|
|
190
|
+
queue.splice(0, consumed);
|
|
191
|
+
record.queuedEventHead = 0;
|
|
192
|
+
}
|
|
162
193
|
}
|
|
163
|
-
if (adoption === void 0 || adoption.pending) return;
|
|
164
|
-
record.queuedEvents.shift();
|
|
165
|
-
record.entry.handleEvent?.(
|
|
166
|
-
queued.event,
|
|
167
|
-
queued.element,
|
|
168
|
-
adoptionContext(adoption, queued.event)
|
|
169
|
-
);
|
|
170
194
|
}
|
|
171
195
|
}
|
|
172
196
|
function completeBehavior(record) {
|
|
@@ -175,9 +199,7 @@ function completeBehavior(record) {
|
|
|
175
199
|
if (range.status === "pending") return;
|
|
176
200
|
record.waitingRanges.delete(range);
|
|
177
201
|
}
|
|
178
|
-
|
|
179
|
-
if (adoption.pending) return;
|
|
180
|
-
}
|
|
202
|
+
if (record.pendingAdoptionCount !== 0) return;
|
|
181
203
|
flushQueuedEvents(record);
|
|
182
204
|
if (record.queuedEvents.length !== 0) return;
|
|
183
205
|
record.readiness.resolve();
|
|
@@ -227,9 +249,10 @@ function adoptElement(record, element, range, event) {
|
|
|
227
249
|
}
|
|
228
250
|
if (typeof result === "object" && result !== null && typeof result.then === "function") {
|
|
229
251
|
adoption.pending = true;
|
|
252
|
+
record.pendingAdoptionCount++;
|
|
230
253
|
const settled = Promise.resolve(result).then(
|
|
231
254
|
(cleanup) => {
|
|
232
|
-
adoption
|
|
255
|
+
finishPendingAdoption(adoption);
|
|
233
256
|
if (typeof cleanup === "function") {
|
|
234
257
|
if (adoption.disposed || adoption.controller.signal.aborted) cleanup();
|
|
235
258
|
else adoption.cleanup = cleanup;
|
|
@@ -240,7 +263,7 @@ function adoptElement(record, element, range, event) {
|
|
|
240
263
|
}
|
|
241
264
|
},
|
|
242
265
|
(error) => {
|
|
243
|
-
adoption
|
|
266
|
+
finishPendingAdoption(adoption);
|
|
244
267
|
if (adoption.disposed || record.controller.signal.aborted) return;
|
|
245
268
|
disposeAdoption(adoption);
|
|
246
269
|
failBehavior(record, error);
|
|
@@ -375,6 +398,7 @@ function disposeBehavior(record) {
|
|
|
375
398
|
record.root.behaviorsById.delete(record.entry.id);
|
|
376
399
|
}
|
|
377
400
|
record.queuedEvents.length = 0;
|
|
401
|
+
record.queuedEventHead = 0;
|
|
378
402
|
record.waitingRanges.clear();
|
|
379
403
|
let firstError;
|
|
380
404
|
for (const adoption of [...record.adoptions.values()]) {
|
|
@@ -428,8 +452,11 @@ function registerBehavior(root, entry) {
|
|
|
428
452
|
readiness,
|
|
429
453
|
status: "pending",
|
|
430
454
|
adoptions: /* @__PURE__ */ new Map(),
|
|
455
|
+
pendingAdoptionCount: 0,
|
|
431
456
|
waitingRanges: /* @__PURE__ */ new Set(),
|
|
432
457
|
queuedEvents: [],
|
|
458
|
+
queuedEventHead: 0,
|
|
459
|
+
queuedEventFlushDepth: 0,
|
|
433
460
|
unlinks: [linkSignal(root.controller.signal, controller)],
|
|
434
461
|
initialScanComplete: false
|
|
435
462
|
};
|
|
@@ -154,9 +154,15 @@ function adoptionContext(adoption, event) {
|
|
|
154
154
|
};
|
|
155
155
|
return context;
|
|
156
156
|
}
|
|
157
|
+
function finishPendingAdoption(adoption) {
|
|
158
|
+
if (!adoption.pending) return;
|
|
159
|
+
adoption.pending = false;
|
|
160
|
+
adoption.entry.pendingAdoptionCount--;
|
|
161
|
+
}
|
|
157
162
|
function disposeAdoption(adoption) {
|
|
158
163
|
if (adoption.disposed) return;
|
|
159
164
|
adoption.disposed = true;
|
|
165
|
+
finishPendingAdoption(adoption);
|
|
160
166
|
adoption.entry.adoptions.delete(adoption.element);
|
|
161
167
|
adoption.controller.abort();
|
|
162
168
|
for (const unlink of adoption.unlinks) unlink();
|
|
@@ -167,29 +173,47 @@ function disposeAdoption(adoption) {
|
|
|
167
173
|
}
|
|
168
174
|
function flushQueuedEvents(record) {
|
|
169
175
|
if (record.status !== "active") return;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
const queue = record.queuedEvents;
|
|
177
|
+
record.queuedEventFlushDepth++;
|
|
178
|
+
try {
|
|
179
|
+
while (record.queuedEventHead < queue.length) {
|
|
180
|
+
const index = record.queuedEventHead;
|
|
181
|
+
const queued = queue[index];
|
|
182
|
+
if (!contains(record.root, queued.element)) {
|
|
183
|
+
record.queuedEventHead = index + 1;
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
const range = nearestRange(record.root, queued.element);
|
|
187
|
+
if (range !== queued.range || !rangeMatches(record, range)) {
|
|
188
|
+
record.queuedEventHead = index + 1;
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (range?.status === "pending") return;
|
|
192
|
+
let adoption = record.adoptions.get(queued.element);
|
|
193
|
+
if (adoption === void 0) {
|
|
194
|
+
adoption = adoptElement(record, queued.element, range, queued.event);
|
|
195
|
+
}
|
|
196
|
+
if (adoption === void 0 || adoption.pending) return;
|
|
197
|
+
if (record.queuedEventHead !== index || queue[index] !== queued) continue;
|
|
198
|
+
record.queuedEventHead = index + 1;
|
|
199
|
+
record.entry.handleEvent?.(
|
|
200
|
+
queued.event,
|
|
201
|
+
queued.element,
|
|
202
|
+
adoptionContext(adoption, queued.event)
|
|
203
|
+
);
|
|
180
204
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if (
|
|
184
|
-
|
|
205
|
+
} finally {
|
|
206
|
+
record.queuedEventFlushDepth--;
|
|
207
|
+
if (record.queuedEventFlushDepth === 0 && record.queuedEventHead !== 0) {
|
|
208
|
+
const consumed = record.queuedEventHead;
|
|
209
|
+
if (consumed >= queue.length) {
|
|
210
|
+
queue.length = 0;
|
|
211
|
+
record.queuedEventHead = 0;
|
|
212
|
+
} else if (consumed >= queue.length - consumed) {
|
|
213
|
+
queue.splice(0, consumed);
|
|
214
|
+
record.queuedEventHead = 0;
|
|
215
|
+
}
|
|
185
216
|
}
|
|
186
|
-
if (adoption === void 0 || adoption.pending) return;
|
|
187
|
-
record.queuedEvents.shift();
|
|
188
|
-
record.entry.handleEvent?.(
|
|
189
|
-
queued.event,
|
|
190
|
-
queued.element,
|
|
191
|
-
adoptionContext(adoption, queued.event)
|
|
192
|
-
);
|
|
193
217
|
}
|
|
194
218
|
}
|
|
195
219
|
function completeBehavior(record) {
|
|
@@ -198,9 +222,7 @@ function completeBehavior(record) {
|
|
|
198
222
|
if (range.status === "pending") return;
|
|
199
223
|
record.waitingRanges.delete(range);
|
|
200
224
|
}
|
|
201
|
-
|
|
202
|
-
if (adoption.pending) return;
|
|
203
|
-
}
|
|
225
|
+
if (record.pendingAdoptionCount !== 0) return;
|
|
204
226
|
flushQueuedEvents(record);
|
|
205
227
|
if (record.queuedEvents.length !== 0) return;
|
|
206
228
|
record.readiness.resolve();
|
|
@@ -250,9 +272,10 @@ function adoptElement(record, element, range, event) {
|
|
|
250
272
|
}
|
|
251
273
|
if (typeof result === "object" && result !== null && typeof result.then === "function") {
|
|
252
274
|
adoption.pending = true;
|
|
275
|
+
record.pendingAdoptionCount++;
|
|
253
276
|
const settled = Promise.resolve(result).then(
|
|
254
277
|
(cleanup) => {
|
|
255
|
-
adoption
|
|
278
|
+
finishPendingAdoption(adoption);
|
|
256
279
|
if (typeof cleanup === "function") {
|
|
257
280
|
if (adoption.disposed || adoption.controller.signal.aborted) cleanup();
|
|
258
281
|
else adoption.cleanup = cleanup;
|
|
@@ -263,7 +286,7 @@ function adoptElement(record, element, range, event) {
|
|
|
263
286
|
}
|
|
264
287
|
},
|
|
265
288
|
(error) => {
|
|
266
|
-
adoption
|
|
289
|
+
finishPendingAdoption(adoption);
|
|
267
290
|
if (adoption.disposed || record.controller.signal.aborted) return;
|
|
268
291
|
disposeAdoption(adoption);
|
|
269
292
|
failBehavior(record, error);
|
|
@@ -398,6 +421,7 @@ function disposeBehavior(record) {
|
|
|
398
421
|
record.root.behaviorsById.delete(record.entry.id);
|
|
399
422
|
}
|
|
400
423
|
record.queuedEvents.length = 0;
|
|
424
|
+
record.queuedEventHead = 0;
|
|
401
425
|
record.waitingRanges.clear();
|
|
402
426
|
let firstError;
|
|
403
427
|
for (const adoption of [...record.adoptions.values()]) {
|
|
@@ -451,8 +475,11 @@ function registerBehavior(root, entry) {
|
|
|
451
475
|
readiness,
|
|
452
476
|
status: "pending",
|
|
453
477
|
adoptions: /* @__PURE__ */ new Map(),
|
|
478
|
+
pendingAdoptionCount: 0,
|
|
454
479
|
waitingRanges: /* @__PURE__ */ new Set(),
|
|
455
480
|
queuedEvents: [],
|
|
481
|
+
queuedEventHead: 0,
|
|
482
|
+
queuedEventFlushDepth: 0,
|
|
456
483
|
unlinks: [linkSignal(root.controller.signal, controller)],
|
|
457
484
|
initialScanComplete: false
|
|
458
485
|
};
|
package/dist/cjs/runtime.cjs
CHANGED
|
@@ -8727,21 +8727,25 @@ function setHostPropSources(el, sources, prev, scope, hasNestedChildren = false)
|
|
|
8727
8727
|
}
|
|
8728
8728
|
}
|
|
8729
8729
|
const values = /* @__PURE__ */ new Map();
|
|
8730
|
+
let needsWinningOrderSort = false;
|
|
8730
8731
|
for (const writer of props.values()) {
|
|
8731
8732
|
if (writer.rawName === "key") continue;
|
|
8732
8733
|
const [identity, name] = normalizedHostProp(el, writer.rawName);
|
|
8733
8734
|
const previous = values.get(identity);
|
|
8734
|
-
if (previous
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
writer.value,
|
|
8738
|
-
writer.firstOrder,
|
|
8739
|
-
writer.lastOrder
|
|
8740
|
-
]);
|
|
8735
|
+
if (previous !== void 0) {
|
|
8736
|
+
if (previous[3] >= writer.lastOrder) continue;
|
|
8737
|
+
needsWinningOrderSort = true;
|
|
8741
8738
|
}
|
|
8739
|
+
values.set(identity, [
|
|
8740
|
+
process.env.NODE_ENV !== "production" && (writer.rawName === "tabIndex" || writer.rawName === "htmlFor") ? writer.rawName : name,
|
|
8741
|
+
writer.value,
|
|
8742
|
+
writer.firstOrder,
|
|
8743
|
+
writer.lastOrder
|
|
8744
|
+
]);
|
|
8742
8745
|
}
|
|
8743
8746
|
const resolved = /* @__PURE__ */ Object.create(null);
|
|
8744
|
-
const ordered = [...values.values()]
|
|
8747
|
+
const ordered = [...values.values()];
|
|
8748
|
+
if (needsWinningOrderSort) ordered.sort((a, b) => a[2] - b[2]);
|
|
8745
8749
|
for (const [name, value] of ordered) resolved[name] = value;
|
|
8746
8750
|
const formHost = el.localName === "input" || el.localName === "textarea" || el.localName === "select";
|
|
8747
8751
|
setSpread(el, resolved, prev, scope, true, formHost);
|
|
@@ -9593,6 +9597,9 @@ let CHECKED_RESTORE = null;
|
|
|
9593
9597
|
let SELECT_SYNCS = [];
|
|
9594
9598
|
let SELECT_DEFAULT_SYNCS = [];
|
|
9595
9599
|
let DEV_FORM_CHECKS = process.env.NODE_ENV === "production" ? null : [];
|
|
9600
|
+
const DEV_FORM_CHECK_MARK = /* @__PURE__ */ Symbol("octane.devFormCheck");
|
|
9601
|
+
const DEV_FORM_CHECK_LINEAR_LIMIT = 8;
|
|
9602
|
+
let DEV_FORM_CHECK_GENERATION = 1;
|
|
9596
9603
|
let AUTOFOCUS_QUEUE = [];
|
|
9597
9604
|
function queueControlledCommit(queue, item) {
|
|
9598
9605
|
queue.push(item);
|
|
@@ -9602,6 +9609,18 @@ function queueControlledCommit(queue, item) {
|
|
|
9602
9609
|
if (index !== -1) queue.splice(index, 1);
|
|
9603
9610
|
});
|
|
9604
9611
|
}
|
|
9612
|
+
function queueDevFormCheck(queue, el) {
|
|
9613
|
+
queue.push(el);
|
|
9614
|
+
if (ROOT_RENDER_TRANSACTION !== null) {
|
|
9615
|
+
const host = el;
|
|
9616
|
+
const generation = DEV_FORM_CHECK_GENERATION;
|
|
9617
|
+
journalUndo(() => {
|
|
9618
|
+
const index = queue.lastIndexOf(el);
|
|
9619
|
+
if (index !== -1) queue.splice(index, 1);
|
|
9620
|
+
if (host[DEV_FORM_CHECK_MARK] === generation) delete host[DEV_FORM_CHECK_MARK];
|
|
9621
|
+
});
|
|
9622
|
+
}
|
|
9623
|
+
}
|
|
9605
9624
|
function hasControlledSyncs() {
|
|
9606
9625
|
return SELECT_SYNCS.length > 0 || SELECT_DEFAULT_SYNCS.length > 0 || DEV_FORM_CHECKS !== null && DEV_FORM_CHECKS.length > 0 || AUTOFOCUS_QUEUE.length > 0;
|
|
9607
9626
|
}
|
|
@@ -9755,7 +9774,19 @@ function queueDevFormDiagnostic(el, scope, force = false) {
|
|
|
9755
9774
|
const q = DEV_FORM_CHECKS;
|
|
9756
9775
|
if (q === null || !force && !hasDevFormDiagnosticContext(el, scope)) return;
|
|
9757
9776
|
if (!force && !hasPotentialFormDiagnostic(el)) return;
|
|
9758
|
-
if (q.
|
|
9777
|
+
if (q.length < DEV_FORM_CHECK_LINEAR_LIMIT) {
|
|
9778
|
+
if (q.indexOf(el) !== -1) return;
|
|
9779
|
+
queueDevFormCheck(q, el);
|
|
9780
|
+
if (q.length < DEV_FORM_CHECK_LINEAR_LIMIT) return;
|
|
9781
|
+
for (let i = 0; i < q.length; i++) {
|
|
9782
|
+
q[i][DEV_FORM_CHECK_MARK] = DEV_FORM_CHECK_GENERATION;
|
|
9783
|
+
}
|
|
9784
|
+
return;
|
|
9785
|
+
}
|
|
9786
|
+
const host = el;
|
|
9787
|
+
if (host[DEV_FORM_CHECK_MARK] === DEV_FORM_CHECK_GENERATION) return;
|
|
9788
|
+
queueDevFormCheck(q, el);
|
|
9789
|
+
host[DEV_FORM_CHECK_MARK] = DEV_FORM_CHECK_GENERATION;
|
|
9759
9790
|
}
|
|
9760
9791
|
function queueFormAuthoringDiagnostic(el, kind, selected) {
|
|
9761
9792
|
if (process.env.NODE_ENV === "production") return;
|
|
@@ -10170,6 +10201,7 @@ function drainDevFormDiagnostics() {
|
|
|
10170
10201
|
const q = DEV_FORM_CHECKS;
|
|
10171
10202
|
if (q === null || q.length === 0) return;
|
|
10172
10203
|
DEV_FORM_CHECKS = [];
|
|
10204
|
+
DEV_FORM_CHECK_GENERATION++;
|
|
10173
10205
|
for (let i = 0; i < q.length; i++) {
|
|
10174
10206
|
const el = q[i];
|
|
10175
10207
|
const authoring = getDevFormDiagnosticState(el);
|
|
@@ -17469,6 +17501,10 @@ function updateSurvivor(block, newItem, newIdx, itemBody, pure, lite, indexIndep
|
|
|
17469
17501
|
}
|
|
17470
17502
|
}
|
|
17471
17503
|
}
|
|
17504
|
+
function consumeAdoptQueuePrefix(adopt, count) {
|
|
17505
|
+
if (count < adopt.length) adopt.copyWithin(0, count);
|
|
17506
|
+
adopt.length -= count;
|
|
17507
|
+
}
|
|
17472
17508
|
function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoot, ssrMarkerless) {
|
|
17473
17509
|
const newLen = items.length;
|
|
17474
17510
|
if (newLen === 0) return;
|
|
@@ -17476,6 +17512,7 @@ function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoo
|
|
|
17476
17512
|
const oldItems = state.items;
|
|
17477
17513
|
const parentNode = state.end.parentNode;
|
|
17478
17514
|
const adopt = state.adopt;
|
|
17515
|
+
let adoptIndex = 0;
|
|
17479
17516
|
let prev = null;
|
|
17480
17517
|
const mounted = [];
|
|
17481
17518
|
try {
|
|
@@ -17484,9 +17521,14 @@ function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoo
|
|
|
17484
17521
|
const key = getKey(item, i);
|
|
17485
17522
|
let adoptNode = null;
|
|
17486
17523
|
let anchor = state.end;
|
|
17487
|
-
if (adopt !== null && adopt.length
|
|
17488
|
-
|
|
17489
|
-
|
|
17524
|
+
if (adopt !== null && adoptIndex < adopt.length) {
|
|
17525
|
+
const candidate = adopt[adoptIndex];
|
|
17526
|
+
if (candidate.key === key) {
|
|
17527
|
+
adoptNode = candidate.node;
|
|
17528
|
+
adoptIndex++;
|
|
17529
|
+
} else {
|
|
17530
|
+
anchor = candidate.node;
|
|
17531
|
+
}
|
|
17490
17532
|
}
|
|
17491
17533
|
const block = mountItem(
|
|
17492
17534
|
parentBlock,
|
|
@@ -17522,6 +17564,7 @@ function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoo
|
|
|
17522
17564
|
state.size = 0;
|
|
17523
17565
|
throw error;
|
|
17524
17566
|
}
|
|
17567
|
+
if (adoptIndex !== 0) consumeAdoptQueuePrefix(adopt, adoptIndex);
|
|
17525
17568
|
}
|
|
17526
17569
|
function reconcileKeyed(parentBlock, state, items, getKey, itemBody, pure, singleRoot, lite = false, indexIndependent = false, ssrMarkerless = false) {
|
|
17527
17570
|
const oldItems = state.items;
|
|
@@ -1421,6 +1421,7 @@ function ssrAttrs(sources, tag, namespace = "html", skipFormControls = false) {
|
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
1423
|
const resolved = /* @__PURE__ */ new Map();
|
|
1424
|
+
let needsWinningOrderSort = false;
|
|
1424
1425
|
for (const writer of props.values()) {
|
|
1425
1426
|
const { rawName, value, firstOrder, lastOrder } = writer;
|
|
1426
1427
|
if (rawName === "key" || rawName === "ref" || rawName === "children" || rawName === "dangerouslySetInnerHTML" || rawName === "suppressHydrationWarning" || rawName === "suppressContentEditableWarning" || rawName === "suppressNativeChangeWarning" || rawName === "__octaneNativeChangeDiagnostic")
|
|
@@ -1434,17 +1435,20 @@ function ssrAttrs(sources, tag, namespace = "html", skipFormControls = false) {
|
|
|
1434
1435
|
if (!import_constants.VALID_ATTR_NAME.test(name)) continue;
|
|
1435
1436
|
const identity = namespace === "html" ? name.toLowerCase() : name;
|
|
1436
1437
|
const previous = resolved.get(identity);
|
|
1437
|
-
if (previous
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
value,
|
|
1441
|
-
firstOrder,
|
|
1442
|
-
lastOrder
|
|
1443
|
-
]);
|
|
1438
|
+
if (previous !== void 0) {
|
|
1439
|
+
if (previous[3] >= lastOrder) continue;
|
|
1440
|
+
needsWinningOrderSort = true;
|
|
1444
1441
|
}
|
|
1442
|
+
resolved.set(identity, [
|
|
1443
|
+
process.env.NODE_ENV !== "production" && (rawName === "tabIndex" || rawName === "htmlFor") ? rawName : name,
|
|
1444
|
+
value,
|
|
1445
|
+
firstOrder,
|
|
1446
|
+
lastOrder
|
|
1447
|
+
]);
|
|
1445
1448
|
}
|
|
1446
1449
|
let out = "";
|
|
1447
|
-
const ordered = [...resolved.values()]
|
|
1450
|
+
const ordered = [...resolved.values()];
|
|
1451
|
+
if (needsWinningOrderSort) ordered.sort((a, b) => a[2] - b[2]);
|
|
1448
1452
|
if (process.env.NODE_ENV !== "production") {
|
|
1449
1453
|
devValidateSsrAriaProps(
|
|
1450
1454
|
ordered.map(([name]) => name),
|
|
@@ -3931,6 +3935,9 @@ function rewindStreamBoundaryReplay(stream, checkpoint) {
|
|
|
3931
3935
|
for (const [key, boundary] of ordered) stream.boundaries.set(key, boundary);
|
|
3932
3936
|
}
|
|
3933
3937
|
}
|
|
3938
|
+
function recordStreamBoundaryOwners(stream, owners) {
|
|
3939
|
+
for (const owner of owners) stream.boundaryOwnerKeys.add(owner);
|
|
3940
|
+
}
|
|
3934
3941
|
let STREAM_REALM_SALT = null;
|
|
3935
3942
|
function streamRealmSalt() {
|
|
3936
3943
|
if (STREAM_REALM_SALT !== null) return STREAM_REALM_SALT;
|
|
@@ -3944,6 +3951,7 @@ function createStreamToken() {
|
|
|
3944
3951
|
}
|
|
3945
3952
|
let STREAM = null;
|
|
3946
3953
|
function pruneUnrepresentedStreamDescendants(stream, ownerKey, ownerHtml) {
|
|
3954
|
+
if (!stream.boundaryOwnerKeys.has(ownerKey)) return;
|
|
3947
3955
|
let removed = true;
|
|
3948
3956
|
while (removed) {
|
|
3949
3957
|
removed = false;
|
|
@@ -4001,6 +4009,7 @@ function ssrTry(scope, siteKey, tryFn, pendFn, catchFn, namespace = FRAME?.names
|
|
|
4001
4009
|
entry = stream.boundaries.get(key);
|
|
4002
4010
|
if (entry !== void 0) {
|
|
4003
4011
|
recordStreamBoundaryMutation(stream, key);
|
|
4012
|
+
if (ownerKeys.length !== 0) recordStreamBoundaryOwners(stream, ownerKeys);
|
|
4004
4013
|
entry.namespace = namespace;
|
|
4005
4014
|
}
|
|
4006
4015
|
if (entry !== void 0 && entry.state === "pending") {
|
|
@@ -4200,6 +4209,7 @@ function ssrTry(scope, siteKey, tryFn, pendFn, catchFn, namespace = FRAME?.names
|
|
|
4200
4209
|
};
|
|
4201
4210
|
recordStreamBoundaryMutation(stream, key);
|
|
4202
4211
|
stream.boundaries.set(key, entry);
|
|
4212
|
+
if (ownerKeys.length !== 0) recordStreamBoundaryOwners(stream, ownerKeys);
|
|
4203
4213
|
enterBoundaryIds(pendingIdOffset);
|
|
4204
4214
|
} else {
|
|
4205
4215
|
ID_COUNTER = entry.pendingIdOffset;
|
|
@@ -4253,6 +4263,7 @@ function ssrTry(scope, siteKey, tryFn, pendFn, catchFn, namespace = FRAME?.names
|
|
|
4253
4263
|
};
|
|
4254
4264
|
recordStreamBoundaryMutation(stream, key);
|
|
4255
4265
|
stream.boundaries.set(key, entry);
|
|
4266
|
+
if (ownerKeys.length !== 0) recordStreamBoundaryOwners(stream, ownerKeys);
|
|
4256
4267
|
enterBoundaryIds(pendingIdOffset);
|
|
4257
4268
|
} else if (entry.state === "pending") {
|
|
4258
4269
|
entry.state = "errored";
|
|
@@ -4350,6 +4361,7 @@ async function runStream(component, props, options, sink) {
|
|
|
4350
4361
|
const resolved = newResolvedMap();
|
|
4351
4362
|
const stream = {
|
|
4352
4363
|
boundaries: /* @__PURE__ */ new Map(),
|
|
4364
|
+
boundaryOwnerKeys: /* @__PURE__ */ new Set(),
|
|
4353
4365
|
nextId: 0,
|
|
4354
4366
|
token: createStreamToken(),
|
|
4355
4367
|
activePassBoundaryKeys: null,
|
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.1.
|
|
24
|
+
const version = "0.1.47";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
version
|
|
@@ -520,8 +520,8 @@ function ownerReachableComponentsAst(ast, localSpecializations) {
|
|
|
520
520
|
tag: record,
|
|
521
521
|
});
|
|
522
522
|
const queue = [...reachable];
|
|
523
|
-
|
|
524
|
-
for (const dependency of dependencies.get(queue
|
|
523
|
+
for (let queueIndex = 0; queueIndex < queue.length; queueIndex++) {
|
|
524
|
+
for (const dependency of dependencies.get(queue[queueIndex]) ?? []) {
|
|
525
525
|
if (reachable.has(dependency)) continue;
|
|
526
526
|
reachable.add(dependency);
|
|
527
527
|
queue.push(dependency);
|
|
@@ -708,8 +708,8 @@ function specializeLocalComponentsAst(region, index, state) {
|
|
|
708
708
|
...localCallReferences(region, localNames),
|
|
709
709
|
]);
|
|
710
710
|
const queue = [...selected];
|
|
711
|
-
|
|
712
|
-
const name = queue
|
|
711
|
+
for (let queueIndex = 0; queueIndex < queue.length; queueIndex++) {
|
|
712
|
+
const name = queue[queueIndex];
|
|
713
713
|
const component = state.localSpecializations.components.get(name);
|
|
714
714
|
if (!component) continue;
|
|
715
715
|
for (const reference of new Set([
|