@lynx-js/react-canary 0.112.4-canary-20250821-1cf567f3 → 0.112.4-canary-20250822-56e62b43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @lynx-js/react
2
2
 
3
- ## 0.112.4-canary-20250821223337-1cf567f31eeef565c8919769d7df5dec941f7071
3
+ ## 0.112.4-canary-20250822075323-56e62b4377a118bfa4d5c70716ce6c2e1ecbb6ca
4
4
 
5
5
  ### Patch Changes
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-canary",
3
- "version": "0.112.4-canary-20250821-1cf567f3",
3
+ "version": "0.112.4-canary-20250822-56e62b43",
4
4
  "description": "ReactLynx is a framework for developing Lynx applications with familiar React.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -5,8 +5,8 @@
5
5
  Rslib v0.12.2
6
6
 
7
7
  info build started...
8
- ready built in 0.13 s
8
+ ready built in 0.11 s
9
9
 
10
10
  File (esm) Size 
11
- dist/index.js 10.5 kB
11
+ dist/index.js 11.1 kB
12
12
 
@@ -7,13 +7,25 @@ const EFFECTS_LIST = '__h';
7
7
  const RERENDER_COUNT = '__r';
8
8
  const CATCH_ERROR_OPTION = '__e';
9
9
  const COMPONENT_DIRTY = '__d';
10
+ const COMPONENT_BITS = '__g';
10
11
  const HOOK_VALUE = '__';
11
12
  const HOOK_ARGS = '__H';
12
13
  const HOOK_CLEANUP = '__c';
14
+ const COMPONENT_DIRTY_BIT = 8;
15
+ const isDirty = (vnode)=>{
16
+ if (vnode[VNODE_COMPONENT] && vnode[VNODE_COMPONENT][COMPONENT_DIRTY]) return true;
17
+ if (vnode[VNODE_COMPONENT] && vnode[VNODE_COMPONENT][COMPONENT_BITS] & COMPONENT_DIRTY_BIT) return true;
18
+ };
19
+ const unsetDirty = (vnode)=>{
20
+ if (vnode[VNODE_COMPONENT]) {
21
+ if (vnode[VNODE_COMPONENT][COMPONENT_DIRTY]) vnode[VNODE_COMPONENT][COMPONENT_DIRTY] = false;
22
+ if (vnode[VNODE_COMPONENT][COMPONENT_BITS]) vnode[VNODE_COMPONENT][COMPONENT_BITS] &= ~COMPONENT_DIRTY_BIT;
23
+ }
24
+ };
13
25
  const oldCatchError = options[CATCH_ERROR_OPTION];
14
- options[CATCH_ERROR_OPTION] = (error, vnode, oldVNode)=>{
15
- if (vnode[VNODE_COMPONENT] && vnode[VNODE_COMPONENT][COMPONENT_DIRTY]) vnode[VNODE_COMPONENT][COMPONENT_DIRTY] = false;
16
- if (oldCatchError) oldCatchError(error, vnode, oldVNode);
26
+ options[CATCH_ERROR_OPTION] = (error, vnode, oldVNode, info)=>{
27
+ if (isDirty(vnode)) unsetDirty(vnode);
28
+ if (oldCatchError) oldCatchError(error, vnode, oldVNode, info);
17
29
  };
18
30
  const defer = 'function' == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout;
19
31
  options.debounceRendering = (process)=>{
@@ -137,7 +149,7 @@ function replaceComponent(OldType, NewType, resetHookState) {
137
149
  pendingUpdates = pendingUpdates.filter((p)=>p[0] !== OldType);
138
150
  vnodes.forEach((node)=>{
139
151
  let vnode = node;
140
- if (!vnode.__c) {
152
+ if (vnode && vnode.__v && !vnode.__c) {
141
153
  vnode = lastSeen.get(vnode.__v, vnode);
142
154
  lastSeen["delete"](vnode.__v);
143
155
  }
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@lynx-js/react": "workspace:*",
17
- "@prefresh/core": "^1.5.5",
17
+ "@prefresh/core": "^1.5.7",
18
18
  "@prefresh/utils": "^1.2.1"
19
19
  }
20
20
  }