@lynx-js/react 0.124.0 → 0.126.0

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.
Files changed (207) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/components/lib/Page.js +4 -2
  3. package/components/lib/Page.js.map +1 -1
  4. package/components/src/Page.ts +4 -2
  5. package/package.json +2 -2
  6. package/runtime/compat/index.d.ts +48 -1
  7. package/runtime/compat/index.js +7 -3
  8. package/runtime/jsx-dev-runtime/index.d.ts +39 -1
  9. package/runtime/jsx-runtime/index.d.ts +39 -1
  10. package/runtime/lazy/compat.js +2 -0
  11. package/runtime/lazy/internal.js +2 -1
  12. package/runtime/lepus/index.js +2 -2
  13. package/runtime/lepus/jsx-runtime/index.js +20 -8
  14. package/runtime/lib/core/component.js +3 -3
  15. package/runtime/lib/core/component.js.map +1 -1
  16. package/runtime/lib/core/forceRootRender.js +3 -2
  17. package/runtime/lib/core/forceRootRender.js.map +1 -1
  18. package/runtime/lib/core/globalProps.js +1 -1
  19. package/runtime/lib/core/globalProps.js.map +1 -1
  20. package/runtime/lib/core/hooks/mainThreadImpl.js +2 -0
  21. package/runtime/lib/core/hooks/mainThreadImpl.js.map +1 -1
  22. package/runtime/lib/core/hooks/useLynxGlobalEventListener.js +1 -1
  23. package/runtime/lib/core/hooks/useLynxGlobalEventListener.js.map +1 -1
  24. package/runtime/lib/core/lynx/lazy-bundle.js +1 -1
  25. package/runtime/lib/core/lynx/lazy-bundle.js.map +1 -1
  26. package/runtime/lib/core/main-thread-function.d.ts +2 -0
  27. package/runtime/lib/core/main-thread-function.js +10 -0
  28. package/runtime/lib/core/main-thread-function.js.map +1 -0
  29. package/runtime/lib/core/main-thread-ref-init-value.d.ts +1 -0
  30. package/runtime/lib/core/main-thread-ref-init-value.js +23 -0
  31. package/runtime/lib/core/main-thread-ref-init-value.js.map +1 -0
  32. package/runtime/lib/{snapshot/worklet/ref/workletRef.d.ts → core/main-thread-ref.d.ts} +6 -7
  33. package/runtime/lib/{snapshot/worklet/ref/workletRef.js → core/main-thread-ref.js} +31 -36
  34. package/runtime/lib/core/main-thread-ref.js.map +1 -0
  35. package/runtime/lib/core/mts-capability.d.ts +1 -0
  36. package/runtime/lib/core/mts-capability.js +18 -0
  37. package/runtime/lib/core/mts-capability.js.map +1 -0
  38. package/runtime/lib/core/thread-function-call/main-thread.js +4 -11
  39. package/runtime/lib/core/thread-function-call/main-thread.js.map +1 -1
  40. package/runtime/lib/element-template/background/attr-slots.d.ts +5 -1
  41. package/runtime/lib/element-template/background/attr-slots.js +15 -4
  42. package/runtime/lib/element-template/background/attr-slots.js.map +1 -1
  43. package/runtime/lib/element-template/background/commit-hook.d.ts +9 -0
  44. package/runtime/lib/element-template/background/commit-hook.js +83 -51
  45. package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
  46. package/runtime/lib/element-template/background/destroy.js +4 -1
  47. package/runtime/lib/element-template/background/destroy.js.map +1 -1
  48. package/runtime/lib/element-template/background/hydrate.js +21 -25
  49. package/runtime/lib/element-template/background/hydrate.js.map +1 -1
  50. package/runtime/lib/element-template/background/hydration-listener.js +22 -14
  51. package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
  52. package/runtime/lib/element-template/background/instance.d.ts +14 -1
  53. package/runtime/lib/element-template/background/instance.js +117 -52
  54. package/runtime/lib/element-template/background/instance.js.map +1 -1
  55. package/runtime/lib/element-template/background/manager.d.ts +1 -0
  56. package/runtime/lib/element-template/background/manager.js +8 -2
  57. package/runtime/lib/element-template/background/manager.js.map +1 -1
  58. package/runtime/lib/element-template/background/page-root-hydrate.d.ts +3 -0
  59. package/runtime/lib/element-template/background/page-root-hydrate.js +14 -0
  60. package/runtime/lib/element-template/background/page-root-hydrate.js.map +1 -0
  61. package/runtime/lib/element-template/debug/alog.d.ts +6 -0
  62. package/runtime/lib/element-template/debug/alog.js +14 -1
  63. package/runtime/lib/element-template/debug/alog.js.map +1 -1
  64. package/runtime/lib/element-template/debug/profile.js +2 -2
  65. package/runtime/lib/element-template/debug/profile.js.map +1 -1
  66. package/runtime/lib/element-template/index.d.ts +1 -0
  67. package/runtime/lib/element-template/index.js +1 -0
  68. package/runtime/lib/element-template/index.js.map +1 -1
  69. package/runtime/lib/element-template/internal.d.ts +2 -1
  70. package/runtime/lib/element-template/internal.js +2 -2
  71. package/runtime/lib/element-template/internal.js.map +1 -1
  72. package/runtime/lib/element-template/jsx-runtime/index.d.ts +3 -1
  73. package/runtime/lib/element-template/jsx-runtime/index.js +2 -4
  74. package/runtime/lib/element-template/jsx-runtime/index.js.map +1 -1
  75. package/runtime/lib/element-template/lynx/env.js +1 -2
  76. package/runtime/lib/element-template/lynx/env.js.map +1 -1
  77. package/runtime/lib/element-template/native/callDestroyLifetimeFun.js +2 -0
  78. package/runtime/lib/element-template/native/callDestroyLifetimeFun.js.map +1 -1
  79. package/runtime/lib/element-template/native/index.js +8 -8
  80. package/runtime/lib/element-template/native/index.js.map +1 -1
  81. package/runtime/lib/element-template/native/main-thread-api.js +1 -2
  82. package/runtime/lib/element-template/native/main-thread-api.js.map +1 -1
  83. package/runtime/lib/element-template/native/patch-listener.js +14 -5
  84. package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
  85. package/runtime/lib/element-template/native/reload-background.js +2 -2
  86. package/runtime/lib/element-template/native/reload-background.js.map +1 -1
  87. package/runtime/lib/element-template/native/reload-main-thread.js +28 -3
  88. package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -1
  89. package/runtime/lib/element-template/prop-adapters/spread.js +1 -4
  90. package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -1
  91. package/runtime/lib/element-template/protocol/opcodes.d.ts +2 -0
  92. package/runtime/lib/element-template/protocol/opcodes.js +2 -0
  93. package/runtime/lib/element-template/protocol/opcodes.js.map +1 -1
  94. package/runtime/lib/element-template/protocol/page.d.ts +3 -0
  95. package/runtime/lib/element-template/protocol/page.js +7 -0
  96. package/runtime/lib/element-template/protocol/page.js.map +1 -0
  97. package/runtime/lib/element-template/protocol/types.d.ts +24 -3
  98. package/runtime/lib/element-template/protocol/types.js +1 -0
  99. package/runtime/lib/element-template/protocol/types.js.map +1 -1
  100. package/runtime/lib/element-template/runtime/page/authored-page.d.ts +8 -0
  101. package/runtime/lib/element-template/runtime/page/authored-page.js +30 -0
  102. package/runtime/lib/element-template/runtime/page/authored-page.js.map +1 -0
  103. package/runtime/lib/element-template/runtime/page/page.d.ts +0 -2
  104. package/runtime/lib/element-template/runtime/page/page.js +2 -10
  105. package/runtime/lib/element-template/runtime/page/page.js.map +1 -1
  106. package/runtime/lib/element-template/runtime/patch.js +53 -18
  107. package/runtime/lib/element-template/runtime/patch.js.map +1 -1
  108. package/runtime/lib/element-template/runtime/render/render-main-thread.d.ts +1 -3
  109. package/runtime/lib/element-template/runtime/render/render-main-thread.js +12 -25
  110. package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
  111. package/runtime/lib/element-template/runtime/render/render-opcodes.d.ts +4 -0
  112. package/runtime/lib/element-template/runtime/render/render-opcodes.js +62 -20
  113. package/runtime/lib/element-template/runtime/render/render-opcodes.js.map +1 -1
  114. package/runtime/lib/element-template/runtime/render/render-to-opcodes.d.ts +2 -0
  115. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js +23 -10
  116. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js.map +1 -1
  117. package/runtime/lib/element-template/runtime/template/attr-slot-plan.d.ts +4 -0
  118. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js +46 -2
  119. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js.map +1 -1
  120. package/runtime/lib/element-template/runtime/template/handle.d.ts +2 -0
  121. package/runtime/lib/element-template/runtime/template/handle.js +11 -3
  122. package/runtime/lib/element-template/runtime/template/handle.js.map +1 -1
  123. package/runtime/lib/element-template/runtime/template/main-thread-background-function.d.ts +3 -3
  124. package/runtime/lib/element-template/runtime/template/main-thread-background-function.js +2 -2
  125. package/runtime/lib/element-template/runtime/template/main-thread-background-function.js.map +1 -1
  126. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.d.ts +16 -7
  127. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js +134 -56
  128. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js.map +1 -1
  129. package/runtime/lib/element-template/runtime/template/main-thread-event-ctx.d.ts +0 -1
  130. package/runtime/lib/element-template/runtime/template/main-thread-event-ctx.js +4 -9
  131. package/runtime/lib/element-template/runtime/template/main-thread-event-ctx.js.map +1 -1
  132. package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.d.ts +13 -0
  133. package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.js +62 -0
  134. package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.js.map +1 -0
  135. package/runtime/lib/element-template/runtime/template/registry.js +2 -1
  136. package/runtime/lib/element-template/runtime/template/registry.js.map +1 -1
  137. package/runtime/lib/element-template/runtime/template/typed-attributes.d.ts +5 -0
  138. package/runtime/lib/element-template/runtime/template/typed-attributes.js +13 -0
  139. package/runtime/lib/element-template/runtime/template/typed-attributes.js.map +1 -0
  140. package/runtime/lib/internal.d.ts +1 -1
  141. package/runtime/lib/internal.js +1 -1
  142. package/runtime/lib/internal.js.map +1 -1
  143. package/runtime/lib/lynx-api.d.ts +1 -1
  144. package/runtime/lib/lynx-api.js +1 -1
  145. package/runtime/lib/lynx-api.js.map +1 -1
  146. package/runtime/lib/shared/attribute-name.js +1 -2
  147. package/runtime/lib/shared/attribute-name.js.map +1 -1
  148. package/runtime/lib/shared/component-stack.js +2 -1
  149. package/runtime/lib/shared/component-stack.js.map +1 -1
  150. package/runtime/lib/shared/render-constants.d.ts +3 -2
  151. package/runtime/lib/shared/render-constants.js +5 -2
  152. package/runtime/lib/shared/render-constants.js.map +1 -1
  153. package/runtime/lib/snapshot/alog/render.js +1 -0
  154. package/runtime/lib/snapshot/alog/render.js.map +1 -1
  155. package/runtime/lib/snapshot/debug/profileHooks.js +2 -2
  156. package/runtime/lib/snapshot/debug/profileHooks.js.map +1 -1
  157. package/runtime/lib/snapshot/debug/vnodeSource.js +1 -0
  158. package/runtime/lib/snapshot/debug/vnodeSource.js.map +1 -1
  159. package/runtime/lib/snapshot/lifecycle/destroy.js +5 -2
  160. package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -1
  161. package/runtime/lib/snapshot/lifecycle/patch/commit.d.ts +10 -1
  162. package/runtime/lib/snapshot/lifecycle/patch/commit.js +31 -2
  163. package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -1
  164. package/runtime/lib/snapshot/lynx/children.js +1 -2
  165. package/runtime/lib/snapshot/lynx/children.js.map +1 -1
  166. package/runtime/lib/snapshot/lynx/env.js +1 -1
  167. package/runtime/lib/snapshot/lynx/env.js.map +1 -1
  168. package/runtime/lib/snapshot/lynx/suspense.js +1 -1
  169. package/runtime/lib/snapshot/lynx/suspense.js.map +1 -1
  170. package/runtime/lib/snapshot/lynx/tt.js +5 -5
  171. package/runtime/lib/snapshot/lynx/tt.js.map +1 -1
  172. package/runtime/lib/snapshot/renderToOpcodes/index.js +8 -11
  173. package/runtime/lib/snapshot/renderToOpcodes/index.js.map +1 -1
  174. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.d.ts +1 -0
  175. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +5 -0
  176. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
  177. package/runtime/lib/snapshot/snapshot/platformInfo.js +1 -3
  178. package/runtime/lib/snapshot/snapshot/platformInfo.js.map +1 -1
  179. package/runtime/lib/snapshot/snapshot/snapshot.d.ts +1 -0
  180. package/runtime/lib/snapshot/snapshot/snapshot.js +8 -0
  181. package/runtime/lib/snapshot/snapshot/snapshot.js.map +1 -1
  182. package/runtime/lib/snapshot/snapshot/spread.js +2 -8
  183. package/runtime/lib/snapshot/snapshot/spread.js.map +1 -1
  184. package/runtime/lib/snapshot/worklet/destroy.js +2 -2
  185. package/runtime/lib/snapshot/worklet/destroy.js.map +1 -1
  186. package/runtime/lib/snapshot/worklet/functionality.d.ts +1 -0
  187. package/runtime/lib/snapshot/worklet/functionality.js +2 -8
  188. package/runtime/lib/snapshot/worklet/functionality.js.map +1 -1
  189. package/runtime/lib/snapshot/worklet/ref/updateInitValue.js +2 -2
  190. package/runtime/lib/snapshot/worklet/ref/updateInitValue.js.map +1 -1
  191. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  192. package/runtime/lib/utils.d.ts +9 -0
  193. package/runtime/lib/utils.js +27 -0
  194. package/runtime/lib/utils.js.map +1 -1
  195. package/runtime/lib/worklet-runtime/bindings/bindings.d.ts +5 -1
  196. package/runtime/lib/worklet-runtime/bindings/bindings.js +7 -1
  197. package/runtime/lib/worklet-runtime/bindings/bindings.js.map +1 -1
  198. package/runtime/lib/worklet-runtime/bindings/observers.js +2 -1
  199. package/runtime/lib/worklet-runtime/bindings/observers.js.map +1 -1
  200. package/runtime/worklet-runtime/dev.js +1 -1
  201. package/testing-library/dist/env/index.js +1 -2
  202. package/testing-library/dist/setupFiles/common/runtime-setup.js +3 -3
  203. package/transform/dist/wasm.cjs +5 -5
  204. package/runtime/lib/snapshot/worklet/ref/workletRef.js.map +0 -1
  205. package/runtime/lib/snapshot/worklet/ref/workletRefPool.d.ts +0 -1
  206. package/runtime/lib/snapshot/worklet/ref/workletRefPool.js +0 -23
  207. package/runtime/lib/snapshot/worklet/ref/workletRefPool.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"workletRef.js","sourceRoot":"","sources":["../../../../src/snapshot/worklet/ref/workletRef.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEvD,gDAAgD;AAChD,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,IAAI,QA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AAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,aAAiB,SAAQ,UAAa;IACjD,YAAY,SAAY;QACtB,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAChC,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YACtB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,iCAAiC,EAAE,CAAC,GAAG,EAAE;gBACrF,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC,aAAa,CAAC;oBACpC,IAAI,EAAE,aAAa,CAAC,iBAAiB;oBACrC,IAAI,EAAE;wBACJ,EAAE;qBACH;iBACF,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA2HD,MAAM,UAAU,gBAAgB,CAAI,SAAa;IAC/C,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,OAAO,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
@@ -1 +0,0 @@
1
- export type workletRefInitValuePatch = [id: number, value: unknown][];
@@ -1,23 +0,0 @@
1
- // Copyright 2024 The Lynx Authors. All rights reserved.
2
- // Licensed under the Apache License Version 2.0 that can be found in the
3
- // LICENSE file in the root directory of this source tree.
4
- import { isMtsEnabled } from '../functionality.js';
5
- let initValuePatch = [];
6
- /**
7
- * @internal
8
- */
9
- export function addWorkletRefInitValue(id, value) {
10
- if (!isMtsEnabled()) {
11
- return;
12
- }
13
- initValuePatch.push([id, value]);
14
- }
15
- /**
16
- * @internal
17
- */
18
- export function takeWorkletRefInitValuePatch() {
19
- const res = initValuePatch;
20
- initValuePatch = [];
21
- return res;
22
- }
23
- //# sourceMappingURL=workletRefPool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workletRefPool.js","sourceRoot":"","sources":["../../../../src/snapshot/worklet/ref/workletRefPool.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,IAAI,cAAc,GAA6B,EAAE,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,EAAU,EAAE,KAAc;IAC/D,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IAED,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B;IAC1C,MAAM,GAAG,GAAG,cAAc,CAAC;IAC3B,cAAc,GAAG,EAAE,CAAC;IACpB,OAAO,GAAG,CAAC;AACb,CAAC"}