@my-react/react-reconciler-compact 0.0.5 → 0.0.7

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.
@@ -1396,7 +1396,15 @@ function requireIndex_development_1 () {
1396
1396
  }
1397
1397
  else {
1398
1398
  // text element
1399
- return { key: null, ref: null, nodeType: exports.NODE_TYPE.__text__, elementType: String(element), pendingProps: emptyProps$1, finalElement: element, pendingText: String(element) };
1399
+ return {
1400
+ key: null,
1401
+ ref: null,
1402
+ nodeType: exports.NODE_TYPE.__text__,
1403
+ elementType: String(element),
1404
+ pendingProps: emptyProps$1,
1405
+ finalElement: element,
1406
+ pendingText: String(element),
1407
+ };
1400
1408
  }
1401
1409
  }
1402
1410
  return { key: null, ref: null, nodeType: nodeType, elementType: null, pendingProps: emptyProps$1, finalElement: element };
@@ -1746,8 +1754,11 @@ function requireIndex_development_1 () {
1746
1754
  var generateFiberToMountList = function (fiber) {
1747
1755
  var listTree = new myreactSharedExports.ListTree();
1748
1756
  var getNext = function (fiber, root) {
1749
- if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__))
1750
- return null;
1757
+ if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__)) {
1758
+ if (fiber.sibling)
1759
+ return fiber.sibling;
1760
+ return fiber.parent;
1761
+ }
1751
1762
  if (fiber.child)
1752
1763
  return fiber.child;
1753
1764
  while (fiber && fiber !== root) {
@@ -1768,6 +1779,39 @@ function requireIndex_development_1 () {
1768
1779
  return listTree;
1769
1780
  };
1770
1781
  var generateFiberToUnmountList = generateFiberToMountList;
1782
+ /**
1783
+ *
1784
+ * @param action listToFoot action for performance
1785
+ */
1786
+ var generateFiberToListWithAction = function (fiber, action) {
1787
+ var listTree = new myreactSharedExports.ListTree();
1788
+ var getNext = function (fiber, root) {
1789
+ if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__)) {
1790
+ if (fiber.sibling)
1791
+ return fiber.sibling;
1792
+ return fiber.parent;
1793
+ }
1794
+ if (fiber.child)
1795
+ return fiber.child;
1796
+ while (fiber && fiber !== root) {
1797
+ listTree.push(fiber);
1798
+ action(fiber);
1799
+ if (fiber.sibling)
1800
+ return fiber.sibling;
1801
+ fiber = fiber.parent;
1802
+ }
1803
+ if (fiber === root) {
1804
+ listTree.push(fiber);
1805
+ action(fiber);
1806
+ }
1807
+ return null;
1808
+ };
1809
+ var f = fiber;
1810
+ while (f) {
1811
+ f = getNext(f, fiber);
1812
+ }
1813
+ return listTree;
1814
+ };
1771
1815
 
1772
1816
  var currentRunningFiber$2 = react.__my_react_internal__.currentRunningFiber;
1773
1817
  var mountToNextFiberFromRoot = function (renderDispatch, fiber) {
@@ -1805,6 +1849,16 @@ function requireIndex_development_1 () {
1805
1849
  renderDispatch.generateCommitList(nextFiber);
1806
1850
  if (nextFiber.sibling)
1807
1851
  return nextFiber.sibling;
1852
+ // current nextFiber is all done, back to parent
1853
+ {
1854
+ safeCallWithCurrentFiber({
1855
+ fiber: nextFiber,
1856
+ action: function safeCallAfterFiberDone() {
1857
+ var _a, _b;
1858
+ (_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.afterFiberDone) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(nextFiber); });
1859
+ },
1860
+ });
1861
+ }
1808
1862
  nextFiber = nextFiber.parent;
1809
1863
  }
1810
1864
  if (nextFiber === renderDispatch.runtimeFiber.scheduledFiber)
@@ -1847,6 +1901,15 @@ function requireIndex_development_1 () {
1847
1901
  renderDispatch.generateCommitList(nextFiber);
1848
1902
  if (nextFiber.sibling)
1849
1903
  return nextFiber.sibling;
1904
+ {
1905
+ safeCallWithCurrentFiber({
1906
+ fiber: nextFiber,
1907
+ action: function safeCallAfterFiberDone() {
1908
+ var _a, _b;
1909
+ (_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.afterFiberDone) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(nextFiber); });
1910
+ },
1911
+ });
1912
+ }
1850
1913
  nextFiber = nextFiber.parent;
1851
1914
  }
1852
1915
  if (nextFiber === renderDispatch.runtimeFiber.scheduledFiber)
@@ -1855,7 +1918,11 @@ function requireIndex_development_1 () {
1855
1918
  };
1856
1919
 
