@my-react/react-reconciler-compact 0.0.9 → 0.0.11
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 +942 -729
- package/dist/cjs/index.production.js +865 -665
- package/dist/types/dispatch.d.ts +61 -24
- package/dist/types/dispatch.d.ts.map +1 -1
- package/dist/types/dispatchFiber.d.ts.map +1 -1
- package/dist/types/dispatchUpdate.d.ts +1 -1
- package/dist/types/dispatchUpdate.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -183,6 +183,7 @@ function requireIndex_production_1 () {
|
|
|
183
183
|
var ScopeSuspense = Symbol.for("react.scope_suspense");
|
|
184
184
|
var Comment = Symbol.for("react.comment");
|
|
185
185
|
var Offscreen = Symbol.for("react.offscreen");
|
|
186
|
+
var Activity = Symbol.for("react.activity");
|
|
186
187
|
var Profiler = Symbol.for("react.profiler");
|
|
187
188
|
|
|
188
189
|
function isObject(target) {
|
|
@@ -282,6 +283,7 @@ function requireIndex_production_1 () {
|
|
|
282
283
|
HOOK_TYPE[HOOK_TYPE["useImperativeHandle"] = 14] = "useImperativeHandle";
|
|
283
284
|
HOOK_TYPE[HOOK_TYPE["useSyncExternalStore"] = 15] = "useSyncExternalStore";
|
|
284
285
|
HOOK_TYPE[HOOK_TYPE["useOptimistic"] = 16] = "useOptimistic";
|
|
286
|
+
HOOK_TYPE[HOOK_TYPE["useEffectEvent"] = 17] = "useEffectEvent";
|
|
285
287
|
})(exports.HOOK_TYPE || (exports.HOOK_TYPE = {}));
|
|
286
288
|
|
|
287
289
|
exports.UpdateQueueType = void 0;
|
|
@@ -697,6 +699,7 @@ function requireIndex_production_1 () {
|
|
|
697
699
|
return ListTree;
|
|
698
700
|
}());
|
|
699
701
|
|
|
702
|
+
exports.Activity = Activity;
|
|
700
703
|
exports.Comment = Comment;
|
|
701
704
|
exports.Consumer = Consumer;
|
|
702
705
|
exports.Context = Context;
|
|
@@ -886,6 +889,7 @@ function requireIndex_production_1 () {
|
|
|
886
889
|
NODE_TYPE[NODE_TYPE["__context__"] = 524288] = "__context__";
|
|
887
890
|
NODE_TYPE[NODE_TYPE["__scopeLazy__"] = 1048576] = "__scopeLazy__";
|
|
888
891
|
NODE_TYPE[NODE_TYPE["__scopeSuspense__"] = 2097152] = "__scopeSuspense__";
|
|
892
|
+
NODE_TYPE[NODE_TYPE["__activity__"] = 4194304] = "__activity__";
|
|
889
893
|
})(exports.NODE_TYPE || (exports.NODE_TYPE = {}));
|
|
890
894
|
|
|
891
895
|
var enableSyncFlush$1 = react.__my_react_shared__.enableSyncFlush;
|
|
@@ -1005,13 +1009,8 @@ function requireIndex_production_1 () {
|
|
|
1005
1009
|
var renderDispatch = getCurrentDispatchFromFiber(fiber);
|
|
1006
1010
|
safeCallWithCurrentFiber({
|
|
1007
1011
|
fiber: fiber,
|
|
1008
|
-
action: function
|
|
1009
|
-
|
|
1010
|
-
try {
|
|
1011
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberWarn) === null || _b === void 0 ? void 0 : _b.forEach(function (listener) { return listener.apply(void 0, __spreadArray([fiber], args, false)); });
|
|
1012
|
-
}
|
|
1013
|
-
catch (_c) {
|
|
1014
|
-
}
|
|
1012
|
+
action: function () {
|
|
1013
|
+
renderDispatch.callOnFiberWarn.apply(renderDispatch, __spreadArray([fiber], args, false));
|
|
1015
1014
|
},
|
|
1016
1015
|
});
|
|
1017
1016
|
};
|
|
@@ -1023,13 +1022,8 @@ function requireIndex_production_1 () {
|
|
|
1023
1022
|
var renderDispatch = getCurrentDispatchFromFiber(fiber);
|
|
1024
1023
|
safeCallWithCurrentFiber({
|
|
1025
1024
|
fiber: fiber,
|
|
1026
|
-
action: function
|
|
1027
|
-
|
|
1028
|
-
try {
|
|
1029
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberError) === null || _b === void 0 ? void 0 : _b.forEach(function (listener) { return listener.apply(void 0, __spreadArray([fiber], args, false)); });
|
|
1030
|
-
}
|
|
1031
|
-
catch (_c) {
|
|
1032
|
-
}
|
|
1025
|
+
action: function () {
|
|
1026
|
+
renderDispatch.callOnFiberError.apply(renderDispatch, __spreadArray([fiber], args, false));
|
|
1033
1027
|
},
|
|
1034
1028
|
});
|
|
1035
1029
|
};
|
|
@@ -1448,6 +1442,9 @@ function requireIndex_production_1 () {
|
|
|
1448
1442
|
case myreactSharedExports.Profiler:
|
|
1449
1443
|
nodeType = myreactSharedExports.merge(nodeType, exports.NODE_TYPE.__profiler__);
|
|
1450
1444
|
break;
|
|
1445
|
+
case myreactSharedExports.Activity:
|
|
1446
|
+
nodeType = myreactSharedExports.merge(nodeType, exports.NODE_TYPE.__activity__);
|
|
1447
|
+
break;
|
|
1451
1448
|
default:
|
|
1452
1449
|
throw new Error("[@my-react/react] invalid symbol element type \"".concat(elementType === null || elementType === void 0 ? void 0 : elementType.toString(), "\""));
|
|
1453
1450
|
}
|
|
@@ -2232,8 +2229,7 @@ function requireIndex_production_1 () {
|
|
|
2232
2229
|
safeCallWithCurrentFiber({
|
|
2233
2230
|
fiber: fiber,
|
|
2234
2231
|
action: function safeCallFiberUpdateListener() {
|
|
2235
|
-
|
|
2236
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberUpdate) === null || _b === void 0 ? void 0 : _b.forEach(function (listener) { return listener(fiber); });
|
|
2232
|
+
renderDispatch.callOnFiberUpdate(fiber);
|
|
2237
2233
|
},
|
|
2238
2234
|
});
|
|
2239
2235
|
};
|
|
@@ -2439,8 +2435,7 @@ function requireIndex_production_1 () {
|
|
|
2439
2435
|
safeCallWithCurrentFiber({
|
|
2440
2436
|
fiber: fiber,
|
|
2441
2437
|
action: function safeCallInstanceInitialListener() {
|
|
2442
|
-
|
|
2443
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.instanceInitial) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(instance, fiber); });
|
|
2438
|
+
renderDispatch.callOnInstanceInitial(instance, fiber);
|
|
2444
2439
|
},
|
|
2445
2440
|
});
|
|
2446
2441
|
instance.props = props;
|
|
@@ -2457,8 +2452,7 @@ function requireIndex_production_1 () {
|
|
|
2457
2452
|
safeCallWithCurrentFiber({
|
|
2458
2453
|
fiber: fiber,
|
|
2459
2454
|
action: function safeCallInstanceUpdateListener() {
|
|
2460
|
-
|
|
2461
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.instanceUpdate) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(typedInstance, fiber); });
|
|
2455
|
+
renderDispatch.callOnInstanceUpdate(typedInstance, fiber);
|
|
2462
2456
|
},
|
|
2463
2457
|
});
|
|
2464
2458
|
setOwnerForInstance(typedInstance, fiber);
|
|
@@ -2723,8 +2717,7 @@ function requireIndex_production_1 () {
|
|
|
2723
2717
|
safeCallWithCurrentFiber({
|
|
2724
2718
|
fiber: fiber,
|
|
2725
2719
|
action: function safeCallInstanceUnmountListener() {
|
|
2726
|
-
|
|
2727
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.instanceUnmount) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(typedInstance, fiber); });
|
|
2720
|
+
renderDispatch.callOnInstanceUnmount(typedInstance, fiber);
|
|
2728
2721
|
},
|
|
2729
2722
|
});
|
|
2730
2723
|
safeCallWithCurrentFiber({
|
|
@@ -2799,7 +2792,7 @@ function requireIndex_production_1 () {
|
|
|
2799
2792
|
_loop_1();
|
|
2800
2793
|
}
|
|
2801
2794
|
if (allQueue.length) {
|
|
2802
|
-
renderScheduler.
|
|
2795
|
+
renderScheduler.microTask(function prepareUpdateOnFiberTask() {
|
|
2803
2796
|
prepareUpdateOnFiber(renderDispatch, fiber, true);
|
|
2804
2797
|
});
|
|
2805
2798
|
}
|
|
@@ -3012,7 +3005,7 @@ function requireIndex_production_1 () {
|
|
|
3012
3005
|
_loop_3();
|
|
3013
3006
|
}
|
|
3014
3007
|
if (allQueue.length) {
|
|
3015
|
-
renderScheduler.
|
|
3008
|
+
renderScheduler.microTask(function prepareUpdateOnFiberTask() {
|
|
3016
3009
|
prepareUpdateOnFiber(renderDispatch, fiber, true);
|
|
3017
3010
|
});
|
|
3018
3011
|
}
|
|
@@ -3300,8 +3293,7 @@ function requireIndex_production_1 () {
|
|
|
3300
3293
|
safeCallWithCurrentFiber({
|
|
3301
3294
|
fiber: ownerFiber,
|
|
3302
3295
|
action: function safeCallFiberStateListener() {
|
|
3303
|
-
|
|
3304
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberState) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(ownerFiber, _params); });
|
|
3296
|
+
renderDispatch.callOnFiberState(ownerFiber, _params);
|
|
3305
3297
|
},
|
|
3306
3298
|
});
|
|
3307
3299
|
var isImmediate = _params.isImmediate;
|
|
@@ -3313,8 +3305,7 @@ function requireIndex_production_1 () {
|
|
|
3313
3305
|
safeCallWithCurrentFiber({
|
|
3314
3306
|
fiber: ownerFiber,
|
|
3315
3307
|
action: function safeCallInstanceStateListener() {
|
|
3316
|
-
|
|
3317
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.instanceState) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(trigger_1, ownerFiber, _params); });
|
|
3308
|
+
renderDispatch.callOnInstanceState(trigger_1, ownerFiber, _params);
|
|
3318
3309
|
},
|
|
3319
3310
|
});
|
|
3320
3311
|
ownerFiber.updateQueue = ownerFiber.updateQueue || new myreactSharedExports.ListTree();
|
|
@@ -3328,8 +3319,7 @@ function requireIndex_production_1 () {
|
|
|
3328
3319
|
safeCallWithCurrentFiber({
|
|
3329
3320
|
fiber: ownerFiber,
|
|
3330
3321
|
action: function safeCallHookStateListener() {
|
|
3331
|
-
|
|
3332
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.hookState) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(trigger_2, ownerFiber, _params); });
|
|
3322
|
+
renderDispatch.callOnHookState(trigger_2, ownerFiber, _params);
|
|
3333
3323
|
},
|
|
3334
3324
|
});
|
|
3335
3325
|
ownerFiber.updateQueue = ownerFiber.updateQueue || new myreactSharedExports.ListTree();
|
|
@@ -3625,11 +3615,10 @@ function requireIndex_production_1 () {
|
|
|
3625
3615
|
renderDispatch.resetUpdateFlowRuntimeFiber();
|
|
3626
3616
|
renderDispatch.pendingCommitFiberList = null;
|
|
3627
3617
|
renderDispatch.pendingChangedFiberList = null;
|
|
3628
|
-
(commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
|
|
3618
|
+
(commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList, true);
|
|
3629
3619
|
(changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
|
|
3630
3620
|
safeCall(function safeCallFiberHasChangeListener() {
|
|
3631
|
-
|
|
3632
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberHasChange) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(changedList); });
|
|
3621
|
+
renderDispatch.callOnFiberChange(changedList);
|
|
3633
3622
|
});
|
|
3634
3623
|
}
|
|
3635
3624
|
var updateSyncFromRoot = function (renderDispatch) {
|
|
@@ -3652,8 +3641,7 @@ function requireIndex_production_1 () {
|
|
|
3652
3641
|
(commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
|
|
3653
3642
|
(changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
|
|
3654
3643
|
safeCall(function safeCallFiberHasChangeListener() {
|
|
3655
|
-
|
|
3656
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberHasChange) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(changedList); });
|
|
3644
|
+
renderDispatch.callOnFiberChange(changedList);
|
|
3657
3645
|
});
|
|
3658
3646
|
}
|
|
3659
3647
|
function checkNextFiberIsSync(renderDispatch) {
|
|
@@ -3681,7 +3669,7 @@ function requireIndex_production_1 () {
|
|
|
3681
3669
|
else {
|
|
3682
3670
|
processAsyncLoadListOnUpdate(renderDispatch);
|
|
3683
3671
|
finishUpdateConcurrentFromRoot(renderDispatch);
|
|
3684
|
-
renderScheduler.
|
|
3672
|
+
renderScheduler.microTask(function callScheduleNext() {
|
|
3685
3673
|
globalLoop$1.current = false;
|
|
3686
3674
|
scheduleNext(renderDispatch);
|
|
3687
3675
|
});
|
|
@@ -3709,7 +3697,7 @@ function requireIndex_production_1 () {
|
|
|
3709
3697
|
else {
|
|
3710
3698
|
processAsyncLoadListOnUpdate(renderDispatch);
|
|
3711
3699
|
finishUpdateConcurrentFromRoot(renderDispatch);
|
|
3712
|
-
renderScheduler.
|
|
3700
|
+
renderScheduler.microTask(function callScheduleNext() {
|
|
3713
3701
|
globalLoop$1.current = false;
|
|
3714
3702
|
scheduleNext(renderDispatch);
|
|
3715
3703
|
});
|
|
@@ -3824,7 +3812,10 @@ function requireIndex_production_1 () {
|
|
|
3824
3812
|
hookNode.result = hookNode.value;
|
|
3825
3813
|
hookNode.hasEffect = true;
|
|
3826
3814
|
}
|
|
3827
|
-
if (hookNode.type === myreactSharedExports.HOOK_TYPE.useRef ||
|
|
3815
|
+
if (hookNode.type === myreactSharedExports.HOOK_TYPE.useRef ||
|
|
3816
|
+
hookNode.type === myreactSharedExports.HOOK_TYPE.useCallback ||
|
|
3817
|
+
hookNode.type === myreactSharedExports.HOOK_TYPE.useDeferredValue ||
|
|
3818
|
+
hookNode.type === myreactSharedExports.HOOK_TYPE.useEffectEvent) {
|
|
3828
3819
|
hookNode.result = hookNode.value;
|
|
3829
3820
|
}
|
|
3830
3821
|
// cache ref state from recreate
|
|
@@ -4195,6 +4186,13 @@ function requireIndex_production_1 () {
|
|
|
4195
4186
|
// currentHook._update({ isForce: true, payLoad: (last) => ({ value: value.value, start: last.start }) });
|
|
4196
4187
|
}
|
|
4197
4188
|
}
|
|
4189
|
+
if (currentHook.type === myreactSharedExports.HOOK_TYPE.useEffectEvent) {
|
|
4190
|
+
if (typeof value !== "function") {
|
|
4191
|
+
throw new Error("[@my-react/react] useEffectEvent should be a function");
|
|
4192
|
+
}
|
|
4193
|
+
currentHook.value = value;
|
|
4194
|
+
currentHook.result = value;
|
|
4195
|
+
}
|
|
4198
4196
|
if (currentHook.type === myreactSharedExports.HOOK_TYPE.useDebugValue) {
|
|
4199
4197
|
if (!myreactSharedExports.isArrayEquals(currentHook.value, value)) {
|
|
4200
4198
|
currentHook.value = value;
|
|
@@ -4213,8 +4211,7 @@ function requireIndex_production_1 () {
|
|
|
4213
4211
|
safeCallWithCurrentFiber({
|
|
4214
4212
|
fiber: fiber,
|
|
4215
4213
|
action: function safeCallHookUnmountListener() {
|
|
4216
|
-
|
|
4217
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.hookUnmount) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(hookNode, fiber); });
|
|
4214
|
+
renderDispatch.callOnHookUnmount(hookNode, fiber);
|
|
4218
4215
|
},
|
|
4219
4216
|
});
|
|
4220
4217
|
safeCallWithCurrentFiber({
|
|
@@ -4296,8 +4293,7 @@ function requireIndex_production_1 () {
|
|
|
4296
4293
|
safeCallWithCurrentFiber({
|
|
4297
4294
|
fiber: fiber,
|
|
4298
4295
|
action: function safeCallFiberTriggerListener() {
|
|
4299
|
-
|
|
4300
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberTrigger) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(fiber, updateState); });
|
|
4296
|
+
renderDispatch.callOnFiberTrigger(fiber, updateState);
|
|
4301
4297
|
},
|
|
4302
4298
|
});
|
|
4303
4299
|
// TODO get from updateState ?
|
|
@@ -4447,8 +4443,7 @@ function requireIndex_production_1 () {
|
|
|
4447
4443
|
safeCallWithCurrentFiber({
|
|
4448
4444
|
fiber: newFiberNode,
|
|
4449
4445
|
action: function safeCallFiberInitialListener() {
|
|
4450
|
-
|
|
4451
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberInitial) === null || _b === void 0 ? void 0 : _b.forEach(function (listener) { return listener(newFiberNode); });
|
|
4446
|
+
renderDispatch.callOnFiberInitial(newFiberNode);
|
|
4452
4447
|
},
|
|
4453
4448
|
});
|
|
4454
4449
|
if (myreactSharedExports.exclude(newFiberNode.patch, myreactSharedExports.PATCH_TYPE.__update__)) {
|
|
@@ -4499,7 +4494,6 @@ function requireIndex_production_1 () {
|
|
|
4499
4494
|
}
|
|
4500
4495
|
}
|
|
4501
4496
|
if (prevRef !== nextRef) {
|
|
4502
|
-
fiber.refPrevious = prevRef;
|
|
4503
4497
|
renderDispatch.pendingRef(fiber);
|
|
4504
4498
|
}
|
|
4505
4499
|
if (fiber !== prevFiber) {
|
|
@@ -4528,8 +4522,7 @@ function requireIndex_production_1 () {
|
|
|
4528
4522
|
safeCallWithCurrentFiber({
|
|
4529
4523
|
fiber: fiber,
|
|
4530
4524
|
action: function safeCallFiberInitialListener() {
|
|
4531
|
-
|
|
4532
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberInitial) === null || _b === void 0 ? void 0 : _b.forEach(function (listener) { return listener(fiber); });
|
|
4525
|
+
renderDispatch.callOnFiberInitial(fiber);
|
|
4533
4526
|
},
|
|
4534
4527
|
});
|
|
4535
4528
|
if (myreactSharedExports.exclude(fiber.patch, myreactSharedExports.PATCH_TYPE.__update__)) {
|
|
@@ -4567,8 +4560,7 @@ function requireIndex_production_1 () {
|
|
|
4567
4560
|
safeCallWithCurrentFiber({
|
|
4568
4561
|
fiber: fiber,
|
|
4569
4562
|
action: function safeCallFiberUnmountListener() {
|
|
4570
|
-
|
|
4571
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberUnmount) === null || _b === void 0 ? void 0 : _b.forEach(function (listener) { return listener(fiber); });
|
|
4563
|
+
renderDispatch.callOnFiberUnmount(fiber);
|
|
4572
4564
|
},
|
|
4573
4565
|
});
|
|
4574
4566
|
fiberToDispatchMap.delete(fiber);
|
|
@@ -4735,6 +4727,14 @@ function requireIndex_production_1 () {
|
|
|
4735
4727
|
}
|
|
4736
4728
|
};
|
|
4737
4729
|
|
|
4730
|
+
// TODO
|
|
4731
|
+
var processActivity = function (fiber) {
|
|
4732
|
+
var props = fiber.pendingProps;
|
|
4733
|
+
if (props.mode === "visible")
|
|
4734
|
+
return props.children;
|
|
4735
|
+
return null;
|
|
4736
|
+
};
|
|
4737
|
+
|
|
4738
4738
|
var currentComponentFiber$2 = react.__my_react_internal__.currentComponentFiber, MyReactInternalInstance$3 = react.__my_react_internal__.MyReactInternalInstance;
|
|
4739
4739
|
var processProvider = function (renderDispatch, fiber) {
|
|
4740
4740
|
if (renderDispatch.isAppMounted) {
|
|
@@ -4946,6 +4946,28 @@ function requireIndex_production_1 () {
|
|
|
4946
4946
|
}
|
|
4947
4947
|
};
|
|
4948
4948
|
|
|
4949
|
+
var initSuspenseInstance = function (instance) {
|
|
4950
|
+
var field = getInstanceFieldByInstance(instance);
|
|
4951
|
+
if (!field)
|
|
4952
|
+
throw new Error("[@my-react/react] can not get field for instance, this is a bug for @my-react");
|
|
4953
|
+
var typedField = field;
|
|
4954
|
+
typedField.isHidden = false;
|
|
4955
|
+
typedField.asyncLoadList = new myreactSharedExports.UniqueArray();
|
|
4956
|
+
};
|
|
4957
|
+
|
|
4958
|
+
var MyReactInternalInstance$2 = react.__my_react_internal__.MyReactInternalInstance;
|
|
4959
|
+
var processSuspense = function (fiber) {
|
|
4960
|
+
var isUpdate = !!fiber.instance;
|
|
4961
|
+
fiber.instance = fiber.instance || new MyReactInternalInstance$2();
|
|
4962
|
+
!isUpdate && initInstance(fiber.instance);
|
|
4963
|
+
!isUpdate && initVisibleInstance(fiber.instance);
|
|
4964
|
+
!isUpdate && initSuspenseInstance(fiber.instance);
|
|
4965
|
+
!isUpdate && setOwnerForInstance(fiber.instance, fiber);
|
|
4966
|
+
var instanceField = getInstanceFieldByInstance(fiber.instance);
|
|
4967
|
+
var children = WrapperBySuspenseScope(instanceField.isHidden ? fiber.pendingProps.fallback : fiber.pendingProps.children);
|
|
4968
|
+
return children;
|
|
4969
|
+
};
|
|
4970
|
+
|
|
4949
4971
|
react.__my_react_internal__.MyReactInternalInstance; var instanceToInitialFieldMap = react.__my_react_internal__.instanceToInitialFieldMap;
|
|
4950
4972
|
// support private instance field
|
|
4951
4973
|
var instanceMap = instanceToInitialFieldMap;
|
|
@@ -5052,7 +5074,7 @@ function requireIndex_production_1 () {
|
|
|
5052
5074
|
return field === null || field === void 0 ? void 0 : field.effect;
|
|
5053
5075
|
};
|
|
5054
5076
|
|
|
5055
|
-
var currentComponentFiber$1 = react.__my_react_internal__.currentComponentFiber, MyReactInternalInstance$
|
|
5077
|
+
var currentComponentFiber$1 = react.__my_react_internal__.currentComponentFiber, MyReactInternalInstance$1 = react.__my_react_internal__.MyReactInternalInstance;
|
|
5056
5078
|
var enablePerformanceLog = react.__my_react_shared__.enablePerformanceLog, enableDebugFiled = react.__my_react_shared__.enableDebugFiled;
|
|
5057
5079
|
var nextWorkCommon = function (renderDispatch, fiber, children) {
|
|
5058
5080
|
if (myreactSharedExports.exclude(fiber.patch, myreactSharedExports.PATCH_TYPE.__update__)) {
|
|
@@ -5120,9 +5142,13 @@ function requireIndex_production_1 () {
|
|
|
5120
5142
|
var children = processConsumer(renderDispatch, fiber);
|
|
5121
5143
|
nextWorkCommon(renderDispatch, fiber, children);
|
|
5122
5144
|
};
|
|
5145
|
+
var nextWorkActivity = function (renderDispatch, fiber) {
|
|
5146
|
+
var children = processActivity(fiber);
|
|
5147
|
+
nextWorkCommon(renderDispatch, fiber, children);
|
|
5148
|
+
};
|
|
5123
5149
|
var nextWorkRoot = function (renderDispatch, fiber) {
|
|
5124
5150
|
var isUpdate = !!fiber.instance;
|
|
5125
|
-
fiber.instance = fiber.instance || new MyReactInternalInstance$
|
|
5151
|
+
fiber.instance = fiber.instance || new MyReactInternalInstance$1();
|
|
5126
5152
|
!isUpdate && initInstance(fiber.instance);
|
|
5127
5153
|
!isUpdate && initVisibleInstance(fiber.instance);
|
|
5128
5154
|
!isUpdate && setOwnerForInstance(fiber.instance, fiber);
|
|
@@ -5141,8 +5167,7 @@ function requireIndex_production_1 () {
|
|
|
5141
5167
|
safeCallWithCurrentFiber({
|
|
5142
5168
|
fiber: fiber,
|
|
5143
5169
|
action: function safeCallFiberRunListener() {
|
|
5144
|
-
|
|
5145
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.beforeFiberRun) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(fiber); });
|
|
5170
|
+
renderDispatch.callOnBeforeFiberRun(fiber);
|
|
5146
5171
|
},
|
|
5147
5172
|
});
|
|
5148
5173
|
setRefreshTypeMap(fiber);
|
|
@@ -5159,8 +5184,7 @@ function requireIndex_production_1 () {
|
|
|
5159
5184
|
safeCallWithCurrentFiber({
|
|
5160
5185
|
fiber: fiber,
|
|
5161
5186
|
action: function safeCallPerformanceWarnListener() {
|
|
5162
|
-
|
|
5163
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.performanceWarn) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(fiber); });
|
|
5187
|
+
renderDispatch.callOnPerformanceWarn(fiber, renderTime);
|
|
5164
5188
|
},
|
|
5165
5189
|
});
|
|
5166
5190
|
}
|
|
@@ -5191,111 +5215,504 @@ function requireIndex_production_1 () {
|
|
|
5191
5215
|
safeCallWithCurrentFiber({
|
|
5192
5216
|
fiber: fiber,
|
|
5193
5217
|
action: function safeCallFiberRunListener() {
|
|
5194
|
-
|
|
5195
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.afterFiberRun) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(fiber); });
|
|
5218
|
+
renderDispatch.callOnAfterFiberRun(fiber);
|
|
5196
5219
|
},
|
|
5197
5220
|
});
|
|
5198
5221
|
};
|
|
5199
5222
|
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5223
|
+
react.__my_react_shared__.enableDebugFiled;
|
|
5224
|
+
var currentRunningFiber = react.__my_react_internal__.currentRunningFiber, MyReactInternalInstance = react.__my_react_internal__.MyReactInternalInstance;
|
|
5225
|
+
var defaultGetContextValue = function (fiber, ContextObject) {
|
|
5226
|
+
var _a;
|
|
5227
|
+
if (fiber) {
|
|
5228
|
+
return fiber.pendingProps["value"];
|
|
5229
|
+
}
|
|
5230
|
+
else {
|
|
5231
|
+
return (_a = ContextObject === null || ContextObject === void 0 ? void 0 : ContextObject.Provider) === null || _a === void 0 ? void 0 : _a["value"];
|
|
5232
|
+
}
|
|
5207
5233
|
};
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5234
|
+
var defaultGetContextFiber = function (fiber, ContextObject) {
|
|
5235
|
+
if ((fiber === null || fiber === void 0 ? void 0 : fiber.parent) && ContextObject) {
|
|
5236
|
+
var parent_1 = fiber.parent;
|
|
5237
|
+
while (parent_1) {
|
|
5238
|
+
if (myreactSharedExports.include(parent_1.type, exports.NODE_TYPE.__provider__)) {
|
|
5239
|
+
var typedElementType = parent_1.elementType;
|
|
5240
|
+
var contextObj = typedElementType["Context"];
|
|
5241
|
+
if (contextObj === ContextObject) {
|
|
5242
|
+
return parent_1;
|
|
5243
|
+
}
|
|
5244
|
+
}
|
|
5245
|
+
if (myreactSharedExports.include(parent_1.type, exports.NODE_TYPE.__context__)) {
|
|
5246
|
+
var typedElementType = parent_1.elementType;
|
|
5247
|
+
var contextObj = typedElementType;
|
|
5248
|
+
if (contextObj === ContextObject) {
|
|
5249
|
+
return parent_1;
|
|
5250
|
+
}
|
|
5251
|
+
}
|
|
5252
|
+
parent_1 = parent_1.parent;
|
|
5253
|
+
}
|
|
5254
|
+
}
|
|
5255
|
+
else {
|
|
5256
|
+
return null;
|
|
5257
|
+
}
|
|
5258
|
+
};
|
|
5259
|
+
var defaultReadContext = function (Context) {
|
|
5260
|
+
var fiber = currentRunningFiber.current;
|
|
5261
|
+
if (!Context) {
|
|
5262
|
+
throw new Error("the Context what you read is not exist");
|
|
5263
|
+
}
|
|
5264
|
+
if (!fiber) {
|
|
5265
|
+
throw new Error('current environment is not support "readContext"');
|
|
5266
|
+
}
|
|
5211
5267
|
var isUpdate = !!fiber.instance;
|
|
5212
|
-
fiber.instance = fiber.instance || new MyReactInternalInstance
|
|
5268
|
+
fiber.instance = fiber.instance || new MyReactInternalInstance();
|
|
5213
5269
|
!isUpdate && initInstance(fiber.instance);
|
|
5214
|
-
!isUpdate && initVisibleInstance(fiber.instance);
|
|
5215
|
-
!isUpdate && initSuspenseInstance(fiber.instance);
|
|
5216
5270
|
!isUpdate && setOwnerForInstance(fiber.instance, fiber);
|
|
5217
|
-
var
|
|
5218
|
-
|
|
5219
|
-
return
|
|
5220
|
-
};
|
|
5221
|
-
|
|
5222
|
-
var Dispatcher = react.__my_react_internal__.Dispatcher, MyReactInternalInstanceClass = react.__my_react_internal__.MyReactInternalInstance, dispatchToListenerMap = react.__my_react_internal__.dispatchToListenerMap;
|
|
5223
|
-
var getInitialListeners = function () {
|
|
5224
|
-
return {
|
|
5225
|
-
fiberInitial: new Set(),
|
|
5226
|
-
fiberUpdate: new Set(),
|
|
5227
|
-
fiberHasChange: new Set(),
|
|
5228
|
-
fiberUnmount: new Set(),
|
|
5229
|
-
fiberState: new Set(),
|
|
5230
|
-
fiberTrigger: new Set(),
|
|
5231
|
-
instanceInitial: new Set(),
|
|
5232
|
-
instanceUpdate: new Set(),
|
|
5233
|
-
instanceState: new Set(),
|
|
5234
|
-
instanceUnmount: new Set(),
|
|
5235
|
-
hookInitial: new Set(),
|
|
5236
|
-
hookUpdate: new Set(),
|
|
5237
|
-
hookState: new Set(),
|
|
5238
|
-
hookUnmount: new Set(),
|
|
5239
|
-
beforeCommitMount: new Set(),
|
|
5240
|
-
afterCommitMount: new Set(),
|
|
5241
|
-
beforeCommitUpdate: new Set(),
|
|
5242
|
-
afterCommitUpdate: new Set(),
|
|
5243
|
-
beforeCommitUnmount: new Set(),
|
|
5244
|
-
afterCommitUnmount: new Set(),
|
|
5245
|
-
};
|
|
5271
|
+
var contextFiber = defaultGetContextFiber(fiber, Context);
|
|
5272
|
+
setSubscribeForInstance(fiber.instance, contextFiber);
|
|
5273
|
+
return defaultGetContextValue(contextFiber, Context);
|
|
5246
5274
|
};
|
|
5247
|
-
var
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5275
|
+
var prepareUpdateAllDependence = function (renderDispatch, fiber, beforeValue, afterValue) {
|
|
5276
|
+
var consumerList = new Set((fiber === null || fiber === void 0 ? void 0 : fiber.dependence) || []);
|
|
5277
|
+
consumerList.forEach(function prepareUpdateSingleConsumer(i) {
|
|
5278
|
+
var owner = getInstanceOwnerFiber(i);
|
|
5279
|
+
if (owner && myreactSharedExports.exclude(owner.state, myreactSharedExports.STATE_TYPE.__unmount__)) {
|
|
5280
|
+
var typedFiber_1 = owner;
|
|
5281
|
+
typedFiber_1.state = myreactSharedExports.STATE_TYPE.__triggerSyncForce__;
|
|
5282
|
+
}
|
|
5283
|
+
});
|
|
5284
|
+
var processedNodes = [];
|
|
5285
|
+
var updater = {
|
|
5286
|
+
type: myreactSharedExports.UpdateQueueType.context,
|
|
5287
|
+
trigger: fiber,
|
|
5288
|
+
payLoad: afterValue,
|
|
5289
|
+
isSync: true,
|
|
5290
|
+
isForce: true,
|
|
5291
|
+
isImmediate: true,
|
|
5292
|
+
isRetrigger: true,
|
|
5293
|
+
};
|
|
5294
|
+
processedNodes.push(updater);
|
|
5295
|
+
var updateState = {
|
|
5296
|
+
needUpdate: true,
|
|
5297
|
+
nodes: processedNodes,
|
|
5298
|
+
isSync: true,
|
|
5299
|
+
isForce: true,
|
|
5300
|
+
isImmediate: true,
|
|
5301
|
+
isRetrigger: true,
|
|
5302
|
+
};
|
|
5303
|
+
safeCallWithCurrentFiber({
|
|
5304
|
+
fiber: fiber,
|
|
5305
|
+
action: function safeCallFiberTriggerListener() {
|
|
5306
|
+
renderDispatch.callOnFiberTrigger(fiber, updateState);
|
|
5307
|
+
},
|
|
5308
|
+
});
|
|
5267
5309
|
};
|
|
5268
|
-
|
|
5269
|
-
var
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5310
|
+
|
|
5311
|
+
var currentScheduler$2 = react.__my_react_internal__.currentScheduler;
|
|
5312
|
+
react.__my_react_shared__.enableScopeTreeLog;
|
|
5313
|
+
// TODO improve
|
|
5314
|
+
var defaultDispatchMountLatest = function (_dispatch, _fiber) {
|
|
5315
|
+
beforeSyncUpdate();
|
|
5316
|
+
var _list = generateFiberToListWithAction(_fiber, function invokeUnmountPendingList(_fiber) {
|
|
5317
|
+
defaultInvokeUnmountList(_dispatch, _fiber);
|
|
5318
|
+
});
|
|
5319
|
+
_list.listToFoot(function invokeInsertionEffectList(_fiber) {
|
|
5320
|
+
insertionEffect(_dispatch, _fiber);
|
|
5321
|
+
});
|
|
5322
|
+
afterSyncUpdate();
|
|
5323
|
+
_list.listToFoot(function invokeCreateAndUpdateList(_fiber) {
|
|
5324
|
+
safeCallWithCurrentFiber({
|
|
5325
|
+
fiber: _fiber,
|
|
5326
|
+
action: function safeCallCreateAndUpdate() {
|
|
5327
|
+
_dispatch.commitCreate(_fiber);
|
|
5328
|
+
_dispatch.commitUpdate(_fiber);
|
|
5329
|
+
},
|
|
5330
|
+
});
|
|
5331
|
+
});
|
|
5332
|
+
_list.listToFoot(function invokeAppendList(_fiber) {
|
|
5333
|
+
safeCallWithCurrentFiber({
|
|
5334
|
+
fiber: _fiber,
|
|
5335
|
+
action: function safeCallAppendList() {
|
|
5336
|
+
_dispatch.commitAppend(_fiber);
|
|
5337
|
+
},
|
|
5338
|
+
});
|
|
5339
|
+
});
|
|
5340
|
+
_list.listToFoot(function invokeSetRefList(_fiber) {
|
|
5341
|
+
safeCallWithCurrentFiber({
|
|
5342
|
+
fiber: _fiber,
|
|
5343
|
+
action: function safeCallSetRefList() {
|
|
5344
|
+
_dispatch.commitSetRef(_fiber);
|
|
5345
|
+
},
|
|
5346
|
+
});
|
|
5347
|
+
});
|
|
5348
|
+
beforeSyncUpdate();
|
|
5349
|
+
_list.listToFoot(function invokeLayoutEffectList(_fiber) {
|
|
5350
|
+
layoutEffect(_dispatch, _fiber);
|
|
5351
|
+
});
|
|
5352
|
+
afterSyncUpdate();
|
|
5353
|
+
function invokeEffectListTask() {
|
|
5354
|
+
_list.listToFoot(function invokeEffectList(_fiber) {
|
|
5355
|
+
effect(_dispatch, _fiber);
|
|
5286
5356
|
});
|
|
5287
|
-
return _this;
|
|
5288
5357
|
}
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5358
|
+
addEffectCallback(invokeEffectListTask);
|
|
5359
|
+
var renderScheduler = currentScheduler$2.current;
|
|
5360
|
+
if (_dispatch.enableConcurrentMode) {
|
|
5361
|
+
renderScheduler.macroTask(function flushEffect() {
|
|
5362
|
+
flushEffectCallback();
|
|
5363
|
+
});
|
|
5364
|
+
}
|
|
5365
|
+
else {
|
|
5366
|
+
renderScheduler.microTask(function flushEffect() {
|
|
5367
|
+
flushEffectCallback();
|
|
5368
|
+
});
|
|
5369
|
+
}
|
|
5370
|
+
};
|
|
5371
|
+
var defaultDispatchMount = defaultDispatchMountLatest;
|
|
5372
|
+
|
|
5373
|
+
var defaultResolveScope = function (fiber) {
|
|
5374
|
+
var parent = fiber.parent;
|
|
5375
|
+
while (parent) {
|
|
5376
|
+
if (myreactSharedExports.include(parent.type, exports.NODE_TYPE.__scope__) || myreactSharedExports.include(parent.type, exports.NODE_TYPE.__scopeSuspense__)) {
|
|
5377
|
+
return parent;
|
|
5378
|
+
}
|
|
5379
|
+
parent = parent.parent;
|
|
5380
|
+
}
|
|
5381
|
+
return null;
|
|
5382
|
+
};
|
|
5383
|
+
|
|
5384
|
+
react.__my_react_shared__.enableDebugFiled;
|
|
5385
|
+
var defaultGenerateStrict = function (fiber) {
|
|
5386
|
+
return false;
|
|
5387
|
+
};
|
|
5388
|
+
|
|
5389
|
+
var currentScheduler$1 = react.__my_react_internal__.currentScheduler;
|
|
5390
|
+
react.__my_react_shared__.enableScopeTreeLog;
|
|
5391
|
+
var defaultDispatchUpdate = function (_dispatch, _list, sync) {
|
|
5392
|
+
// TODO maybe need call `insertionEffect` in another function
|
|
5393
|
+
beforeSyncUpdate();
|
|
5394
|
+
_list.listToFoot(function invokeUnmountPendingAndInsertionEffectList(_fiber) {
|
|
5395
|
+
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5396
|
+
defaultInvokeUnmountList(_dispatch, _fiber);
|
|
5397
|
+
}
|
|
5398
|
+
});
|
|
5399
|
+
_list.listToFoot(function invokeUnmountPendingAndInsertionEffectList(_fiber) {
|
|
5400
|
+
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5401
|
+
insertionEffect(_dispatch, _fiber);
|
|
5402
|
+
}
|
|
5403
|
+
});
|
|
5404
|
+
afterSyncUpdate();
|
|
5405
|
+
_list.listToFoot(function invokeCreateAndUpdateList(_fiber) {
|
|
5406
|
+
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5407
|
+
safeCallWithCurrentFiber({
|
|
5408
|
+
fiber: _fiber,
|
|
5409
|
+
action: function safeCallCreateAndUpdate() {
|
|
5410
|
+
_dispatch.commitCreate(_fiber);
|
|
5411
|
+
_dispatch.commitUpdate(_fiber);
|
|
5412
|
+
},
|
|
5413
|
+
});
|
|
5414
|
+
}
|
|
5415
|
+
});
|
|
5416
|
+
_list.listToHead(function invokePositionList(_fiber) {
|
|
5417
|
+
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5418
|
+
safeCallWithCurrentFiber({
|
|
5419
|
+
fiber: _fiber,
|
|
5420
|
+
action: function safeCallPosition() {
|
|
5421
|
+
_dispatch.commitPosition(_fiber);
|
|
5422
|
+
},
|
|
5423
|
+
});
|
|
5424
|
+
}
|
|
5425
|
+
});
|
|
5426
|
+
_list.listToFoot(function invokeAppendList(_fiber) {
|
|
5427
|
+
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5428
|
+
safeCallWithCurrentFiber({
|
|
5429
|
+
fiber: _fiber,
|
|
5430
|
+
action: function safeCallAppendList() {
|
|
5431
|
+
_dispatch.commitAppend(_fiber);
|
|
5432
|
+
},
|
|
5433
|
+
});
|
|
5434
|
+
}
|
|
5435
|
+
});
|
|
5436
|
+
_list.listToFoot(function invokeSetRefList(_fiber) {
|
|
5437
|
+
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5438
|
+
safeCallWithCurrentFiber({
|
|
5439
|
+
fiber: _fiber,
|
|
5440
|
+
action: function safeCallSetRefList() {
|
|
5441
|
+
_dispatch.commitSetRef(_fiber);
|
|
5442
|
+
},
|
|
5443
|
+
});
|
|
5444
|
+
}
|
|
5445
|
+
});
|
|
5446
|
+
beforeSyncUpdate();
|
|
5447
|
+
_list.listToFoot(function invokeLayoutEffectList(_fiber) {
|
|
5448
|
+
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5449
|
+
layoutEffect(_dispatch, _fiber);
|
|
5450
|
+
}
|
|
5451
|
+
});
|
|
5452
|
+
afterSyncUpdate();
|
|
5453
|
+
function invokeEffectListTask() {
|
|
5454
|
+
_list.listToFoot(function invokeEffectList(_fiber) {
|
|
5455
|
+
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5456
|
+
effect(_dispatch, _fiber);
|
|
5457
|
+
}
|
|
5458
|
+
});
|
|
5459
|
+
}
|
|
5460
|
+
addEffectCallback(invokeEffectListTask);
|
|
5461
|
+
var renderScheduler = currentScheduler$1.current;
|
|
5462
|
+
if (_dispatch.enableConcurrentMode && !sync) {
|
|
5463
|
+
renderScheduler.macroTask(function flushEffect() {
|
|
5464
|
+
flushEffectCallback();
|
|
5465
|
+
});
|
|
5466
|
+
}
|
|
5467
|
+
else {
|
|
5468
|
+
renderScheduler.microTask(function flushEffect() {
|
|
5469
|
+
flushEffectCallback();
|
|
5470
|
+
});
|
|
5471
|
+
}
|
|
5472
|
+
};
|
|
5473
|
+
|
|
5474
|
+
var currentComponentFiber = react.__my_react_internal__.currentComponentFiber, currentHookNodeIndex = react.__my_react_internal__.currentHookNodeIndex;
|
|
5475
|
+
var resolveHookValue = function (hookNode, field) {
|
|
5476
|
+
if (hookNode) {
|
|
5477
|
+
switch (hookNode.type) {
|
|
5478
|
+
case myreactSharedExports.HOOK_TYPE.useState:
|
|
5479
|
+
case myreactSharedExports.HOOK_TYPE.useReducer:
|
|
5480
|
+
return [hookNode.result, field.dispatch];
|
|
5481
|
+
case myreactSharedExports.HOOK_TYPE.useId:
|
|
5482
|
+
case myreactSharedExports.HOOK_TYPE.useRef:
|
|
5483
|
+
case myreactSharedExports.HOOK_TYPE.useMemo:
|
|
5484
|
+
case myreactSharedExports.HOOK_TYPE.useContext:
|
|
5485
|
+
case myreactSharedExports.HOOK_TYPE.useCallback:
|
|
5486
|
+
case myreactSharedExports.HOOK_TYPE.useDeferredValue:
|
|
5487
|
+
case myreactSharedExports.HOOK_TYPE.useSyncExternalStore:
|
|
5488
|
+
case myreactSharedExports.HOOK_TYPE.useEffectEvent:
|
|
5489
|
+
return hookNode.result;
|
|
5490
|
+
case myreactSharedExports.HOOK_TYPE.useOptimistic:
|
|
5491
|
+
case myreactSharedExports.HOOK_TYPE.useTransition:
|
|
5492
|
+
return [hookNode.result.value, hookNode.result.start];
|
|
5493
|
+
case myreactSharedExports.HOOK_TYPE.useSignal:
|
|
5494
|
+
return [hookNode.result.getValue, hookNode.result.setValue];
|
|
5495
|
+
}
|
|
5496
|
+
}
|
|
5497
|
+
};
|
|
5498
|
+
var processHook = function (renderDispatch, _a) {
|
|
5499
|
+
var type = _a.type, reducer = _a.reducer, value = _a.value, deps = _a.deps;
|
|
5500
|
+
var fiber = currentComponentFiber.current;
|
|
5501
|
+
if (!fiber)
|
|
5502
|
+
throw new Error("[@my-react/react] can not use hook outside of component");
|
|
5503
|
+
if (!renderDispatch)
|
|
5504
|
+
throw new Error("[@my-react/react] internal error, can not get 'renderDispatch' for current render");
|
|
5505
|
+
fiber.hookList = fiber.hookList || new myreactSharedExports.ListTree();
|
|
5506
|
+
var currentHook = null;
|
|
5507
|
+
// initial
|
|
5508
|
+
if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__create__ | myreactSharedExports.STATE_TYPE.__recreate__)) {
|
|
5509
|
+
currentHook = createHookNode(renderDispatch, { type: type, reducer: reducer, value: value, deps: deps }, fiber);
|
|
5510
|
+
safeCall(function safeCallHookInitialListener() {
|
|
5511
|
+
renderDispatch.callOnHookInitial(currentHook, fiber);
|
|
5512
|
+
});
|
|
5513
|
+
}
|
|
5514
|
+
else {
|
|
5515
|
+
// update
|
|
5516
|
+
currentHook = updateHookNode(renderDispatch, { type: type, reducer: reducer, value: value, deps: deps }, fiber, false);
|
|
5517
|
+
safeCall(function safeCallHookUpdateListener() {
|
|
5518
|
+
renderDispatch.callOnHookUpdate(currentHook, fiber);
|
|
5519
|
+
});
|
|
5520
|
+
}
|
|
5521
|
+
currentHookNodeIndex.current++;
|
|
5522
|
+
var field = getInstanceFieldByInstance(currentHook);
|
|
5523
|
+
effectHookNode(renderDispatch, fiber, currentHook, field);
|
|
5524
|
+
return resolveHookValue(currentHook, field);
|
|
5525
|
+
};
|
|
5526
|
+
|
|
5527
|
+
var enableSuspenseRoot = react.__my_react_shared__.enableSuspenseRoot;
|
|
5528
|
+
var currentScheduler = react.__my_react_internal__.currentScheduler;
|
|
5529
|
+
var loadPromise = function (renderDispatch, promise) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5530
|
+
var value, reason_1;
|
|
5531
|
+
return __generator(this, function (_a) {
|
|
5532
|
+
switch (_a.label) {
|
|
5533
|
+
case 0:
|
|
5534
|
+
if (promise.status === "fulfilled" || promise.status === "rejected")
|
|
5535
|
+
return [2 /*return*/];
|
|
5536
|
+
_a.label = 1;
|
|
5537
|
+
case 1:
|
|
5538
|
+
_a.trys.push([1, 3, , 4]);
|
|
5539
|
+
promise.status = "pending";
|
|
5540
|
+
return [4 /*yield*/, Promise.resolve(promise)];
|
|
5541
|
+
case 2:
|
|
5542
|
+
value = _a.sent();
|
|
5543
|
+
promise.status = "fulfilled";
|
|
5544
|
+
promise._value = value;
|
|
5545
|
+
return [3 /*break*/, 4];
|
|
5546
|
+
case 3:
|
|
5547
|
+
reason_1 = _a.sent();
|
|
5548
|
+
promise.status = "rejected";
|
|
5549
|
+
promise._reason = reason_1;
|
|
5550
|
+
return [3 /*break*/, 4];
|
|
5551
|
+
case 4: return [2 /*return*/];
|
|
5552
|
+
}
|
|
5553
|
+
});
|
|
5554
|
+
}); };
|
|
5555
|
+
var processPromise = function (renderDispatch, fiber, promise) {
|
|
5556
|
+
var _a, _b;
|
|
5557
|
+
defaultDeleteCurrentEffect(renderDispatch, fiber);
|
|
5558
|
+
if (promise.status === "rejected") {
|
|
5559
|
+
(_b = (_a = currentScheduler.current).dispatchError) === null || _b === void 0 ? void 0 : _b.call(_a, { fiber: fiber, error: promise._reason });
|
|
5560
|
+
return null;
|
|
5561
|
+
}
|
|
5562
|
+
if (promise.status === "fulfilled") ;
|
|
5563
|
+
promise._list = promise._list || new Set();
|
|
5564
|
+
promise._list.add(fiber);
|
|
5565
|
+
var suspenseFiber = renderDispatch.resolveSuspenseFiber(fiber);
|
|
5566
|
+
if (suspenseFiber) {
|
|
5567
|
+
var suspenseField = getInstanceFieldByInstance(suspenseFiber.instance);
|
|
5568
|
+
suspenseField.asyncLoadList.uniPush(promise);
|
|
5569
|
+
renderDispatch.pendingSuspenseFiberArray.uniPush(suspenseFiber);
|
|
5570
|
+
return null;
|
|
5571
|
+
}
|
|
5572
|
+
else {
|
|
5573
|
+
// TODO update flow
|
|
5574
|
+
if (enableSuspenseRoot.current && !renderDispatch.isAppMounted) {
|
|
5575
|
+
var suspenseField = getInstanceFieldByInstance(renderDispatch);
|
|
5576
|
+
suspenseField.asyncLoadList.uniPush(promise);
|
|
5577
|
+
return null;
|
|
5578
|
+
}
|
|
5579
|
+
devWarnWithFiber(fiber, "[@my-react/react] promise must be used inside a Suspense component, otherwise it will not work as expected");
|
|
5580
|
+
if (promise._loading)
|
|
5581
|
+
return null;
|
|
5582
|
+
promise._loading = true;
|
|
5583
|
+
promise.status = "pending";
|
|
5584
|
+
var renderScheduler_1 = currentScheduler.current;
|
|
5585
|
+
renderDispatch
|
|
5586
|
+
.processPromise(promise)
|
|
5587
|
+
.then(function () {
|
|
5588
|
+
fiber.state = myreactSharedExports.STATE_TYPE.__recreate__;
|
|
5589
|
+
promise._list.delete(fiber);
|
|
5590
|
+
promise._loading = false;
|
|
5591
|
+
var updater = {
|
|
5592
|
+
type: myreactSharedExports.UpdateQueueType.promise,
|
|
5593
|
+
trigger: fiber,
|
|
5594
|
+
isSync: true,
|
|
5595
|
+
isForce: true,
|
|
5596
|
+
payLoad: promise,
|
|
5597
|
+
};
|
|
5598
|
+
renderScheduler_1.dispatchState(updater);
|
|
5599
|
+
})
|
|
5600
|
+
.catch(function (e) { return renderScheduler_1.dispatchError({ fiber: fiber, error: e }); });
|
|
5601
|
+
return null;
|
|
5602
|
+
}
|
|
5603
|
+
};
|
|
5604
|
+
var processSuspensePromise = function (renderDispatch, fiber, promise) {
|
|
5605
|
+
var _a, _b;
|
|
5606
|
+
defaultDeleteCurrentEffect(renderDispatch, fiber);
|
|
5607
|
+
fiber.state = myreactSharedExports.STATE_TYPE.__suspense__;
|
|
5608
|
+
if (promise.status === "rejected") {
|
|
5609
|
+
(_b = (_a = currentScheduler.current).dispatchError) === null || _b === void 0 ? void 0 : _b.call(_a, { fiber: fiber, error: promise._reason });
|
|
5610
|
+
return null;
|
|
5611
|
+
}
|
|
5612
|
+
if (promise.status === "fulfilled") ;
|
|
5613
|
+
promise._list = promise._list || new Set();
|
|
5614
|
+
promise._list.add(fiber);
|
|
5615
|
+
if (promise._loading)
|
|
5616
|
+
return null;
|
|
5617
|
+
promise._loading = true;
|
|
5618
|
+
promise.status = "pending";
|
|
5619
|
+
var renderScheduler = currentScheduler.current;
|
|
5620
|
+
renderDispatch
|
|
5621
|
+
.processPromise(promise)
|
|
5622
|
+
.then(function () {
|
|
5623
|
+
fiber.state = myreactSharedExports.STATE_TYPE.__recreate__;
|
|
5624
|
+
promise._list.delete(fiber);
|
|
5625
|
+
promise._loading = false;
|
|
5626
|
+
var updater = {
|
|
5627
|
+
type: myreactSharedExports.UpdateQueueType.promise,
|
|
5628
|
+
trigger: fiber,
|
|
5629
|
+
isSync: true,
|
|
5630
|
+
isForce: true,
|
|
5631
|
+
payLoad: promise,
|
|
5632
|
+
};
|
|
5633
|
+
renderScheduler.dispatchState(updater);
|
|
5634
|
+
})
|
|
5635
|
+
.catch(function (e) { return renderScheduler.dispatchError({ fiber: fiber, error: e }); });
|
|
5636
|
+
return null;
|
|
5637
|
+
};
|
|
5638
|
+
|
|
5639
|
+
var Dispatcher = react.__my_react_internal__.Dispatcher, MyReactInternalInstanceClass = react.__my_react_internal__.MyReactInternalInstance, dispatchToListenerMap = react.__my_react_internal__.dispatchToListenerMap;
|
|
5640
|
+
var getInitialListeners = function () {
|
|
5641
|
+
return {
|
|
5642
|
+
fiberInitial: new Set(),
|
|
5643
|
+
fiberUpdate: new Set(),
|
|
5644
|
+
fiberHasChange: new Set(),
|
|
5645
|
+
fiberUnmount: new Set(),
|
|
5646
|
+
fiberState: new Set(),
|
|
5647
|
+
fiberTrigger: new Set(),
|
|
5648
|
+
instanceInitial: new Set(),
|
|
5649
|
+
instanceUpdate: new Set(),
|
|
5650
|
+
instanceState: new Set(),
|
|
5651
|
+
instanceUnmount: new Set(),
|
|
5652
|
+
hookInitial: new Set(),
|
|
5653
|
+
hookUpdate: new Set(),
|
|
5654
|
+
hookState: new Set(),
|
|
5655
|
+
hookUnmount: new Set(),
|
|
5656
|
+
beforeCommitMount: new Set(),
|
|
5657
|
+
afterCommitMount: new Set(),
|
|
5658
|
+
beforeCommitUpdate: new Set(),
|
|
5659
|
+
afterCommitUpdate: new Set(),
|
|
5660
|
+
beforeCommitUnmount: new Set(),
|
|
5661
|
+
afterCommitUnmount: new Set(),
|
|
5662
|
+
};
|
|
5663
|
+
};
|
|
5664
|
+
var getInitialMap = function () { return ({
|
|
5665
|
+
effectMap: new MyWeakMap(),
|
|
5666
|
+
layoutEffectMap: new MyWeakMap(),
|
|
5667
|
+
insertionEffectMap: new MyWeakMap(),
|
|
5668
|
+
unmountMap: new MyWeakMap(),
|
|
5669
|
+
eventMap: new MyWeakMap(),
|
|
5670
|
+
triggerCallbackMap: new MyWeakMap(),
|
|
5671
|
+
}); };
|
|
5672
|
+
var getInitialFiber = function () { return ({
|
|
5673
|
+
scheduledFiber: null,
|
|
5674
|
+
errorCatchFiber: null,
|
|
5675
|
+
nextWorkingFiber: null,
|
|
5676
|
+
retriggerFiber: null,
|
|
5677
|
+
}); };
|
|
5678
|
+
var initialRef = {
|
|
5679
|
+
typeForRef: exports.NODE_TYPE.__plain__ | exports.NODE_TYPE.__class__,
|
|
5680
|
+
typeForCreate: exports.NODE_TYPE.__text__ | exports.NODE_TYPE.__plain__ | exports.NODE_TYPE.__portal__ | exports.NODE_TYPE.__comment__,
|
|
5681
|
+
typeForUpdate: exports.NODE_TYPE.__text__ | exports.NODE_TYPE.__plain__ | exports.NODE_TYPE.__comment__,
|
|
5682
|
+
typeForAppend: exports.NODE_TYPE.__text__ | exports.NODE_TYPE.__plain__ | exports.NODE_TYPE.__comment__,
|
|
5683
|
+
typeForNativeNode: exports.NODE_TYPE.__text__ | exports.NODE_TYPE.__plain__ | exports.NODE_TYPE.__portal__ | exports.NODE_TYPE.__comment__,
|
|
5684
|
+
};
|
|
5685
|
+
var listenerMap = dispatchToListenerMap;
|
|
5686
|
+
var RenderDispatchEvent = /** @class */ (function (_super) {
|
|
5687
|
+
__extends(RenderDispatchEvent, _super);
|
|
5688
|
+
function RenderDispatchEvent() {
|
|
5689
|
+
var _this = _super.call(this) || this;
|
|
5690
|
+
_this.dispatcher = Dispatcher;
|
|
5691
|
+
_this.runtimeRef = initialRef;
|
|
5692
|
+
_this.runtimeMap = getInitialMap();
|
|
5693
|
+
_this.runtimeFiber = getInitialFiber();
|
|
5694
|
+
listenerMap.set(_this, getInitialListeners());
|
|
5695
|
+
initInstance(_this);
|
|
5696
|
+
initVisibleInstance(_this);
|
|
5697
|
+
initSuspenseInstance(_this);
|
|
5698
|
+
Object.defineProperty(_this, "dispatcher", {
|
|
5699
|
+
value: Dispatcher,
|
|
5700
|
+
writable: false,
|
|
5701
|
+
enumerable: false,
|
|
5702
|
+
configurable: false,
|
|
5703
|
+
});
|
|
5704
|
+
return _this;
|
|
5705
|
+
}
|
|
5706
|
+
RenderDispatchEvent.prototype.getFiberTree = function (_fiber) {
|
|
5707
|
+
throw new Error("Method not implemented.");
|
|
5708
|
+
};
|
|
5709
|
+
RenderDispatchEvent.prototype.readPromise = function (_params) {
|
|
5710
|
+
throw new Error("Method not implemented.");
|
|
5711
|
+
};
|
|
5712
|
+
RenderDispatchEvent.prototype.readContext = function (_params) {
|
|
5713
|
+
throw new Error("Method not implemented.");
|
|
5714
|
+
};
|
|
5715
|
+
RenderDispatchEvent.prototype.dispatchHook = function (_params) {
|
|
5299
5716
|
throw new Error("Method not implemented.");
|
|
5300
5717
|
};
|
|
5301
5718
|
RenderDispatchEvent.prototype.dispatchState = function (_params) {
|
|
@@ -5379,11 +5796,29 @@ function requireIndex_production_1 () {
|
|
|
5379
5796
|
};
|
|
5380
5797
|
set.add(onceCb);
|
|
5381
5798
|
};
|
|
5799
|
+
RenderDispatchEvent.prototype.callOnFiberInitial = function (_fiber) {
|
|
5800
|
+
var _a;
|
|
5801
|
+
var set = listenerMap.get(this).fiberInitial;
|
|
5802
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_fiber); });
|
|
5803
|
+
};
|
|
5382
5804
|
RenderDispatchEvent.prototype.onFiberUpdate = function (cb) {
|
|
5383
5805
|
var set = listenerMap.get(this).fiberUpdate;
|
|
5384
5806
|
set.add(cb);
|
|
5385
5807
|
return function () { return set.delete(cb); };
|
|
5386
5808
|
};
|
|
5809
|
+
RenderDispatchEvent.prototype.onceFiberUpdate = function (cb) {
|
|
5810
|
+
var set = listenerMap.get(this).fiberUpdate;
|
|
5811
|
+
var onceCb = function (_fiber) {
|
|
5812
|
+
cb(_fiber);
|
|
5813
|
+
set.delete(onceCb);
|
|
5814
|
+
};
|
|
5815
|
+
set.add(onceCb);
|
|
5816
|
+
};
|
|
5817
|
+
RenderDispatchEvent.prototype.callOnFiberUpdate = function (_fiber) {
|
|
5818
|
+
var _a;
|
|
5819
|
+
var set = listenerMap.get(this).fiberUpdate;
|
|
5820
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_fiber); });
|
|
5821
|
+
};
|
|
5387
5822
|
RenderDispatchEvent.prototype.onFiberChange = function (cb) {
|
|
5388
5823
|
var set = listenerMap.get(this).fiberHasChange;
|
|
5389
5824
|
set.add(cb);
|
|
@@ -5397,13 +5832,10 @@ function requireIndex_production_1 () {
|
|
|
5397
5832
|
};
|
|
5398
5833
|
set.add(onceCb);
|
|
5399
5834
|
};
|
|
5400
|
-
RenderDispatchEvent.prototype.
|
|
5401
|
-
var
|
|
5402
|
-
var
|
|
5403
|
-
|
|
5404
|
-
set.delete(onceCb);
|
|
5405
|
-
};
|
|
5406
|
-
set.add(onceCb);
|
|
5835
|
+
RenderDispatchEvent.prototype.callOnFiberChange = function (_list) {
|
|
5836
|
+
var _a;
|
|
5837
|
+
var set = listenerMap.get(this).fiberHasChange;
|
|
5838
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_list); });
|
|
5407
5839
|
};
|
|
5408
5840
|
RenderDispatchEvent.prototype.onFiberUnmount = function (cb) {
|
|
5409
5841
|
var set = listenerMap.get(this).fiberUnmount;
|
|
@@ -5418,6 +5850,11 @@ function requireIndex_production_1 () {
|
|
|
5418
5850
|
};
|
|
5419
5851
|
set.add(onceCb);
|
|
5420
5852
|
};
|
|
5853
|
+
RenderDispatchEvent.prototype.callOnFiberUnmount = function (_fiber) {
|
|
5854
|
+
var _a;
|
|
5855
|
+
var set = listenerMap.get(this).fiberUnmount;
|
|
5856
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_fiber); });
|
|
5857
|
+
};
|
|
5421
5858
|
RenderDispatchEvent.prototype.onFiberState = function (cb) {
|
|
5422
5859
|
var set = listenerMap.get(this).fiberState;
|
|
5423
5860
|
set.add(cb);
|
|
@@ -5431,6 +5868,11 @@ function requireIndex_production_1 () {
|
|
|
5431
5868
|
};
|
|
5432
5869
|
set.add(onceCb);
|
|
5433
5870
|
};
|
|
5871
|
+
RenderDispatchEvent.prototype.callOnFiberState = function (_fiber, _updater) {
|
|
5872
|
+
var _a;
|
|
5873
|
+
var set = listenerMap.get(this).fiberState;
|
|
5874
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_fiber, _updater); });
|
|
5875
|
+
};
|
|
5434
5876
|
RenderDispatchEvent.prototype.onFiberTrigger = function (cb) {
|
|
5435
5877
|
var set = listenerMap.get(this).fiberTrigger;
|
|
5436
5878
|
set.add(cb);
|
|
@@ -5444,6 +5886,11 @@ function requireIndex_production_1 () {
|
|
|
5444
5886
|
};
|
|
5445
5887
|
set.add(onceCb);
|
|
5446
5888
|
};
|
|
5889
|
+
RenderDispatchEvent.prototype.callOnFiberTrigger = function (_fiber, _state) {
|
|
5890
|
+
var _a;
|
|
5891
|
+
var set = listenerMap.get(this).fiberTrigger;
|
|
5892
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_fiber, _state); });
|
|
5893
|
+
};
|
|
5447
5894
|
RenderDispatchEvent.prototype.onFiberHMR = function (cb) {
|
|
5448
5895
|
var _a;
|
|
5449
5896
|
var set = listenerMap.get(this).fiberHMR;
|
|
@@ -5460,6 +5907,11 @@ function requireIndex_production_1 () {
|
|
|
5460
5907
|
};
|
|
5461
5908
|
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
5462
5909
|
};
|
|
5910
|
+
RenderDispatchEvent.prototype.callOnFiberHMR = function (_fiber, _forceRefresh) {
|
|
5911
|
+
var _a;
|
|
5912
|
+
var set = listenerMap.get(this).fiberHMR;
|
|
5913
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_fiber, _forceRefresh); });
|
|
5914
|
+
};
|
|
5463
5915
|
RenderDispatchEvent.prototype.onFiberWarn = function (cb) {
|
|
5464
5916
|
var _a;
|
|
5465
5917
|
var set = listenerMap.get(this).fiberWarn;
|
|
@@ -5476,6 +5928,15 @@ function requireIndex_production_1 () {
|
|
|
5476
5928
|
};
|
|
5477
5929
|
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
5478
5930
|
};
|
|
5931
|
+
RenderDispatchEvent.prototype.callOnFiberWarn = function (_fiber) {
|
|
5932
|
+
var _a;
|
|
5933
|
+
var args = [];
|
|
5934
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
5935
|
+
args[_i - 1] = arguments[_i];
|
|
5936
|
+
}
|
|
5937
|
+
var set = listenerMap.get(this).fiberWarn;
|
|
5938
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb.apply(void 0, __spreadArray([_fiber], args, false)); });
|
|
5939
|
+
};
|
|
5479
5940
|
RenderDispatchEvent.prototype.onFiberError = function (cb) {
|
|
5480
5941
|
var _a;
|
|
5481
5942
|
var set = listenerMap.get(this).fiberError;
|
|
@@ -5492,6 +5953,15 @@ function requireIndex_production_1 () {
|
|
|
5492
5953
|
};
|
|
5493
5954
|
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
5494
5955
|
};
|
|
5956
|
+
RenderDispatchEvent.prototype.callOnFiberError = function (_fiber) {
|
|
5957
|
+
var _a;
|
|
5958
|
+
var args = [];
|
|
5959
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
5960
|
+
args[_i - 1] = arguments[_i];
|
|
5961
|
+
}
|
|
5962
|
+
var set = listenerMap.get(this).fiberError;
|
|
5963
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb.apply(void 0, __spreadArray([_fiber], args, false)); });
|
|
5964
|
+
};
|
|
5495
5965
|
RenderDispatchEvent.prototype.onPerformanceWarn = function (cb) {
|
|
5496
5966
|
var _a;
|
|
5497
5967
|
var set = listenerMap.get(this).performanceWarn;
|
|
@@ -5501,13 +5971,18 @@ function requireIndex_production_1 () {
|
|
|
5501
5971
|
RenderDispatchEvent.prototype.oncePerformanceWarn = function (cb) {
|
|
5502
5972
|
var _a;
|
|
5503
5973
|
var set = listenerMap.get(this).performanceWarn;
|
|
5504
|
-
var onceCb = function (_fiber) {
|
|
5974
|
+
var onceCb = function (_fiber, _renderTime) {
|
|
5505
5975
|
var _a;
|
|
5506
|
-
cb(_fiber);
|
|
5976
|
+
cb(_fiber, _renderTime);
|
|
5507
5977
|
(_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
5508
5978
|
};
|
|
5509
5979
|
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
5510
5980
|
};
|
|
5981
|
+
RenderDispatchEvent.prototype.callOnPerformanceWarn = function (_fiber, _renderTime) {
|
|
5982
|
+
var _a;
|
|
5983
|
+
var set = listenerMap.get(this).performanceWarn;
|
|
5984
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_fiber, _renderTime); });
|
|
5985
|
+
};
|
|
5511
5986
|
RenderDispatchEvent.prototype.onBeforeFiberRun = function (cb) {
|
|
5512
5987
|
var _a;
|
|
5513
5988
|
var set = listenerMap.get(this).beforeFiberRun;
|
|
@@ -5524,6 +5999,11 @@ function requireIndex_production_1 () {
|
|
|
5524
5999
|
};
|
|
5525
6000
|
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
5526
6001
|
};
|
|
6002
|
+
RenderDispatchEvent.prototype.callOnBeforeFiberRun = function (_fiber) {
|
|
6003
|
+
var _a;
|
|
6004
|
+
var set = listenerMap.get(this).beforeFiberRun;
|
|
6005
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_fiber); });
|
|
6006
|
+
};
|
|
5527
6007
|
RenderDispatchEvent.prototype.onAfterFiberRun = function (cb) {
|
|
5528
6008
|
var _a;
|
|
5529
6009
|
var set = listenerMap.get(this).afterFiberRun;
|
|
@@ -5540,6 +6020,11 @@ function requireIndex_production_1 () {
|
|
|
5540
6020
|
};
|
|
5541
6021
|
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
5542
6022
|
};
|
|
6023
|
+
RenderDispatchEvent.prototype.callOnAfterFiberRun = function (_fiber) {
|
|
6024
|
+
var _a;
|
|
6025
|
+
var set = listenerMap.get(this).afterFiberRun;
|
|
6026
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_fiber); });
|
|
6027
|
+
};
|
|
5543
6028
|
RenderDispatchEvent.prototype.onAfterFiberDone = function (cb) {
|
|
5544
6029
|
var _a;
|
|
5545
6030
|
var set = listenerMap.get(this).afterFiberDone;
|
|
@@ -5556,6 +6041,11 @@ function requireIndex_production_1 () {
|
|
|
5556
6041
|
};
|
|
5557
6042
|
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
5558
6043
|
};
|
|
6044
|
+
RenderDispatchEvent.prototype.callOnAfterFiberDone = function (_fiber) {
|
|
6045
|
+
var _a;
|
|
6046
|
+
var set = listenerMap.get(this).afterFiberDone;
|
|
6047
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_fiber); });
|
|
6048
|
+
};
|
|
5559
6049
|
RenderDispatchEvent.prototype.onBeforeDispatchRender = function (cb) {
|
|
5560
6050
|
var _a;
|
|
5561
6051
|
var set = listenerMap.get(this).beforeDispatchRender;
|
|
@@ -5565,6 +6055,27 @@ function requireIndex_production_1 () {
|
|
|
5565
6055
|
RenderDispatchEvent.prototype.onceBeforeDispatchRender = function (cb) {
|
|
5566
6056
|
var _a;
|
|
5567
6057
|
var set = listenerMap.get(this).beforeDispatchRender;
|
|
6058
|
+
var onceCb = function (renderDispatch, fiber) {
|
|
6059
|
+
var _a;
|
|
6060
|
+
cb(renderDispatch, fiber);
|
|
6061
|
+
(_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
6062
|
+
};
|
|
6063
|
+
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
6064
|
+
};
|
|
6065
|
+
RenderDispatchEvent.prototype.callOnBeforeDispatchRender = function (renderDispatch, fiber) {
|
|
6066
|
+
var _a;
|
|
6067
|
+
var set = listenerMap.get(this).beforeDispatchRender;
|
|
6068
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(renderDispatch, fiber); });
|
|
6069
|
+
};
|
|
6070
|
+
RenderDispatchEvent.prototype.onAfterDispatchRender = function (cb) {
|
|
6071
|
+
var _a;
|
|
6072
|
+
var set = listenerMap.get(this).afterDispatchRender;
|
|
6073
|
+
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, cb);
|
|
6074
|
+
return function () { var _a; return (_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, cb); };
|
|
6075
|
+
};
|
|
6076
|
+
RenderDispatchEvent.prototype.onceAfterDispatchRender = function (cb) {
|
|
6077
|
+
var _a;
|
|
6078
|
+
var set = listenerMap.get(this).afterDispatchRender;
|
|
5568
6079
|
var onceCb = function (renderDispatch) {
|
|
5569
6080
|
var _a;
|
|
5570
6081
|
cb(renderDispatch);
|
|
@@ -5572,6 +6083,11 @@ function requireIndex_production_1 () {
|
|
|
5572
6083
|
};
|
|
5573
6084
|
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
5574
6085
|
};
|
|
6086
|
+
RenderDispatchEvent.prototype.callOnAfterDispatchRender = function (renderDispatch) {
|
|
6087
|
+
var _a;
|
|
6088
|
+
var set = listenerMap.get(this).afterDispatchRender;
|
|
6089
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(renderDispatch); });
|
|
6090
|
+
};
|
|
5575
6091
|
RenderDispatchEvent.prototype.onBeforeDispatchUpdate = function (cb) {
|
|
5576
6092
|
var _a;
|
|
5577
6093
|
var set = listenerMap.get(this).beforeDispatchUpdate;
|
|
@@ -5588,6 +6104,32 @@ function requireIndex_production_1 () {
|
|
|
5588
6104
|
};
|
|
5589
6105
|
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
5590
6106
|
};
|
|
6107
|
+
RenderDispatchEvent.prototype.callOnBeforeDispatchUpdate = function (renderDispatch, list) {
|
|
6108
|
+
var _a;
|
|
6109
|
+
var set = listenerMap.get(this).beforeDispatchUpdate;
|
|
6110
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(renderDispatch, list); });
|
|
6111
|
+
};
|
|
6112
|
+
RenderDispatchEvent.prototype.onAfterDispatchUpdate = function (cb) {
|
|
6113
|
+
var _a;
|
|
6114
|
+
var set = listenerMap.get(this).afterDispatchUpdate;
|
|
6115
|
+
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, cb);
|
|
6116
|
+
return function () { var _a; return (_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, cb); };
|
|
6117
|
+
};
|
|
6118
|
+
RenderDispatchEvent.prototype.onceAfterDispatchUpdate = function (cb) {
|
|
6119
|
+
var _a;
|
|
6120
|
+
var set = listenerMap.get(this).afterDispatchUpdate;
|
|
6121
|
+
var onceCb = function (renderDispatch) {
|
|
6122
|
+
var _a;
|
|
6123
|
+
cb(renderDispatch);
|
|
6124
|
+
(_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
6125
|
+
};
|
|
6126
|
+
(_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
|
|
6127
|
+
};
|
|
6128
|
+
RenderDispatchEvent.prototype.callOnAfterDispatchUpdate = function (renderDispatch) {
|
|
6129
|
+
var _a;
|
|
6130
|
+
var set = listenerMap.get(this).afterDispatchUpdate;
|
|
6131
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(renderDispatch); });
|
|
6132
|
+
};
|
|
5591
6133
|
RenderDispatchEvent.prototype.onInstanceInitial = function (cb) {
|
|
5592
6134
|
var set = listenerMap.get(this).instanceInitial;
|
|
5593
6135
|
set.add(cb);
|
|
@@ -5601,6 +6143,11 @@ function requireIndex_production_1 () {
|
|
|
5601
6143
|
};
|
|
5602
6144
|
set.add(onceCb);
|
|
5603
6145
|
};
|
|
6146
|
+
RenderDispatchEvent.prototype.callOnInstanceInitial = function (_instance, _fiber) {
|
|
6147
|
+
var _a;
|
|
6148
|
+
var set = listenerMap.get(this).instanceInitial;
|
|
6149
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_instance, _fiber); });
|
|
6150
|
+
};
|
|
5604
6151
|
RenderDispatchEvent.prototype.onInstanceUpdate = function (cb) {
|
|
5605
6152
|
var set = listenerMap.get(this).instanceUpdate;
|
|
5606
6153
|
set.add(cb);
|
|
@@ -5614,6 +6161,11 @@ function requireIndex_production_1 () {
|
|
|
5614
6161
|
};
|
|
5615
6162
|
set.add(onceCb);
|
|
5616
6163
|
};
|
|
6164
|
+
RenderDispatchEvent.prototype.callOnInstanceUpdate = function (_instance, _fiber) {
|
|
6165
|
+
var _a;
|
|
6166
|
+
var set = listenerMap.get(this).instanceUpdate;
|
|
6167
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_instance, _fiber); });
|
|
6168
|
+
};
|
|
5617
6169
|
RenderDispatchEvent.prototype.onInstanceState = function (cb) {
|
|
5618
6170
|
var set = listenerMap.get(this).instanceState;
|
|
5619
6171
|
set.add(cb);
|
|
@@ -5627,6 +6179,11 @@ function requireIndex_production_1 () {
|
|
|
5627
6179
|
};
|
|
5628
6180
|
set.add(onceCb);
|
|
5629
6181
|
};
|
|
6182
|
+
RenderDispatchEvent.prototype.callOnInstanceState = function (_instance, _fiber, _updater) {
|
|
6183
|
+
var _a;
|
|
6184
|
+
var set = listenerMap.get(this).instanceState;
|
|
6185
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_instance, _fiber, _updater); });
|
|
6186
|
+
};
|
|
5630
6187
|
RenderDispatchEvent.prototype.onInstanceUnmount = function (cb) {
|
|
5631
6188
|
var set = listenerMap.get(this).instanceUnmount;
|
|
5632
6189
|
set.add(cb);
|
|
@@ -5640,6 +6197,11 @@ function requireIndex_production_1 () {
|
|
|
5640
6197
|
};
|
|
5641
6198
|
set.add(onceCb);
|
|
5642
6199
|
};
|
|
6200
|
+
RenderDispatchEvent.prototype.callOnInstanceUnmount = function (_instance, _fiber) {
|
|
6201
|
+
var _a;
|
|
6202
|
+
var set = listenerMap.get(this).instanceUnmount;
|
|
6203
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_instance, _fiber); });
|
|
6204
|
+
};
|
|
5643
6205
|
RenderDispatchEvent.prototype.onHookInitial = function (cb) {
|
|
5644
6206
|
var set = listenerMap.get(this).hookInitial;
|
|
5645
6207
|
set.add(cb);
|
|
@@ -5647,12 +6209,17 @@ function requireIndex_production_1 () {
|
|
|
5647
6209
|
};
|
|
5648
6210
|
RenderDispatchEvent.prototype.onceHookInitial = function (cb) {
|
|
5649
6211
|
var set = listenerMap.get(this).hookInitial;
|
|
5650
|
-
var onceCb = function (_hook) {
|
|
5651
|
-
cb(_hook);
|
|
6212
|
+
var onceCb = function (_hook, _fiber) {
|
|
6213
|
+
cb(_hook, _fiber);
|
|
5652
6214
|
set.delete(onceCb);
|
|
5653
6215
|
};
|
|
5654
6216
|
set.add(onceCb);
|
|
5655
6217
|
};
|
|
6218
|
+
RenderDispatchEvent.prototype.callOnHookInitial = function (_hook, _fiber) {
|
|
6219
|
+
var _a;
|
|
6220
|
+
var set = listenerMap.get(this).hookInitial;
|
|
6221
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_hook, _fiber); });
|
|
6222
|
+
};
|
|
5656
6223
|
RenderDispatchEvent.prototype.onHookUpdate = function (cb) {
|
|
5657
6224
|
var set = listenerMap.get(this).hookUpdate;
|
|
5658
6225
|
set.add(cb);
|
|
@@ -5660,12 +6227,17 @@ function requireIndex_production_1 () {
|
|
|
5660
6227
|
};
|
|
5661
6228
|
RenderDispatchEvent.prototype.onceHookUpdate = function (cb) {
|
|
5662
6229
|
var set = listenerMap.get(this).hookUpdate;
|
|
5663
|
-
var onceCb = function (_hook) {
|
|
5664
|
-
cb(_hook);
|
|
6230
|
+
var onceCb = function (_hook, _fiber) {
|
|
6231
|
+
cb(_hook, _fiber);
|
|
5665
6232
|
set.delete(onceCb);
|
|
5666
6233
|
};
|
|
5667
6234
|
set.add(onceCb);
|
|
5668
6235
|
};
|
|
6236
|
+
RenderDispatchEvent.prototype.callOnHookUpdate = function (_hook, _fiber) {
|
|
6237
|
+
var _a;
|
|
6238
|
+
var set = listenerMap.get(this).hookUpdate;
|
|
6239
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_hook, _fiber); });
|
|
6240
|
+
};
|
|
5669
6241
|
RenderDispatchEvent.prototype.onHookUnmount = function (cb) {
|
|
5670
6242
|
var set = listenerMap.get(this).hookUnmount;
|
|
5671
6243
|
set.add(cb);
|
|
@@ -5673,12 +6245,17 @@ function requireIndex_production_1 () {
|
|
|
5673
6245
|
};
|
|
5674
6246
|
RenderDispatchEvent.prototype.onceHookUnmount = function (cb) {
|
|
5675
6247
|
var set = listenerMap.get(this).hookUnmount;
|
|
5676
|
-
var onceCb = function (_hook) {
|
|
5677
|
-
cb(_hook);
|
|
6248
|
+
var onceCb = function (_hook, _fiber) {
|
|
6249
|
+
cb(_hook, _fiber);
|
|
5678
6250
|
set.delete(onceCb);
|
|
5679
6251
|
};
|
|
5680
6252
|
set.add(onceCb);
|
|
5681
6253
|
};
|
|
6254
|
+
RenderDispatchEvent.prototype.callOnHookUnmount = function (_hook, _fiber) {
|
|
6255
|
+
var _a;
|
|
6256
|
+
var set = listenerMap.get(this).hookUnmount;
|
|
6257
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_hook, _fiber); });
|
|
6258
|
+
};
|
|
5682
6259
|
RenderDispatchEvent.prototype.onHookState = function (cb) {
|
|
5683
6260
|
var set = listenerMap.get(this).hookState;
|
|
5684
6261
|
set.add(cb);
|
|
@@ -5692,6 +6269,11 @@ function requireIndex_production_1 () {
|
|
|
5692
6269
|
};
|
|
5693
6270
|
set.add(onceCb);
|
|
5694
6271
|
};
|
|
6272
|
+
RenderDispatchEvent.prototype.callOnHookState = function (_hook, _fiber, _updater) {
|
|
6273
|
+
var _a;
|
|
6274
|
+
var set = listenerMap.get(this).hookState;
|
|
6275
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(_hook, _fiber, _updater); });
|
|
6276
|
+
};
|
|
5695
6277
|
RenderDispatchEvent.prototype.onBeforeCommitMount = function (cb) {
|
|
5696
6278
|
var set = listenerMap.get(this).beforeCommitMount;
|
|
5697
6279
|
set.add(cb);
|
|
@@ -5699,12 +6281,17 @@ function requireIndex_production_1 () {
|
|
|
5699
6281
|
};
|
|
5700
6282
|
RenderDispatchEvent.prototype.onceBeforeCommitMount = function (cb) {
|
|
5701
6283
|
var set = listenerMap.get(this).beforeCommitMount;
|
|
5702
|
-
var onceCb = function () {
|
|
5703
|
-
cb();
|
|
6284
|
+
var onceCb = function (renderDispatch) {
|
|
6285
|
+
cb(renderDispatch);
|
|
5704
6286
|
set.delete(onceCb);
|
|
5705
6287
|
};
|
|
5706
6288
|
set.add(onceCb);
|
|
5707
6289
|
};
|
|
6290
|
+
RenderDispatchEvent.prototype.callOnBeforeCommitMount = function (renderDispatch) {
|
|
6291
|
+
var _a;
|
|
6292
|
+
var set = listenerMap.get(this).beforeCommitMount;
|
|
6293
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(renderDispatch); });
|
|
6294
|
+
};
|
|
5708
6295
|
RenderDispatchEvent.prototype.onAfterCommitMount = function (cb) {
|
|
5709
6296
|
var set = listenerMap.get(this).afterCommitMount;
|
|
5710
6297
|
set.add(cb);
|
|
@@ -5712,12 +6299,17 @@ function requireIndex_production_1 () {
|
|
|
5712
6299
|
};
|
|
5713
6300
|
RenderDispatchEvent.prototype.onceAfterCommitMount = function (cb) {
|
|
5714
6301
|
var set = listenerMap.get(this).afterCommitMount;
|
|
5715
|
-
var onceCb = function () {
|
|
5716
|
-
cb();
|
|
6302
|
+
var onceCb = function (renderDispatch) {
|
|
6303
|
+
cb(renderDispatch);
|
|
5717
6304
|
set.delete(onceCb);
|
|
5718
6305
|
};
|
|
5719
6306
|
set.add(onceCb);
|
|
5720
6307
|
};
|
|
6308
|
+
RenderDispatchEvent.prototype.callOnAfterCommitMount = function (renderDispatch) {
|
|
6309
|
+
var _a;
|
|
6310
|
+
var set = listenerMap.get(this).afterCommitMount;
|
|
6311
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(renderDispatch); });
|
|
6312
|
+
};
|
|
5721
6313
|
RenderDispatchEvent.prototype.onBeforeCommitUpdate = function (cb) {
|
|
5722
6314
|
var set = listenerMap.get(this).beforeCommitUpdate;
|
|
5723
6315
|
set.add(cb);
|
|
@@ -5725,12 +6317,17 @@ function requireIndex_production_1 () {
|
|
|
5725
6317
|
};
|
|
5726
6318
|
RenderDispatchEvent.prototype.onceBeforeCommitUpdate = function (cb) {
|
|
5727
6319
|
var set = listenerMap.get(this).beforeCommitUpdate;
|
|
5728
|
-
var onceCb = function () {
|
|
5729
|
-
cb();
|
|
6320
|
+
var onceCb = function (renderDispatch) {
|
|
6321
|
+
cb(renderDispatch);
|
|
5730
6322
|
set.delete(onceCb);
|
|
5731
6323
|
};
|
|
5732
6324
|
set.add(onceCb);
|
|
5733
6325
|
};
|
|
6326
|
+
RenderDispatchEvent.prototype.callOnBeforeCommitUpdate = function (renderDispatch) {
|
|
6327
|
+
var _a;
|
|
6328
|
+
var set = listenerMap.get(this).beforeCommitUpdate;
|
|
6329
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(renderDispatch); });
|
|
6330
|
+
};
|
|
5734
6331
|
RenderDispatchEvent.prototype.onAfterCommitUpdate = function (cb) {
|
|
5735
6332
|
var set = listenerMap.get(this).afterCommitUpdate;
|
|
5736
6333
|
set.add(cb);
|
|
@@ -5738,12 +6335,17 @@ function requireIndex_production_1 () {
|
|
|
5738
6335
|
};
|
|
5739
6336
|
RenderDispatchEvent.prototype.onceAfterCommitUpdate = function (cb) {
|
|
5740
6337
|
var set = listenerMap.get(this).afterCommitUpdate;
|
|
5741
|
-
var onceCb = function () {
|
|
5742
|
-
cb();
|
|
6338
|
+
var onceCb = function (renderDispatch) {
|
|
6339
|
+
cb(renderDispatch);
|
|
5743
6340
|
set.delete(onceCb);
|
|
5744
6341
|
};
|
|
5745
6342
|
set.add(onceCb);
|
|
5746
6343
|
};
|
|
6344
|
+
RenderDispatchEvent.prototype.callOnAfterCommitUpdate = function (renderDispatch) {
|
|
6345
|
+
var _a;
|
|
6346
|
+
var set = listenerMap.get(this).afterCommitUpdate;
|
|
6347
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(renderDispatch); });
|
|
6348
|
+
};
|
|
5747
6349
|
RenderDispatchEvent.prototype.onBeforeCommitUnmount = function (cb) {
|
|
5748
6350
|
var set = listenerMap.get(this).beforeCommitUnmount;
|
|
5749
6351
|
set.add(cb);
|
|
@@ -5751,326 +6353,64 @@ function requireIndex_production_1 () {
|
|
|
5751
6353
|
};
|
|
5752
6354
|
RenderDispatchEvent.prototype.onceBeforeCommitUnmount = function (cb) {
|
|
5753
6355
|
var set = listenerMap.get(this).beforeCommitUnmount;
|
|
5754
|
-
var onceCb = function () {
|
|
5755
|
-
cb();
|
|
6356
|
+
var onceCb = function (renderDispatch) {
|
|
6357
|
+
cb(renderDispatch);
|
|
5756
6358
|
set.delete(onceCb);
|
|
5757
6359
|
};
|
|
5758
6360
|
set.add(onceCb);
|
|
5759
6361
|
};
|
|
5760
|
-
RenderDispatchEvent.prototype.
|
|
5761
|
-
var
|
|
5762
|
-
set.
|
|
5763
|
-
|
|
6362
|
+
RenderDispatchEvent.prototype.callOnBeforeCommitUnmount = function (renderDispatch) {
|
|
6363
|
+
var _a;
|
|
6364
|
+
var set = listenerMap.get(this).beforeCommitUnmount;
|
|
6365
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(renderDispatch); });
|
|
5764
6366
|
};
|
|
5765
|
-
RenderDispatchEvent.prototype.
|
|
6367
|
+
RenderDispatchEvent.prototype.onAfterCommitUnmount = function (cb) {
|
|
5766
6368
|
var set = listenerMap.get(this).afterCommitUnmount;
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
set.
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
else if (myreactSharedExports.include(fiber.type, exports.NODE_TYPE.__consumer__)) {
|
|
5791
|
-
nextWorkConsumer(renderDispatch, fiber);
|
|
5792
|
-
}
|
|
5793
|
-
else if (myreactSharedExports.include(fiber.type, exports.NODE_TYPE.__provider__ | exports.NODE_TYPE.__context__)) {
|
|
5794
|
-
nextWorkProvider(renderDispatch, fiber);
|
|
5795
|
-
}
|
|
5796
|
-
else {
|
|
5797
|
-
nextWorkNormal(renderDispatch, fiber);
|
|
5798
|
-
}
|
|
5799
|
-
};
|
|
5800
|
-
|
|
5801
|
-
var currentScheduler$2 = react.__my_react_internal__.currentScheduler;
|
|
5802
|
-
react.__my_react_shared__.enableScopeTreeLog;
|
|
5803
|
-
// TODO improve
|
|
5804
|
-
var defaultDispatchMountLatest = function (_dispatch, _fiber) {
|
|
5805
|
-
beforeSyncUpdate();
|
|
5806
|
-
var _list = generateFiberToListWithAction(_fiber, function invokeUnmountPendingList(_fiber) {
|
|
5807
|
-
defaultInvokeUnmountList(_dispatch, _fiber);
|
|
5808
|
-
});
|
|
5809
|
-
_list.listToFoot(function invokeInsertionEffectList(_fiber) {
|
|
5810
|
-
insertionEffect(_dispatch, _fiber);
|
|
5811
|
-
});
|
|
5812
|
-
afterSyncUpdate();
|
|
5813
|
-
_list.listToFoot(function invokeCreateAndUpdateList(_fiber) {
|
|
5814
|
-
safeCallWithCurrentFiber({
|
|
5815
|
-
fiber: _fiber,
|
|
5816
|
-
action: function safeCallCreateAndUpdate() {
|
|
5817
|
-
_dispatch.commitCreate(_fiber);
|
|
5818
|
-
_dispatch.commitUpdate(_fiber);
|
|
5819
|
-
},
|
|
5820
|
-
});
|
|
5821
|
-
});
|
|
5822
|
-
_list.listToFoot(function invokeAppendList(_fiber) {
|
|
5823
|
-
safeCallWithCurrentFiber({
|
|
5824
|
-
fiber: _fiber,
|
|
5825
|
-
action: function safeCallAppendList() {
|
|
5826
|
-
_dispatch.commitAppend(_fiber);
|
|
5827
|
-
},
|
|
5828
|
-
});
|
|
5829
|
-
});
|
|
5830
|
-
_list.listToFoot(function invokeSetRefList(_fiber) {
|
|
5831
|
-
safeCallWithCurrentFiber({
|
|
5832
|
-
fiber: _fiber,
|
|
5833
|
-
action: function safeCallSetRefList() {
|
|
5834
|
-
_dispatch.commitSetRef(_fiber);
|
|
5835
|
-
},
|
|
5836
|
-
});
|
|
5837
|
-
});
|
|
5838
|
-
beforeSyncUpdate();
|
|
5839
|
-
_list.listToFoot(function invokeLayoutEffectList(_fiber) {
|
|
5840
|
-
layoutEffect(_dispatch, _fiber);
|
|
5841
|
-
});
|
|
5842
|
-
afterSyncUpdate();
|
|
5843
|
-
function invokeEffectListTask() {
|
|
5844
|
-
_list.listToFoot(function invokeEffectList(_fiber) {
|
|
5845
|
-
effect(_dispatch, _fiber);
|
|
5846
|
-
});
|
|
5847
|
-
}
|
|
5848
|
-
addEffectCallback(invokeEffectListTask);
|
|
5849
|
-
var renderScheduler = currentScheduler$2.current;
|
|
5850
|
-
if (_dispatch.enableConcurrentMode) {
|
|
5851
|
-
renderScheduler.macroTask(function flushEffect() {
|
|
5852
|
-
flushEffectCallback();
|
|
5853
|
-
});
|
|
5854
|
-
}
|
|
5855
|
-
else {
|
|
5856
|
-
renderScheduler.microTask(function flushEffect() {
|
|
5857
|
-
flushEffectCallback();
|
|
5858
|
-
});
|
|
5859
|
-
}
|
|
5860
|
-
};
|
|
5861
|
-
var defaultDispatchMount = defaultDispatchMountLatest;
|
|
5862
|
-
|
|
5863
|
-
var defaultResolveScope = function (fiber) {
|
|
5864
|
-
var parent = fiber.parent;
|
|
5865
|
-
while (parent) {
|
|
5866
|
-
if (myreactSharedExports.include(parent.type, exports.NODE_TYPE.__scope__) || myreactSharedExports.include(parent.type, exports.NODE_TYPE.__scopeSuspense__)) {
|
|
5867
|
-
return parent;
|
|
5868
|
-
}
|
|
5869
|
-
parent = parent.parent;
|
|
5870
|
-
}
|
|
5871
|
-
return null;
|
|
5872
|
-
};
|
|
5873
|
-
|
|
5874
|
-
react.__my_react_shared__.enableDebugFiled;
|
|
5875
|
-
var defaultGenerateStrict = function (fiber) {
|
|
5876
|
-
return false;
|
|
5877
|
-
};
|
|
5878
|
-
|
|
5879
|
-
var currentScheduler$1 = react.__my_react_internal__.currentScheduler;
|
|
5880
|
-
react.__my_react_shared__.enableScopeTreeLog;
|
|
5881
|
-
var defaultDispatchUpdate = function (_dispatch, _list) {
|
|
5882
|
-
// TODO maybe need call `insertionEffect` in another function
|
|
5883
|
-
beforeSyncUpdate();
|
|
5884
|
-
_list.listToFoot(function invokeUnmountPendingAndInsertionEffectList(_fiber) {
|
|
5885
|
-
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5886
|
-
defaultInvokeUnmountList(_dispatch, _fiber);
|
|
5887
|
-
}
|
|
5888
|
-
});
|
|
5889
|
-
_list.listToFoot(function invokeUnmountPendingAndInsertionEffectList(_fiber) {
|
|
5890
|
-
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5891
|
-
insertionEffect(_dispatch, _fiber);
|
|
5892
|
-
}
|
|
5893
|
-
});
|
|
5894
|
-
afterSyncUpdate();
|
|
5895
|
-
_list.listToFoot(function invokeCreateAndUpdateList(_fiber) {
|
|
5896
|
-
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5897
|
-
safeCallWithCurrentFiber({
|
|
5898
|
-
fiber: _fiber,
|
|
5899
|
-
action: function safeCallCreateAndUpdate() {
|
|
5900
|
-
_dispatch.commitCreate(_fiber);
|
|
5901
|
-
_dispatch.commitUpdate(_fiber);
|
|
5902
|
-
},
|
|
5903
|
-
});
|
|
5904
|
-
}
|
|
5905
|
-
});
|
|
5906
|
-
_list.listToHead(function invokePositionList(_fiber) {
|
|
5907
|
-
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5908
|
-
safeCallWithCurrentFiber({
|
|
5909
|
-
fiber: _fiber,
|
|
5910
|
-
action: function safeCallPosition() {
|
|
5911
|
-
_dispatch.commitPosition(_fiber);
|
|
5912
|
-
},
|
|
5913
|
-
});
|
|
5914
|
-
}
|
|
5915
|
-
});
|
|
5916
|
-
_list.listToFoot(function invokeAppendList(_fiber) {
|
|
5917
|
-
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5918
|
-
safeCallWithCurrentFiber({
|
|
5919
|
-
fiber: _fiber,
|
|
5920
|
-
action: function safeCallAppendList() {
|
|
5921
|
-
_dispatch.commitAppend(_fiber);
|
|
5922
|
-
},
|
|
5923
|
-
});
|
|
5924
|
-
}
|
|
5925
|
-
});
|
|
5926
|
-
_list.listToFoot(function invokeSetRefList(_fiber) {
|
|
5927
|
-
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5928
|
-
safeCallWithCurrentFiber({
|
|
5929
|
-
fiber: _fiber,
|
|
5930
|
-
action: function safeCallSetRefList() {
|
|
5931
|
-
_dispatch.commitSetRef(_fiber);
|
|
5932
|
-
},
|
|
5933
|
-
});
|
|
5934
|
-
}
|
|
5935
|
-
});
|
|
5936
|
-
beforeSyncUpdate();
|
|
5937
|
-
_list.listToFoot(function invokeLayoutEffectList(_fiber) {
|
|
5938
|
-
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5939
|
-
layoutEffect(_dispatch, _fiber);
|
|
5940
|
-
}
|
|
5941
|
-
});
|
|
5942
|
-
afterSyncUpdate();
|
|
5943
|
-
function invokeEffectListTask() {
|
|
5944
|
-
_list.listToFoot(function invokeEffectList(_fiber) {
|
|
5945
|
-
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
5946
|
-
effect(_dispatch, _fiber);
|
|
5947
|
-
}
|
|
5948
|
-
});
|
|
5949
|
-
}
|
|
5950
|
-
addEffectCallback(invokeEffectListTask);
|
|
5951
|
-
var renderScheduler = currentScheduler$1.current;
|
|
5952
|
-
if (_dispatch.enableConcurrentMode) {
|
|
5953
|
-
renderScheduler.macroTask(function flushEffect() {
|
|
5954
|
-
flushEffectCallback();
|
|
5955
|
-
});
|
|
5956
|
-
}
|
|
5957
|
-
else {
|
|
5958
|
-
renderScheduler.microTask(function flushEffect() {
|
|
5959
|
-
flushEffectCallback();
|
|
5960
|
-
});
|
|
5961
|
-
}
|
|
5962
|
-
};
|
|
5963
|
-
|
|
5964
|
-
var enableSuspenseRoot = react.__my_react_shared__.enableSuspenseRoot;
|
|
5965
|
-
var currentScheduler = react.__my_react_internal__.currentScheduler;
|
|
5966
|
-
var loadPromise = function (renderDispatch, promise) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5967
|
-
var value, reason_1;
|
|
5968
|
-
return __generator(this, function (_a) {
|
|
5969
|
-
switch (_a.label) {
|
|
5970
|
-
case 0:
|
|
5971
|
-
if (promise.status === "fulfilled" || promise.status === "rejected")
|
|
5972
|
-
return [2 /*return*/];
|
|
5973
|
-
_a.label = 1;
|
|
5974
|
-
case 1:
|
|
5975
|
-
_a.trys.push([1, 3, , 4]);
|
|
5976
|
-
promise.status = "pending";
|
|
5977
|
-
return [4 /*yield*/, Promise.resolve(promise)];
|
|
5978
|
-
case 2:
|
|
5979
|
-
value = _a.sent();
|
|
5980
|
-
promise.status = "fulfilled";
|
|
5981
|
-
promise._value = value;
|
|
5982
|
-
return [3 /*break*/, 4];
|
|
5983
|
-
case 3:
|
|
5984
|
-
reason_1 = _a.sent();
|
|
5985
|
-
promise.status = "rejected";
|
|
5986
|
-
promise._reason = reason_1;
|
|
5987
|
-
return [3 /*break*/, 4];
|
|
5988
|
-
case 4: return [2 /*return*/];
|
|
5989
|
-
}
|
|
5990
|
-
});
|
|
5991
|
-
}); };
|
|
5992
|
-
var processPromise = function (renderDispatch, fiber, promise) {
|
|
5993
|
-
var _a, _b;
|
|
5994
|
-
defaultDeleteCurrentEffect(renderDispatch, fiber);
|
|
5995
|
-
if (promise.status === "rejected") {
|
|
5996
|
-
(_b = (_a = currentScheduler.current).dispatchError) === null || _b === void 0 ? void 0 : _b.call(_a, { fiber: fiber, error: promise._reason });
|
|
5997
|
-
return null;
|
|
6369
|
+
set.add(cb);
|
|
6370
|
+
return function () { return set.delete(cb); };
|
|
6371
|
+
};
|
|
6372
|
+
RenderDispatchEvent.prototype.onceAfterCommitUnmount = function (cb) {
|
|
6373
|
+
var set = listenerMap.get(this).afterCommitUnmount;
|
|
6374
|
+
var onceCb = function (renderDispatch) {
|
|
6375
|
+
cb(renderDispatch);
|
|
6376
|
+
set.delete(onceCb);
|
|
6377
|
+
};
|
|
6378
|
+
set.add(onceCb);
|
|
6379
|
+
};
|
|
6380
|
+
RenderDispatchEvent.prototype.callOnAfterCommitUnmount = function (renderDispatch) {
|
|
6381
|
+
var _a;
|
|
6382
|
+
var set = listenerMap.get(this).afterCommitUnmount;
|
|
6383
|
+
(_a = set === null || set === void 0 ? void 0 : set.forEach) === null || _a === void 0 ? void 0 : _a.call(set, function (cb) { return cb(renderDispatch); });
|
|
6384
|
+
};
|
|
6385
|
+
return RenderDispatchEvent;
|
|
6386
|
+
}(MyReactInternalInstanceClass));
|
|
6387
|
+
|
|
6388
|
+
var defaultDispatchFiber = function (renderDispatch, fiber) {
|
|
6389
|
+
if (myreactSharedExports.include(fiber.type, exports.NODE_TYPE.__root__)) {
|
|
6390
|
+
// TODO
|
|
6391
|
+
nextWorkRoot(renderDispatch, fiber);
|
|
5998
6392
|
}
|
|
5999
|
-
if (
|
|
6000
|
-
|
|
6001
|
-
promise._list.add(fiber);
|
|
6002
|
-
var suspenseFiber = renderDispatch.resolveSuspenseFiber(fiber);
|
|
6003
|
-
if (suspenseFiber) {
|
|
6004
|
-
var suspenseField = getInstanceFieldByInstance(suspenseFiber.instance);
|
|
6005
|
-
suspenseField.asyncLoadList.uniPush(promise);
|
|
6006
|
-
renderDispatch.pendingSuspenseFiberArray.uniPush(suspenseFiber);
|
|
6007
|
-
return null;
|
|
6393
|
+
else if (myreactSharedExports.include(fiber.type, exports.NODE_TYPE.__class__ | exports.NODE_TYPE.__function__)) {
|
|
6394
|
+
nextWorkComponent(renderDispatch, fiber);
|
|
6008
6395
|
}
|
|
6009
|
-
else {
|
|
6010
|
-
|
|
6011
|
-
if (enableSuspenseRoot.current && !renderDispatch.isAppMounted) {
|
|
6012
|
-
var suspenseField = getInstanceFieldByInstance(renderDispatch);
|
|
6013
|
-
suspenseField.asyncLoadList.uniPush(promise);
|
|
6014
|
-
return null;
|
|
6015
|
-
}
|
|
6016
|
-
devWarnWithFiber(fiber, "[@my-react/react] promise must be used inside a Suspense component, otherwise it will not work as expected");
|
|
6017
|
-
if (promise._loading)
|
|
6018
|
-
return null;
|
|
6019
|
-
promise._loading = true;
|
|
6020
|
-
promise.status = "pending";
|
|
6021
|
-
var renderScheduler_1 = currentScheduler.current;
|
|
6022
|
-
renderDispatch
|
|
6023
|
-
.processPromise(promise)
|
|
6024
|
-
.then(function () {
|
|
6025
|
-
fiber.state = myreactSharedExports.STATE_TYPE.__recreate__;
|
|
6026
|
-
promise._list.delete(fiber);
|
|
6027
|
-
promise._loading = false;
|
|
6028
|
-
var updater = {
|
|
6029
|
-
type: myreactSharedExports.UpdateQueueType.promise,
|
|
6030
|
-
trigger: fiber,
|
|
6031
|
-
isSync: true,
|
|
6032
|
-
isForce: true,
|
|
6033
|
-
payLoad: promise,
|
|
6034
|
-
};
|
|
6035
|
-
renderScheduler_1.dispatchState(updater);
|
|
6036
|
-
})
|
|
6037
|
-
.catch(function (e) { return renderScheduler_1.dispatchError({ fiber: fiber, error: e }); });
|
|
6038
|
-
return null;
|
|
6396
|
+
else if (myreactSharedExports.include(fiber.type, exports.NODE_TYPE.__lazy__)) {
|
|
6397
|
+
nextWorkLazy(renderDispatch, fiber);
|
|
6039
6398
|
}
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6399
|
+
else if (myreactSharedExports.include(fiber.type, exports.NODE_TYPE.__suspense__)) {
|
|
6400
|
+
nextWorkSuspense(renderDispatch, fiber);
|
|
6401
|
+
}
|
|
6402
|
+
else if (myreactSharedExports.include(fiber.type, exports.NODE_TYPE.__consumer__)) {
|
|
6403
|
+
nextWorkConsumer(renderDispatch, fiber);
|
|
6404
|
+
}
|
|
6405
|
+
else if (myreactSharedExports.include(fiber.type, exports.NODE_TYPE.__provider__ | exports.NODE_TYPE.__context__)) {
|
|
6406
|
+
nextWorkProvider(renderDispatch, fiber);
|
|
6407
|
+
}
|
|
6408
|
+
else if (myreactSharedExports.include(fiber.type, exports.NODE_TYPE.__activity__)) {
|
|
6409
|
+
nextWorkActivity(renderDispatch, fiber);
|
|
6410
|
+
}
|
|
6411
|
+
else {
|
|
6412
|
+
nextWorkNormal(renderDispatch, fiber);
|
|
6048
6413
|
}
|
|
6049
|
-
if (promise.status === "fulfilled") ;
|
|
6050
|
-
promise._list = promise._list || new Set();
|
|
6051
|
-
promise._list.add(fiber);
|
|
6052
|
-
if (promise._loading)
|
|
6053
|
-
return null;
|
|
6054
|
-
promise._loading = true;
|
|
6055
|
-
promise.status = "pending";
|
|
6056
|
-
var renderScheduler = currentScheduler.current;
|
|
6057
|
-
renderDispatch
|
|
6058
|
-
.processPromise(promise)
|
|
6059
|
-
.then(function () {
|
|
6060
|
-
fiber.state = myreactSharedExports.STATE_TYPE.__recreate__;
|
|
6061
|
-
promise._list.delete(fiber);
|
|
6062
|
-
promise._loading = false;
|
|
6063
|
-
var updater = {
|
|
6064
|
-
type: myreactSharedExports.UpdateQueueType.promise,
|
|
6065
|
-
trigger: fiber,
|
|
6066
|
-
isSync: true,
|
|
6067
|
-
isForce: true,
|
|
6068
|
-
payLoad: promise,
|
|
6069
|
-
};
|
|
6070
|
-
renderScheduler.dispatchState(updater);
|
|
6071
|
-
})
|
|
6072
|
-
.catch(function (e) { return renderScheduler.dispatchError({ fiber: fiber, error: e }); });
|
|
6073
|
-
return null;
|
|
6074
6414
|
};
|
|
6075
6415
|
|
|
6076
6416
|
var CustomRenderDispatch = /** @class */ (function (_super) {
|
|
@@ -6082,7 +6422,7 @@ function requireIndex_production_1 () {
|
|
|
6082
6422
|
_this.isAppMounted = false;
|
|
6083
6423
|
_this.isAppCrashed = false;
|
|
6084
6424
|
_this.isAppUnmounted = false;
|
|
6085
|
-
_this.version = "0.3.
|
|
6425
|
+
_this.version = "0.3.20";
|
|
6086
6426
|
_this.mode = "production";
|
|
6087
6427
|
_this.renderMode = "render";
|
|
6088
6428
|
_this.pendingCommitFiberList = null;
|
|
@@ -6226,29 +6566,29 @@ function requireIndex_production_1 () {
|
|
|
6226
6566
|
(_a = instance.beforeCommit) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
6227
6567
|
});
|
|
6228
6568
|
safeCall(function safeCallBeforeCommitListener() {
|
|
6229
|
-
|
|
6569
|
+
instance.callOnBeforeCommitMount(instance);
|
|
6230
6570
|
});
|
|
6231
6571
|
defaultDispatchMount(this, _fiber);
|
|
6232
6572
|
safeCall(function safeCallAfterCommitListener() {
|
|
6233
|
-
|
|
6573
|
+
instance.callOnAfterCommitMount(instance);
|
|
6234
6574
|
});
|
|
6235
6575
|
safeCall(function safeCallAfterCommit() {
|
|
6236
6576
|
var _a;
|
|
6237
6577
|
(_a = instance.afterCommit) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
6238
6578
|
});
|
|
6239
6579
|
};
|
|
6240
|
-
CustomRenderDispatch.prototype.reconcileUpdate = function (_list) {
|
|
6580
|
+
CustomRenderDispatch.prototype.reconcileUpdate = function (_list, sync) {
|
|
6241
6581
|
var instance = this;
|
|
6242
6582
|
safeCall(function safeCallBeforeUpdate() {
|
|
6243
6583
|
var _a;
|
|
6244
6584
|
(_a = instance.beforeUpdate) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
6245
6585
|
});
|
|
6246
6586
|
safeCall(function safeCallBeforeUpdateListener() {
|
|
6247
|
-
|
|
6587
|
+
instance.callOnBeforeCommitUpdate(instance);
|
|
6248
6588
|
});
|
|
6249
|
-
defaultDispatchUpdate(this, _list);
|
|
6589
|
+
defaultDispatchUpdate(this, _list, sync);
|
|
6250
6590
|
safeCall(function safeCallAfterUpdateListener() {
|
|
6251
|
-
|
|
6591
|
+
instance.callOnAfterCommitUpdate(instance);
|
|
6252
6592
|
});
|
|
6253
6593
|
safeCall(function safeCallAfterUpdate() {
|
|
6254
6594
|
var _a;
|
|
@@ -6262,11 +6602,11 @@ function requireIndex_production_1 () {
|
|
|
6262
6602
|
(_a = instance.beforeUnmount) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
6263
6603
|
});
|
|
6264
6604
|
safeCall(function safeCallBeforeUnmountListener() {
|
|
6265
|
-
|
|
6605
|
+
instance.callOnBeforeCommitUnmount(instance);
|
|
6266
6606
|
});
|
|
6267
6607
|
defaultDispatchUnmount(this);
|
|
6268
6608
|
safeCall(function safeCallAfterUnmountListener() {
|
|
6269
|
-
|
|
6609
|
+
instance.callOnAfterCommitUnmount(instance);
|
|
6270
6610
|
});
|
|
6271
6611
|
safeCall(function safeCallAfterUnmount() {
|
|
6272
6612
|
var _a;
|
|
@@ -6296,149 +6636,6 @@ function requireIndex_production_1 () {
|
|
|
6296
6636
|
return CustomRenderDispatch;
|
|
6297
6637
|
}(RenderDispatchEvent));
|
|
6298
6638
|
|
|
6299
|
-
react.__my_react_shared__.enableDebugFiled;
|
|
6300
|
-
var currentRunningFiber = react.__my_react_internal__.currentRunningFiber, MyReactInternalInstance = react.__my_react_internal__.MyReactInternalInstance;
|
|
6301
|
-
var defaultGetContextValue = function (fiber, ContextObject) {
|
|
6302
|
-
var _a;
|
|
6303
|
-
if (fiber) {
|
|
6304
|
-
return fiber.pendingProps["value"];
|
|
6305
|
-
}
|
|
6306
|
-
else {
|
|
6307
|
-
return (_a = ContextObject === null || ContextObject === void 0 ? void 0 : ContextObject.Provider) === null || _a === void 0 ? void 0 : _a["value"];
|
|
6308
|
-
}
|
|
6309
|
-
};
|
|
6310
|
-
var defaultGetContextFiber = function (fiber, ContextObject) {
|
|
6311
|
-
if ((fiber === null || fiber === void 0 ? void 0 : fiber.parent) && ContextObject) {
|
|
6312
|
-
var parent_1 = fiber.parent;
|
|
6313
|
-
while (parent_1) {
|
|
6314
|
-
if (myreactSharedExports.include(parent_1.type, exports.NODE_TYPE.__provider__)) {
|
|
6315
|
-
var typedElementType = parent_1.elementType;
|
|
6316
|
-
var contextObj = typedElementType["Context"];
|
|
6317
|
-
if (contextObj === ContextObject) {
|
|
6318
|
-
return parent_1;
|
|
6319
|
-
}
|
|
6320
|
-
}
|
|
6321
|
-
if (myreactSharedExports.include(parent_1.type, exports.NODE_TYPE.__context__)) {
|
|
6322
|
-
var typedElementType = parent_1.elementType;
|
|
6323
|
-
var contextObj = typedElementType;
|
|
6324
|
-
if (contextObj === ContextObject) {
|
|
6325
|
-
return parent_1;
|
|
6326
|
-
}
|
|
6327
|
-
}
|
|
6328
|
-
parent_1 = parent_1.parent;
|
|
6329
|
-
}
|
|
6330
|
-
}
|
|
6331
|
-
else {
|
|
6332
|
-
return null;
|
|
6333
|
-
}
|
|
6334
|
-
};
|
|
6335
|
-
var defaultReadContext = function (Context) {
|
|
6336
|
-
var fiber = currentRunningFiber.current;
|
|
6337
|
-
if (!Context) {
|
|
6338
|
-
throw new Error("the Context what you read is not exist");
|
|
6339
|
-
}
|
|
6340
|
-
if (!fiber) {
|
|
6341
|
-
throw new Error('current environment is not support "readContext"');
|
|
6342
|
-
}
|
|
6343
|
-
var isUpdate = !!fiber.instance;
|
|
6344
|
-
fiber.instance = fiber.instance || new MyReactInternalInstance();
|
|
6345
|
-
!isUpdate && initInstance(fiber.instance);
|
|
6346
|
-
!isUpdate && setOwnerForInstance(fiber.instance, fiber);
|
|
6347
|
-
var contextFiber = defaultGetContextFiber(fiber, Context);
|
|
6348
|
-
setSubscribeForInstance(fiber.instance, contextFiber);
|
|
6349
|
-
return defaultGetContextValue(contextFiber, Context);
|
|
6350
|
-
};
|
|
6351
|
-
var prepareUpdateAllDependence = function (renderDispatch, fiber, beforeValue, afterValue) {
|
|
6352
|
-
var consumerList = new Set((fiber === null || fiber === void 0 ? void 0 : fiber.dependence) || []);
|
|
6353
|
-
consumerList.forEach(function prepareUpdateSingleConsumer(i) {
|
|
6354
|
-
var owner = getInstanceOwnerFiber(i);
|
|
6355
|
-
if (owner && myreactSharedExports.exclude(owner.state, myreactSharedExports.STATE_TYPE.__unmount__)) {
|
|
6356
|
-
var typedFiber_1 = owner;
|
|
6357
|
-
typedFiber_1.state = myreactSharedExports.STATE_TYPE.__triggerSyncForce__;
|
|
6358
|
-
}
|
|
6359
|
-
});
|
|
6360
|
-
var processedNodes = [];
|
|
6361
|
-
var updater = {
|
|
6362
|
-
type: myreactSharedExports.UpdateQueueType.context,
|
|
6363
|
-
trigger: fiber,
|
|
6364
|
-
payLoad: afterValue,
|
|
6365
|
-
isSync: true,
|
|
6366
|
-
isForce: true,
|
|
6367
|
-
isImmediate: true,
|
|
6368
|
-
isRetrigger: true,
|
|
6369
|
-
};
|
|
6370
|
-
processedNodes.push(updater);
|
|
6371
|
-
var updateState = {
|
|
6372
|
-
needUpdate: true,
|
|
6373
|
-
nodes: processedNodes,
|
|
6374
|
-
isSync: true,
|
|
6375
|
-
isForce: true,
|
|
6376
|
-
isImmediate: true,
|
|
6377
|
-
isRetrigger: true,
|
|
6378
|
-
};
|
|
6379
|
-
safeCallWithCurrentFiber({
|
|
6380
|
-
fiber: fiber,
|
|
6381
|
-
action: function safeCallFiberTriggerListener() {
|
|
6382
|
-
var _a, _b;
|
|
6383
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberTrigger) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(fiber, updateState); });
|
|
6384
|
-
},
|
|
6385
|
-
});
|
|
6386
|
-
};
|
|
6387
|
-
|
|
6388
|
-
var currentComponentFiber = react.__my_react_internal__.currentComponentFiber, currentHookNodeIndex = react.__my_react_internal__.currentHookNodeIndex;
|
|
6389
|
-
var resolveHookValue = function (hookNode, field) {
|
|
6390
|
-
if (hookNode) {
|
|
6391
|
-
switch (hookNode.type) {
|
|
6392
|
-
case myreactSharedExports.HOOK_TYPE.useState:
|
|
6393
|
-
case myreactSharedExports.HOOK_TYPE.useReducer:
|
|
6394
|
-
return [hookNode.result, field.dispatch];
|
|
6395
|
-
case myreactSharedExports.HOOK_TYPE.useId:
|
|
6396
|
-
case myreactSharedExports.HOOK_TYPE.useRef:
|
|
6397
|
-
case myreactSharedExports.HOOK_TYPE.useMemo:
|
|
6398
|
-
case myreactSharedExports.HOOK_TYPE.useContext:
|
|
6399
|
-
case myreactSharedExports.HOOK_TYPE.useCallback:
|
|
6400
|
-
case myreactSharedExports.HOOK_TYPE.useDeferredValue:
|
|
6401
|
-
case myreactSharedExports.HOOK_TYPE.useSyncExternalStore:
|
|
6402
|
-
return hookNode.result;
|
|
6403
|
-
case myreactSharedExports.HOOK_TYPE.useOptimistic:
|
|
6404
|
-
case myreactSharedExports.HOOK_TYPE.useTransition:
|
|
6405
|
-
return [hookNode.result.value, hookNode.result.start];
|
|
6406
|
-
case myreactSharedExports.HOOK_TYPE.useSignal:
|
|
6407
|
-
return [hookNode.result.getValue, hookNode.result.setValue];
|
|
6408
|
-
}
|
|
6409
|
-
}
|
|
6410
|
-
};
|
|
6411
|
-
var processHook = function (renderDispatch, _a) {
|
|
6412
|
-
var type = _a.type, reducer = _a.reducer, value = _a.value, deps = _a.deps;
|
|
6413
|
-
var fiber = currentComponentFiber.current;
|
|
6414
|
-
if (!fiber)
|
|
6415
|
-
throw new Error("[@my-react/react] can not use hook outside of component");
|
|
6416
|
-
if (!renderDispatch)
|
|
6417
|
-
throw new Error("[@my-react/react] internal error, can not get 'renderDispatch' for current render");
|
|
6418
|
-
fiber.hookList = fiber.hookList || new myreactSharedExports.ListTree();
|
|
6419
|
-
var currentHook = null;
|
|
6420
|
-
// initial
|
|
6421
|
-
if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__create__ | myreactSharedExports.STATE_TYPE.__recreate__)) {
|
|
6422
|
-
currentHook = createHookNode(renderDispatch, { type: type, reducer: reducer, value: value, deps: deps }, fiber);
|
|
6423
|
-
safeCall(function safeCallHookInitialListener() {
|
|
6424
|
-
var _a, _b;
|
|
6425
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.hookInitial) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(currentHook, fiber); });
|
|
6426
|
-
});
|
|
6427
|
-
}
|
|
6428
|
-
else {
|
|
6429
|
-
// update
|
|
6430
|
-
currentHook = updateHookNode(renderDispatch, { type: type, reducer: reducer, value: value, deps: deps }, fiber, false);
|
|
6431
|
-
safeCall(function safeCallHookUpdateListener() {
|
|
6432
|
-
var _a, _b;
|
|
6433
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.hookUpdate) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(currentHook, fiber); });
|
|
6434
|
-
});
|
|
6435
|
-
}
|
|
6436
|
-
currentHookNodeIndex.current++;
|
|
6437
|
-
var field = getInstanceFieldByInstance(currentHook);
|
|
6438
|
-
effectHookNode(renderDispatch, fiber, currentHook, field);
|
|
6439
|
-
return resolveHookValue(currentHook, field);
|
|
6440
|
-
};
|
|
6441
|
-
|
|
6442
6639
|
var globalLoop = react.__my_react_internal__.globalLoop;
|
|
6443
6640
|
react.__my_react_shared__.enableScopeTreeLog;
|
|
6444
6641
|
function finishMountSync(renderDispatch, fiber) {
|
|
@@ -6451,8 +6648,7 @@ function requireIndex_production_1 () {
|
|
|
6451
6648
|
safeCallWithCurrentFiber({
|
|
6452
6649
|
fiber: fiber,
|
|
6453
6650
|
action: function safeCallFiberHasChangeListener() {
|
|
6454
|
-
|
|
6455
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberHasChange) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(changedList); });
|
|
6651
|
+
renderDispatch.callOnFiberChange(changedList);
|
|
6456
6652
|
},
|
|
6457
6653
|
});
|
|
6458
6654
|
}
|
|
@@ -6473,20 +6669,19 @@ function requireIndex_production_1 () {
|
|
|
6473
6669
|
safeCallWithCurrentFiber({
|
|
6474
6670
|
fiber: fiber,
|
|
6475
6671
|
action: function safeCallFiberHasChangeListener() {
|
|
6476
|
-
|
|
6477
|
-
(_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.fiberHasChange) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(changedList); });
|
|
6672
|
+
renderDispatch.callOnFiberChange(changedList);
|
|
6478
6673
|
},
|
|
6479
6674
|
});
|
|
6480
6675
|
}
|
|
6481
6676
|
var mountAsync = function (renderDispatch, fiber) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6482
|
-
return __generator(this, function (
|
|
6483
|
-
switch (
|
|
6677
|
+
return __generator(this, function (_a) {
|
|
6678
|
+
switch (_a.label) {
|
|
6484
6679
|
case 0:
|
|
6485
6680
|
globalLoop.current = true;
|
|
6486
6681
|
mountLoopAll(renderDispatch, fiber);
|
|
6487
6682
|
return [4 /*yield*/, processAsyncLoadListOnAsyncMount(renderDispatch)];
|
|
6488
6683
|
case 1:
|
|
6489
|
-
|
|
6684
|
+
_a.sent();
|
|
6490
6685
|
finishMountAsync(renderDispatch, fiber);
|
|
6491
6686
|
globalLoop.current = false;
|
|
6492
6687
|
return [2 /*return*/];
|
|
@@ -6494,7 +6689,7 @@ function requireIndex_production_1 () {
|
|
|
6494
6689
|
});
|
|
6495
6690
|
}); };
|
|
6496
6691
|
|
|
6497
|
-
var version = "0.3.
|
|
6692
|
+
var version = "0.3.20";
|
|
6498
6693
|
|
|
6499
6694
|
exports.CustomRenderDispatch = CustomRenderDispatch;
|
|
6500
6695
|
exports.MyReactFiberNode = MyReactFiberNode;
|
|
@@ -6596,7 +6791,6 @@ function requireIndex_production_1 () {
|
|
|
6596
6791
|
exports.isErrorBoundariesComponent = isErrorBoundariesComponent;
|
|
6597
6792
|
exports.isErrorBoundariesInstance = isErrorBoundariesInstance;
|
|
6598
6793
|
exports.layoutEffect = layoutEffect;
|
|
6599
|
-
exports.listenerMap = listenerMap;
|
|
6600
6794
|
exports.loadLazy = loadLazy;
|
|
6601
6795
|
exports.loadPromise = loadPromise;
|
|
6602
6796
|
exports.mountAsync = mountAsync;
|
|
@@ -6605,6 +6799,7 @@ function requireIndex_production_1 () {
|
|
|
6605
6799
|
exports.mountLoopAllFromScheduler = mountLoopAllFromScheduler;
|
|
6606
6800
|
exports.mountSync = mountSync;
|
|
6607
6801
|
exports.mountToNextFiberFromRoot = mountToNextFiberFromRoot;
|
|
6802
|
+
exports.nextWorkActivity = nextWorkActivity;
|
|
6608
6803
|
exports.nextWorkClassComponent = nextWorkClassComponent;
|
|
6609
6804
|
exports.nextWorkCommon = nextWorkCommon;
|
|
6610
6805
|
exports.nextWorkComponent = nextWorkComponent;
|
|
@@ -6792,6 +6987,7 @@ function requireIndex_production () {
|
|
|
6792
6987
|
var ScopeSuspense = Symbol.for("react.scope_suspense");
|
|
6793
6988
|
var Comment = Symbol.for("react.comment");
|
|
6794
6989
|
var Offscreen = Symbol.for("react.offscreen");
|
|
6990
|
+
var Activity = Symbol.for("react.activity");
|
|
6795
6991
|
var Profiler = Symbol.for("react.profiler");
|
|
6796
6992
|
|
|
6797
6993
|
function isObject(target) {
|
|
@@ -6891,6 +7087,7 @@ function requireIndex_production () {
|
|
|
6891
7087
|
HOOK_TYPE[HOOK_TYPE["useImperativeHandle"] = 14] = "useImperativeHandle";
|
|
6892
7088
|
HOOK_TYPE[HOOK_TYPE["useSyncExternalStore"] = 15] = "useSyncExternalStore";
|
|
6893
7089
|
HOOK_TYPE[HOOK_TYPE["useOptimistic"] = 16] = "useOptimistic";
|
|
7090
|
+
HOOK_TYPE[HOOK_TYPE["useEffectEvent"] = 17] = "useEffectEvent";
|
|
6894
7091
|
})(exports.HOOK_TYPE || (exports.HOOK_TYPE = {}));
|
|
6895
7092
|
|
|
6896
7093
|
exports.UpdateQueueType = void 0;
|
|
@@ -7306,6 +7503,7 @@ function requireIndex_production () {
|
|
|
7306
7503
|
return ListTree;
|
|
7307
7504
|
}());
|
|
7308
7505
|
|
|
7506
|
+
exports.Activity = Activity;
|
|
7309
7507
|
exports.Comment = Comment;
|
|
7310
7508
|
exports.Consumer = Consumer;
|
|
7311
7509
|
exports.Context = Context;
|
|
@@ -7401,19 +7599,18 @@ var delGlobalDispatch = function (dispatch) {
|
|
|
7401
7599
|
var setRef = function (_fiber, config) {
|
|
7402
7600
|
if (myreactSharedExports.include(_fiber.patch, myreactSharedExports.PATCH_TYPE.__ref__)) {
|
|
7403
7601
|
var cleanUp = function () {
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
_fiber.refPrevious = undefined;
|
|
7602
|
+
// const refPrevious = _fiber.refPrevious;
|
|
7603
|
+
// safeCallWithCurrentFiber({
|
|
7604
|
+
// fiber: _fiber,
|
|
7605
|
+
// action: function safeCallRefPrevious() {
|
|
7606
|
+
// if (typeof refPrevious === "object" && refPrevious !== null) {
|
|
7607
|
+
// refPrevious.current = null;
|
|
7608
|
+
// } else if (typeof refPrevious === "function") {
|
|
7609
|
+
// refPrevious?.(null);
|
|
7610
|
+
// }
|
|
7611
|
+
// },
|
|
7612
|
+
// });
|
|
7613
|
+
// _fiber.refPrevious = undefined;
|
|
7417
7614
|
var refCleanup = _fiber.refCleanup;
|
|
7418
7615
|
myreactReconcilerExports.safeCallWithCurrentFiber({
|
|
7419
7616
|
fiber: _fiber,
|
|
@@ -7867,6 +8064,9 @@ var ReconcilerDispatchFiber = function (renderDispatch, fiber) {
|
|
|
7867
8064
|
else if (myreactSharedExports.include(fiber.type, myreactReconcilerExports.NODE_TYPE.__provider__ | myreactReconcilerExports.NODE_TYPE.__context__)) {
|
|
7868
8065
|
myreactReconcilerExports.nextWorkProvider(renderDispatch, fiber);
|
|
7869
8066
|
}
|
|
8067
|
+
else if (myreactSharedExports.include(fiber.type, myreactReconcilerExports.NODE_TYPE.__activity__)) {
|
|
8068
|
+
myreactReconcilerExports.nextWorkActivity(renderDispatch, fiber);
|
|
8069
|
+
}
|
|
7870
8070
|
else {
|
|
7871
8071
|
myreactReconcilerExports.nextWorkNormal(renderDispatch, fiber);
|
|
7872
8072
|
}
|
|
@@ -7947,7 +8147,7 @@ var ReconcilerDispatchMount = function (_dispatch, _fiber, config) {
|
|
|
7947
8147
|
|
|
7948
8148
|
var currentScheduler$1 = require$$0.__my_react_internal__.currentScheduler;
|
|
7949
8149
|
require$$0.__my_react_shared__.enableScopeTreeLog;
|
|
7950
|
-
var ReconcilerDispatchUpdate = function (_dispatch, _list, config) {
|
|
8150
|
+
var ReconcilerDispatchUpdate = function (_dispatch, _list, config, sync) {
|
|
7951
8151
|
myreactReconcilerExports.beforeSyncUpdate();
|
|
7952
8152
|
_list.listToFoot(function invokeUnmountPendingAndInsertionEffectList(_fiber) {
|
|
7953
8153
|
if (myreactSharedExports.exclude(_fiber.state, myreactSharedExports.STATE_TYPE.__unmount__) && !_dispatch.isAppUnmounted) {
|
|
@@ -8047,7 +8247,7 @@ var ReconcilerDispatchUpdate = function (_dispatch, _list, config) {
|
|
|
8047
8247
|
}
|
|
8048
8248
|
myreactReconcilerExports.addEffectCallback(invokeEffectListTask);
|
|
8049
8249
|
var renderScheduler = currentScheduler$1.current;
|
|
8050
|
-
if (_dispatch.enableConcurrentMode) {
|
|
8250
|
+
if (_dispatch.enableConcurrentMode && !sync) {
|
|
8051
8251
|
renderScheduler.macroTask(function flushEffect() {
|
|
8052
8252
|
myreactReconcilerExports.flushEffectCallback();
|
|
8053
8253
|
});
|
|
@@ -8114,11 +8314,11 @@ var createDispatch = function (rootNode, rootFiber, rootElement, config, flag) {
|
|
|
8114
8314
|
(_a = instance.beforeCommit) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
8115
8315
|
});
|
|
8116
8316
|
myreactReconcilerExports.safeCall(function safeCallBeforeCommitListener() {
|
|
8117
|
-
|
|
8317
|
+
instance.callOnBeforeCommitMount(instance);
|
|
8118
8318
|
});
|
|
8119
8319
|
ReconcilerDispatchMount(this, _fiber, config);
|
|
8120
8320
|
myreactReconcilerExports.safeCall(function safeCallAfterCommitListener() {
|
|
8121
|
-
|
|
8321
|
+
instance.callOnAfterCommitMount(instance);
|
|
8122
8322
|
});
|
|
8123
8323
|
myreactReconcilerExports.safeCall(function safeCallAfterCommit() {
|
|
8124
8324
|
var _a;
|
|
@@ -8126,7 +8326,7 @@ var createDispatch = function (rootNode, rootFiber, rootElement, config, flag) {
|
|
|
8126
8326
|
});
|
|
8127
8327
|
(_b = config.resetAfterCommit) === null || _b === void 0 ? void 0 : _b.call(config, rootNode);
|
|
8128
8328
|
};
|
|
8129
|
-
ReconcilerDispatch.prototype.reconcileUpdate = function (_list) {
|
|
8329
|
+
ReconcilerDispatch.prototype.reconcileUpdate = function (_list, sync) {
|
|
8130
8330
|
var _a, _b;
|
|
8131
8331
|
(_a = config.prepareForCommit) === null || _a === void 0 ? void 0 : _a.call(config, rootNode);
|
|
8132
8332
|
var instance = this;
|
|
@@ -8135,11 +8335,11 @@ var createDispatch = function (rootNode, rootFiber, rootElement, config, flag) {
|
|
|
8135
8335
|
(_a = instance.beforeUpdate) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
8136
8336
|
});
|
|
8137
8337
|
myreactReconcilerExports.safeCall(function safeCallBeforeUpdateListener() {
|
|
8138
|
-
|
|
8338
|
+
instance.callOnBeforeCommitUpdate(instance);
|
|
8139
8339
|
});
|
|
8140
|
-
ReconcilerDispatchUpdate(this, _list, config);
|
|
8340
|
+
ReconcilerDispatchUpdate(this, _list, config, sync);
|
|
8141
8341
|
myreactReconcilerExports.safeCall(function safeCallAfterUpdateListener() {
|
|
8142
|
-
|
|
8342
|
+
instance.callOnAfterCommitUpdate(instance);
|
|
8143
8343
|
});
|
|
8144
8344
|
myreactReconcilerExports.safeCall(function safeCallAfterUpdate() {
|
|
8145
8345
|
var _a;
|
|
@@ -8250,7 +8450,7 @@ var prepareScheduler = function () {
|
|
|
8250
8450
|
|
|
8251
8451
|
var enableDebugFiled = require$$0.__my_react_shared__.enableDebugFiled, enableScopeTreeLog = require$$0.__my_react_shared__.enableScopeTreeLog;
|
|
8252
8452
|
var currentScheduler = require$$0.__my_react_internal__.currentScheduler;
|
|
8253
|
-
// react-reconciler
|
|
8453
|
+
// react-reconciler compat implementation
|
|
8254
8454
|
var Reconciler = function (_config) {
|
|
8255
8455
|
var rendererPackageName = "@my-react";
|
|
8256
8456
|
var ReconcilerSet = new Set();
|
|
@@ -8359,7 +8559,7 @@ var Reconciler = function (_config) {
|
|
|
8359
8559
|
};
|
|
8360
8560
|
};
|
|
8361
8561
|
|
|
8362
|
-
var version = "0.0.
|
|
8562
|
+
var version = "0.0.11";
|
|
8363
8563
|
var createReconciler = Reconciler;
|
|
8364
8564
|
|
|
8365
8565
|
exports.createReconciler = createReconciler;
|