@my-react/react-reconciler-compact 0.0.12 → 0.0.13
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/index.development.js +176 -76
- package/dist/cjs/index.production.js +70 -56
- package/dist/esm/index.mjs +241 -133
- package/dist/types/config.d.ts +5 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/dispatch.d.ts +0 -5
- package/dist/types/dispatch.d.ts.map +1 -1
- package/dist/types/feature.d.ts +1 -5
- package/dist/types/feature.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import require$$0, { createElement, __my_react_internal__, __my_react_shared__ } from '@my-react/react';
|
|
1
|
+
import require$$0, { createRef, createElement, __my_react_internal__, __my_react_shared__ } from '@my-react/react';
|
|
2
2
|
|
|
3
3
|
/******************************************************************************
|
|
4
4
|
Copyright (c) Microsoft Corporation.
|
|
@@ -344,8 +344,10 @@ function requireIndex_production () {
|
|
|
344
344
|
return ListTreeNode;
|
|
345
345
|
}());
|
|
346
346
|
var ListTree = /** @class */ (function () {
|
|
347
|
-
function ListTree() {
|
|
347
|
+
function ListTree(max) {
|
|
348
348
|
this.length = 0;
|
|
349
|
+
this.maxLength = Infinity;
|
|
350
|
+
this.maxLength = max || Infinity;
|
|
349
351
|
var _stickyHead = null;
|
|
350
352
|
Object.defineProperty(this, "stickyHead", {
|
|
351
353
|
get: function () {
|
|
@@ -384,6 +386,9 @@ function requireIndex_production () {
|
|
|
384
386
|
});
|
|
385
387
|
}
|
|
386
388
|
ListTree.prototype.push = function (node) {
|
|
389
|
+
while (this.length >= this.maxLength) {
|
|
390
|
+
this.pop();
|
|
391
|
+
}
|
|
387
392
|
var listNode = new ListTreeNode(node);
|
|
388
393
|
this.length++;
|
|
389
394
|
if (!this.foot) {
|
|
@@ -401,6 +406,7 @@ function requireIndex_production () {
|
|
|
401
406
|
var node_1 = this.stickyFoot;
|
|
402
407
|
this.push(node_1.value);
|
|
403
408
|
this.stickyFoot = null;
|
|
409
|
+
this.length--;
|
|
404
410
|
}
|
|
405
411
|
else {
|
|
406
412
|
this.length++;
|
|
@@ -413,6 +419,7 @@ function requireIndex_production () {
|
|
|
413
419
|
var node_2 = this.stickyHead;
|
|
414
420
|
this.unshift(node_2.value);
|
|
415
421
|
this.stickyHead = null;
|
|
422
|
+
this.length--;
|
|
416
423
|
}
|
|
417
424
|
else {
|
|
418
425
|
this.length++;
|
|
@@ -431,6 +438,9 @@ function requireIndex_production () {
|
|
|
431
438
|
}
|
|
432
439
|
};
|
|
433
440
|
ListTree.prototype.unshift = function (node) {
|
|
441
|
+
while (this.length >= this.maxLength) {
|
|
442
|
+
this.shift();
|
|
443
|
+
}
|
|
434
444
|
var listNode = new ListTreeNode(node);
|
|
435
445
|
this.length++;
|
|
436
446
|
if (!this.head) {
|
|
@@ -448,6 +458,7 @@ function requireIndex_production () {
|
|
|
448
458
|
var node_3 = this.stickyHead;
|
|
449
459
|
this.unshift(node_3.value);
|
|
450
460
|
this.stickyHead = null;
|
|
461
|
+
this.length--;
|
|
451
462
|
}
|
|
452
463
|
else {
|
|
453
464
|
this.length++;
|
|
@@ -460,6 +471,7 @@ function requireIndex_production () {
|
|
|
460
471
|
var node_4 = this.stickyFoot;
|
|
461
472
|
this.push(node_4.value);
|
|
462
473
|
this.stickyFoot = null;
|
|
474
|
+
this.length--;
|
|
463
475
|
}
|
|
464
476
|
else {
|
|
465
477
|
this.length++;
|
|
@@ -611,7 +623,7 @@ function requireIndex_production () {
|
|
|
611
623
|
return newList;
|
|
612
624
|
};
|
|
613
625
|
ListTree.prototype.clone = function () {
|
|
614
|
-
var newList = new ListTree();
|
|
626
|
+
var newList = new ListTree(this.maxLength);
|
|
615
627
|
this.listToFoot(function (v) { return newList.push(v); });
|
|
616
628
|
return newList;
|
|
617
629
|
};
|
|
@@ -2197,12 +2209,52 @@ function requireIndex_production () {
|
|
|
2197
2209
|
}
|
|
2198
2210
|
// TODO update flow
|
|
2199
2211
|
if (enableSuspenseRoot$2.current) {
|
|
2200
|
-
var
|
|
2201
|
-
var list =
|
|
2212
|
+
var suspenseField_1 = getInstanceFieldByInstance(renderDispatch);
|
|
2213
|
+
var list = suspenseField_1.asyncLoadList.getAll();
|
|
2202
2214
|
if (list.length === 0)
|
|
2203
2215
|
return;
|
|
2204
2216
|
if (renderDispatch.enableAsyncLoad) {
|
|
2205
|
-
|
|
2217
|
+
var allPendingLoadArray = list.filter(function (item) {
|
|
2218
|
+
if (isPromise(item)) {
|
|
2219
|
+
return typeof item.status !== "string";
|
|
2220
|
+
}
|
|
2221
|
+
else {
|
|
2222
|
+
return !item._loading && !item._loaded && !item._error;
|
|
2223
|
+
}
|
|
2224
|
+
});
|
|
2225
|
+
if (allPendingLoadArray.length) {
|
|
2226
|
+
Promise.all(allPendingLoadArray.map(function (item) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2227
|
+
var allNode;
|
|
2228
|
+
var _a;
|
|
2229
|
+
return __generator(this, function (_b) {
|
|
2230
|
+
switch (_b.label) {
|
|
2231
|
+
case 0:
|
|
2232
|
+
if (!isPromise(item)) return [3 /*break*/, 2];
|
|
2233
|
+
return [4 /*yield*/, renderDispatch.processPromise(item)];
|
|
2234
|
+
case 1:
|
|
2235
|
+
_b.sent();
|
|
2236
|
+
return [3 /*break*/, 4];
|
|
2237
|
+
case 2: return [4 /*yield*/, renderDispatch.processLazy(item)];
|
|
2238
|
+
case 3:
|
|
2239
|
+
_b.sent();
|
|
2240
|
+
_b.label = 4;
|
|
2241
|
+
case 4:
|
|
2242
|
+
allNode = Array.from(item._list);
|
|
2243
|
+
(_a = item._list) === null || _a === void 0 ? void 0 : _a.clear();
|
|
2244
|
+
allNode.forEach(function (node) {
|
|
2245
|
+
node.state = STATE_TYPE.__reschedule__;
|
|
2246
|
+
});
|
|
2247
|
+
suspenseField_1.asyncLoadList.uniDelete(item);
|
|
2248
|
+
return [2 /*return*/];
|
|
2249
|
+
}
|
|
2250
|
+
});
|
|
2251
|
+
}); }));
|
|
2252
|
+
var root = renderDispatch.rootFiber;
|
|
2253
|
+
root.state = remove(root.state, STATE_TYPE.__stable__);
|
|
2254
|
+
root.state = merge(root.state, STATE_TYPE.__retrigger__);
|
|
2255
|
+
// TODO use hide tree to improve
|
|
2256
|
+
mountLoopAll(renderDispatch, root);
|
|
2257
|
+
}
|
|
2206
2258
|
}
|
|
2207
2259
|
else {
|
|
2208
2260
|
throw new Error("[@my-react/reconciler] should not process async load list on sync mount without enableAsyncLoad, you may use a wrong renderDispatch instance");
|
|
@@ -3257,12 +3309,11 @@ function requireIndex_production () {
|
|
|
3257
3309
|
cb === null || cb === void 0 ? void 0 : cb();
|
|
3258
3310
|
};
|
|
3259
3311
|
var clearContainer = function (renderDispatch) {
|
|
3260
|
-
var _a, _b, _c
|
|
3312
|
+
var _a, _b, _c;
|
|
3261
3313
|
renderDispatch.pendingCommitFiberPatch = PATCH_TYPE.__initial__;
|
|
3262
3314
|
(_a = renderDispatch.pendingUpdateFiberArray) === null || _a === void 0 ? void 0 : _a.clear();
|
|
3263
3315
|
(_b = renderDispatch.pendingSuspenseFiberArray) === null || _b === void 0 ? void 0 : _b.clear();
|
|
3264
3316
|
(_c = renderDispatch.pendingCommitFiberList) === null || _c === void 0 ? void 0 : _c.clear();
|
|
3265
|
-
(_d = renderDispatch.pendingChangedFiberList) === null || _d === void 0 ? void 0 : _d.clear();
|
|
3266
3317
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
3267
3318
|
renderDispatch.isAppMounted = false;
|
|
3268
3319
|
renderDispatch.isAppUnmounted = true;
|
|
@@ -3482,14 +3533,12 @@ function requireIndex_production () {
|
|
|
3482
3533
|
react.__my_react_shared__.enableScopeTreeLog;
|
|
3483
3534
|
function finishUpdateSyncFromRoot(renderDispatch) {
|
|
3484
3535
|
var commitList = renderDispatch.pendingCommitFiberList;
|
|
3485
|
-
var changedList = renderDispatch.pendingChangedFiberList;
|
|
3486
3536
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
3487
3537
|
renderDispatch.pendingCommitFiberList = null;
|
|
3488
|
-
renderDispatch.pendingChangedFiberList = null;
|
|
3489
3538
|
(commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList, true);
|
|
3490
|
-
(
|
|
3539
|
+
(commitList === null || commitList === void 0 ? void 0 : commitList.length) &&
|
|
3491
3540
|
safeCall(function safeCallFiberHasChangeListener() {
|
|
3492
|
-
renderDispatch.callOnFiberChange(
|
|
3541
|
+
renderDispatch.callOnFiberChange(commitList);
|
|
3493
3542
|
});
|
|
3494
3543
|
}
|
|
3495
3544
|
var updateSyncFromRoot = function (renderDispatch) {
|
|
@@ -3505,14 +3554,12 @@ function requireIndex_production () {
|
|
|
3505
3554
|
};
|
|
3506
3555
|
function finishUpdateConcurrentFromRoot(renderDispatch) {
|
|
3507
3556
|
var commitList = renderDispatch.pendingCommitFiberList;
|
|
3508
|
-
var changedList = renderDispatch.pendingChangedFiberList;
|
|
3509
3557
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
3510
3558
|
renderDispatch.pendingCommitFiberList = null;
|
|
3511
|
-
renderDispatch.pendingChangedFiberList = null;
|
|
3512
3559
|
(commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
|
|
3513
|
-
(
|
|
3560
|
+
(commitList === null || commitList === void 0 ? void 0 : commitList.length) &&
|
|
3514
3561
|
safeCall(function safeCallFiberHasChangeListener() {
|
|
3515
|
-
renderDispatch.callOnFiberChange(
|
|
3562
|
+
renderDispatch.callOnFiberChange(commitList);
|
|
3516
3563
|
});
|
|
3517
3564
|
}
|
|
3518
3565
|
function checkNextFiberIsSync(renderDispatch) {
|
|
@@ -4442,7 +4489,6 @@ function requireIndex_production () {
|
|
|
4442
4489
|
renderDispatch.runtimeMap.effectMap.delete(fiber);
|
|
4443
4490
|
renderDispatch.runtimeMap.layoutEffectMap.delete(fiber);
|
|
4444
4491
|
renderDispatch.runtimeMap.unmountMap.delete(fiber);
|
|
4445
|
-
renderDispatch.runtimeMap.eventMap.delete(fiber);
|
|
4446
4492
|
renderDispatch.runtimeMap.triggerCallbackMap.delete(fiber);
|
|
4447
4493
|
if (Boolean(false) === false) {
|
|
4448
4494
|
// fiber.child = null;
|
|
@@ -4500,7 +4546,6 @@ function requireIndex_production () {
|
|
|
4500
4546
|
renderDispatch.pendingUnmount(parentFiber, f);
|
|
4501
4547
|
});
|
|
4502
4548
|
});
|
|
4503
|
-
renderDispatch.generateChangedList(parentFiber, true);
|
|
4504
4549
|
}
|
|
4505
4550
|
};
|
|
4506
4551
|
var getNewFiberWithUpdate = function (renderDispatch, newChild, parentFiber, existingChildren, prevFiberChild, index) {
|
|
@@ -4514,11 +4559,9 @@ function requireIndex_production () {
|
|
|
4514
4559
|
// same type
|
|
4515
4560
|
if (include(draftFiber_1 === null || draftFiber_1 === void 0 ? void 0 : draftFiber_1.type, exports.NODE_TYPE.__fragment__)) {
|
|
4516
4561
|
var newElement = react.createElement(Fragment, dynamicFragmentProps, newChild);
|
|
4517
|
-
draftFiber_1 !== prevFiberChild && renderDispatch.generateChangedList(parentFiber);
|
|
4518
4562
|
return updateFiberNode(renderDispatch, { fiber: draftFiber_1, parent: parentFiber, prevFiber: prevFiberChild }, newElement);
|
|
4519
4563
|
}
|
|
4520
4564
|
else {
|
|
4521
|
-
draftFiber_1 && renderDispatch.generateChangedList(parentFiber);
|
|
4522
4565
|
draftFiber_1 && renderDispatch.pendingUnmount(parentFiber, draftFiber_1);
|
|
4523
4566
|
return createFragmentWithUpdate(renderDispatch, newChild, parentFiber);
|
|
4524
4567
|
}
|
|
@@ -4531,12 +4574,10 @@ function requireIndex_production () {
|
|
|
4531
4574
|
}
|
|
4532
4575
|
var isSameType = getIsSameTypeNode(newChild, draftFiber);
|
|
4533
4576
|
if (isSameType) {
|
|
4534
|
-
draftFiber !== prevFiberChild && renderDispatch.generateChangedList(parentFiber);
|
|
4535
4577
|
return updateFiberNode(renderDispatch, { fiber: draftFiber, parent: parentFiber, prevFiber: prevFiberChild }, newChild);
|
|
4536
4578
|
}
|
|
4537
4579
|
else {
|
|
4538
4580
|
draftFiber && renderDispatch.pendingUnmount(parentFiber, draftFiber);
|
|
4539
|
-
draftFiber && renderDispatch.generateChangedList(parentFiber);
|
|
4540
4581
|
return createFiberNode(renderDispatch, { parent: parentFiber, type: "position" }, newChild);
|
|
4541
4582
|
}
|
|
4542
4583
|
};
|
|
@@ -4579,7 +4620,6 @@ function requireIndex_production () {
|
|
|
4579
4620
|
deleteIfNeed(renderDispatch, parentFiber, existingChildrenMap);
|
|
4580
4621
|
}
|
|
4581
4622
|
else {
|
|
4582
|
-
renderDispatch.generateChangedList(parentFiber);
|
|
4583
4623
|
var existingChildrenMap = getExistingChildren(parentFiber).existingChildrenMap;
|
|
4584
4624
|
deleteIfNeed(renderDispatch, parentFiber, existingChildrenMap);
|
|
4585
4625
|
parentFiber.child = null;
|
|
@@ -5540,7 +5580,6 @@ function requireIndex_production () {
|
|
|
5540
5580
|
layoutEffectMap: new MyWeakMap(),
|
|
5541
5581
|
insertionEffectMap: new MyWeakMap(),
|
|
5542
5582
|
unmountMap: new MyWeakMap(),
|
|
5543
|
-
eventMap: new MyWeakMap(),
|
|
5544
5583
|
triggerCallbackMap: new MyWeakMap(),
|
|
5545
5584
|
}); };
|
|
5546
5585
|
var getInitialFiber = function () { return ({
|
|
@@ -6296,13 +6335,12 @@ function requireIndex_production () {
|
|
|
6296
6335
|
_this.isAppMounted = false;
|
|
6297
6336
|
_this.isAppCrashed = false;
|
|
6298
6337
|
_this.isAppUnmounted = false;
|
|
6299
|
-
_this.version = "0.3.
|
|
6338
|
+
_this.version = "0.3.22";
|
|
6300
6339
|
_this.id = Math.random().toString(16).slice(2);
|
|
6301
6340
|
_this.mode = "production";
|
|
6302
6341
|
_this.renderMode = "render";
|
|
6303
6342
|
_this.pendingCommitFiberList = null;
|
|
6304
6343
|
_this.pendingCommitFiberPatch = PATCH_TYPE.__initial__;
|
|
6305
|
-
_this.pendingChangedFiberList = null;
|
|
6306
6344
|
_this.pendingUpdateFiberArray = new UniqueArray();
|
|
6307
6345
|
_this.pendingSuspenseFiberArray = new UniqueArray();
|
|
6308
6346
|
_this.uniqueIdCount = 0;
|
|
@@ -6320,17 +6358,6 @@ function requireIndex_production () {
|
|
|
6320
6358
|
this.pendingCommitFiberList.push(_fiber);
|
|
6321
6359
|
}
|
|
6322
6360
|
};
|
|
6323
|
-
CustomRenderDispatch.prototype.generateChangedList = function (_fiber, withCheck) {
|
|
6324
|
-
if (!_fiber)
|
|
6325
|
-
return;
|
|
6326
|
-
if (!this.isAppMounted)
|
|
6327
|
-
return;
|
|
6328
|
-
this.pendingChangedFiberList = this.pendingChangedFiberList || new ListTree();
|
|
6329
|
-
if (withCheck && this.pendingChangedFiberList.hasValue(_fiber)) {
|
|
6330
|
-
return;
|
|
6331
|
-
}
|
|
6332
|
-
this.pendingChangedFiberList.push(_fiber);
|
|
6333
|
-
};
|
|
6334
6361
|
CustomRenderDispatch.prototype.pendingCreate = function (_fiber) {
|
|
6335
6362
|
if (include(_fiber.type, this.runtimeRef.typeForCreate)) {
|
|
6336
6363
|
_fiber.patch = merge(_fiber.patch, PATCH_TYPE.__create__);
|
|
@@ -6515,17 +6542,8 @@ function requireIndex_production () {
|
|
|
6515
6542
|
react.__my_react_shared__.enableScopeTreeLog;
|
|
6516
6543
|
function finishMountSync(renderDispatch, fiber) {
|
|
6517
6544
|
renderDispatch.reconcileCommit(fiber);
|
|
6518
|
-
var changedList = renderDispatch.pendingChangedFiberList;
|
|
6519
6545
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
6520
6546
|
renderDispatch.pendingCommitFiberList = null;
|
|
6521
|
-
renderDispatch.pendingChangedFiberList = null;
|
|
6522
|
-
(changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
|
|
6523
|
-
safeCallWithCurrentFiber({
|
|
6524
|
-
fiber: fiber,
|
|
6525
|
-
action: function safeCallFiberHasChangeListener() {
|
|
6526
|
-
renderDispatch.callOnFiberChange(changedList);
|
|
6527
|
-
},
|
|
6528
|
-
});
|
|
6529
6547
|
}
|
|
6530
6548
|
var mountSync = function (renderDispatch, fiber) {
|
|
6531
6549
|
globalLoop.current = true;
|
|
@@ -6536,17 +6554,8 @@ function requireIndex_production () {
|
|
|
6536
6554
|
};
|
|
6537
6555
|
function finishMountAsync(renderDispatch, fiber) {
|
|
6538
6556
|
renderDispatch.reconcileCommit(fiber);
|
|
6539
|
-
var changedList = renderDispatch.pendingChangedFiberList;
|
|
6540
6557
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
6541
6558
|
renderDispatch.pendingCommitFiberList = null;
|
|
6542
|
-
renderDispatch.pendingChangedFiberList = null;
|
|
6543
|
-
(changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
|
|
6544
|
-
safeCallWithCurrentFiber({
|
|
6545
|
-
fiber: fiber,
|
|
6546
|
-
action: function safeCallFiberHasChangeListener() {
|
|
6547
|
-
renderDispatch.callOnFiberChange(changedList);
|
|
6548
|
-
},
|
|
6549
|
-
});
|
|
6550
6559
|
}
|
|
6551
6560
|
var mountAsync = function (renderDispatch, fiber) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6552
6561
|
return __generator(this, function (_a) {
|
|
@@ -6564,7 +6573,7 @@ function requireIndex_production () {
|
|
|
6564
6573
|
});
|
|
6565
6574
|
}); };
|
|
6566
6575
|
|
|
6567
|
-
var version = "0.3.
|
|
6576
|
+
var version = "0.3.22";
|
|
6568
6577
|
|
|
6569
6578
|
exports.CustomRenderDispatch = CustomRenderDispatch;
|
|
6570
6579
|
exports.MyReactFiberNode = MyReactFiberNode;
|
|
@@ -7001,8 +7010,10 @@ function requireIndex_development () {
|
|
|
7001
7010
|
return ListTreeNode;
|
|
7002
7011
|
}());
|
|
7003
7012
|
var ListTree = /** @class */ (function () {
|
|
7004
|
-
function ListTree() {
|
|
7013
|
+
function ListTree(max) {
|
|
7005
7014
|
this.length = 0;
|
|
7015
|
+
this.maxLength = Infinity;
|
|
7016
|
+
this.maxLength = max || Infinity;
|
|
7006
7017
|
var _stickyHead = null;
|
|
7007
7018
|
Object.defineProperty(this, "stickyHead", {
|
|
7008
7019
|
get: function () {
|
|
@@ -7041,6 +7052,9 @@ function requireIndex_development () {
|
|
|
7041
7052
|
});
|
|
7042
7053
|
}
|
|
7043
7054
|
ListTree.prototype.push = function (node) {
|
|
7055
|
+
while (this.length >= this.maxLength) {
|
|
7056
|
+
this.pop();
|
|
7057
|
+
}
|
|
7044
7058
|
var listNode = new ListTreeNode(node);
|
|
7045
7059
|
this.length++;
|
|
7046
7060
|
if (!this.foot) {
|
|
@@ -7058,6 +7072,7 @@ function requireIndex_development () {
|
|
|
7058
7072
|
var node_1 = this.stickyFoot;
|
|
7059
7073
|
this.push(node_1.value);
|
|
7060
7074
|
this.stickyFoot = null;
|
|
7075
|
+
this.length--;
|
|
7061
7076
|
}
|
|
7062
7077
|
else {
|
|
7063
7078
|
this.length++;
|
|
@@ -7070,6 +7085,7 @@ function requireIndex_development () {
|
|
|
7070
7085
|
var node_2 = this.stickyHead;
|
|
7071
7086
|
this.unshift(node_2.value);
|
|
7072
7087
|
this.stickyHead = null;
|
|
7088
|
+
this.length--;
|
|
7073
7089
|
}
|
|
7074
7090
|
else {
|
|
7075
7091
|
this.length++;
|
|
@@ -7088,6 +7104,9 @@ function requireIndex_development () {
|
|
|
7088
7104
|
}
|
|
7089
7105
|
};
|
|
7090
7106
|
ListTree.prototype.unshift = function (node) {
|
|
7107
|
+
while (this.length >= this.maxLength) {
|
|
7108
|
+
this.shift();
|
|
7109
|
+
}
|
|
7091
7110
|
var listNode = new ListTreeNode(node);
|
|
7092
7111
|
this.length++;
|
|
7093
7112
|
if (!this.head) {
|
|
@@ -7105,6 +7124,7 @@ function requireIndex_development () {
|
|
|
7105
7124
|
var node_3 = this.stickyHead;
|
|
7106
7125
|
this.unshift(node_3.value);
|
|
7107
7126
|
this.stickyHead = null;
|
|
7127
|
+
this.length--;
|
|
7108
7128
|
}
|
|
7109
7129
|
else {
|
|
7110
7130
|
this.length++;
|
|
@@ -7117,6 +7137,7 @@ function requireIndex_development () {
|
|
|
7117
7137
|
var node_4 = this.stickyFoot;
|
|
7118
7138
|
this.push(node_4.value);
|
|
7119
7139
|
this.stickyFoot = null;
|
|
7140
|
+
this.length--;
|
|
7120
7141
|
}
|
|
7121
7142
|
else {
|
|
7122
7143
|
this.length++;
|
|
@@ -7268,7 +7289,7 @@ function requireIndex_development () {
|
|
|
7268
7289
|
return newList;
|
|
7269
7290
|
};
|
|
7270
7291
|
ListTree.prototype.clone = function () {
|
|
7271
|
-
var newList = new ListTree();
|
|
7292
|
+
var newList = new ListTree(this.maxLength);
|
|
7272
7293
|
this.listToFoot(function (v) { return newList.push(v); });
|
|
7273
7294
|
return newList;
|
|
7274
7295
|
};
|
|
@@ -8997,12 +9018,52 @@ function requireIndex_development () {
|
|
|
8997
9018
|
}
|
|
8998
9019
|
// TODO update flow
|
|
8999
9020
|
if (enableSuspenseRoot$2.current) {
|
|
9000
|
-
var
|
|
9001
|
-
var list =
|
|
9021
|
+
var suspenseField_1 = getInstanceFieldByInstance(renderDispatch);
|
|
9022
|
+
var list = suspenseField_1.asyncLoadList.getAll();
|
|
9002
9023
|
if (list.length === 0)
|
|
9003
9024
|
return;
|
|
9004
9025
|
if (renderDispatch.enableAsyncLoad) {
|
|
9005
|
-
|
|
9026
|
+
var allPendingLoadArray = list.filter(function (item) {
|
|
9027
|
+
if (isPromise(item)) {
|
|
9028
|
+
return typeof item.status !== "string";
|
|
9029
|
+
}
|
|
9030
|
+
else {
|
|
9031
|
+
return !item._loading && !item._loaded && !item._error;
|
|
9032
|
+
}
|
|
9033
|
+
});
|
|
9034
|
+
if (allPendingLoadArray.length) {
|
|
9035
|
+
Promise.all(allPendingLoadArray.map(function (item) { return __awaiter(void 0, void 0, void 0, function () {
|
|
9036
|
+
var allNode;
|
|
9037
|
+
var _a;
|
|
9038
|
+
return __generator(this, function (_b) {
|
|
9039
|
+
switch (_b.label) {
|
|
9040
|
+
case 0:
|
|
9041
|
+
if (!isPromise(item)) return [3 /*break*/, 2];
|
|
9042
|
+
return [4 /*yield*/, renderDispatch.processPromise(item)];
|
|
9043
|
+
case 1:
|
|
9044
|
+
_b.sent();
|
|
9045
|
+
return [3 /*break*/, 4];
|
|
9046
|
+
case 2: return [4 /*yield*/, renderDispatch.processLazy(item)];
|
|
9047
|
+
case 3:
|
|
9048
|
+
_b.sent();
|
|
9049
|
+
_b.label = 4;
|
|
9050
|
+
case 4:
|
|
9051
|
+
allNode = Array.from(item._list);
|
|
9052
|
+
(_a = item._list) === null || _a === void 0 ? void 0 : _a.clear();
|
|
9053
|
+
allNode.forEach(function (node) {
|
|
9054
|
+
node.state = STATE_TYPE.__reschedule__;
|
|
9055
|
+
});
|
|
9056
|
+
suspenseField_1.asyncLoadList.uniDelete(item);
|
|
9057
|
+
return [2 /*return*/];
|
|
9058
|
+
}
|
|
9059
|
+
});
|
|
9060
|
+
}); }));
|
|
9061
|
+
var root = renderDispatch.rootFiber;
|
|
9062
|
+
root.state = remove(root.state, STATE_TYPE.__stable__);
|
|
9063
|
+
root.state = merge(root.state, STATE_TYPE.__retrigger__);
|
|
9064
|
+
// TODO use hide tree to improve
|
|
9065
|
+
mountLoopAll(renderDispatch, root);
|
|
9066
|
+
}
|
|
9006
9067
|
}
|
|
9007
9068
|
else {
|
|
9008
9069
|
throw new Error("[@my-react/reconciler] should not process async load list on sync mount without enableAsyncLoad, you may use a wrong renderDispatch instance");
|
|
@@ -9445,6 +9506,9 @@ function requireIndex_development () {
|
|
|
9445
9506
|
var baseState = Object.assign({}, fiber.pendingState);
|
|
9446
9507
|
var baseProps = Object.assign({}, typedInstance.props);
|
|
9447
9508
|
var pendingState = Object.assign({}, fiber.pendingState);
|
|
9509
|
+
if (enableDebugFiled$8.current && enableDebugUpdateQueue.current) {
|
|
9510
|
+
typedFiber._debugLatestUpdateQueue = new ListTree();
|
|
9511
|
+
}
|
|
9448
9512
|
if (enableTaskPriority && allQueue.some(function (l) { return l.isSync; })) {
|
|
9449
9513
|
var _loop_1 = function () {
|
|
9450
9514
|
var updater = node.value;
|
|
@@ -9477,8 +9541,9 @@ function requireIndex_development () {
|
|
|
9477
9541
|
typedNode._debugBaseValue = baseState;
|
|
9478
9542
|
typedNode._debugAfterValue = fiber.pendingState;
|
|
9479
9543
|
if (enableDebugUpdateQueue.current) {
|
|
9480
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
9544
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9481
9545
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9546
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9482
9547
|
}
|
|
9483
9548
|
}
|
|
9484
9549
|
}
|
|
@@ -9497,8 +9562,9 @@ function requireIndex_development () {
|
|
|
9497
9562
|
typedNode._debugBaseValue = baseState;
|
|
9498
9563
|
typedNode._debugAfterValue = fiber.pendingState;
|
|
9499
9564
|
if (enableDebugUpdateQueue.current) {
|
|
9500
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
9565
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9501
9566
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9567
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9502
9568
|
}
|
|
9503
9569
|
}
|
|
9504
9570
|
}
|
|
@@ -9558,8 +9624,9 @@ function requireIndex_development () {
|
|
|
9558
9624
|
typedNode._debugBaseValue = baseState;
|
|
9559
9625
|
typedNode._debugAfterValue = fiber.pendingState;
|
|
9560
9626
|
if (enableDebugUpdateQueue.current) {
|
|
9561
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
9627
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9562
9628
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9629
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9563
9630
|
}
|
|
9564
9631
|
}
|
|
9565
9632
|
}
|
|
@@ -9578,8 +9645,9 @@ function requireIndex_development () {
|
|
|
9578
9645
|
typedNode._debugBaseValue = baseState;
|
|
9579
9646
|
typedNode._debugAfterValue = fiber.pendingState;
|
|
9580
9647
|
if (enableDebugUpdateQueue.current) {
|
|
9581
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
9648
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9582
9649
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9650
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9583
9651
|
}
|
|
9584
9652
|
}
|
|
9585
9653
|
}
|
|
@@ -9624,6 +9692,9 @@ function requireIndex_development () {
|
|
|
9624
9692
|
var baseState = Object.assign({}, fiber.pendingState);
|
|
9625
9693
|
var baseProps = Object.assign({}, typedInstance.props);
|
|
9626
9694
|
var pendingState = Object.assign({}, fiber.pendingState);
|
|
9695
|
+
if (enableDebugFiled$8.current && enableDebugUpdateQueue.current) {
|
|
9696
|
+
typedFiber._debugLatestUpdateQueue = new ListTree();
|
|
9697
|
+
}
|
|
9627
9698
|
if (node) {
|
|
9628
9699
|
var updater = node.value;
|
|
9629
9700
|
if (updater.type === UpdateQueueType.component) {
|
|
@@ -9653,8 +9724,9 @@ function requireIndex_development () {
|
|
|
9653
9724
|
typedNode._debugBaseValue = baseState;
|
|
9654
9725
|
typedNode._debugAfterValue = fiber.pendingState;
|
|
9655
9726
|
if (enableDebugUpdateQueue.current) {
|
|
9656
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
9727
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9657
9728
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9729
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9658
9730
|
}
|
|
9659
9731
|
}
|
|
9660
9732
|
}
|
|
@@ -9673,8 +9745,9 @@ function requireIndex_development () {
|
|
|
9673
9745
|
typedNode._debugBaseValue = baseState;
|
|
9674
9746
|
typedNode._debugAfterValue = fiber.pendingState;
|
|
9675
9747
|
if (enableDebugUpdateQueue.current) {
|
|
9676
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
9748
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9677
9749
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9750
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9678
9751
|
}
|
|
9679
9752
|
}
|
|
9680
9753
|
}
|
|
@@ -9717,6 +9790,9 @@ function requireIndex_development () {
|
|
|
9717
9790
|
var isRetrigger = false;
|
|
9718
9791
|
var processedNodes = [];
|
|
9719
9792
|
var callbacks = [];
|
|
9793
|
+
if (enableDebugFiled$8.current && enableDebugUpdateQueue.current) {
|
|
9794
|
+
typedFiber._debugLatestUpdateQueue = new ListTree();
|
|
9795
|
+
}
|
|
9720
9796
|
if (enableTaskPriority && allQueue.some(function (l) { return l.isSync; })) {
|
|
9721
9797
|
var _loop_3 = function () {
|
|
9722
9798
|
var updater = node.value;
|
|
@@ -9762,9 +9838,10 @@ function requireIndex_development () {
|
|
|
9762
9838
|
typedNode._debugBeforeValue = lastResult_1;
|
|
9763
9839
|
typedNode._debugAfterValue = typedTrigger_1.result;
|
|
9764
9840
|
if (enableDebugUpdateQueue.current) {
|
|
9765
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
9841
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9766
9842
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9767
|
-
|
|
9843
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9844
|
+
typedTrigger_1._debugUpdateQueue = typedTrigger_1._debugUpdateQueue || new ListTree(10);
|
|
9768
9845
|
typedTrigger_1._debugUpdateQueue.push(typedNode);
|
|
9769
9846
|
}
|
|
9770
9847
|
}
|
|
@@ -9785,8 +9862,9 @@ function requireIndex_development () {
|
|
|
9785
9862
|
typedNode._debugBeforeValue = undefined;
|
|
9786
9863
|
typedNode._debugAfterValue = payLoad;
|
|
9787
9864
|
if (enableDebugUpdateQueue.current) {
|
|
9788
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
9865
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9789
9866
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9867
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9790
9868
|
}
|
|
9791
9869
|
}
|
|
9792
9870
|
}
|
|
@@ -9860,9 +9938,10 @@ function requireIndex_development () {
|
|
|
9860
9938
|
typedNode._debugBeforeValue = lastResult_2;
|
|
9861
9939
|
typedNode._debugAfterValue = typedTrigger_2.result;
|
|
9862
9940
|
if (enableDebugUpdateQueue.current) {
|
|
9863
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
9941
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9864
9942
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9865
|
-
|
|
9943
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9944
|
+
typedTrigger_2._debugUpdateQueue = typedTrigger_2._debugUpdateQueue || new ListTree(10);
|
|
9866
9945
|
typedTrigger_2._debugUpdateQueue.push(typedNode);
|
|
9867
9946
|
}
|
|
9868
9947
|
}
|
|
@@ -9883,8 +9962,9 @@ function requireIndex_development () {
|
|
|
9883
9962
|
typedNode._debugBeforeValue = undefined;
|
|
9884
9963
|
typedNode._debugAfterValue = payLoad;
|
|
9885
9964
|
if (enableDebugUpdateQueue.current) {
|
|
9886
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
9965
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9887
9966
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9967
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9888
9968
|
}
|
|
9889
9969
|
}
|
|
9890
9970
|
}
|
|
@@ -9927,6 +10007,9 @@ function requireIndex_development () {
|
|
|
9927
10007
|
var isRetrigger = false;
|
|
9928
10008
|
var processedNodes = [];
|
|
9929
10009
|
var callbacks = [];
|
|
10010
|
+
if (enableDebugFiled$8.current && enableDebugUpdateQueue.current) {
|
|
10011
|
+
typedFiber._debugLatestUpdateQueue = new ListTree();
|
|
10012
|
+
}
|
|
9930
10013
|
if (node) {
|
|
9931
10014
|
var updater = node.value;
|
|
9932
10015
|
if (updater.type === UpdateQueueType.hook) {
|
|
@@ -9970,9 +10053,10 @@ function requireIndex_development () {
|
|
|
9970
10053
|
typedNode._debugBeforeValue = lastResult_3;
|
|
9971
10054
|
typedNode._debugAfterValue = typedTrigger_3.result;
|
|
9972
10055
|
if (enableDebugUpdateQueue.current) {
|
|
9973
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
10056
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9974
10057
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
9975
|
-
|
|
10058
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
10059
|
+
typedTrigger_3._debugUpdateQueue = typedTrigger_3._debugUpdateQueue || new ListTree(10);
|
|
9976
10060
|
typedTrigger_3._debugUpdateQueue.push(typedNode);
|
|
9977
10061
|
}
|
|
9978
10062
|
}
|
|
@@ -9993,8 +10077,9 @@ function requireIndex_development () {
|
|
|
9993
10077
|
typedNode._debugBeforeValue = undefined;
|
|
9994
10078
|
typedNode._debugAfterValue = payLoad;
|
|
9995
10079
|
if (enableDebugUpdateQueue.current) {
|
|
9996
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
10080
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
9997
10081
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
10082
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
9998
10083
|
}
|
|
9999
10084
|
}
|
|
10000
10085
|
}
|
|
@@ -10032,6 +10117,9 @@ function requireIndex_development () {
|
|
|
10032
10117
|
var isRetrigger = false;
|
|
10033
10118
|
var processedNodes = [];
|
|
10034
10119
|
var callbacks = [];
|
|
10120
|
+
if (enableDebugFiled$8.current && enableDebugUpdateQueue.current) {
|
|
10121
|
+
typedFiber._debugLatestUpdateQueue = new ListTree();
|
|
10122
|
+
}
|
|
10035
10123
|
while (node) {
|
|
10036
10124
|
var updater = node.value;
|
|
10037
10125
|
var nextNode = node.next;
|
|
@@ -10049,8 +10137,9 @@ function requireIndex_development () {
|
|
|
10049
10137
|
typedNode._debugBeforeValue = undefined;
|
|
10050
10138
|
typedNode._debugAfterValue = payLoad;
|
|
10051
10139
|
if (enableDebugUpdateQueue.current) {
|
|
10052
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
10140
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
10053
10141
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
10142
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
10054
10143
|
}
|
|
10055
10144
|
}
|
|
10056
10145
|
node = nextNode;
|
|
@@ -10084,6 +10173,9 @@ function requireIndex_development () {
|
|
|
10084
10173
|
var isRetrigger = false;
|
|
10085
10174
|
var processedNodes = [];
|
|
10086
10175
|
var callbacks = [];
|
|
10176
|
+
if (enableDebugFiled$8.current && enableDebugUpdateQueue.current) {
|
|
10177
|
+
typedFiber._debugLatestUpdateQueue = new ListTree();
|
|
10178
|
+
}
|
|
10087
10179
|
if (node) {
|
|
10088
10180
|
var updater = node.value;
|
|
10089
10181
|
allQueue.delete(node);
|
|
@@ -10100,8 +10192,9 @@ function requireIndex_development () {
|
|
|
10100
10192
|
typedNode._debugBeforeValue = undefined;
|
|
10101
10193
|
typedNode._debugAfterValue = payLoad;
|
|
10102
10194
|
if (enableDebugUpdateQueue.current) {
|
|
10103
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
10195
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
10104
10196
|
typedFiber._debugUpdateQueue.push(typedNode);
|
|
10197
|
+
typedFiber._debugLatestUpdateQueue.push(typedNode);
|
|
10105
10198
|
}
|
|
10106
10199
|
}
|
|
10107
10200
|
}
|
|
@@ -10319,12 +10412,11 @@ function requireIndex_development () {
|
|
|
10319
10412
|
currentTriggerFiber.current = null;
|
|
10320
10413
|
};
|
|
10321
10414
|
var clearContainer = function (renderDispatch) {
|
|
10322
|
-
var _a, _b, _c
|
|
10415
|
+
var _a, _b, _c;
|
|
10323
10416
|
renderDispatch.pendingCommitFiberPatch = PATCH_TYPE.__initial__;
|
|
10324
10417
|
(_a = renderDispatch.pendingUpdateFiberArray) === null || _a === void 0 ? void 0 : _a.clear();
|
|
10325
10418
|
(_b = renderDispatch.pendingSuspenseFiberArray) === null || _b === void 0 ? void 0 : _b.clear();
|
|
10326
10419
|
(_c = renderDispatch.pendingCommitFiberList) === null || _c === void 0 ? void 0 : _c.clear();
|
|
10327
|
-
(_d = renderDispatch.pendingChangedFiberList) === null || _d === void 0 ? void 0 : _d.clear();
|
|
10328
10420
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
10329
10421
|
renderDispatch.isAppMounted = false;
|
|
10330
10422
|
renderDispatch.isAppUnmounted = true;
|
|
@@ -10485,6 +10577,11 @@ function requireIndex_development () {
|
|
|
10485
10577
|
};
|
|
10486
10578
|
|
|
10487
10579
|
var globalLoop$2 = react.__my_react_internal__.globalLoop, currentScheduler$a = react.__my_react_internal__.currentScheduler;
|
|
10580
|
+
var clearLatestUpdateQueue = function (fiber) {
|
|
10581
|
+
var _a;
|
|
10582
|
+
var typedFiber = fiber;
|
|
10583
|
+
(_a = typedFiber._debugLatestUpdateQueue) === null || _a === void 0 ? void 0 : _a.clear();
|
|
10584
|
+
};
|
|
10488
10585
|
var scheduleUpdateFromRoot = function (renderDispatch) {
|
|
10489
10586
|
flushEffectCallback();
|
|
10490
10587
|
var allLive = renderDispatch.pendingUpdateFiberArray.getAll().filter(function (f) { return exclude(f.state, STATE_TYPE.__unmount__); });
|
|
@@ -10498,6 +10595,7 @@ function requireIndex_development () {
|
|
|
10498
10595
|
{
|
|
10499
10596
|
safeCall(function safeCallBeforeDispatchUpdate() {
|
|
10500
10597
|
renderDispatch.callOnBeforeDispatchUpdate(renderDispatch, allLive);
|
|
10598
|
+
allLive.forEach(clearLatestUpdateQueue);
|
|
10501
10599
|
});
|
|
10502
10600
|
}
|
|
10503
10601
|
updateSyncFromRoot(renderDispatch);
|
|
@@ -10507,6 +10605,7 @@ function requireIndex_development () {
|
|
|
10507
10605
|
{
|
|
10508
10606
|
safeCall(function safeCallBeforeDispatchUpdate() {
|
|
10509
10607
|
renderDispatch.callOnBeforeDispatchUpdate(renderDispatch, allLive);
|
|
10608
|
+
allLive.forEach(clearLatestUpdateQueue);
|
|
10510
10609
|
});
|
|
10511
10610
|
}
|
|
10512
10611
|
updateConcurrentFromRoot(renderDispatch);
|
|
@@ -10566,19 +10665,17 @@ function requireIndex_development () {
|
|
|
10566
10665
|
var enableScopeTreeLog$3 = react.__my_react_shared__.enableScopeTreeLog;
|
|
10567
10666
|
function finishUpdateSyncFromRoot(renderDispatch) {
|
|
10568
10667
|
var commitList = renderDispatch.pendingCommitFiberList;
|
|
10569
|
-
var changedList = renderDispatch.pendingChangedFiberList;
|
|
10570
10668
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
10571
10669
|
renderDispatch.pendingCommitFiberList = null;
|
|
10572
|
-
renderDispatch.pendingChangedFiberList = null;
|
|
10573
10670
|
enableScopeTreeLog$3.current && setLogScope();
|
|
10574
10671
|
(commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList, true);
|
|
10575
10672
|
enableScopeTreeLog$3.current && resetLogScope();
|
|
10576
10673
|
safeCall(function safeCallAfterDispatchUpdate() {
|
|
10577
10674
|
renderDispatch.callOnAfterDispatchUpdate(renderDispatch);
|
|
10578
10675
|
});
|
|
10579
|
-
(
|
|
10676
|
+
(commitList === null || commitList === void 0 ? void 0 : commitList.length) &&
|
|
10580
10677
|
safeCall(function safeCallFiberHasChangeListener() {
|
|
10581
|
-
renderDispatch.callOnFiberChange(
|
|
10678
|
+
renderDispatch.callOnFiberChange(commitList);
|
|
10582
10679
|
});
|
|
10583
10680
|
}
|
|
10584
10681
|
var updateSyncFromRoot = function (renderDispatch) {
|
|
@@ -10596,19 +10693,17 @@ function requireIndex_development () {
|
|
|
10596
10693
|
};
|
|
10597
10694
|
function finishUpdateConcurrentFromRoot(renderDispatch) {
|
|
10598
10695
|
var commitList = renderDispatch.pendingCommitFiberList;
|
|
10599
|
-
var changedList = renderDispatch.pendingChangedFiberList;
|
|
10600
10696
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
10601
10697
|
renderDispatch.pendingCommitFiberList = null;
|
|
10602
|
-
renderDispatch.pendingChangedFiberList = null;
|
|
10603
10698
|
enableScopeTreeLog$3.current && setLogScope();
|
|
10604
10699
|
(commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
|
|
10605
10700
|
enableScopeTreeLog$3.current && setLogScope();
|
|
10606
10701
|
safeCall(function safeCallAfterDispatchUpdate() {
|
|
10607
10702
|
renderDispatch.callOnAfterDispatchUpdate(renderDispatch);
|
|
10608
10703
|
});
|
|
10609
|
-
(
|
|
10704
|
+
(commitList === null || commitList === void 0 ? void 0 : commitList.length) &&
|
|
10610
10705
|
safeCall(function safeCallFiberHasChangeListener() {
|
|
10611
|
-
renderDispatch.callOnFiberChange(
|
|
10706
|
+
renderDispatch.callOnFiberChange(commitList);
|
|
10612
10707
|
});
|
|
10613
10708
|
}
|
|
10614
10709
|
function checkNextFiberIsSync(renderDispatch) {
|
|
@@ -11637,7 +11732,6 @@ function requireIndex_development () {
|
|
|
11637
11732
|
renderDispatch.runtimeMap.effectMap.delete(fiber);
|
|
11638
11733
|
renderDispatch.runtimeMap.layoutEffectMap.delete(fiber);
|
|
11639
11734
|
renderDispatch.runtimeMap.unmountMap.delete(fiber);
|
|
11640
|
-
renderDispatch.runtimeMap.eventMap.delete(fiber);
|
|
11641
11735
|
renderDispatch.runtimeMap.triggerCallbackMap.delete(fiber);
|
|
11642
11736
|
if (Boolean(true) === false) {
|
|
11643
11737
|
// fiber.child = null;
|
|
@@ -11702,7 +11796,6 @@ function requireIndex_development () {
|
|
|
11702
11796
|
renderDispatch.pendingUnmount(parentFiber, f);
|
|
11703
11797
|
});
|
|
11704
11798
|
});
|
|
11705
|
-
renderDispatch.generateChangedList(parentFiber, true);
|
|
11706
11799
|
}
|
|
11707
11800
|
};
|
|
11708
11801
|
var getNewFiberWithUpdate = function (renderDispatch, newChild, parentFiber, existingChildren, prevFiberChild, index) {
|
|
@@ -11716,11 +11809,9 @@ function requireIndex_development () {
|
|
|
11716
11809
|
// same type
|
|
11717
11810
|
if (include(draftFiber_1 === null || draftFiber_1 === void 0 ? void 0 : draftFiber_1.type, exports.NODE_TYPE.__fragment__)) {
|
|
11718
11811
|
var newElement = react.createElement(Fragment, dynamicFragmentProps, newChild);
|
|
11719
|
-
draftFiber_1 !== prevFiberChild && renderDispatch.generateChangedList(parentFiber);
|
|
11720
11812
|
return updateFiberNode(renderDispatch, { fiber: draftFiber_1, parent: parentFiber, prevFiber: prevFiberChild }, newElement);
|
|
11721
11813
|
}
|
|
11722
11814
|
else {
|
|
11723
|
-
draftFiber_1 && renderDispatch.generateChangedList(parentFiber);
|
|
11724
11815
|
draftFiber_1 && renderDispatch.pendingUnmount(parentFiber, draftFiber_1);
|
|
11725
11816
|
return createFragmentWithUpdate(renderDispatch, newChild, parentFiber);
|
|
11726
11817
|
}
|
|
@@ -11733,12 +11824,10 @@ function requireIndex_development () {
|
|
|
11733
11824
|
}
|
|
11734
11825
|
var isSameType = getIsSameTypeNode(newChild, draftFiber);
|
|
11735
11826
|
if (isSameType) {
|
|
11736
|
-
draftFiber !== prevFiberChild && renderDispatch.generateChangedList(parentFiber);
|
|
11737
11827
|
return updateFiberNode(renderDispatch, { fiber: draftFiber, parent: parentFiber, prevFiber: prevFiberChild }, newChild);
|
|
11738
11828
|
}
|
|
11739
11829
|
else {
|
|
11740
11830
|
draftFiber && renderDispatch.pendingUnmount(parentFiber, draftFiber);
|
|
11741
|
-
draftFiber && renderDispatch.generateChangedList(parentFiber);
|
|
11742
11831
|
return createFiberNode(renderDispatch, { parent: parentFiber, type: "position" }, newChild);
|
|
11743
11832
|
}
|
|
11744
11833
|
};
|
|
@@ -11790,7 +11879,6 @@ function requireIndex_development () {
|
|
|
11790
11879
|
deleteIfNeed(renderDispatch, parentFiber, existingChildrenMap);
|
|
11791
11880
|
}
|
|
11792
11881
|
else {
|
|
11793
|
-
renderDispatch.generateChangedList(parentFiber);
|
|
11794
11882
|
var existingChildrenMap = getExistingChildren(parentFiber).existingChildrenMap;
|
|
11795
11883
|
deleteIfNeed(renderDispatch, parentFiber, existingChildrenMap);
|
|
11796
11884
|
var typedParentFiber = parentFiber;
|
|
@@ -12408,8 +12496,10 @@ function requireIndex_development () {
|
|
|
12408
12496
|
updater._debugRunTime = now;
|
|
12409
12497
|
updater._debugType = UpdateQueueType[UpdateQueueType.context];
|
|
12410
12498
|
if (enableDebugUpdateQueue.current) {
|
|
12411
|
-
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree();
|
|
12499
|
+
typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new ListTree(10);
|
|
12412
12500
|
typedFiber._debugUpdateQueue.push(updater);
|
|
12501
|
+
typedFiber._debugLatestUpdateQueue = new ListTree();
|
|
12502
|
+
typedFiber._debugLatestUpdateQueue.push(updater);
|
|
12413
12503
|
}
|
|
12414
12504
|
}
|
|
12415
12505
|
processedNodes.push(updater);
|
|
@@ -12828,7 +12918,6 @@ function requireIndex_development () {
|
|
|
12828
12918
|
layoutEffectMap: new MyWeakMap(),
|
|
12829
12919
|
insertionEffectMap: new MyWeakMap(),
|
|
12830
12920
|
unmountMap: new MyWeakMap(),
|
|
12831
|
-
eventMap: new MyWeakMap(),
|
|
12832
12921
|
triggerCallbackMap: new MyWeakMap(),
|
|
12833
12922
|
}); };
|
|
12834
12923
|
var getInitialFiber = function () { return ({
|
|
@@ -13584,13 +13673,12 @@ function requireIndex_development () {
|
|
|
13584
13673
|
_this.isAppMounted = false;
|
|
13585
13674
|
_this.isAppCrashed = false;
|
|
13586
13675
|
_this.isAppUnmounted = false;
|
|
13587
|
-
_this.version = "0.3.
|
|
13676
|
+
_this.version = "0.3.22";
|
|
13588
13677
|
_this.id = Math.random().toString(16).slice(2);
|
|
13589
13678
|
_this.mode = "development" ;
|
|
13590
13679
|
_this.renderMode = "render";
|
|
13591
13680
|
_this.pendingCommitFiberList = null;
|
|
13592
13681
|
_this.pendingCommitFiberPatch = PATCH_TYPE.__initial__;
|
|
13593
|
-
_this.pendingChangedFiberList = null;
|
|
13594
13682
|
_this.pendingUpdateFiberArray = new UniqueArray();
|
|
13595
13683
|
_this.pendingSuspenseFiberArray = new UniqueArray();
|
|
13596
13684
|
_this.uniqueIdCount = 0;
|
|
@@ -13608,17 +13696,6 @@ function requireIndex_development () {
|
|
|
13608
13696
|
this.pendingCommitFiberList.push(_fiber);
|
|
13609
13697
|
}
|
|
13610
13698
|
};
|
|
13611
|
-
CustomRenderDispatch.prototype.generateChangedList = function (_fiber, withCheck) {
|
|
13612
|
-
if (!_fiber)
|
|
13613
|
-
return;
|
|
13614
|
-
if (!this.isAppMounted)
|
|
13615
|
-
return;
|
|
13616
|
-
this.pendingChangedFiberList = this.pendingChangedFiberList || new ListTree();
|
|
13617
|
-
if (withCheck && this.pendingChangedFiberList.hasValue(_fiber)) {
|
|
13618
|
-
return;
|
|
13619
|
-
}
|
|
13620
|
-
this.pendingChangedFiberList.push(_fiber);
|
|
13621
|
-
};
|
|
13622
13699
|
CustomRenderDispatch.prototype.pendingCreate = function (_fiber) {
|
|
13623
13700
|
if (include(_fiber.type, this.runtimeRef.typeForCreate)) {
|
|
13624
13701
|
_fiber.patch = merge(_fiber.patch, PATCH_TYPE.__create__);
|
|
@@ -13804,18 +13881,9 @@ function requireIndex_development () {
|
|
|
13804
13881
|
function finishMountSync(renderDispatch, fiber) {
|
|
13805
13882
|
enableScopeTreeLog.current && setLogScope();
|
|
13806
13883
|
renderDispatch.reconcileCommit(fiber);
|
|
13807
|
-
var changedList = renderDispatch.pendingChangedFiberList;
|
|
13808
13884
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
13809
13885
|
renderDispatch.pendingCommitFiberList = null;
|
|
13810
|
-
renderDispatch.pendingChangedFiberList = null;
|
|
13811
13886
|
enableScopeTreeLog.current && resetLogScope();
|
|
13812
|
-
(changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
|
|
13813
|
-
safeCallWithCurrentFiber({
|
|
13814
|
-
fiber: fiber,
|
|
13815
|
-
action: function safeCallFiberHasChangeListener() {
|
|
13816
|
-
renderDispatch.callOnFiberChange(changedList);
|
|
13817
|
-
},
|
|
13818
|
-
});
|
|
13819
13887
|
}
|
|
13820
13888
|
var mountSync = function (renderDispatch, fiber) {
|
|
13821
13889
|
safeCall(function safeCallBeforeDispatchRender() {
|
|
@@ -13835,18 +13903,9 @@ function requireIndex_development () {
|
|
|
13835
13903
|
function finishMountAsync(renderDispatch, fiber) {
|
|
13836
13904
|
enableScopeTreeLog.current && setLogScope();
|
|
13837
13905
|
renderDispatch.reconcileCommit(fiber);
|
|
13838
|
-
var changedList = renderDispatch.pendingChangedFiberList;
|
|
13839
13906
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
13840
13907
|
renderDispatch.pendingCommitFiberList = null;
|
|
13841
|
-
renderDispatch.pendingChangedFiberList = null;
|
|
13842
13908
|
enableScopeTreeLog.current && resetLogScope();
|
|
13843
|
-
(changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
|
|
13844
|
-
safeCallWithCurrentFiber({
|
|
13845
|
-
fiber: fiber,
|
|
13846
|
-
action: function safeCallFiberHasChangeListener() {
|
|
13847
|
-
renderDispatch.callOnFiberChange(changedList);
|
|
13848
|
-
},
|
|
13849
|
-
});
|
|
13850
13909
|
}
|
|
13851
13910
|
var mountAsync = function (renderDispatch, fiber) { return __awaiter(void 0, void 0, void 0, function () {
|
|
13852
13911
|
return __generator(this, function (_a) {
|
|
@@ -13872,7 +13931,7 @@ function requireIndex_development () {
|
|
|
13872
13931
|
});
|
|
13873
13932
|
}); };
|
|
13874
13933
|
|
|
13875
|
-
var version = "0.3.
|
|
13934
|
+
var version = "0.3.22";
|
|
13876
13935
|
|
|
13877
13936
|
exports.CustomRenderDispatch = CustomRenderDispatch;
|
|
13878
13937
|
exports.MyReactFiberNode = MyReactFiberNode;
|
|
@@ -14181,8 +14240,10 @@ var ListTreeNode = /** @class */ (function () {
|
|
|
14181
14240
|
return ListTreeNode;
|
|
14182
14241
|
}());
|
|
14183
14242
|
var ListTree = /** @class */ (function () {
|
|
14184
|
-
function ListTree() {
|
|
14243
|
+
function ListTree(max) {
|
|
14185
14244
|
this.length = 0;
|
|
14245
|
+
this.maxLength = Infinity;
|
|
14246
|
+
this.maxLength = max || Infinity;
|
|
14186
14247
|
var _stickyHead = null;
|
|
14187
14248
|
Object.defineProperty(this, "stickyHead", {
|
|
14188
14249
|
get: function () {
|
|
@@ -14221,6 +14282,9 @@ var ListTree = /** @class */ (function () {
|
|
|
14221
14282
|
});
|
|
14222
14283
|
}
|
|
14223
14284
|
ListTree.prototype.push = function (node) {
|
|
14285
|
+
while (this.length >= this.maxLength) {
|
|
14286
|
+
this.pop();
|
|
14287
|
+
}
|
|
14224
14288
|
var listNode = new ListTreeNode(node);
|
|
14225
14289
|
this.length++;
|
|
14226
14290
|
if (!this.foot) {
|
|
@@ -14238,6 +14302,7 @@ var ListTree = /** @class */ (function () {
|
|
|
14238
14302
|
var node_1 = this.stickyFoot;
|
|
14239
14303
|
this.push(node_1.value);
|
|
14240
14304
|
this.stickyFoot = null;
|
|
14305
|
+
this.length--;
|
|
14241
14306
|
}
|
|
14242
14307
|
else {
|
|
14243
14308
|
this.length++;
|
|
@@ -14250,6 +14315,7 @@ var ListTree = /** @class */ (function () {
|
|
|
14250
14315
|
var node_2 = this.stickyHead;
|
|
14251
14316
|
this.unshift(node_2.value);
|
|
14252
14317
|
this.stickyHead = null;
|
|
14318
|
+
this.length--;
|
|
14253
14319
|
}
|
|
14254
14320
|
else {
|
|
14255
14321
|
this.length++;
|
|
@@ -14268,6 +14334,9 @@ var ListTree = /** @class */ (function () {
|
|
|
14268
14334
|
}
|
|
14269
14335
|
};
|
|
14270
14336
|
ListTree.prototype.unshift = function (node) {
|
|
14337
|
+
while (this.length >= this.maxLength) {
|
|
14338
|
+
this.shift();
|
|
14339
|
+
}
|
|
14271
14340
|
var listNode = new ListTreeNode(node);
|
|
14272
14341
|
this.length++;
|
|
14273
14342
|
if (!this.head) {
|
|
@@ -14285,6 +14354,7 @@ var ListTree = /** @class */ (function () {
|
|
|
14285
14354
|
var node_3 = this.stickyHead;
|
|
14286
14355
|
this.unshift(node_3.value);
|
|
14287
14356
|
this.stickyHead = null;
|
|
14357
|
+
this.length--;
|
|
14288
14358
|
}
|
|
14289
14359
|
else {
|
|
14290
14360
|
this.length++;
|
|
@@ -14297,6 +14367,7 @@ var ListTree = /** @class */ (function () {
|
|
|
14297
14367
|
var node_4 = this.stickyFoot;
|
|
14298
14368
|
this.push(node_4.value);
|
|
14299
14369
|
this.stickyFoot = null;
|
|
14370
|
+
this.length--;
|
|
14300
14371
|
}
|
|
14301
14372
|
else {
|
|
14302
14373
|
this.length++;
|
|
@@ -14448,7 +14519,7 @@ var ListTree = /** @class */ (function () {
|
|
|
14448
14519
|
return newList;
|
|
14449
14520
|
};
|
|
14450
14521
|
ListTree.prototype.clone = function () {
|
|
14451
|
-
var newList = new ListTree();
|
|
14522
|
+
var newList = new ListTree(this.maxLength);
|
|
14452
14523
|
this.listToFoot(function (v) { return newList.push(v); });
|
|
14453
14524
|
return newList;
|
|
14454
14525
|
};
|
|
@@ -14469,6 +14540,38 @@ if (process.env.NODE_ENV === "development") {
|
|
|
14469
14540
|
});
|
|
14470
14541
|
}
|
|
14471
14542
|
|
|
14543
|
+
var enableKnownConfigLog = createRef(false);
|
|
14544
|
+
var knownConfigKeys = [
|
|
14545
|
+
"prepareForCommit",
|
|
14546
|
+
"resetAfterCommit",
|
|
14547
|
+
"appendChildToContainer",
|
|
14548
|
+
"appendInitialChild",
|
|
14549
|
+
"appendChild",
|
|
14550
|
+
"shouldSetTextContent",
|
|
14551
|
+
"createTextInstance",
|
|
14552
|
+
"createInstance",
|
|
14553
|
+
"preparePortalMount",
|
|
14554
|
+
"insertInContainerBefore",
|
|
14555
|
+
"insertBefore",
|
|
14556
|
+
"getPublicInstance",
|
|
14557
|
+
"removeChildFromContainer",
|
|
14558
|
+
"removeChild",
|
|
14559
|
+
"commitTextUpdate",
|
|
14560
|
+
"prepareUpdate",
|
|
14561
|
+
"commitUpdate",
|
|
14562
|
+
"getRootHostContext",
|
|
14563
|
+
"getChildHostContext",
|
|
14564
|
+
"finalizeInitialChildren",
|
|
14565
|
+
"commitMount",
|
|
14566
|
+
];
|
|
14567
|
+
var knownConfig = function (config) {
|
|
14568
|
+
Object.keys(config).forEach(function (key) {
|
|
14569
|
+
if (!knownConfigKeys.includes(key)) {
|
|
14570
|
+
console.warn("not used config key ".concat(key, " with %o value"), config[key]);
|
|
14571
|
+
}
|
|
14572
|
+
});
|
|
14573
|
+
};
|
|
14574
|
+
|
|
14472
14575
|
var DISPATCH_FIELD = "__@my-react/dispatch__";
|
|
14473
14576
|
var DEV_TOOL_FIELD = "__@my-react/react-devtool-inject__";
|
|
14474
14577
|
var addGlobalDispatch = function (dispatch) {
|
|
@@ -15735,6 +15838,9 @@ var currentScheduler = __my_react_internal__.currentScheduler;
|
|
|
15735
15838
|
var Reconciler = function (_config) {
|
|
15736
15839
|
var rendererPackageName = "@my-react";
|
|
15737
15840
|
var ReconcilerSet = new Set();
|
|
15841
|
+
if (process.env.NODE_ENV === "development" && enableKnownConfigLog.current) {
|
|
15842
|
+
knownConfig(_config);
|
|
15843
|
+
}
|
|
15738
15844
|
var createContainer = function (_container, flag) {
|
|
15739
15845
|
prepareScheduler();
|
|
15740
15846
|
if (flag === 0) {
|
|
@@ -15746,6 +15852,7 @@ var Reconciler = function (_config) {
|
|
|
15746
15852
|
_container.__flag__ = 1;
|
|
15747
15853
|
}
|
|
15748
15854
|
enableDebugFiled.current = process.env.NODE_ENV === "development";
|
|
15855
|
+
myreactReconcilerExports.enableDebugUpdateQueue.current = process.env.NODE_ENV === "development";
|
|
15749
15856
|
enableScopeTreeLog.current = false;
|
|
15750
15857
|
myreactReconcilerExports.enableFiberForLog.current = false;
|
|
15751
15858
|
return _container;
|
|
@@ -15841,12 +15948,13 @@ var Reconciler = function (_config) {
|
|
|
15841
15948
|
getPublicRootInstance: getPublicRootInstance,
|
|
15842
15949
|
injectIntoDevToolsWithSocketIO: injectIntoDevToolsWithSocketIO,
|
|
15843
15950
|
flushSync: myreactReconcilerExports.safeCallWithSync,
|
|
15951
|
+
flushSyncWork: myreactReconcilerExports.safeCallWithSync,
|
|
15844
15952
|
batchedUpdates: myreactReconcilerExports.safeCallWithSync,
|
|
15845
15953
|
};
|
|
15846
15954
|
};
|
|
15847
15955
|
|
|
15848
15956
|
/* eslint-disable import/export */
|
|
15849
|
-
var version = "0.0.
|
|
15957
|
+
var version = "0.0.13";
|
|
15850
15958
|
var createReconciler = Reconciler;
|
|
15851
15959
|
|
|
15852
|
-
export { createReconciler, createReconciler as default, version };
|
|
15960
|
+
export { createReconciler, createReconciler as default, enableKnownConfigLog, version };
|