@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.
@@ -1335,7 +1335,15 @@ function requireIndex_production_1 () {
1335
1335
  }
1336
1336
  else {
1337
1337
  // text element
1338
- return { key: null, ref: null, nodeType: exports.NODE_TYPE.__text__, elementType: String(element), pendingProps: emptyProps$1, finalElement: element, pendingText: String(element) };
1338
+ return {
1339
+ key: null,
1340
+ ref: null,
1341
+ nodeType: exports.NODE_TYPE.__text__,
1342
+ elementType: String(element),
1343
+ pendingProps: emptyProps$1,
1344
+ finalElement: element,
1345
+ pendingText: String(element),
1346
+ };
1339
1347
  }
1340
1348
  }
1341
1349
  return { key: null, ref: null, nodeType: nodeType, elementType: null, pendingProps: emptyProps$1, finalElement: element };
@@ -1642,8 +1650,11 @@ function requireIndex_production_1 () {
1642
1650
  var generateFiberToMountList = function (fiber) {
1643
1651
  var listTree = new myreactSharedExports.ListTree();
1644
1652
  var getNext = function (fiber, root) {
1645
- if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__))
1646
- return null;
1653
+ if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__)) {
1654
+ if (fiber.sibling)
1655
+ return fiber.sibling;
1656
+ return fiber.parent;
1657
+ }
1647
1658
  if (fiber.child)
1648
1659
  return fiber.child;
1649
1660
  while (fiber && fiber !== root) {
@@ -1664,6 +1675,39 @@ function requireIndex_production_1 () {
1664
1675
  return listTree;
1665
1676
  };
1666
1677
  var generateFiberToUnmountList = generateFiberToMountList;
1678
+ /**
1679
+ *
1680
+ * @param action listToFoot action for performance
1681
+ */
1682
+ var generateFiberToListWithAction = function (fiber, action) {
1683
+ var listTree = new myreactSharedExports.ListTree();
1684
+ var getNext = function (fiber, root) {
1685
+ if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__)) {
1686
+ if (fiber.sibling)
1687
+ return fiber.sibling;
1688
+ return fiber.parent;
1689
+ }
1690
+ if (fiber.child)
1691
+ return fiber.child;
1692
+ while (fiber && fiber !== root) {
1693
+ listTree.push(fiber);
1694
+ action(fiber);
1695
+ if (fiber.sibling)
1696
+ return fiber.sibling;
1697
+ fiber = fiber.parent;
1698
+ }
1699
+ if (fiber === root) {
1700
+ listTree.push(fiber);
1701
+ action(fiber);
1702
+ }
1703
+ return null;
1704
+ };
1705
+ var f = fiber;
1706
+ while (f) {
1707
+ f = getNext(f, fiber);
1708
+ }
1709
+ return listTree;
1710
+ };
1667
1711
 
1668
1712
  var currentRunningFiber$2 = react.__my_react_internal__.currentRunningFiber;