1857
1920
  var defaultGenerateEffectMap = function (fiber, effect, map, option) {
1858
- var list = map.get(fiber) || new myreactSharedExports.ListTree();
1921
+ var list = map.get(fiber);
1922
+ if (!list) {
1923
+ list = new myreactSharedExports.ListTree();
1924
+ map.set(fiber, list);
1925
+ }
1859
1926
  if (option) {
1860
1927
  if (option.stickyToHead) {
1861
1928
  list.pushToHead(effect);
@@ -1870,7 +1937,6 @@ function requireIndex_development_1 () {
1870
1937
  else {
1871
1938
  list.push(effect);
1872
1939
  }
1873
- map.set(fiber, list);
1874
1940
  };
1875
1941
  var defaultInvokeEffect = function (renderDispatch, fiber) {
1876
1942
  if (myreactSharedExports.include(fiber.patch, myreactSharedExports.PATCH_TYPE.__effect__)) {
@@ -2148,7 +2214,7 @@ function requireIndex_development_1 () {
2148
2214
  }
2149
2215
  });
2150
2216
  }); })).then(function () {
2151
- var aliveNode = defaultResolveAliveSuspenseFiber(node);
2217
+ var aliveNode = defaultResolveAliveSuspenseFiber(node) || renderDispatch.rootFiber;
2152
2218
  aliveNode.state = myreactSharedExports.STATE_TYPE.__triggerSyncForce__;
2153
2219
  var renderScheduler = currentScheduler$d.current;
2154
2220
  var updater = {
@@ -2741,9 +2807,7 @@ function requireIndex_development_1 () {
2741
2807
  throw new Error("[@my-react/react] current update not valid, look like a bug for @my-react");
2742
2808
  }
2743
2809
  allQueue.delete(node);
2744
- {
2745
- processedNodes.push(updater);
2746
- }
2810
+ processedNodes.push(updater);
2747
2811
  var payLoad_1 = updater.payLoad;
2748
2812
  fiber.pendingState = safeCallWithCurrentFiber({
2749
2813
  fiber: fiber,
@@ -2773,9 +2837,7 @@ function requireIndex_development_1 () {
2773
2837
  }
2774
2838
  else if (updater.isSync) {
2775
2839
  allQueue.delete(node);
2776
- {
2777
- processedNodes.push(updater);
2778
- }
2840
+ processedNodes.push(updater);
2779
2841
  isSync = isSync || updater.isSync;
2780
2842
  isForce = isForce || updater.isForce;
2781
2843
  isImmediate = isImmediate || updater.isImmediate;
@@ -2808,17 +2870,15 @@ function requireIndex_development_1 () {
2808
2870
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
2809
2871
  }
2810
2872
  : void 0;
2811
- {
2812
- return {
2813
- needUpdate: needUpdate,
2814
- nodes: processedNodes,
2815
- isSync: isSync,
2816
- isForce: isForce,
2817
- isImmediate: isImmediate,
2818
- isRetrigger: isRetrigger,
2819
- callback: invokeCallbackArray,
2820
- };
2821
- }
2873
+ return {
2874
+ needUpdate: needUpdate,
2875
+ nodes: processedNodes,
2876
+ isSync: isSync,
2877
+ isForce: isForce,
2878
+ isImmediate: isImmediate,
2879
+ isRetrigger: isRetrigger,
2880
+ callback: invokeCallbackArray,
2881
+ };
2822
2882
  }
2823
2883
  else {
2824
2884
  var _loop_2 = function () {
@@ -2828,9 +2888,7 @@ function requireIndex_development_1 () {
2828
2888
  if (updater.trigger !== typedInstance)
2829
2889
  throw new Error("[@my-react/react] current update not valid, look like a bug for @my-react");
2830
2890
  allQueue.delete(node);
2831
- {
2832
- processedNodes.push(updater);
2833
- }
2891
+ processedNodes.push(updater);
2834
2892
  var payLoad_2 = updater.payLoad;
2835
2893
  fiber.pendingState = safeCallWithCurrentFiber({
2836
2894
  fiber: fiber,
@@ -2860,9 +2918,7 @@ function requireIndex_development_1 () {
2860
2918
  }
2861
2919
  else {
2862
2920
  allQueue.delete(node);
2863
- {
2864
- processedNodes.push(updater);
2865
- }
2921
+ processedNodes.push(updater);
2866
2922
  isSync = isSync || updater.isSync;
2867
2923
  isForce = isForce || updater.isForce;
2868
2924
  isImmediate = isImmediate || updater.isImmediate;
@@ -2890,17 +2946,15 @@ function requireIndex_development_1 () {
2890
2946
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
2891
2947
  }
2892
2948
  : void 0;
2893
- {
2894
- return {
2895
- needUpdate: needUpdate,
2896
- nodes: processedNodes,
2897
- isSync: isSync,
2898
- isForce: isForce,
2899
- isImmediate: isImmediate,
2900
- isRetrigger: isRetrigger,
2901
- callback: invokeCallbackArray,
2902
- };
2903
- }
2949
+ return {
2950
+ needUpdate: needUpdate,
2951
+ nodes: processedNodes,
2952
+ isSync: isSync,
2953
+ isForce: isForce,
2954
+ isImmediate: isImmediate,
2955
+ isRetrigger: isRetrigger,
2956
+ callback: invokeCallbackArray,
2957
+ };
2904
2958
  }
2905
2959
  };
2906
2960
  var processClassComponentUpdateQueueLegacy = function (renderDispatch, fiber) {
@@ -2929,9 +2983,7 @@ function requireIndex_development_1 () {
2929
2983
  if (updater.trigger !== typedInstance)
2930
2984
  throw new Error("[@my-react/react] current update not valid, look like a bug for @my-react");
2931
2985
  allQueue.delete(node);
2932
- {
2933
- processedNodes.push(updater);
2934
- }
2986
+ processedNodes.push(updater);
2935
2987
  var payLoad_3 = updater.payLoad;
2936
2988
  fiber.pendingState = safeCallWithCurrentFiber({
2937
2989
  fiber: fiber,
@@ -2961,9 +3013,7 @@ function requireIndex_development_1 () {
2961
3013
  }
2962
3014
  else {
2963
3015
  allQueue.delete(node);
2964
- {
2965
- processedNodes.push(updater);
2966
- }
3016
+ processedNodes.push(updater);
2967
3017
  isSync = isSync || updater.isSync;
2968
3018
  isForce = isForce || updater.isForce;
2969
3019
  isImmediate = isImmediate || updater.isImmediate;
@@ -2992,17 +3042,15 @@ function requireIndex_development_1 () {
2992
3042
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
2993
3043
  }
2994
3044
  : void 0;
2995
- {
2996
- return {
2997
- needUpdate: needUpdate,
2998
- nodes: processedNodes,
2999
- isSync: isSync,
3000
- isForce: isForce,
3001
- isImmediate: isImmediate,
3002
- isRetrigger: isRetrigger,
3003
- callback: invokeCallbackArray,
3004
- };
3005
- }
3045
+ return {
3046
+ needUpdate: needUpdate,
3047
+ nodes: processedNodes,
3048
+ isSync: isSync,
3049
+ isForce: isForce,
3050
+ isImmediate: isImmediate,
3051
+ isRetrigger: isRetrigger,
3052
+ callback: invokeCallbackArray,
3053
+ };
3006
3054
  };
3007
3055
  var processFunctionComponentUpdateQueueLatest = function (renderDispatch, fiber, enableTaskPriority) {
3008
3056
  var _a, _b;
@@ -3031,9 +3079,7 @@ function requireIndex_development_1 () {
3031
3079
  throw new Error("[@my-react/react] current update not valid, look like a bug for @my-react");
3032
3080
  }
3033
3081
  allQueue.delete(node);
3034
- {
3035
- processedNodes.push(updater);
3036
- }
3082
+ processedNodes.push(updater);
3037
3083
  var trigger = updater.trigger, payLoad_4 = updater.payLoad, reducer_1 = updater.reducer;
3038
3084
  var typedTrigger_1 = trigger;
3039
3085
  var lastResult_1 = typedTrigger_1.result;
@@ -3078,9 +3124,7 @@ function requireIndex_development_1 () {
3078
3124
  }
3079
3125
  else if (updater.isSync) {
3080
3126
  allQueue.delete(node);
3081
- {
3082
- processedNodes.push(updater);
3083
- }
3127
+ processedNodes.push(updater);
3084
3128
  var payLoad = updater.payLoad;
3085
3129
  isSync = isSync || updater.isSync;
3086
3130
  isForce = isForce || updater.isForce;
@@ -3114,17 +3158,15 @@ function requireIndex_development_1 () {
3114
3158
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
3115
3159
  }
3116
3160
  : void 0;
3117
- {
3118
- return {
3119
- needUpdate: needUpdate,
3120
- nodes: processedNodes,
3121
- isSync: isSync,
3122
- isForce: isForce,
3123
- isImmediate: isImmediate,
3124
- isRetrigger: isRetrigger,
3125
- callback: invokeCallbackArray,
3126
- };
3127
- }
3161
+ return {
3162
+ needUpdate: needUpdate,
3163
+ nodes: processedNodes,
3164
+ isSync: isSync,
3165
+ isForce: isForce,
3166
+ isImmediate: isImmediate,
3167
+ isRetrigger: isRetrigger,
3168
+ callback: invokeCallbackArray,
3169
+ };
3128
3170
  }
3129
3171
  else {
3130
3172
  var _loop_4 = function () {
@@ -3135,9 +3177,7 @@ function requireIndex_development_1 () {
3135
3177
  throw new Error("[@my-react/react] current update not valid, look like a bug for @my-react");
3136
3178
  }
3137
3179
  allQueue.delete(node);
3138
- {
3139
- processedNodes.push(updater);
3140
- }
3180
+ processedNodes.push(updater);
3141
3181
  var trigger = updater.trigger, payLoad_5 = updater.payLoad, reducer_2 = updater.reducer;
3142
3182
  var typedTrigger_2 = trigger;
3143
3183
  var lastResult_2 = typedTrigger_2.result;
@@ -3182,9 +3222,7 @@ function requireIndex_development_1 () {
3182
3222
  }
3183
3223
  else {
3184
3224
  allQueue.delete(node);
3185
- {
3186
- processedNodes.push(updater);
3187
- }
3225
+ processedNodes.push(updater);
3188
3226
  var payLoad = updater.payLoad;
3189
3227
  isSync = isSync || updater.isSync;
3190
3228
  isForce = isForce || updater.isForce;
@@ -3213,17 +3251,15 @@ function requireIndex_development_1 () {
3213
3251
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
3214
3252
  }
3215
3253
  : void 0;
3216
- {
3217
- return {
3218
- needUpdate: needUpdate,
3219
- nodes: processedNodes,
3220
- isSync: isSync,
3221
- isForce: isForce,
3222
- isImmediate: isImmediate,
3223
- isRetrigger: isRetrigger,
3224
- callback: invokeCallbackArray,
3225
- };
3226
- }
3254
+ return {
3255
+ needUpdate: needUpdate,
3256
+ nodes: processedNodes,
3257
+ isSync: isSync,
3258
+ isForce: isForce,
3259
+ isImmediate: isImmediate,
3260
+ isRetrigger: isRetrigger,
3261
+ callback: invokeCallbackArray,
3262
+ };
3227
3263
  }
3228
3264
  };
3229
3265
  var processFunctionComponentUpdateQueueLegacy = function (renderDispatch, fiber) {
@@ -3251,9 +3287,7 @@ function requireIndex_development_1 () {
3251
3287
  throw new Error("[@my-react/react] current update not valid, look like a bug for @my-react");
3252
3288
  }
3253
3289
  allQueue.delete(node);
3254
- {
3255
- processedNodes.push(updater);
3256
- }
3290
+ processedNodes.push(updater);
3257
3291
  var trigger = updater.trigger, payLoad_6 = updater.payLoad, reducer_3 = updater.reducer;
3258
3292
  var typedTrigger_3 = trigger;
3259
3293
  var lastResult_3 = typedTrigger_3.result;
@@ -3298,9 +3332,7 @@ function requireIndex_development_1 () {
3298
3332
  }
3299
3333
  else {
3300
3334
  allQueue.delete(node);
3301
- {
3302
- processedNodes.push(updater);
3303
- }
3335
+ processedNodes.push(updater);
3304
3336
  var payLoad = updater.payLoad;
3305
3337
  isSync = isSync || updater.isSync;
3306
3338
  isForce = isForce || updater.isForce;
@@ -3330,17 +3362,15 @@ function requireIndex_development_1 () {
3330
3362
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
3331
3363
  }
3332
3364
  : void 0;
3333
- {
3334
- return {
3335
- needUpdate: needUpdate,
3336
- nodes: processedNodes,
3337
- isSync: isSync,
3338
- isForce: isForce,
3339
- isImmediate: isImmediate,
3340
- isRetrigger: isRetrigger,
3341
- callback: invokeCallbackArray,
3342
- };
3343
- }
3365
+ return {
3366
+ needUpdate: needUpdate,
3367
+ nodes: processedNodes,
3368
+ isSync: isSync,
3369
+ isForce: isForce,
3370
+ isImmediate: isImmediate,
3371
+ isRetrigger: isRetrigger,
3372
+ callback: invokeCallbackArray,
3373
+ };
3344
3374
  };
3345
3375
  var processNormalComponentUpdateLatest = function (renderDispatch, fiber) {
3346
3376
  if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__))
@@ -3359,9 +3389,7 @@ function requireIndex_development_1 () {
3359
3389
  var updater = node.value;
3360
3390
  var nextNode = node.next;
3361
3391
  allQueue.delete(node);
3362
- {
3363
- processedNodes.push(updater);
3364
- }
3392
+ processedNodes.push(updater);
3365
3393
  var payLoad = updater.payLoad;
3366
3394
  isSync = isSync || updater.isSync;
3367
3395
  isForce = isForce || updater.isForce;
@@ -3385,17 +3413,15 @@ function requireIndex_development_1 () {
3385
3413
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
3386
3414
  }
3387
3415
  : void 0;
3388
- {
3389
- return {
3390
- needUpdate: needUpdate,
3391
- nodes: processedNodes,
3392
- isSync: isSync,
3393
- isForce: isForce,
3394
- isImmediate: isImmediate,
3395
- isRetrigger: isRetrigger,
3396
- callback: invokeCallbackArray,
3397
- };
3398
- }
3416
+ return {
3417
+ needUpdate: needUpdate,
3418
+ nodes: processedNodes,
3419
+ isSync: isSync,
3420
+ isForce: isForce,
3421
+ isImmediate: isImmediate,
3422
+ isRetrigger: isRetrigger,
3423
+ callback: invokeCallbackArray,
3424
+ };
3399
3425
  };
3400
3426
  var processNormalComponentUpdateLegacy = function (renderDispatch, fiber) {
3401
3427
  if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__))
@@ -3414,9 +3440,7 @@ function requireIndex_development_1 () {
3414
3440
  if (node) {
3415
3441
  var updater = node.value;
3416
3442
  allQueue.delete(node);
3417
- {
3418
- processedNodes.push(updater);
3419
- }
3443
+ processedNodes.push(updater);
3420
3444
  var payLoad = updater.payLoad;
3421
3445
  isSync = isSync || updater.isSync;
3422
3446
  isForce = isForce || updater.isForce;
@@ -3444,17 +3468,15 @@ function requireIndex_development_1 () {
3444
3468
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
3445
3469
  }
3446
3470
  : void 0;
3447
- {
3448
- return {
3449
- needUpdate: needUpdate,
3450
- nodes: processedNodes,
3451
- isSync: isSync,
3452
- isForce: isForce,
3453
- isImmediate: isImmediate,
3454
- isRetrigger: isRetrigger,
3455
- callback: invokeCallbackArray,
3456
- };
3457
- }
3471
+ return {
3472
+ needUpdate: needUpdate,
3473
+ nodes: processedNodes,
3474
+ isSync: isSync,
3475
+ isForce: isForce,
3476
+ isImmediate: isImmediate,
3477
+ isRetrigger: isRetrigger,
3478
+ callback: invokeCallbackArray,
3479
+ };
3458
3480
  };
3459
3481
  /**
3460
3482
  * @deprecated
@@ -3602,9 +3624,12 @@ function requireIndex_development_1 () {
3602
3624
  };
3603
3625
 
3604
3626
  var defaultGenerateUnmountMap = function (fiber, unmount, map) {
3605
- var list = map.get(fiber) || new myreactSharedExports.ListTree();
3606
- var newList = generateFiberToUnmountList(unmount);
3607
- map.set(fiber, list.concat(newList));
3627
+ var list = map.get(fiber);
3628
+ if (!list) {
3629
+ list = new myreactSharedExports.ListTree();
3630
+ map.set(fiber, list);
3631
+ }
3632
+ list.push(unmount);
3608
3633
  };
3609
3634
  var defaultDispatchUnmount = function (renderDispatch) {
3610
3635
  if (renderDispatch.isAppUnmounted)
@@ -3616,35 +3641,33 @@ function requireIndex_development_1 () {
3616
3641
  var defaultInvokeUnmountList = function (renderDispatch, fiber) {
3617
3642
  if (myreactSharedExports.include(fiber.patch, myreactSharedExports.PATCH_TYPE.__unmount__)) {
3618
3643
  var unmountMap = renderDispatch.runtimeMap.unmountMap;
3619
- var allUnmount_1 = unmountMap.get(fiber);
3644
+ var allUnmount = unmountMap.get(fiber);
3620
3645
  unmountMap.delete(fiber);
3621
- if (allUnmount_1 && allUnmount_1.length)
3622
- safeCallWithCurrentFiber({
3623
- fiber: fiber,
3624
- action: function safeCallUnmountList() {
3625
- unmountList(renderDispatch, allUnmount_1);
3626
- },
3646
+ if (allUnmount && allUnmount.length) {
3647
+ allUnmount.listToFoot(function invokeUnmountFromCurrent(unmount) {
3648
+ safeCallWithCurrentFiber({
3649
+ fiber: unmount,
3650
+ action: function safeCallUnmountFromCurrent() {
3651
+ unmountFiber(renderDispatch, unmount);
3652
+ },
3653
+ });
3627
3654
  });
3655
+ }
3628
3656
  fiber.patch = myreactSharedExports.remove(fiber.patch, myreactSharedExports.PATCH_TYPE.__unmount__);
3629
3657
  }
3630
3658
  };
3631
3659
 
3632
- var unmountList = function (renderDispatch, list) {
3633
- // will happen when app crash
3634
- list.listToFoot(function invokeUnmountPendingList(f) {
3660
+ // unmount current fiber
3661
+ var unmountFiber = function (renderDispatch, fiber) {
3662
+ if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__))
3663
+ return;
3664
+ var list = generateFiberToListWithAction(fiber, function invokeUnmountPending(f) {
3635
3665
  defaultInvokeUnmountList(renderDispatch, f);
3636
3666
  });
3637
3667
  list.listToFoot(function invokeFiberUnmountList(f) {
3638
3668
  unmountFiberNode(renderDispatch, f);
3639
3669
  });
3640
3670
  };
3641
- // unmount current fiber
3642
- var unmountFiber = function (renderDispatch, fiber) {
3643
- if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__))
3644
- return;
3645
- var list = generateFiberToUnmountList(fiber);
3646
- unmountList(renderDispatch, list);
3647
- };
3648
3671
  // unmount current container with safe
3649
3672
  var unmountContainer = function (renderDispatch, cb) {
3650
3673
  renderDispatch.reconcileUnmount();
@@ -3820,6 +3843,7 @@ function requireIndex_development_1 () {
3820
3843
  var globalLoop$2 = react.__my_react_internal__.globalLoop, currentScheduler$a = react.__my_react_internal__.currentScheduler;
3821
3844
  var enableConcurrentMode$1 = react.__my_react_shared__.enableConcurrentMode;
3822
3845
  var scheduleUpdateFromRoot = function (renderDispatch) {
3846
+ var _a, _b, _c, _d;
3823
3847
  var allLive = renderDispatch.pendingUpdateFiberArray.getAll().filter(function (f) { return myreactSharedExports.exclude(f.state, myreactSharedExports.STATE_TYPE.__unmount__); });
3824
3848
  renderDispatch.pendingUpdateFiberArray.clear();
3825
3849
  if (allLive.length) {
@@ -3828,10 +3852,16 @@ function requireIndex_development_1 () {
3828
3852
  currentTriggerFiber.current = allLive.length > 1 ? allLive : allLive[0];
3829
3853
  allLive.forEach(function (fiber) { return applyTriggerFiberCb(renderDispatch, fiber); });
3830
3854
  if (!enableConcurrentMode$1.current || allLive.some(function (f) { return myreactSharedExports.include(f.state, myreactSharedExports.STATE_TYPE.__triggerSync__ | myreactSharedExports.STATE_TYPE.__triggerSyncForce__); })) {
3855
+ {
3856
+ (_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.beforeDispatchUpdate) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(renderDispatch, allLive); });
3857
+ }
3831
3858
  updateSyncFromRoot(renderDispatch);
3832
3859
  }
3833
3860
  else {
3834
3861
  renderDispatch.resetYield();
3862
+ {
3863
+ (_d = (_c = listenerMap.get(renderDispatch)) === null || _c === void 0 ? void 0 : _c.beforeDispatchUpdate) === null || _d === void 0 ? void 0 : _d.forEach(function (cb) { return cb(renderDispatch, allLive); });
3864
+ }
3835
3865
  updateConcurrentFromRoot(renderDispatch);
3836
3866
  }
3837
3867
  }
@@ -3840,6 +3870,22 @@ function requireIndex_development_1 () {
3840
3870
  scheduleNext(renderDispatch);
3841
3871
  }
3842
3872
  };
3873
+ var scheduleOther = function (renderDispatch) {
3874
+ var _a;
3875
+ var renderScheduler = currentScheduler$a.current;
3876
+ if (!renderScheduler.dispatchSet || ((_a = renderScheduler.dispatchSet) === null || _a === void 0 ? void 0 : _a.length) === 1)
3877
+ return;
3878
+ var allDispatch = renderScheduler.dispatchSet;
3879
+ var hasPending = allDispatch
3880
+ .getAll()
3881
+ .find(function (d) { return d !== renderDispatch && d.isAppMounted && d.enableUpdate && !d.isAppCrashed && !d.isAppUnmounted && d.pendingUpdateFiberArray.length; });
3882
+ if (hasPending) {
3883
+ scheduleUpdate(hasPending);
3884
+ }
3885
+ else {
3886
+ globalLoop$2.current = false;
3887
+ }
3888
+ };
3843
3889
  var scheduleNext = function (renderDispatch) {
3844
3890
  var _a;
3845
3891
  if (!renderDispatch.isAppUnmounted && !renderDispatch.isAppCrashed && renderDispatch.enableUpdate && renderDispatch.pendingUpdateFiberArray.length) {
@@ -3862,7 +3908,7 @@ function requireIndex_development_1 () {
3862
3908
  };
3863
3909
  var scheduleUpdate = function (renderDispatch) {
3864
3910
  if (renderDispatch.isAppUnmounted) {
3865
- scheduleNext(renderDispatch);
3911
+ scheduleOther(renderDispatch);
3866
3912
  return;
3867
3913
  }
3868
3914
  scheduleUpdateFromRoot(renderDispatch);
@@ -3870,6 +3916,23 @@ function requireIndex_development_1 () {
3870
3916
 
3871
3917
  var globalLoop$1 = react.__my_react_internal__.globalLoop, currentScheduler$9 = react.__my_react_internal__.currentScheduler;
3872
3918
  var enableScopeTreeLog$3 = react.__my_react_shared__.enableScopeTreeLog;
3919
+ function finishUpdateSyncFromRoot(renderDispatch) {
3920
+ var _a, _b;
3921
+ var commitList = renderDispatch.pendingCommitFiberList;
3922
+ var changedList = renderDispatch.pendingChangedFiberList;
3923
+ renderDispatch.resetUpdateFlowRuntimeFiber();
3924
+ renderDispatch.pendingCommitFiberList = null;
3925
+ renderDispatch.pendingChangedFiberList = null;
3926
+ enableScopeTreeLog$3.current && setLogScope();
3927
+ (commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
3928
+ enableScopeTreeLog$3.current && resetLogScope();
3929
+ ((_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.afterDispatchUpdate) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(renderDispatch); }));
3930
+ (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
3931
+ safeCall(function safeCallFiberHasChangeListener() {
3932
+ var _a, _b;
3933
+ (_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); });
3934
+ });
3935
+ }
3873
3936
  var updateSyncFromRoot = function (renderDispatch) {
3874
3937
  globalLoop$1.current = true;
3875
3938
  var renderScheduler = currentScheduler$9.current;
@@ -3877,26 +3940,63 @@ function requireIndex_development_1 () {
3877
3940
  updateLoopSyncFromRoot(renderDispatch);
3878
3941
  processAsyncLoadListOnUpdate(renderDispatch);
3879
3942
  enableScopeTreeLog$3.current && resetLogScope();
3880
- (function finishUpdateSyncFromRoot() {
3881
- var commitList = renderDispatch.pendingCommitFiberList;
3882
- var changedList = renderDispatch.pendingChangedFiberList;
3883
- renderDispatch.resetUpdateFlowRuntimeFiber();
3884
- renderDispatch.pendingCommitFiberList = null;
3885
- renderDispatch.pendingChangedFiberList = null;
3886
- enableScopeTreeLog$3.current && setLogScope();
3887
- (commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
3888
- enableScopeTreeLog$3.current && resetLogScope();
3889
- (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
3890
- safeCall(function safeCallFiberHasChangeListener() {
3891
- var _a, _b;
3892
- (_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); });
3893
- });
3894
- })();
3943
+ finishUpdateSyncFromRoot(renderDispatch);
3895
3944
  renderScheduler.microTask(function callScheduleNext() {
3896
3945
  globalLoop$1.current = false;
3897
3946
  scheduleNext(renderDispatch);
3898
3947
  });
3899
3948
  };
3949
+ function finishUpdateConcurrentFromRoot(renderDispatch) {
3950
+ var _a, _b;
3951
+ var commitList = renderDispatch.pendingCommitFiberList;
3952
+ var changedList = renderDispatch.pendingChangedFiberList;
3953
+ renderDispatch.resetUpdateFlowRuntimeFiber();
3954
+ renderDispatch.pendingCommitFiberList = null;
3955
+ renderDispatch.pendingChangedFiberList = null;
3956
+ enableScopeTreeLog$3.current && setLogScope();
3957
+ (commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
3958
+ enableScopeTreeLog$3.current && setLogScope();
3959
+ ((_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.afterDispatchUpdate) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(renderDispatch); }));
3960
+ (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
3961
+ safeCall(function safeCallFiberHasChangeListener() {
3962
+ var _a, _b;
3963
+ (_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); });
3964
+ });
3965
+ }
3966
+ function checkNextFiberIsSync(renderDispatch) {
3967
+ return myreactSharedExports.include(renderDispatch.runtimeFiber.nextWorkingFiber.state, myreactSharedExports.STATE_TYPE.__triggerSync__ | myreactSharedExports.STATE_TYPE.__triggerSyncForce__);
3968
+ // include(renderDispatch.runtimeFiber.nextWorkingFiber.state, STATE_TYPE.__retrigger__)
3969
+ }
3970
+ function updateConCurrentNextFrame(renderDispatch) {
3971
+ var renderScheduler = currentScheduler$9.current;
3972
+ enableScopeTreeLog$3.current && setLogScope();
3973
+ var hasSync = updateLoopConcurrentFromRoot(renderDispatch);
3974
+ enableScopeTreeLog$3.current && resetLogScope();
3975
+ if (renderDispatch.runtimeFiber.nextWorkingFiber) {
3976
+ if (hasSync || checkNextFiberIsSync(renderDispatch)) {
3977
+ updateSyncFromRoot(renderDispatch);
3978
+ }
3979
+ else {
3980
+ renderScheduler.yieldTask(function resumeUpdateConcurrentFromRoot() {
3981
+ if (hasSync || checkNextFiberIsSync(renderDispatch)) {
3982
+ updateSyncFromRoot(renderDispatch);
3983
+ }
3984
+ else {
3985
+ updateConCurrentNextFrame(renderDispatch);
3986
+ }
3987
+ });
3988
+ }
3989
+ }
3990
+ else {
3991
+ processAsyncLoadListOnUpdate(renderDispatch);
3992
+ finishUpdateConcurrentFromRoot(renderDispatch);
3993
+ renderScheduler.microTask(function callScheduleNext() {
3994
+ // TODO! flash all effect
3995
+ globalLoop$1.current = false;
3996
+ scheduleNext(renderDispatch);
3997
+ });
3998
+ }
3999
+ }
3900
4000
  var updateConcurrentFromRoot = function (renderDispatch) {
3901
4001
  globalLoop$1.current = true;
3902
4002
  var renderScheduler = currentScheduler$9.current;
@@ -3904,40 +4004,23 @@ function requireIndex_development_1 () {
3904
4004
  var hasSync = updateLoopConcurrentFromRoot(renderDispatch);
3905
4005
  enableScopeTreeLog$3.current && resetLogScope();
3906
4006
  if (renderDispatch.runtimeFiber.nextWorkingFiber) {
3907
- var checkCurrentIsSync_1 = function () {
3908
- return hasSync || myreactSharedExports.include(renderDispatch.runtimeFiber.nextWorkingFiber.state, myreactSharedExports.STATE_TYPE.__triggerSync__ | myreactSharedExports.STATE_TYPE.__triggerSyncForce__);
3909
- };
3910
- if (checkCurrentIsSync_1()) {
4007
+ if (hasSync || checkNextFiberIsSync(renderDispatch)) {
3911
4008
  updateSyncFromRoot(renderDispatch);
3912
4009
  }
3913
4010
  else {
3914
4011
  renderScheduler.yieldTask(function resumeUpdateConcurrentFromRoot() {
3915
- if (checkCurrentIsSync_1()) {
4012
+ if (hasSync || checkNextFiberIsSync(renderDispatch)) {
3916
4013
  updateSyncFromRoot(renderDispatch);
3917
4014
  }
3918
4015
  else {
3919
- updateConcurrentFromRoot(renderDispatch);
4016
+ updateConCurrentNextFrame(renderDispatch);
3920
4017
  }
3921
4018
  });
3922
4019
  }
3923
4020
  }
3924
4021
  else {
3925
4022
  processAsyncLoadListOnUpdate(renderDispatch);
3926
- (function finishUpdateConcurrentFromRoot() {
3927
- var commitList = renderDispatch.pendingCommitFiberList;
3928
- var changedList = renderDispatch.pendingChangedFiberList;
3929
- renderDispatch.resetUpdateFlowRuntimeFiber();
3930
- renderDispatch.pendingCommitFiberList = null;
3931
- renderDispatch.pendingChangedFiberList = null;
3932
- enableScopeTreeLog$3.current && setLogScope();
3933
- (commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
3934
- enableScopeTreeLog$3.current && setLogScope();
3935
- (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
3936
- safeCall(function safeCallFiberHasChangeListener() {
3937
- var _a, _b;
3938
- (_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); });
3939
- });
3940
- })();
4023
+ finishUpdateConcurrentFromRoot(renderDispatch);
3941
4024
  renderScheduler.microTask(function callScheduleNext() {
3942
4025
  // TODO! flash all effect
3943
4026
  globalLoop$1.current = false;
@@ -3968,7 +4051,7 @@ function requireIndex_development_1 () {
3968
4051
  }
3969
4052
  if (hookNode.type === myreactSharedExports.HOOK_TYPE.useOptimistic) {
3970
4053
  var value = hookNode.value;
3971
- if (value.reducer && typeof value.reducer !== 'function') {
4054
+ if (value.reducer && typeof value.reducer !== "function") {
3972
4055
  throw new Error("[@my-react/react] ".concat(myreactSharedExports.HOOK_TYPE[hookNode.type], " initial error"));
3973
4056
  }
3974
4057
  }
@@ -4191,7 +4274,7 @@ function requireIndex_development_1 () {
4191
4274
  var nextValue = mergeFunc(newValue, hookNode.result.value.value);
4192
4275
  var payloadRef = { current: function (last) { return ({ value: nextValue, start: last.start }); } };
4193
4276
  hookNode._update({ isForce: true, isSync: true, payLoad: function (last) { return payloadRef.current(last); } });
4194
- hookNode.cancel = function () { return payloadRef.current = function (last) { return last; }; };
4277
+ hookNode.cancel = function () { return (payloadRef.current = function (last) { return last; }); };
4195
4278
  },
4196
4279
  };
4197
4280
  }
@@ -4992,7 +5075,7 @@ function requireIndex_development_1 () {
4992
5075
  return createFiberNode(renderDispatch, { parent: parentFiber }, newChild);
4993
5076
  };
4994
5077
  var transformChildrenFiber = function (renderDispatch, parentFiber, children) {
4995
- var isUpdate = myreactSharedExports.exclude(parentFiber.state, myreactSharedExports.STATE_TYPE.__create__) && renderDispatch.isAppMounted;
5078
+ var isUpdate = myreactSharedExports.exclude(parentFiber.state, myreactSharedExports.STATE_TYPE.__create__);
4996
5079
  var isHMR = myreactSharedExports.include(parentFiber.state, myreactSharedExports.STATE_TYPE.__hmr__);
4997
5080
  var isRetrigger = myreactSharedExports.include(parentFiber.state, myreactSharedExports.STATE_TYPE.__retrigger__);
4998
5081
  // is current is retrigger update, skip update children
@@ -5550,6 +5633,9 @@ function requireIndex_development_1 () {
5550
5633
  fiberHMR: new Set(),
5551
5634
  beforeFiberRun: new Set(),
5552
5635
  afterFiberRun: new Set(),
5636
+ afterFiberDone: new Set(),
5637
+ beforeDispatchRender: new Set(),
5638
+ afterDispatchRender: new Set(),
5553
5639
  fiberWarn: new Set(),
5554
5640
  fiberError: new Set(),
5555
5641
  fiberState: new Set(),
@@ -5563,12 +5649,12 @@ function requireIndex_development_1 () {
5563
5649
  hookUpdate: new Set(),
5564
5650
  hookState: new Set(),
5565
5651
  hookUnmount: new Set(),
5566
- beforeCommit: new Set(),
5567
- afterCommit: new Set(),
5568
- beforeUpdate: new Set(),
5569
- afterUpdate: new Set(),
5570
- beforeUnmount: new Set(),
5571
- afterUnmount: new Set(),
5652
+ beforeCommitMount: new Set(),
5653
+ afterCommitMount: new Set(),
5654
+ beforeCommitUpdate: new Set(),
5655
+ afterCommitUpdate: new Set(),
5656
+ beforeCommitUnmount: new Set(),
5657
+ afterCommitUnmount: new Set(),
5572
5658
  }
5573
5659
  ;
5574
5660
  };
@@ -5865,6 +5951,54 @@ function requireIndex_development_1 () {
5865
5951
  };
5866
5952
  (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5867
5953
  };
5954
+ RenderDispatchEvent.prototype.onAfterFiberDone = function (cb) {
5955
+ var _a;
5956
+ var set = listenerMap.get(this).afterFiberDone;
5957
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, cb);
5958
+ 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); };
5959
+ };
5960
+ RenderDispatchEvent.prototype.onceAfterFiberDone = function (cb) {
5961
+ var _a;
5962
+ var set = listenerMap.get(this).afterFiberDone;
5963
+ var onceCb = function (_fiber) {
5964
+ var _a;
5965
+ cb(_fiber);
5966
+ (_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5967
+ };
5968
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5969
+ };
5970
+ RenderDispatchEvent.prototype.onBeforeDispatchRender = function (cb) {
5971
+ var _a;
5972
+ var set = listenerMap.get(this).beforeDispatchRender;
5973
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, cb);
5974
+ 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); };
5975
+ };
5976
+ RenderDispatchEvent.prototype.onceBeforeDispatchRender = function (cb) {
5977
+ var _a;
5978
+ var set = listenerMap.get(this).beforeDispatchRender;
5979
+ var onceCb = function (renderDispatch) {
5980
+ var _a;
5981
+ cb(renderDispatch);
5982
+ (_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5983
+ };
5984
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5985
+ };
5986
+ RenderDispatchEvent.prototype.onBeforeDispatchUpdate = function (cb) {
5987
+ var _a;
5988
+ var set = listenerMap.get(this).beforeDispatchUpdate;
5989
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, cb);
5990
+ 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); };
5991
+ };
5992
+ RenderDispatchEvent.prototype.onceBeforeDispatchUpdate = function (cb) {
5993
+ var _a;
5994
+ var set = listenerMap.get(this).beforeDispatchUpdate;
5995
+ var onceCb = function (renderDispatch, list) {
5996
+ var _a;
5997
+ cb(renderDispatch, list);
5998
+ (_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5999
+ };
6000
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
6001
+ };
5868
6002
  RenderDispatchEvent.prototype.onInstanceInitial = function (cb) {
5869
6003
  var set = listenerMap.get(this).instanceInitial;
5870
6004
  set.add(cb);
@@ -5969,78 +6103,78 @@ function requireIndex_development_1 () {
5969
6103
  };
5970
6104
  set.add(onceCb);
5971
6105
  };
5972
- RenderDispatchEvent.prototype.onBeforeCommit = function (cb) {
5973
- var set = listenerMap.get(this).beforeCommit;
6106
+ RenderDispatchEvent.prototype.onBeforeCommitMount = function (cb) {
6107
+ var set = listenerMap.get(this).beforeCommitMount;
5974
6108
  set.add(cb);
5975
6109
  return function () { return set.delete(cb); };
5976
6110
  };
5977
- RenderDispatchEvent.prototype.onceBeforeCommit = function (cb) {
5978
- var set = listenerMap.get(this).beforeCommit;
6111
+ RenderDispatchEvent.prototype.onceBeforeCommitMount = function (cb) {
6112
+ var set = listenerMap.get(this).beforeCommitMount;
5979
6113
  var onceCb = function () {
5980
6114
  cb();
5981
6115
  set.delete(onceCb);
5982
6116
  };
5983
6117
  set.add(onceCb);
5984
6118
  };
5985
- RenderDispatchEvent.prototype.onAfterCommit = function (cb) {
5986
- var set = listenerMap.get(this).afterCommit;
6119
+ RenderDispatchEvent.prototype.onAfterCommitMount = function (cb) {
6120
+ var set = listenerMap.get(this).afterCommitMount;
5987
6121
  set.add(cb);
5988
6122
  return function () { return set.delete(cb); };
5989
6123
  };
5990
- RenderDispatchEvent.prototype.onceAfterCommit = function (cb) {
5991
- var set = listenerMap.get(this).afterCommit;
6124
+ RenderDispatchEvent.prototype.onceAfterCommitMount = function (cb) {
6125
+ var set = listenerMap.get(this).afterCommitMount;
5992
6126
  var onceCb = function () {
5993
6127
  cb();
5994
6128
  set.delete(onceCb);
5995
6129
  };
5996
6130
  set.add(onceCb);
5997
6131
  };
5998
- RenderDispatchEvent.prototype.onBeforeUpdate = function (cb) {
5999
- var set = listenerMap.get(this).beforeUpdate;
6132
+ RenderDispatchEvent.prototype.onBeforeCommitUpdate = function (cb) {
6133
+ var set = listenerMap.get(this).beforeCommitUpdate;
6000
6134
  set.add(cb);
6001
6135
  return function () { return set.delete(cb); };
6002
6136
  };
6003
- RenderDispatchEvent.prototype.onceBeforeUpdate = function (cb) {
6004
- var set = listenerMap.get(this).beforeUpdate;
6137
+ RenderDispatchEvent.prototype.onceBeforeCommitUpdate = function (cb) {
6138
+ var set = listenerMap.get(this).beforeCommitUpdate;
6005
6139
  var onceCb = function () {
6006
6140
  cb();
6007
6141
  set.delete(onceCb);
6008
6142
  };
6009
6143
  set.add(onceCb);
6010
6144
  };
6011
- RenderDispatchEvent.prototype.onAfterUpdate = function (cb) {
6012
- var set = listenerMap.get(this).afterUpdate;
6145
+ RenderDispatchEvent.prototype.onAfterCommitUpdate = function (cb) {
6146
+ var set = listenerMap.get(this).afterCommitUpdate;
6013
6147
  set.add(cb);
6014
6148
  return function () { return set.delete(cb); };
6015
6149
  };
6016
- RenderDispatchEvent.prototype.onceAfterUpdate = function (cb) {
6017
- var set = listenerMap.get(this).afterUpdate;
6150
+ RenderDispatchEvent.prototype.onceAfterCommitUpdate = function (cb) {
6151
+ var set = listenerMap.get(this).afterCommitUpdate;
6018
6152
  var onceCb = function () {
6019
6153
  cb();
6020
6154
  set.delete(onceCb);
6021
6155
  };
6022
6156
  set.add(onceCb);
6023
6157
  };
6024
- RenderDispatchEvent.prototype.onBeforeUnmount = function (cb) {
6025
- var set = listenerMap.get(this).beforeUnmount;
6158
+ RenderDispatchEvent.prototype.onBeforeCommitUnmount = function (cb) {
6159
+ var set = listenerMap.get(this).beforeCommitUnmount;
6026
6160
  set.add(cb);
6027
6161
  return function () { return set.delete(cb); };
6028
6162
  };
6029
- RenderDispatchEvent.prototype.onceBeforeUnmount = function (cb) {
6030
- var set = listenerMap.get(this).beforeUnmount;
6163
+ RenderDispatchEvent.prototype.onceBeforeCommitUnmount = function (cb) {
6164
+ var set = listenerMap.get(this).beforeCommitUnmount;
6031
6165
  var onceCb = function () {
6032
6166
  cb();
6033
6167
  set.delete(onceCb);
6034
6168
  };
6035
6169
  set.add(onceCb);
6036
6170
  };
6037
- RenderDispatchEvent.prototype.onAfterUnmount = function (cb) {
6038
- var set = listenerMap.get(this).afterUnmount;
6171
+ RenderDispatchEvent.prototype.onAfterCommitUnmount = function (cb) {
6172
+ var set = listenerMap.get(this).afterCommitUnmount;
6039
6173
  set.add(cb);
6040
6174
  return function () { return set.delete(cb); };
6041
6175
  };
6042
- RenderDispatchEvent.prototype.onceAfterUnmount = function (cb) {
6043
- var set = listenerMap.get(this).afterUnmount;
6176
+ RenderDispatchEvent.prototype.onceAfterCommitUnmount = function (cb) {
6177
+ var set = listenerMap.get(this).afterCommitUnmount;
6044
6178
  var onceCb = function () {
6045
6179
  cb();
6046
6180
  set.delete(onceCb);
@@ -6077,10 +6211,10 @@ function requireIndex_development_1 () {
6077
6211
 
6078
6212
  var currentScheduler$2 = react.__my_react_internal__.currentScheduler;
6079
6213
  var enableScopeTreeLog$2 = react.__my_react_shared__.enableScopeTreeLog;
6214
+ // TODO improve
6080
6215
  var defaultDispatchMountLatest = function (_dispatch, _fiber) {
6081
- var _list = generateFiberToMountList(_fiber);
6082
6216
  beforeSyncUpdate();
6083
- _list.listToFoot(function invokeUnmountPendingAndInsertionEffectList(_fiber) {
6217
+ var _list = generateFiberToListWithAction(_fiber, function invokeUnmountPendingList(_fiber) {
6084
6218
  defaultInvokeUnmountList(_dispatch, _fiber);
6085
6219
  });
6086
6220
  _list.listToFoot(function invokeInsertionEffectList(_fiber) {
@@ -6326,7 +6460,7 @@ function requireIndex_development_1 () {
6326
6460
  _this.isAppMounted = false;
6327
6461
  _this.isAppCrashed = false;
6328
6462
  _this.isAppUnmounted = false;
6329
- _this.version = "0.3.14";
6463
+ _this.version = "0.3.16";
6330
6464
  _this.mode = "development" ;
6331
6465
  _this.renderMode = "render";
6332
6466
  _this.pendingCommitFiberList = null;
@@ -6470,11 +6604,11 @@ function requireIndex_development_1 () {
6470
6604
  (_a = instance.beforeCommit) === null || _a === void 0 ? void 0 : _a.call(instance);
6471
6605
  });
6472
6606
  safeCall(function safeCallBeforeCommitListener() {
6473
- listenerMap.get(instance).beforeCommit.forEach(function (cb) { return cb(); });
6607
+ listenerMap.get(instance).beforeCommitMount.forEach(function (cb) { return cb(); });
6474
6608
  });
6475
6609
  defaultDispatchMount(this, _fiber);
6476
6610
  safeCall(function safeCallAfterCommitListener() {
6477
- listenerMap.get(instance).afterCommit.forEach(function (cb) { return cb(); });
6611
+ listenerMap.get(instance).afterCommitMount.forEach(function (cb) { return cb(); });
6478
6612
  });
6479
6613
  safeCall(function safeCallAfterCommit() {
6480
6614
  var _a;
@@ -6488,11 +6622,11 @@ function requireIndex_development_1 () {
6488
6622
  (_a = instance.beforeUpdate) === null || _a === void 0 ? void 0 : _a.call(instance);
6489
6623
  });
6490
6624
  safeCall(function safeCallBeforeUpdateListener() {
6491
- listenerMap.get(instance).beforeUpdate.forEach(function (cb) { return cb(); });
6625
+ listenerMap.get(instance).beforeCommitUpdate.forEach(function (cb) { return cb(); });
6492
6626
  });
6493
6627
  defaultDispatchUpdate(this, _list);
6494
6628
  safeCall(function safeCallAfterUpdateListener() {
6495
- listenerMap.get(instance).afterUpdate.forEach(function (cb) { return cb(); });
6629
+ listenerMap.get(instance).afterCommitUpdate.forEach(function (cb) { return cb(); });
6496
6630
  });
6497
6631
  safeCall(function safeCallAfterUpdate() {
6498
6632
  var _a;
@@ -6506,11 +6640,11 @@ function requireIndex_development_1 () {
6506
6640
  (_a = instance.beforeUnmount) === null || _a === void 0 ? void 0 : _a.call(instance);
6507
6641
  });
6508
6642
  safeCall(function safeCallBeforeUnmountListener() {
6509
- listenerMap.get(instance).beforeUnmount.forEach(function (cb) { return cb(); });
6643
+ listenerMap.get(instance).beforeCommitUnmount.forEach(function (cb) { return cb(); });
6510
6644
  });
6511
6645
  defaultDispatchUnmount(this);
6512
6646
  safeCall(function safeCallAfterUnmountListener() {
6513
- listenerMap.get(instance).afterUnmount.forEach(function (cb) { return cb(); });
6647
+ listenerMap.get(instance).afterCommitUnmount.forEach(function (cb) { return cb(); });
6514
6648
  });
6515
6649
  safeCall(function safeCallAfterUnmount() {
6516
6650
  var _a;
@@ -6603,29 +6737,29 @@ function requireIndex_development_1 () {
6603
6737
  });
6604
6738
  var typedFiber = fiber;
6605
6739
  var processedNodes = [];
6740
+ var updater = {
6741
+ type: myreactSharedExports.UpdateQueueType.context,
6742
+ trigger: fiber,
6743
+ payLoad: afterValue,
6744
+ isSync: true,
6745
+ isForce: true,
6746
+ isImmediate: true,
6747
+ isRetrigger: true,
6748
+ };
6606
6749
  if (enableDebugFiled.current) {
6607
- typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new myreactSharedExports.ListTree();
6608
6750
  var now = Date.now();
6609
- var updater = {
6610
- type: myreactSharedExports.UpdateQueueType.context,
6611
- trigger: fiber,
6612
- payLoad: afterValue,
6613
- isSync: true,
6614
- isForce: true,
6615
- isImmediate: true,
6616
- isRetrigger: true,
6617
- _debugBeforeValue: beforeValue,
6618
- _debugAfterValue: afterValue,
6619
- _debugCreateTime: now,
6620
- _debugRunTime: now,
6621
- _debugType: myreactSharedExports.UpdateQueueType[myreactSharedExports.UpdateQueueType.context],
6622
- };
6623
- processedNodes.push(updater);
6751
+ updater._debugBeforeValue = beforeValue;
6752
+ updater._debugAfterValue = afterValue;
6753
+ updater._debugCreateTime = now;
6754
+ updater._debugRunTime = now;
6755
+ updater._debugType = myreactSharedExports.UpdateQueueType[myreactSharedExports.UpdateQueueType.context];
6624
6756
  if (enableDebugUpdateQueue.current) {
6757
+ typedFiber._debugUpdateQueue = typedFiber._debugUpdateQueue || new myreactSharedExports.ListTree();
6625
6758
  typedFiber._debugUpdateQueue.push(updater);
6626
6759
  }
6627
6760
  }
6628
- var devUpdater = {
6761
+ processedNodes.push(updater);
6762
+ var updateState = {
6629
6763
  needUpdate: true,
6630
6764
  nodes: processedNodes,
6631
6765
  isSync: true,
@@ -6637,7 +6771,7 @@ function requireIndex_development_1 () {
6637
6771
  fiber: fiber,
6638
6772
  action: function safeCallFiberTriggerListener() {
6639
6773
  var _a, _b;
6640
- (_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, devUpdater ); });
6774
+ (_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); });
6641
6775
  },
6642
6776
  });
6643
6777
  };
@@ -6698,66 +6832,74 @@ function requireIndex_development_1 () {
6698
6832
 
6699
6833
  var globalLoop = react.__my_react_internal__.globalLoop;
6700
6834
  var enableScopeTreeLog = react.__my_react_shared__.enableScopeTreeLog;
6835
+ function finishMountSync(renderDispatch, fiber) {
6836
+ enableScopeTreeLog.current && setLogScope();
6837
+ renderDispatch.reconcileCommit(fiber);
6838
+ var changedList = renderDispatch.pendingChangedFiberList;
6839
+ renderDispatch.resetUpdateFlowRuntimeFiber();
6840
+ renderDispatch.pendingCommitFiberList = null;
6841
+ renderDispatch.pendingChangedFiberList = null;
6842
+ enableScopeTreeLog.current && resetLogScope();
6843
+ (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
6844
+ safeCallWithCurrentFiber({
6845
+ fiber: fiber,
6846
+ action: function safeCallFiberHasChangeListener() {
6847
+ var _a, _b;
6848
+ (_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); });
6849
+ },
6850
+ });
6851
+ }
6701
6852
  var mountSync = function (renderDispatch, fiber) {
6853
+ var _a, _b, _c;
6854
+ ((_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.beforeDispatchRender) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(renderDispatch); }));
6702
6855
  globalLoop.current = true;
6703
6856
  enableScopeTreeLog.current && setLogScope();
6704
6857
  mountLoopAll(renderDispatch, fiber);
6705
6858
  processAsyncLoadListOnSyncMount(renderDispatch);
6706
6859
  enableScopeTreeLog.current && resetLogScope();
6707
- (function finishMount() {
6708
- enableScopeTreeLog.current && setLogScope();
6709
- renderDispatch.reconcileCommit(fiber);
6710
- var changedList = renderDispatch.pendingChangedFiberList;
6711
- renderDispatch.resetUpdateFlowRuntimeFiber();
6712
- renderDispatch.pendingCommitFiberList = null;
6713
- renderDispatch.pendingChangedFiberList = null;
6714
- enableScopeTreeLog.current && resetLogScope();
6715
- (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
6716
- safeCallWithCurrentFiber({
6717
- fiber: fiber,
6718
- action: function safeCallFiberHasChangeListener() {
6719
- var _a, _b;
6720
- (_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); });
6721
- },
6722
- });
6723
- })();
6860
+ finishMountSync(renderDispatch, fiber);
6861
+ ((_c = listenerMap.get(renderDispatch)) === null || _c === void 0 ? void 0 : _c.afterDispatchRender.forEach(function (cb) { return cb(renderDispatch); }));
6724
6862
  globalLoop.current = false;
6725
6863
  };
6864
+ function finishMountAsync(renderDispatch, fiber) {
6865
+ enableScopeTreeLog.current && setLogScope();
6866
+ renderDispatch.reconcileCommit(fiber);
6867
+ var changedList = renderDispatch.pendingChangedFiberList;
6868
+ renderDispatch.resetUpdateFlowRuntimeFiber();
6869
+ renderDispatch.pendingCommitFiberList = null;
6870
+ renderDispatch.pendingChangedFiberList = null;
6871
+ enableScopeTreeLog.current && resetLogScope();
6872
+ (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
6873
+ safeCallWithCurrentFiber({
6874
+ fiber: fiber,
6875
+ action: function safeCallFiberHasChangeListener() {
6876
+ var _a, _b;
6877
+ (_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); });
6878
+ },
6879
+ });
6880
+ }
6726
6881
  var mountAsync = function (renderDispatch, fiber) { return __awaiter(void 0, void 0, void 0, function () {
6727
- return __generator(this, function (_a) {
6728
- switch (_a.label) {
6882
+ var _a, _b, _c;
6883
+ return __generator(this, function (_d) {
6884
+ switch (_d.label) {
6729
6885
  case 0:
6886
+ ((_b = (_a = listenerMap.get(renderDispatch)) === null || _a === void 0 ? void 0 : _a.beforeDispatchRender) === null || _b === void 0 ? void 0 : _b.forEach(function (cb) { return cb(renderDispatch); }));
6730
6887
  globalLoop.current = true;
6731
6888
  enableScopeTreeLog.current && setLogScope();
6732
6889
  mountLoopAll(renderDispatch, fiber);
6733
6890
  return [4 /*yield*/, processAsyncLoadListOnAsyncMount(renderDispatch)];
6734
6891
  case 1:
6735
- _a.sent();
6736
- enableScopeTreeLog.current && setLogScope();
6737
- (function finishMount() {
6738
- enableScopeTreeLog.current && setLogScope();
6739
- renderDispatch.reconcileCommit(fiber);
6740
- var changedList = renderDispatch.pendingChangedFiberList;
6741
- renderDispatch.resetUpdateFlowRuntimeFiber();
6742
- renderDispatch.pendingCommitFiberList = null;
6743
- renderDispatch.pendingChangedFiberList = null;
6744
- enableScopeTreeLog.current && setLogScope();
6745
- (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
6746
- safeCallWithCurrentFiber({
6747
- fiber: fiber,
6748
- action: function safeCallFiberHasChangeListener() {
6749
- var _a, _b;
6750
- (_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); });
6751
- },
6752
- });
6753
- })();
6892
+ _d.sent();
6893
+ enableScopeTreeLog.current && resetLogScope();
6894
+ finishMountAsync(renderDispatch, fiber);
6895
+ ((_c = listenerMap.get(renderDispatch)) === null || _c === void 0 ? void 0 : _c.afterDispatchRender.forEach(function (cb) { return cb(renderDispatch); }));
6754
6896
  globalLoop.current = false;
6755
6897
  return [2 /*return*/];
6756
6898
  }
6757
6899
  });
6758
6900
  }); };
6759
6901
 
6760
- var version = "0.3.14";
6902
+ var version = "0.3.16";
6761
6903
 
6762
6904
  exports.CustomRenderDispatch = CustomRenderDispatch;
6763
6905
  exports.MyReactFiberNode = MyReactFiberNode;
@@ -6815,6 +6957,7 @@ function requireIndex_development_1 () {
6815
6957
  exports.enableLogForCurrentFlowIsRunning = enableLogForCurrentFlowIsRunning;
6816
6958
  exports.enableValidMyReactElement = enableValidMyReactElement;
6817
6959
  exports.fiberToDispatchMap = fiberToDispatchMap;
6960
+ exports.generateFiberToListWithAction = generateFiberToListWithAction;
6818
6961
  exports.generateFiberToMountList = generateFiberToMountList;
6819
6962
  exports.generateFiberToUnmountList = generateFiberToUnmountList;
6820
6963
  exports.getClassInstanceFieldByInstance = getClassInstanceFieldByInstance;
@@ -6932,7 +7075,6 @@ function requireIndex_development_1 () {
6932
7075
  exports.unmountFiber = unmountFiber;
6933
7076
  exports.unmountFiberNode = unmountFiberNode;
6934
7077
  exports.unmountInstance = unmountInstance;
6935
- exports.unmountList = unmountList;
6936
7078
  exports.updateConcurrentFromRoot = updateConcurrentFromRoot;
6937
7079
  exports.updateFiberNode = updateFiberNode;
6938
7080
  exports.updateHookNode = updateHookNode;
@@ -8121,10 +8263,9 @@ var ReconcilerDispatchFiber = function (renderDispatch, fiber) {
8121
8263
  var currentScheduler$2 = require$$0.__my_react_internal__.currentScheduler;
8122
8264
  var enableScopeTreeLog$3 = require$$0.__my_react_shared__.enableScopeTreeLog;
8123
8265
  var ReconcilerDispatchMount = function (_dispatch, _fiber, config) {
8124
- var _list = myreactReconcilerExports.generateFiberToMountList(_fiber);
8125
8266
  var pendingCommitFiberArray = [];
8126
8267
  myreactReconcilerExports.beforeSyncUpdate();
8127
- _list.listToFoot(function invokeUnmountPendingAndInsertionEffectList(_fiber) {
8268
+ var _list = myreactReconcilerExports.generateFiberToListWithAction(_fiber, function invokeUnmountPendingList(_fiber) {
8128
8269
  myreactReconcilerExports.defaultInvokeUnmountList(_dispatch, _fiber);
8129
8270
  });
8130
8271
  _list.listToFoot(function invokeInsertionEffectList(_fiber) {
@@ -8347,11 +8488,11 @@ var createDispatch = function (rootNode, rootFiber, rootElement, config) {
8347
8488
  (_a = instance.beforeCommit) === null || _a === void 0 ? void 0 : _a.call(instance);
8348
8489
  });
8349
8490
  myreactReconcilerExports.safeCall(function safeCallBeforeCommitListener() {
8350
- myreactReconcilerExports.listenerMap.get(instance).beforeCommit.forEach(function (cb) { return cb(); });
8491
+ myreactReconcilerExports.listenerMap.get(instance).beforeCommitMount.forEach(function (cb) { return cb(); });
8351
8492
  });
8352
8493
  ReconcilerDispatchMount(this, _fiber, config);
8353
8494
  myreactReconcilerExports.safeCall(function safeCallAfterCommitListener() {
8354
- myreactReconcilerExports.listenerMap.get(instance).afterCommit.forEach(function (cb) { return cb(); });
8495
+ myreactReconcilerExports.listenerMap.get(instance).afterCommitMount.forEach(function (cb) { return cb(); });
8355
8496
  });
8356
8497
  myreactReconcilerExports.safeCall(function safeCallAfterCommit() {
8357
8498
  var _a;
@@ -8368,11 +8509,11 @@ var createDispatch = function (rootNode, rootFiber, rootElement, config) {
8368
8509
  (_a = instance.beforeUpdate) === null || _a === void 0 ? void 0 : _a.call(instance);
8369
8510
  });
8370
8511
  myreactReconcilerExports.safeCall(function safeCallBeforeUpdateListener() {
8371
- myreactReconcilerExports.listenerMap.get(instance).beforeUpdate.forEach(function (cb) { return cb(); });
8512
+ myreactReconcilerExports.listenerMap.get(instance).beforeCommitUpdate.forEach(function (cb) { return cb(); });
8372
8513
  });
8373
8514
  ReconcilerDispatchUpdate(this, _list, config);
8374
8515
  myreactReconcilerExports.safeCall(function safeCallAfterUpdateListener() {
8375
- myreactReconcilerExports.listenerMap.get(instance).afterUpdate.forEach(function (cb) { return cb(); });
8516
+ myreactReconcilerExports.listenerMap.get(instance).afterCommitUpdate.forEach(function (cb) { return cb(); });
8376
8517
  });
8377
8518
  myreactReconcilerExports.safeCall(function safeCallAfterUpdate() {
8378
8519
  var _a;
@@ -8499,7 +8640,7 @@ var loadScript = function (url) {
8499
8640
  }
8500
8641
  };
8501
8642
 
8502
- var enableDebugFiled$1 = require$$0.__my_react_shared__.enableDebugFiled, enableScopeTreeLog$1 = require$$0.__my_react_shared__.enableScopeTreeLog;
8643
+ var enableDebugFiled$1 = require$$0.__my_react_shared__.enableDebugFiled, enableScopeTreeLog$1 = require$$0.__my_react_shared__.enableScopeTreeLog /* enableConcurrentMode */;
8503
8644
  /**
8504
8645
  * @internal
8505
8646
  */
@@ -8616,7 +8757,7 @@ var Reconciler = function (_config) {
8616
8757
  };
8617
8758
  };
8618
8759
 
8619
- var version = "0.0.5";
8760
+ var version = "0.0.7";
8620
8761
  var createReconciler = Reconciler;
8621
8762
 
8622
8763
  exports.createReconciler = createReconciler;