1669
1713
  var mountToNextFiberFromRoot = function (renderDispatch, fiber) {
@@ -1745,7 +1789,11 @@ function requireIndex_production_1 () {
1745
1789
  };
1746
1790
 
1747
1791
  var defaultGenerateEffectMap = function (fiber, effect, map, option) {
1748
- var list = map.get(fiber) || new myreactSharedExports.ListTree();
1792
+ var list = map.get(fiber);
1793
+ if (!list) {
1794
+ list = new myreactSharedExports.ListTree();
1795
+ map.set(fiber, list);
1796
+ }
1749
1797
  if (option) {
1750
1798
  if (option.stickyToHead) {
1751
1799
  list.pushToHead(effect);
@@ -1760,7 +1808,6 @@ function requireIndex_production_1 () {
1760
1808
  else {
1761
1809
  list.push(effect);
1762
1810
  }
1763
- map.set(fiber, list);
1764
1811
  };
1765
1812
  var defaultInvokeEffect = function (renderDispatch, fiber) {
1766
1813
  if (myreactSharedExports.include(fiber.patch, myreactSharedExports.PATCH_TYPE.__effect__)) {
@@ -2038,7 +2085,7 @@ function requireIndex_production_1 () {
2038
2085
  }
2039
2086
  });
2040
2087
  }); })).then(function () {
2041
- var aliveNode = defaultResolveAliveSuspenseFiber(node);
2088
+ var aliveNode = defaultResolveAliveSuspenseFiber(node) || renderDispatch.rootFiber;
2042
2089
  aliveNode.state = myreactSharedExports.STATE_TYPE.__triggerSyncForce__;
2043
2090
  var renderScheduler = currentScheduler$d.current;
2044
2091
  var updater = {
@@ -2596,6 +2643,7 @@ function requireIndex_production_1 () {
2596
2643
  var isImmediate = false;
2597
2644
  var isRetrigger = false;
2598
2645
  var callbacks = [];
2646
+ var processedNodes = [];
2599
2647
  var typedInstance = fiber.instance;
2600
2648
  var baseState = Object.assign({}, fiber.pendingState);
2601
2649
  var baseProps = Object.assign({}, typedInstance.props);
@@ -2606,6 +2654,7 @@ function requireIndex_production_1 () {
2606
2654
  var nextNode = node.next;
2607
2655
  if (updater.type === myreactSharedExports.UpdateQueueType.component && updater.isSync) {
2608
2656
  allQueue.delete(node);
2657
+ processedNodes.push(updater);
2609
2658
  var payLoad_1 = updater.payLoad;
2610
2659
  fiber.pendingState = safeCallWithCurrentFiber({
2611
2660
  fiber: fiber,
@@ -2624,6 +2673,7 @@ function requireIndex_production_1 () {
2624
2673
  }
2625
2674
  else if (updater.isSync) {
2626
2675
  allQueue.delete(node);
2676
+ processedNodes.push(updater);
2627
2677
  isSync = isSync || updater.isSync;
2628
2678
  isForce = isForce || updater.isForce;
2629
2679
  isImmediate = isImmediate || updater.isImmediate;
@@ -2645,16 +2695,15 @@ function requireIndex_production_1 () {
2645
2695
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
2646
2696
  }
2647
2697
  : void 0;
2648
- {
2649
- return {
2650
- needUpdate: needUpdate,
2651
- isSync: isSync,
2652
- isForce: isForce,
2653
- isImmediate: isImmediate,
2654
- isRetrigger: isRetrigger,
2655
- callback: invokeCallbackArray,
2656
- };
2657
- }
2698
+ return {
2699
+ needUpdate: needUpdate,
2700
+ nodes: processedNodes,
2701
+ isSync: isSync,
2702
+ isForce: isForce,
2703
+ isImmediate: isImmediate,
2704
+ isRetrigger: isRetrigger,
2705
+ callback: invokeCallbackArray,
2706
+ };
2658
2707
  }
2659
2708
  else {
2660
2709
  var _loop_2 = function () {
@@ -2662,6 +2711,7 @@ function requireIndex_production_1 () {
2662
2711
  var nextNode = node.next;
2663
2712
  if (updater.type === myreactSharedExports.UpdateQueueType.component) {
2664
2713
  allQueue.delete(node);
2714
+ processedNodes.push(updater);
2665
2715
  var payLoad_2 = updater.payLoad;
2666
2716
  fiber.pendingState = safeCallWithCurrentFiber({
2667
2717
  fiber: fiber,
@@ -2680,6 +2730,7 @@ function requireIndex_production_1 () {
2680
2730
  }
2681
2731
  else {
2682
2732
  allQueue.delete(node);
2733
+ processedNodes.push(updater);
2683
2734
  isSync = isSync || updater.isSync;
2684
2735
  isForce = isForce || updater.isForce;
2685
2736
  isImmediate = isImmediate || updater.isImmediate;
@@ -2696,16 +2747,15 @@ function requireIndex_production_1 () {
2696
2747
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
2697
2748
  }
2698
2749
  : void 0;
2699
- {
2700
- return {
2701
- needUpdate: needUpdate,
2702
- isSync: isSync,
2703
- isForce: isForce,
2704
- isImmediate: isImmediate,
2705
- isRetrigger: isRetrigger,
2706
- callback: invokeCallbackArray,
2707
- };
2708
- }
2750
+ return {
2751
+ needUpdate: needUpdate,
2752
+ nodes: processedNodes,
2753
+ isSync: isSync,
2754
+ isForce: isForce,
2755
+ isImmediate: isImmediate,
2756
+ isRetrigger: isRetrigger,
2757
+ callback: invokeCallbackArray,
2758
+ };
2709
2759
  }
2710
2760
  };
2711
2761
  var processClassComponentUpdateQueueLegacy = function (renderDispatch, fiber) {
@@ -2722,6 +2772,7 @@ function requireIndex_production_1 () {
2722
2772
  var isImmediate = false;
2723
2773
  var isRetrigger = false;
2724
2774
  var callbacks = [];
2775
+ var processedNodes = [];
2725
2776
  var typedInstance = fiber.instance;
2726
2777
  var baseState = Object.assign({}, fiber.pendingState);
2727
2778
  var baseProps = Object.assign({}, typedInstance.props);
@@ -2730,6 +2781,7 @@ function requireIndex_production_1 () {
2730
2781
  var updater = node.value;
2731
2782
  if (updater.type === myreactSharedExports.UpdateQueueType.component) {
2732
2783
  allQueue.delete(node);
2784
+ processedNodes.push(updater);
2733
2785
  var payLoad_3 = updater.payLoad;
2734
2786
  fiber.pendingState = safeCallWithCurrentFiber({
2735
2787
  fiber: fiber,
@@ -2748,6 +2800,7 @@ function requireIndex_production_1 () {
2748
2800
  }
2749
2801
  else {
2750
2802
  allQueue.delete(node);
2803
+ processedNodes.push(updater);
2751
2804
  isSync = isSync || updater.isSync;
2752
2805
  isForce = isForce || updater.isForce;
2753
2806
  isImmediate = isImmediate || updater.isImmediate;
@@ -2765,16 +2818,15 @@ function requireIndex_production_1 () {
2765
2818
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
2766
2819
  }
2767
2820
  : void 0;
2768
- {
2769
- return {
2770
- needUpdate: needUpdate,
2771
- isSync: isSync,
2772
- isForce: isForce,
2773
- isImmediate: isImmediate,
2774
- isRetrigger: isRetrigger,
2775
- callback: invokeCallbackArray,
2776
- };
2777
- }
2821
+ return {
2822
+ needUpdate: needUpdate,
2823
+ nodes: processedNodes,
2824
+ isSync: isSync,
2825
+ isForce: isForce,
2826
+ isImmediate: isImmediate,
2827
+ isRetrigger: isRetrigger,
2828
+ callback: invokeCallbackArray,
2829
+ };
2778
2830
  };
2779
2831
  var processFunctionComponentUpdateQueueLatest = function (renderDispatch, fiber, enableTaskPriority) {
2780
2832
  var _a, _b;
@@ -2791,6 +2843,7 @@ function requireIndex_production_1 () {
2791
2843
  var isForce = false;
2792
2844
  var isImmediate = false;
2793
2845
  var isRetrigger = false;
2846
+ var processedNodes = [];
2794
2847
  var callbacks = [];
2795
2848
  if (enableTaskPriority && allQueue.some(function (l) { return l.isSync; })) {
2796
2849
  var _loop_3 = function () {
@@ -2798,6 +2851,7 @@ function requireIndex_production_1 () {
2798
2851
  var nextNode = node.next;
2799
2852
  if (updater.type === myreactSharedExports.UpdateQueueType.hook && updater.isSync) {
2800
2853
  allQueue.delete(node);
2854
+ processedNodes.push(updater);
2801
2855
  var trigger = updater.trigger, payLoad_4 = updater.payLoad, reducer_1 = updater.reducer;
2802
2856
  var typedTrigger_1 = trigger;
2803
2857
  var lastResult_1 = typedTrigger_1.result;
@@ -2830,6 +2884,7 @@ function requireIndex_production_1 () {
2830
2884
  }
2831
2885
  else if (updater.isSync) {
2832
2886
  allQueue.delete(node);
2887
+ processedNodes.push(updater);
2833
2888
  updater.payLoad;
2834
2889
  isSync = isSync || updater.isSync;
2835
2890
  isForce = isForce || updater.isForce;
@@ -2853,16 +2908,15 @@ function requireIndex_production_1 () {
2853
2908
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
2854
2909
  }
2855
2910
  : void 0;
2856
- {
2857
- return {
2858
- needUpdate: needUpdate,
2859
- isSync: isSync,
2860
- isForce: isForce,
2861
- isImmediate: isImmediate,
2862
- isRetrigger: isRetrigger,
2863
- callback: invokeCallbackArray,
2864
- };
2865
- }
2911
+ return {
2912
+ needUpdate: needUpdate,
2913
+ nodes: processedNodes,
2914
+ isSync: isSync,
2915
+ isForce: isForce,
2916
+ isImmediate: isImmediate,
2917
+ isRetrigger: isRetrigger,
2918
+ callback: invokeCallbackArray,
2919
+ };
2866
2920
  }
2867
2921
  else {
2868
2922
  var _loop_4 = function () {
@@ -2870,6 +2924,7 @@ function requireIndex_production_1 () {
2870
2924
  var nextNode = node.next;
2871
2925
  if (updater.type === myreactSharedExports.UpdateQueueType.hook) {
2872
2926
  allQueue.delete(node);
2927
+ processedNodes.push(updater);
2873
2928
  var trigger = updater.trigger, payLoad_5 = updater.payLoad, reducer_2 = updater.reducer;
2874
2929
  var typedTrigger_2 = trigger;
2875
2930
  var lastResult_2 = typedTrigger_2.result;
@@ -2902,6 +2957,7 @@ function requireIndex_production_1 () {
2902
2957
  }
2903
2958
  else {
2904
2959
  allQueue.delete(node);
2960
+ processedNodes.push(updater);
2905
2961
  updater.payLoad;
2906
2962
  isSync = isSync || updater.isSync;
2907
2963
  isForce = isForce || updater.isForce;
@@ -2920,16 +2976,15 @@ function requireIndex_production_1 () {
2920
2976
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
2921
2977
  }
2922
2978
  : void 0;
2923
- {
2924
- return {
2925
- needUpdate: needUpdate,
2926
- isSync: isSync,
2927
- isForce: isForce,
2928
- isImmediate: isImmediate,
2929
- isRetrigger: isRetrigger,
2930
- callback: invokeCallbackArray,
2931
- };
2932
- }
2979
+ return {
2980
+ needUpdate: needUpdate,
2981
+ nodes: processedNodes,
2982
+ isSync: isSync,
2983
+ isForce: isForce,
2984
+ isImmediate: isImmediate,
2985
+ isRetrigger: isRetrigger,
2986
+ callback: invokeCallbackArray,
2987
+ };
2933
2988
  }
2934
2989
  };
2935
2990
  var processFunctionComponentUpdateQueueLegacy = function (renderDispatch, fiber) {
@@ -2947,11 +3002,13 @@ function requireIndex_production_1 () {
2947
3002
  var isForce = false;
2948
3003
  var isImmediate = false;
2949
3004
  var isRetrigger = false;
3005
+ var processedNodes = [];
2950
3006
  var callbacks = [];
2951
3007
  if (node) {
2952
3008
  var updater = node.value;
2953
3009
  if (updater.type === myreactSharedExports.UpdateQueueType.hook) {
2954
3010
  allQueue.delete(node);
3011
+ processedNodes.push(updater);
2955
3012
  var trigger = updater.trigger, payLoad_6 = updater.payLoad, reducer_3 = updater.reducer;
2956
3013
  var typedTrigger_3 = trigger;
2957
3014
  var lastResult_3 = typedTrigger_3.result;
@@ -2984,6 +3041,7 @@ function requireIndex_production_1 () {
2984
3041
  }
2985
3042
  else {
2986
3043
  allQueue.delete(node);
3044
+ processedNodes.push(updater);
2987
3045
  updater.payLoad;
2988
3046
  isSync = isSync || updater.isSync;
2989
3047
  isForce = isForce || updater.isForce;
@@ -3003,16 +3061,15 @@ function requireIndex_production_1 () {
3003
3061
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
3004
3062
  }
3005
3063
  : void 0;
3006
- {
3007
- return {
3008
- needUpdate: needUpdate,
3009
- isSync: isSync,
3010
- isForce: isForce,
3011
- isImmediate: isImmediate,
3012
- isRetrigger: isRetrigger,
3013
- callback: invokeCallbackArray,
3014
- };
3015
- }
3064
+ return {
3065
+ needUpdate: needUpdate,
3066
+ nodes: processedNodes,
3067
+ isSync: isSync,
3068
+ isForce: isForce,
3069
+ isImmediate: isImmediate,
3070
+ isRetrigger: isRetrigger,
3071
+ callback: invokeCallbackArray,
3072
+ };
3016
3073
  };
3017
3074
  var processNormalComponentUpdateLatest = function (renderDispatch, fiber) {
3018
3075
  if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__))
@@ -3024,11 +3081,13 @@ function requireIndex_production_1 () {
3024
3081
  var isForce = false;
3025
3082
  var isImmediate = false;
3026
3083
  var isRetrigger = false;
3084
+ var processedNodes = [];
3027
3085
  var callbacks = [];
3028
3086
  while (node) {
3029
3087
  var updater = node.value;
3030
3088
  var nextNode = node.next;
3031
3089
  allQueue.delete(node);
3090
+ processedNodes.push(updater);
3032
3091
  updater.payLoad;
3033
3092
  isSync = isSync || updater.isSync;
3034
3093
  isForce = isForce || updater.isForce;
@@ -3042,16 +3101,15 @@ function requireIndex_production_1 () {
3042
3101
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
3043
3102
  }
3044
3103
  : void 0;
3045
- {
3046
- return {
3047
- needUpdate: needUpdate,
3048
- isSync: isSync,
3049
- isForce: isForce,
3050
- isImmediate: isImmediate,
3051
- isRetrigger: isRetrigger,
3052
- callback: invokeCallbackArray,
3053
- };
3054
- }
3104
+ return {
3105
+ needUpdate: needUpdate,
3106
+ nodes: processedNodes,
3107
+ isSync: isSync,
3108
+ isForce: isForce,
3109
+ isImmediate: isImmediate,
3110
+ isRetrigger: isRetrigger,
3111
+ callback: invokeCallbackArray,
3112
+ };
3055
3113
  };
3056
3114
  var processNormalComponentUpdateLegacy = function (renderDispatch, fiber) {
3057
3115
  if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__))
@@ -3064,10 +3122,12 @@ function requireIndex_production_1 () {
3064
3122
  var isForce = false;
3065
3123
  var isImmediate = false;
3066
3124
  var isRetrigger = false;
3125
+ var processedNodes = [];
3067
3126
  var callbacks = [];
3068
3127
  if (node) {
3069
3128
  var updater = node.value;
3070
3129
  allQueue.delete(node);
3130
+ processedNodes.push(updater);
3071
3131
  updater.payLoad;
3072
3132
  isSync = isSync || updater.isSync;
3073
3133
  isForce = isForce || updater.isForce;
@@ -3085,16 +3145,15 @@ function requireIndex_production_1 () {
3085
3145
  return callbacks.forEach(function (cb) { return cb === null || cb === void 0 ? void 0 : cb(); });
3086
3146
  }
3087
3147
  : void 0;
3088
- {
3089
- return {
3090
- needUpdate: needUpdate,
3091
- isSync: isSync,
3092
- isForce: isForce,
3093
- isImmediate: isImmediate,
3094
- isRetrigger: isRetrigger,
3095
- callback: invokeCallbackArray,
3096
- };
3097
- }
3148
+ return {
3149
+ needUpdate: needUpdate,
3150
+ nodes: processedNodes,
3151
+ isSync: isSync,
3152
+ isForce: isForce,
3153
+ isImmediate: isImmediate,
3154
+ isRetrigger: isRetrigger,
3155
+ callback: invokeCallbackArray,
3156
+ };
3098
3157
  };
3099
3158
  /**
3100
3159
  * @deprecated
@@ -3175,9 +3234,12 @@ function requireIndex_production_1 () {
3175
3234
  };
3176
3235
 
3177
3236
  var defaultGenerateUnmountMap = function (fiber, unmount, map) {
3178
- var list = map.get(fiber) || new myreactSharedExports.ListTree();
3179
- var newList = generateFiberToUnmountList(unmount);
3180
- map.set(fiber, list.concat(newList));
3237
+ var list = map.get(fiber);
3238
+ if (!list) {
3239
+ list = new myreactSharedExports.ListTree();
3240
+ map.set(fiber, list);
3241
+ }
3242
+ list.push(unmount);
3181
3243
  };
3182
3244
  var defaultDispatchUnmount = function (renderDispatch) {
3183
3245
  if (renderDispatch.isAppUnmounted)
@@ -3189,35 +3251,33 @@ function requireIndex_production_1 () {
3189
3251
  var defaultInvokeUnmountList = function (renderDispatch, fiber) {
3190
3252
  if (myreactSharedExports.include(fiber.patch, myreactSharedExports.PATCH_TYPE.__unmount__)) {
3191
3253
  var unmountMap = renderDispatch.runtimeMap.unmountMap;
3192
- var allUnmount_1 = unmountMap.get(fiber);
3254
+ var allUnmount = unmountMap.get(fiber);
3193
3255
  unmountMap.delete(fiber);
3194
- if (allUnmount_1 && allUnmount_1.length)
3195
- safeCallWithCurrentFiber({
3196
- fiber: fiber,
3197
- action: function safeCallUnmountList() {
3198
- unmountList(renderDispatch, allUnmount_1);
3199
- },
3256
+ if (allUnmount && allUnmount.length) {
3257
+ allUnmount.listToFoot(function invokeUnmountFromCurrent(unmount) {
3258
+ safeCallWithCurrentFiber({
3259
+ fiber: unmount,
3260
+ action: function safeCallUnmountFromCurrent() {
3261
+ unmountFiber(renderDispatch, unmount);
3262
+ },
3263
+ });
3200
3264
  });
3265
+ }
3201
3266
  fiber.patch = myreactSharedExports.remove(fiber.patch, myreactSharedExports.PATCH_TYPE.__unmount__);
3202
3267
  }
3203
3268
  };
3204
3269
 
3205
- var unmountList = function (renderDispatch, list) {
3206
- // will happen when app crash
3207
- list.listToFoot(function invokeUnmountPendingList(f) {
3270
+ // unmount current fiber
3271
+ var unmountFiber = function (renderDispatch, fiber) {
3272
+ if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__))
3273
+ return;
3274
+ var list = generateFiberToListWithAction(fiber, function invokeUnmountPending(f) {
3208
3275
  defaultInvokeUnmountList(renderDispatch, f);
3209
3276
  });
3210
3277
  list.listToFoot(function invokeFiberUnmountList(f) {
3211
3278
  unmountFiberNode(renderDispatch, f);
3212
3279
  });
3213
3280
  };
3214
- // unmount current fiber
3215
- var unmountFiber = function (renderDispatch, fiber) {
3216
- if (myreactSharedExports.include(fiber.state, myreactSharedExports.STATE_TYPE.__unmount__))
3217
- return;
3218
- var list = generateFiberToUnmountList(fiber);
3219
- unmountList(renderDispatch, list);
3220
- };
3221
3281
  // unmount current container with safe
3222
3282
  var unmountContainer = function (renderDispatch, cb) {
3223
3283
  renderDispatch.reconcileUnmount();
@@ -3400,6 +3460,22 @@ function requireIndex_production_1 () {
3400
3460
  scheduleNext(renderDispatch);
3401
3461
  }
3402
3462
  };
3463
+ var scheduleOther = function (renderDispatch) {
3464
+ var _a;
3465
+ var renderScheduler = currentScheduler$a.current;
3466
+ if (!renderScheduler.dispatchSet || ((_a = renderScheduler.dispatchSet) === null || _a === void 0 ? void 0 : _a.length) === 1)
3467
+ return;
3468
+ var allDispatch = renderScheduler.dispatchSet;
3469
+ var hasPending = allDispatch
3470
+ .getAll()
3471
+ .find(function (d) { return d !== renderDispatch && d.isAppMounted && d.enableUpdate && !d.isAppCrashed && !d.isAppUnmounted && d.pendingUpdateFiberArray.length; });
3472
+ if (hasPending) {
3473
+ scheduleUpdate(hasPending);
3474
+ }
3475
+ else {
3476
+ globalLoop$2.current = false;
3477
+ }
3478
+ };
3403
3479
  var scheduleNext = function (renderDispatch) {
3404
3480
  var _a;
3405
3481
  if (!renderDispatch.isAppUnmounted && !renderDispatch.isAppCrashed && renderDispatch.enableUpdate && renderDispatch.pendingUpdateFiberArray.length) {
@@ -3422,7 +3498,7 @@ function requireIndex_production_1 () {
3422
3498
  };
3423
3499
  var scheduleUpdate = function (renderDispatch) {
3424
3500
  if (renderDispatch.isAppUnmounted) {
3425
- scheduleNext(renderDispatch);
3501
+ scheduleOther(renderDispatch);
3426
3502
  return;
3427
3503
  }
3428
3504
  scheduleUpdateFromRoot(renderDispatch);
@@ -3430,66 +3506,97 @@ function requireIndex_production_1 () {
3430
3506
 
3431
3507
  var globalLoop$1 = react.__my_react_internal__.globalLoop, currentScheduler$9 = react.__my_react_internal__.currentScheduler;
3432
3508
  react.__my_react_shared__.enableScopeTreeLog;
3509
+ function finishUpdateSyncFromRoot(renderDispatch) {
3510
+ var commitList = renderDispatch.pendingCommitFiberList;
3511
+ var changedList = renderDispatch.pendingChangedFiberList;
3512
+ renderDispatch.resetUpdateFlowRuntimeFiber();
3513
+ renderDispatch.pendingCommitFiberList = null;
3514
+ renderDispatch.pendingChangedFiberList = null;
3515
+ (commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
3516
+ (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
3517
+ safeCall(function safeCallFiberHasChangeListener() {
3518
+ var _a, _b;
3519
+ (_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); });
3520
+ });
3521
+ }
3433
3522
  var updateSyncFromRoot = function (renderDispatch) {
3434
3523
  globalLoop$1.current = true;
3435
3524
  var renderScheduler = currentScheduler$9.current;
3436
3525
  updateLoopSyncFromRoot(renderDispatch);
3437
3526
  processAsyncLoadListOnUpdate(renderDispatch);
3438
- (function finishUpdateSyncFromRoot() {
3439
- var commitList = renderDispatch.pendingCommitFiberList;
3440
- var changedList = renderDispatch.pendingChangedFiberList;
3441
- renderDispatch.resetUpdateFlowRuntimeFiber();
3442
- renderDispatch.pendingCommitFiberList = null;
3443
- renderDispatch.pendingChangedFiberList = null;
3444
- (commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
3445
- (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
3446
- safeCall(function safeCallFiberHasChangeListener() {
3447
- var _a, _b;
3448
- (_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); });
3449
- });
3450
- })();
3527
+ finishUpdateSyncFromRoot(renderDispatch);
3451
3528
  renderScheduler.microTask(function callScheduleNext() {
3452
3529
  globalLoop$1.current = false;
3453
3530
  scheduleNext(renderDispatch);
3454
3531
  });
3455
3532
  };
3533
+ function finishUpdateConcurrentFromRoot(renderDispatch) {
3534
+ var commitList = renderDispatch.pendingCommitFiberList;
3535
+ var changedList = renderDispatch.pendingChangedFiberList;
3536
+ renderDispatch.resetUpdateFlowRuntimeFiber();
3537
+ renderDispatch.pendingCommitFiberList = null;
3538
+ renderDispatch.pendingChangedFiberList = null;
3539
+ (commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
3540
+ (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
3541
+ safeCall(function safeCallFiberHasChangeListener() {
3542
+ var _a, _b;
3543
+ (_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); });
3544
+ });
3545
+ }
3546
+ function checkNextFiberIsSync(renderDispatch) {
3547
+ return myreactSharedExports.include(renderDispatch.runtimeFiber.nextWorkingFiber.state, myreactSharedExports.STATE_TYPE.__triggerSync__ | myreactSharedExports.STATE_TYPE.__triggerSyncForce__);
3548
+ // include(renderDispatch.runtimeFiber.nextWorkingFiber.state, STATE_TYPE.__retrigger__)
3549
+ }
3550
+ function updateConCurrentNextFrame(renderDispatch) {
3551
+ var renderScheduler = currentScheduler$9.current;
3552
+ var hasSync = updateLoopConcurrentFromRoot(renderDispatch);
3553
+ if (renderDispatch.runtimeFiber.nextWorkingFiber) {
3554
+ if (hasSync || checkNextFiberIsSync(renderDispatch)) {
3555
+ updateSyncFromRoot(renderDispatch);
3556
+ }
3557
+ else {
3558
+ renderScheduler.yieldTask(function resumeUpdateConcurrentFromRoot() {
3559
+ if (hasSync || checkNextFiberIsSync(renderDispatch)) {
3560
+ updateSyncFromRoot(renderDispatch);
3561
+ }
3562
+ else {
3563
+ updateConCurrentNextFrame(renderDispatch);
3564
+ }
3565
+ });
3566
+ }
3567
+ }
3568
+ else {
3569
+ processAsyncLoadListOnUpdate(renderDispatch);
3570
+ finishUpdateConcurrentFromRoot(renderDispatch);
3571
+ renderScheduler.microTask(function callScheduleNext() {
3572
+ // TODO! flash all effect
3573
+ globalLoop$1.current = false;
3574
+ scheduleNext(renderDispatch);
3575
+ });
3576
+ }
3577
+ }
3456
3578
  var updateConcurrentFromRoot = function (renderDispatch) {
3457
3579
  globalLoop$1.current = true;
3458
3580
  var renderScheduler = currentScheduler$9.current;
3459
3581
  var hasSync = updateLoopConcurrentFromRoot(renderDispatch);
3460
3582
  if (renderDispatch.runtimeFiber.nextWorkingFiber) {
3461
- var checkCurrentIsSync_1 = function () {
3462
- return hasSync || myreactSharedExports.include(renderDispatch.runtimeFiber.nextWorkingFiber.state, myreactSharedExports.STATE_TYPE.__triggerSync__ | myreactSharedExports.STATE_TYPE.__triggerSyncForce__);
3463
- };
3464
- if (checkCurrentIsSync_1()) {
3583
+ if (hasSync || checkNextFiberIsSync(renderDispatch)) {
3465
3584
  updateSyncFromRoot(renderDispatch);
3466
3585
  }
3467
3586
  else {
3468
3587
  renderScheduler.yieldTask(function resumeUpdateConcurrentFromRoot() {
3469
- if (checkCurrentIsSync_1()) {
3588
+ if (hasSync || checkNextFiberIsSync(renderDispatch)) {
3470
3589
  updateSyncFromRoot(renderDispatch);
3471
3590
  }
3472
3591
  else {
3473
- updateConcurrentFromRoot(renderDispatch);
3592
+ updateConCurrentNextFrame(renderDispatch);
3474
3593
  }
3475
3594
  });
3476
3595
  }
3477
3596
  }
3478
3597
  else {
3479
3598
  processAsyncLoadListOnUpdate(renderDispatch);
3480
- (function finishUpdateConcurrentFromRoot() {
3481
- var commitList = renderDispatch.pendingCommitFiberList;
3482
- var changedList = renderDispatch.pendingChangedFiberList;
3483
- renderDispatch.resetUpdateFlowRuntimeFiber();
3484
- renderDispatch.pendingCommitFiberList = null;
3485
- renderDispatch.pendingChangedFiberList = null;
3486
- (commitList === null || commitList === void 0 ? void 0 : commitList.length) && renderDispatch.reconcileUpdate(commitList);
3487
- (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
3488
- safeCall(function safeCallFiberHasChangeListener() {
3489
- var _a, _b;
3490
- (_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); });
3491
- });
3492
- })();
3599
+ finishUpdateConcurrentFromRoot(renderDispatch);
3493
3600
  renderScheduler.microTask(function callScheduleNext() {
3494
3601
  // TODO! flash all effect
3495
3602
  globalLoop$1.current = false;
@@ -3714,7 +3821,7 @@ function requireIndex_production_1 () {
3714
3821
  var nextValue = mergeFunc(newValue, hookNode.result.value.value);
3715
3822
  var payloadRef = { current: function (last) { return ({ value: nextValue, start: last.start }); } };
3716
3823
  hookNode._update({ isForce: true, isSync: true, payLoad: function (last) { return payloadRef.current(last); } });
3717
- hookNode.cancel = function () { return payloadRef.current = function (last) { return last; }; };
3824
+ hookNode.cancel = function () { return (payloadRef.current = function (last) { return last; }); };
3718
3825
  },
3719
3826
  };
3720
3827
  }
@@ -4446,7 +4553,7 @@ function requireIndex_production_1 () {
4446
4553
  return createFiberNode(renderDispatch, { parent: parentFiber }, newChild);
4447
4554
  };
4448
4555
  var transformChildrenFiber = function (renderDispatch, parentFiber, children) {
4449
- var isUpdate = myreactSharedExports.exclude(parentFiber.state, myreactSharedExports.STATE_TYPE.__create__) && renderDispatch.isAppMounted;
4556
+ var isUpdate = myreactSharedExports.exclude(parentFiber.state, myreactSharedExports.STATE_TYPE.__create__);
4450
4557
  var isHMR = myreactSharedExports.include(parentFiber.state, myreactSharedExports.STATE_TYPE.__hmr__);
4451
4558
  var isRetrigger = myreactSharedExports.include(parentFiber.state, myreactSharedExports.STATE_TYPE.__retrigger__);
4452
4559
  // is current is retrigger update, skip update children
@@ -4501,7 +4608,7 @@ function requireIndex_production_1 () {
4501
4608
  var prevProps = fiber.memoizedProps.value;
4502
4609
  var nextProps = fiber.pendingProps.value;
4503
4610
  if (!myreactSharedExports.isNormalEquals(prevProps, nextProps)) {
4504
- prepareUpdateAllDependence(renderDispatch, fiber);
4611
+ prepareUpdateAllDependence(renderDispatch, fiber, prevProps, nextProps);
4505
4612
  }
4506
4613
  }
4507
4614
  };
@@ -4979,12 +5086,12 @@ function requireIndex_production_1 () {
4979
5086
  hookUpdate: new Set(),
4980
5087
  hookState: new Set(),
4981
5088
  hookUnmount: new Set(),
4982
- beforeCommit: new Set(),
4983
- afterCommit: new Set(),
4984
- beforeUpdate: new Set(),
4985
- afterUpdate: new Set(),
4986
- beforeUnmount: new Set(),
4987
- afterUnmount: new Set(),
5089
+ beforeCommitMount: new Set(),
5090
+ afterCommitMount: new Set(),
5091
+ beforeCommitUpdate: new Set(),
5092
+ afterCommitUpdate: new Set(),
5093
+ beforeCommitUnmount: new Set(),
5094
+ afterCommitUnmount: new Set(),
4988
5095
  };
4989
5096
  };
4990
5097
  var getInitialMap = function () { return ({
@@ -5280,6 +5387,54 @@ function requireIndex_production_1 () {
5280
5387
  };
5281
5388
  (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5282
5389
  };
5390
+ RenderDispatchEvent.prototype.onAfterFiberDone = function (cb) {
5391
+ var _a;
5392
+ var set = listenerMap.get(this).afterFiberDone;
5393
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, cb);
5394
+ 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); };
5395
+ };
5396
+ RenderDispatchEvent.prototype.onceAfterFiberDone = function (cb) {
5397
+ var _a;
5398
+ var set = listenerMap.get(this).afterFiberDone;
5399
+ var onceCb = function (_fiber) {
5400
+ var _a;
5401
+ cb(_fiber);
5402
+ (_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5403
+ };
5404
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5405
+ };
5406
+ RenderDispatchEvent.prototype.onBeforeDispatchRender = function (cb) {
5407
+ var _a;
5408
+ var set = listenerMap.get(this).beforeDispatchRender;
5409
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, cb);
5410
+ 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); };
5411
+ };
5412
+ RenderDispatchEvent.prototype.onceBeforeDispatchRender = function (cb) {
5413
+ var _a;
5414
+ var set = listenerMap.get(this).beforeDispatchRender;
5415
+ var onceCb = function (renderDispatch) {
5416
+ var _a;
5417
+ cb(renderDispatch);
5418
+ (_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5419
+ };
5420
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5421
+ };
5422
+ RenderDispatchEvent.prototype.onBeforeDispatchUpdate = function (cb) {
5423
+ var _a;
5424
+ var set = listenerMap.get(this).beforeDispatchUpdate;
5425
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, cb);
5426
+ 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); };
5427
+ };
5428
+ RenderDispatchEvent.prototype.onceBeforeDispatchUpdate = function (cb) {
5429
+ var _a;
5430
+ var set = listenerMap.get(this).beforeDispatchUpdate;
5431
+ var onceCb = function (renderDispatch, list) {
5432
+ var _a;
5433
+ cb(renderDispatch, list);
5434
+ (_a = set === null || set === void 0 ? void 0 : set.delete) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5435
+ };
5436
+ (_a = set === null || set === void 0 ? void 0 : set.add) === null || _a === void 0 ? void 0 : _a.call(set, onceCb);
5437
+ };
5283
5438
  RenderDispatchEvent.prototype.onInstanceInitial = function (cb) {
5284
5439
  var set = listenerMap.get(this).instanceInitial;
5285
5440
  set.add(cb);
@@ -5384,78 +5539,78 @@ function requireIndex_production_1 () {
5384
5539
  };
5385
5540
  set.add(onceCb);
5386
5541
  };
5387
- RenderDispatchEvent.prototype.onBeforeCommit = function (cb) {
5388
- var set = listenerMap.get(this).beforeCommit;
5542
+ RenderDispatchEvent.prototype.onBeforeCommitMount = function (cb) {
5543
+ var set = listenerMap.get(this).beforeCommitMount;
5389
5544
  set.add(cb);
5390
5545
  return function () { return set.delete(cb); };
5391
5546
  };
5392
- RenderDispatchEvent.prototype.onceBeforeCommit = function (cb) {
5393
- var set = listenerMap.get(this).beforeCommit;
5547
+ RenderDispatchEvent.prototype.onceBeforeCommitMount = function (cb) {
5548
+ var set = listenerMap.get(this).beforeCommitMount;
5394
5549
  var onceCb = function () {
5395
5550
  cb();
5396
5551
  set.delete(onceCb);
5397
5552
  };
5398
5553
  set.add(onceCb);
5399
5554
  };
5400
- RenderDispatchEvent.prototype.onAfterCommit = function (cb) {
5401
- var set = listenerMap.get(this).afterCommit;
5555
+ RenderDispatchEvent.prototype.onAfterCommitMount = function (cb) {
5556
+ var set = listenerMap.get(this).afterCommitMount;
5402
5557
  set.add(cb);
5403
5558
  return function () { return set.delete(cb); };
5404
5559
  };
5405
- RenderDispatchEvent.prototype.onceAfterCommit = function (cb) {
5406
- var set = listenerMap.get(this).afterCommit;
5560
+ RenderDispatchEvent.prototype.onceAfterCommitMount = function (cb) {
5561
+ var set = listenerMap.get(this).afterCommitMount;
5407
5562
  var onceCb = function () {
5408
5563
  cb();
5409
5564
  set.delete(onceCb);
5410
5565
  };
5411
5566
  set.add(onceCb);
5412
5567
  };
5413
- RenderDispatchEvent.prototype.onBeforeUpdate = function (cb) {
5414
- var set = listenerMap.get(this).beforeUpdate;
5568
+ RenderDispatchEvent.prototype.onBeforeCommitUpdate = function (cb) {
5569
+ var set = listenerMap.get(this).beforeCommitUpdate;
5415
5570
  set.add(cb);
5416
5571
  return function () { return set.delete(cb); };
5417
5572
  };
5418
- RenderDispatchEvent.prototype.onceBeforeUpdate = function (cb) {
5419
- var set = listenerMap.get(this).beforeUpdate;
5573
+ RenderDispatchEvent.prototype.onceBeforeCommitUpdate = function (cb) {
5574
+ var set = listenerMap.get(this).beforeCommitUpdate;
5420
5575
  var onceCb = function () {
5421
5576
  cb();
5422
5577
  set.delete(onceCb);
5423
5578
  };
5424
5579
  set.add(onceCb);
5425
5580
  };
5426
- RenderDispatchEvent.prototype.onAfterUpdate = function (cb) {
5427
- var set = listenerMap.get(this).afterUpdate;
5581
+ RenderDispatchEvent.prototype.onAfterCommitUpdate = function (cb) {
5582
+ var set = listenerMap.get(this).afterCommitUpdate;
5428
5583
  set.add(cb);
5429
5584
  return function () { return set.delete(cb); };
5430
5585
  };
5431
- RenderDispatchEvent.prototype.onceAfterUpdate = function (cb) {
5432
- var set = listenerMap.get(this).afterUpdate;
5586
+ RenderDispatchEvent.prototype.onceAfterCommitUpdate = function (cb) {
5587
+ var set = listenerMap.get(this).afterCommitUpdate;
5433
5588
  var onceCb = function () {
5434
5589
  cb();
5435
5590
  set.delete(onceCb);
5436
5591
  };
5437
5592
  set.add(onceCb);
5438
5593
  };
5439
- RenderDispatchEvent.prototype.onBeforeUnmount = function (cb) {
5440
- var set = listenerMap.get(this).beforeUnmount;
5594
+ RenderDispatchEvent.prototype.onBeforeCommitUnmount = function (cb) {
5595
+ var set = listenerMap.get(this).beforeCommitUnmount;
5441
5596
  set.add(cb);
5442
5597
  return function () { return set.delete(cb); };
5443
5598
  };
5444
- RenderDispatchEvent.prototype.onceBeforeUnmount = function (cb) {
5445
- var set = listenerMap.get(this).beforeUnmount;
5599
+ RenderDispatchEvent.prototype.onceBeforeCommitUnmount = function (cb) {
5600
+ var set = listenerMap.get(this).beforeCommitUnmount;
5446
5601
  var onceCb = function () {
5447
5602
  cb();
5448
5603
  set.delete(onceCb);
5449
5604
  };
5450
5605
  set.add(onceCb);
5451
5606
  };
5452
- RenderDispatchEvent.prototype.onAfterUnmount = function (cb) {
5453
- var set = listenerMap.get(this).afterUnmount;
5607
+ RenderDispatchEvent.prototype.onAfterCommitUnmount = function (cb) {
5608
+ var set = listenerMap.get(this).afterCommitUnmount;
5454
5609
  set.add(cb);
5455
5610
  return function () { return set.delete(cb); };
5456
5611
  };
5457
- RenderDispatchEvent.prototype.onceAfterUnmount = function (cb) {
5458
- var set = listenerMap.get(this).afterUnmount;
5612
+ RenderDispatchEvent.prototype.onceAfterCommitUnmount = function (cb) {
5613
+ var set = listenerMap.get(this).afterCommitUnmount;
5459
5614
  var onceCb = function () {
5460
5615
  cb();
5461
5616
  set.delete(onceCb);
@@ -5492,10 +5647,10 @@ function requireIndex_production_1 () {
5492
5647
 
5493
5648
  var currentScheduler$2 = react.__my_react_internal__.currentScheduler;
5494
5649
  react.__my_react_shared__.enableScopeTreeLog;
5650
+ // TODO improve
5495
5651
  var defaultDispatchMountLatest = function (_dispatch, _fiber) {
5496
- var _list = generateFiberToMountList(_fiber);
5497
5652
  beforeSyncUpdate();
5498
- _list.listToFoot(function invokeUnmountPendingAndInsertionEffectList(_fiber) {
5653
+ var _list = generateFiberToListWithAction(_fiber, function invokeUnmountPendingList(_fiber) {
5499
5654
  defaultInvokeUnmountList(_dispatch, _fiber);
5500
5655
  });
5501
5656
  _list.listToFoot(function invokeInsertionEffectList(_fiber) {
@@ -5716,7 +5871,7 @@ function requireIndex_production_1 () {
5716
5871
  _this.isAppMounted = false;
5717
5872
  _this.isAppCrashed = false;
5718
5873
  _this.isAppUnmounted = false;
5719
- _this.version = "0.3.14";
5874
+ _this.version = "0.3.16";
5720
5875
  _this.mode = "production";
5721
5876
  _this.renderMode = "render";
5722
5877
  _this.pendingCommitFiberList = null;
@@ -5860,11 +6015,11 @@ function requireIndex_production_1 () {
5860
6015
  (_a = instance.beforeCommit) === null || _a === void 0 ? void 0 : _a.call(instance);
5861
6016
  });
5862
6017
  safeCall(function safeCallBeforeCommitListener() {
5863
- listenerMap.get(instance).beforeCommit.forEach(function (cb) { return cb(); });
6018
+ listenerMap.get(instance).beforeCommitMount.forEach(function (cb) { return cb(); });
5864
6019
  });
5865
6020
  defaultDispatchMount(this, _fiber);
5866
6021
  safeCall(function safeCallAfterCommitListener() {
5867
- listenerMap.get(instance).afterCommit.forEach(function (cb) { return cb(); });
6022
+ listenerMap.get(instance).afterCommitMount.forEach(function (cb) { return cb(); });
5868
6023
  });
5869
6024
  safeCall(function safeCallAfterCommit() {
5870
6025
  var _a;
@@ -5878,11 +6033,11 @@ function requireIndex_production_1 () {
5878
6033
  (_a = instance.beforeUpdate) === null || _a === void 0 ? void 0 : _a.call(instance);
5879
6034
  });
5880
6035
  safeCall(function safeCallBeforeUpdateListener() {
5881
- listenerMap.get(instance).beforeUpdate.forEach(function (cb) { return cb(); });
6036
+ listenerMap.get(instance).beforeCommitUpdate.forEach(function (cb) { return cb(); });
5882
6037
  });
5883
6038
  defaultDispatchUpdate(this, _list);
5884
6039
  safeCall(function safeCallAfterUpdateListener() {
5885
- listenerMap.get(instance).afterUpdate.forEach(function (cb) { return cb(); });
6040
+ listenerMap.get(instance).afterCommitUpdate.forEach(function (cb) { return cb(); });
5886
6041
  });
5887
6042
  safeCall(function safeCallAfterUpdate() {
5888
6043
  var _a;
@@ -5896,11 +6051,11 @@ function requireIndex_production_1 () {
5896
6051
  (_a = instance.beforeUnmount) === null || _a === void 0 ? void 0 : _a.call(instance);
5897
6052
  });
5898
6053
  safeCall(function safeCallBeforeUnmountListener() {
5899
- listenerMap.get(instance).beforeUnmount.forEach(function (cb) { return cb(); });
6054
+ listenerMap.get(instance).beforeCommitUnmount.forEach(function (cb) { return cb(); });
5900
6055
  });
5901
6056
  defaultDispatchUnmount(this);
5902
6057
  safeCall(function safeCallAfterUnmountListener() {
5903
- listenerMap.get(instance).afterUnmount.forEach(function (cb) { return cb(); });
6058
+ listenerMap.get(instance).afterCommitUnmount.forEach(function (cb) { return cb(); });
5904
6059
  });
5905
6060
  safeCall(function safeCallAfterUnmount() {
5906
6061
  var _a;
@@ -5991,8 +6146,20 @@ function requireIndex_production_1 () {
5991
6146
  typedFiber_1.state = myreactSharedExports.STATE_TYPE.__triggerSyncForce__;
5992
6147
  }
5993
6148
  });
5994
- var proUpdater = {
6149
+ var processedNodes = [];
6150
+ var updater = {
6151
+ type: myreactSharedExports.UpdateQueueType.context,
6152
+ trigger: fiber,
6153
+ payLoad: afterValue,
6154
+ isSync: true,
6155
+ isForce: true,
6156
+ isImmediate: true,
6157
+ isRetrigger: true,
6158
+ };
6159
+ processedNodes.push(updater);
6160
+ var updateState = {
5995
6161
  needUpdate: true,
6162
+ nodes: processedNodes,
5996
6163
  isSync: true,
5997
6164
  isForce: true,
5998
6165
  isImmediate: true,
@@ -6002,7 +6169,7 @@ function requireIndex_production_1 () {
6002
6169
  fiber: fiber,
6003
6170
  action: function safeCallFiberTriggerListener() {
6004
6171
  var _a, _b;
6005
- (_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, proUpdater); });
6172
+ (_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); });
6006
6173
  },
6007
6174
  });
6008
6175
  };
@@ -6063,58 +6230,60 @@ function requireIndex_production_1 () {
6063
6230
 
6064
6231
  var globalLoop = react.__my_react_internal__.globalLoop;
6065
6232
  react.__my_react_shared__.enableScopeTreeLog;
6233
+ function finishMountSync(renderDispatch, fiber) {
6234
+ renderDispatch.reconcileCommit(fiber);
6235
+ var changedList = renderDispatch.pendingChangedFiberList;
6236
+ renderDispatch.resetUpdateFlowRuntimeFiber();
6237
+ renderDispatch.pendingCommitFiberList = null;
6238
+ renderDispatch.pendingChangedFiberList = null;
6239
+ (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
6240
+ safeCallWithCurrentFiber({
6241
+ fiber: fiber,
6242
+ action: function safeCallFiberHasChangeListener() {
6243
+ var _a, _b;
6244
+ (_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); });
6245
+ },
6246
+ });
6247
+ }
6066
6248
  var mountSync = function (renderDispatch, fiber) {
6067
6249
  globalLoop.current = true;
6068
6250
  mountLoopAll(renderDispatch, fiber);
6069
6251
  processAsyncLoadListOnSyncMount(renderDispatch);
6070
- (function finishMount() {
6071
- renderDispatch.reconcileCommit(fiber);
6072
- var changedList = renderDispatch.pendingChangedFiberList;
6073
- renderDispatch.resetUpdateFlowRuntimeFiber();
6074
- renderDispatch.pendingCommitFiberList = null;
6075
- renderDispatch.pendingChangedFiberList = null;
6076
- (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
6077
- safeCallWithCurrentFiber({
6078
- fiber: fiber,
6079
- action: function safeCallFiberHasChangeListener() {
6080
- var _a, _b;
6081
- (_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); });
6082
- },
6083
- });
6084
- })();
6252
+ finishMountSync(renderDispatch, fiber);
6085
6253
  globalLoop.current = false;
6086
6254
  };
6255
+ function finishMountAsync(renderDispatch, fiber) {
6256
+ renderDispatch.reconcileCommit(fiber);
6257
+ var changedList = renderDispatch.pendingChangedFiberList;
6258
+ renderDispatch.resetUpdateFlowRuntimeFiber();
6259
+ renderDispatch.pendingCommitFiberList = null;
6260
+ renderDispatch.pendingChangedFiberList = null;
6261
+ (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
6262
+ safeCallWithCurrentFiber({
6263
+ fiber: fiber,
6264
+ action: function safeCallFiberHasChangeListener() {
6265
+ var _a, _b;
6266
+ (_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); });
6267
+ },
6268
+ });
6269
+ }
6087
6270
  var mountAsync = function (renderDispatch, fiber) { return __awaiter(void 0, void 0, void 0, function () {
6088
- return __generator(this, function (_a) {
6089
- switch (_a.label) {
6271
+ return __generator(this, function (_d) {
6272
+ switch (_d.label) {
6090
6273
  case 0:
6091
6274
  globalLoop.current = true;
6092
6275
  mountLoopAll(renderDispatch, fiber);
6093
6276
  return [4 /*yield*/, processAsyncLoadListOnAsyncMount(renderDispatch)];
6094
6277
  case 1:
6095
- _a.sent();
6096
- (function finishMount() {
6097
- renderDispatch.reconcileCommit(fiber);
6098
- var changedList = renderDispatch.pendingChangedFiberList;
6099
- renderDispatch.resetUpdateFlowRuntimeFiber();
6100
- renderDispatch.pendingCommitFiberList = null;
6101
- renderDispatch.pendingChangedFiberList = null;
6102
- (changedList === null || changedList === void 0 ? void 0 : changedList.length) &&
6103
- safeCallWithCurrentFiber({
6104
- fiber: fiber,
6105
- action: function safeCallFiberHasChangeListener() {
6106
- var _a, _b;
6107
- (_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); });
6108
- },
6109
- });
6110
- })();
6278
+ _d.sent();
6279
+ finishMountAsync(renderDispatch, fiber);
6111
6280
  globalLoop.current = false;
6112
6281
  return [2 /*return*/];
6113
6282
  }
6114
6283
  });
6115
6284
  }); };
6116
6285
 
6117
- var version = "0.3.14";
6286
+ var version = "0.3.16";
6118
6287
 
6119
6288
  exports.CustomRenderDispatch = CustomRenderDispatch;
6120
6289
  exports.MyReactFiberNode = MyReactFiberNode;
@@ -6172,6 +6341,7 @@ function requireIndex_production_1 () {
6172
6341
  exports.enableLogForCurrentFlowIsRunning = enableLogForCurrentFlowIsRunning;
6173
6342
  exports.enableValidMyReactElement = enableValidMyReactElement;
6174
6343
  exports.fiberToDispatchMap = fiberToDispatchMap;
6344
+ exports.generateFiberToListWithAction = generateFiberToListWithAction;
6175
6345
  exports.generateFiberToMountList = generateFiberToMountList;
6176
6346
  exports.generateFiberToUnmountList = generateFiberToUnmountList;
6177
6347
  exports.getClassInstanceFieldByInstance = getClassInstanceFieldByInstance;
@@ -6289,7 +6459,6 @@ function requireIndex_production_1 () {
6289
6459
  exports.unmountFiber = unmountFiber;
6290
6460
  exports.unmountFiberNode = unmountFiberNode;
6291
6461
  exports.unmountInstance = unmountInstance;
6292
- exports.unmountList = unmountList;
6293
6462
  exports.updateConcurrentFromRoot = updateConcurrentFromRoot;
6294
6463
  exports.updateFiberNode = updateFiberNode;
6295
6464
  exports.updateHookNode = updateHookNode;
@@ -7467,10 +7636,9 @@ var ReconcilerDispatchFiber = function (renderDispatch, fiber) {
7467
7636
  var currentScheduler$2 = require$$0.__my_react_internal__.currentScheduler;
7468
7637
  require$$0.__my_react_shared__.enableScopeTreeLog;
7469
7638
  var ReconcilerDispatchMount = function (_dispatch, _fiber, config) {
7470
- var _list = myreactReconcilerExports.generateFiberToMountList(_fiber);
7471
7639
  var pendingCommitFiberArray = [];
7472
7640
  myreactReconcilerExports.beforeSyncUpdate();
7473
- _list.listToFoot(function invokeUnmountPendingAndInsertionEffectList(_fiber) {
7641
+ var _list = myreactReconcilerExports.generateFiberToListWithAction(_fiber, function invokeUnmountPendingList(_fiber) {
7474
7642
  myreactReconcilerExports.defaultInvokeUnmountList(_dispatch, _fiber);
7475
7643
  });
7476
7644
  _list.listToFoot(function invokeInsertionEffectList(_fiber) {
@@ -7689,11 +7857,11 @@ var createDispatch = function (rootNode, rootFiber, rootElement, config) {
7689
7857
  (_a = instance.beforeCommit) === null || _a === void 0 ? void 0 : _a.call(instance);
7690
7858
  });
7691
7859
  myreactReconcilerExports.safeCall(function safeCallBeforeCommitListener() {
7692
- myreactReconcilerExports.listenerMap.get(instance).beforeCommit.forEach(function (cb) { return cb(); });
7860
+ myreactReconcilerExports.listenerMap.get(instance).beforeCommitMount.forEach(function (cb) { return cb(); });
7693
7861
  });
7694
7862
  ReconcilerDispatchMount(this, _fiber, config);
7695
7863
  myreactReconcilerExports.safeCall(function safeCallAfterCommitListener() {
7696
- myreactReconcilerExports.listenerMap.get(instance).afterCommit.forEach(function (cb) { return cb(); });
7864
+ myreactReconcilerExports.listenerMap.get(instance).afterCommitMount.forEach(function (cb) { return cb(); });
7697
7865
  });
7698
7866
  myreactReconcilerExports.safeCall(function safeCallAfterCommit() {
7699
7867
  var _a;
@@ -7710,11 +7878,11 @@ var createDispatch = function (rootNode, rootFiber, rootElement, config) {
7710
7878
  (_a = instance.beforeUpdate) === null || _a === void 0 ? void 0 : _a.call(instance);
7711
7879
  });
7712
7880
  myreactReconcilerExports.safeCall(function safeCallBeforeUpdateListener() {
7713
- myreactReconcilerExports.listenerMap.get(instance).beforeUpdate.forEach(function (cb) { return cb(); });
7881
+ myreactReconcilerExports.listenerMap.get(instance).beforeCommitUpdate.forEach(function (cb) { return cb(); });
7714
7882
  });
7715
7883
  ReconcilerDispatchUpdate(this, _list, config);
7716
7884
  myreactReconcilerExports.safeCall(function safeCallAfterUpdateListener() {
7717
- myreactReconcilerExports.listenerMap.get(instance).afterUpdate.forEach(function (cb) { return cb(); });
7885
+ myreactReconcilerExports.listenerMap.get(instance).afterCommitUpdate.forEach(function (cb) { return cb(); });
7718
7886
  });
7719
7887
  myreactReconcilerExports.safeCall(function safeCallAfterUpdate() {
7720
7888
  var _a;
@@ -7805,7 +7973,7 @@ var loadScript = function (url) {
7805
7973
  }
7806
7974
  };
7807
7975
 
7808
- var enableDebugFiled$1 = require$$0.__my_react_shared__.enableDebugFiled, enableScopeTreeLog$1 = require$$0.__my_react_shared__.enableScopeTreeLog;
7976
+ var enableDebugFiled$1 = require$$0.__my_react_shared__.enableDebugFiled, enableScopeTreeLog$1 = require$$0.__my_react_shared__.enableScopeTreeLog /* enableConcurrentMode */;
7809
7977
  /**
7810
7978
  * @internal
7811
7979
  */
@@ -7921,7 +8089,7 @@ var Reconciler = function (_config) {
7921
8089
  };
7922
8090
  };
7923
8091
 
7924
- var version = "0.0.5";
8092
+ var version = "0.0.7";
7925
8093
  var createReconciler = Reconciler;
7926
8094
 
7927
8095
  exports.createReconciler = createReconciler;