@lynx-js/react 0.121.0 → 0.121.2

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 (238) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/package.json +5 -5
  3. package/runtime/lazy/element-template-import.js +73 -0
  4. package/runtime/lazy/import.js +4 -0
  5. package/runtime/lazy/target.js +23 -0
  6. package/runtime/lib/core/commit-context.d.ts +8 -0
  7. package/runtime/lib/core/commit-context.js +18 -0
  8. package/runtime/lib/core/commit-context.js.map +1 -0
  9. package/runtime/lib/{snapshot/legacy-react-runtime/index.d.ts → core/compat/legacy-react-runtime.d.ts} +4 -4
  10. package/runtime/lib/{snapshot/legacy-react-runtime/index.js → core/compat/legacy-react-runtime.js} +6 -6
  11. package/runtime/lib/core/compat/legacy-react-runtime.js.map +1 -0
  12. package/runtime/lib/{snapshot → core}/compat/lynxComponent.d.ts +2 -1
  13. package/runtime/lib/{snapshot → core}/compat/lynxComponent.js +11 -5
  14. package/runtime/lib/core/compat/lynxComponent.js.map +1 -0
  15. package/runtime/lib/core/component.d.ts +2 -0
  16. package/runtime/lib/core/component.js +79 -0
  17. package/runtime/lib/core/component.js.map +1 -0
  18. package/runtime/lib/core/forceRootRender.d.ts +7 -0
  19. package/runtime/lib/core/forceRootRender.js +40 -0
  20. package/runtime/lib/core/forceRootRender.js.map +1 -0
  21. package/runtime/lib/core/globalProps.d.ts +31 -0
  22. package/runtime/lib/core/globalProps.js +55 -0
  23. package/runtime/lib/core/globalProps.js.map +1 -0
  24. package/runtime/lib/core/hooks/useLynxGlobalEventListener.js +1 -1
  25. package/runtime/lib/core/hooks/useLynxGlobalEventListener.js.map +1 -1
  26. package/runtime/lib/{snapshot/compat → core}/initData.d.ts +1 -1
  27. package/runtime/lib/{snapshot/compat → core}/initData.js +4 -5
  28. package/runtime/lib/core/initData.js.map +1 -0
  29. package/runtime/lib/{snapshot/lynx/dynamic-js.js → core/lynx/dynamic-import.js} +1 -1
  30. package/runtime/lib/core/lynx/dynamic-import.js.map +1 -0
  31. package/runtime/lib/core/lynx/lazy-bundle.js.map +1 -0
  32. package/runtime/lib/core/lynx/runtime-backend.d.ts +5 -0
  33. package/runtime/lib/core/lynx/runtime-backend.js +20 -0
  34. package/runtime/lib/core/lynx/runtime-backend.js.map +1 -0
  35. package/runtime/lib/core/lynx-data-processors.d.ts +2 -0
  36. package/runtime/lib/core/lynx-data-processors.js +53 -0
  37. package/runtime/lib/core/lynx-data-processors.js.map +1 -0
  38. package/runtime/lib/core/lynx-page-data.d.ts +1 -0
  39. package/runtime/lib/core/lynx-page-data.js +14 -0
  40. package/runtime/lib/core/lynx-page-data.js.map +1 -0
  41. package/runtime/lib/core/lynx-update-data.d.ts +11 -0
  42. package/runtime/lib/core/lynx-update-data.js +21 -0
  43. package/runtime/lib/core/lynx-update-data.js.map +1 -0
  44. package/runtime/lib/core/performance.d.ts +30 -0
  45. package/runtime/lib/core/performance.js +145 -0
  46. package/runtime/lib/core/performance.js.map +1 -0
  47. package/runtime/lib/core/ref.d.ts +37 -0
  48. package/runtime/lib/core/ref.js +108 -0
  49. package/runtime/lib/core/ref.js.map +1 -0
  50. package/runtime/lib/core/reload-version.d.ts +2 -0
  51. package/runtime/lib/{snapshot/lifecycle/pass.js → core/reload-version.js} +4 -5
  52. package/runtime/lib/core/reload-version.js.map +1 -0
  53. package/runtime/lib/element-template/background/attr-slots.d.ts +6 -1
  54. package/runtime/lib/element-template/background/attr-slots.js +35 -2
  55. package/runtime/lib/element-template/background/attr-slots.js.map +1 -1
  56. package/runtime/lib/element-template/background/commit-context.d.ts +3 -3
  57. package/runtime/lib/element-template/background/commit-context.js +15 -18
  58. package/runtime/lib/element-template/background/commit-context.js.map +1 -1
  59. package/runtime/lib/element-template/background/commit-hook.d.ts +1 -1
  60. package/runtime/lib/element-template/background/commit-hook.js +68 -43
  61. package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
  62. package/runtime/lib/element-template/background/destroy.js +9 -6
  63. package/runtime/lib/element-template/background/destroy.js.map +1 -1
  64. package/runtime/lib/element-template/background/document.js +5 -5
  65. package/runtime/lib/element-template/background/document.js.map +1 -1
  66. package/runtime/lib/element-template/background/hydrate.d.ts +2 -3
  67. package/runtime/lib/element-template/background/hydrate.js +247 -74
  68. package/runtime/lib/element-template/background/hydrate.js.map +1 -1
  69. package/runtime/lib/element-template/background/hydration-listener.js +49 -22
  70. package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
  71. package/runtime/lib/element-template/background/instance.d.ts +38 -9
  72. package/runtime/lib/element-template/background/instance.js +292 -113
  73. package/runtime/lib/element-template/background/instance.js.map +1 -1
  74. package/runtime/lib/element-template/client/root.d.ts +7 -0
  75. package/runtime/lib/element-template/client/root.js +3 -6
  76. package/runtime/lib/element-template/client/root.js.map +1 -1
  77. package/runtime/lib/element-template/debug/alog.d.ts +21 -0
  78. package/runtime/lib/element-template/debug/alog.js +33 -0
  79. package/runtime/lib/element-template/debug/alog.js.map +1 -1
  80. package/runtime/lib/element-template/debug/elementPAPICall.js +5 -0
  81. package/runtime/lib/element-template/debug/elementPAPICall.js.map +1 -1
  82. package/runtime/lib/element-template/hydration-map.d.ts +5 -0
  83. package/runtime/lib/element-template/hydration-map.js +12 -0
  84. package/runtime/lib/element-template/hydration-map.js.map +1 -0
  85. package/runtime/lib/element-template/index.d.ts +25 -3
  86. package/runtime/lib/element-template/index.js +38 -9
  87. package/runtime/lib/element-template/index.js.map +1 -1
  88. package/runtime/lib/element-template/internal.d.ts +5 -1
  89. package/runtime/lib/element-template/internal.js +6 -7
  90. package/runtime/lib/element-template/internal.js.map +1 -1
  91. package/runtime/lib/element-template/lynx/env.js +5 -48
  92. package/runtime/lib/element-template/lynx/env.js.map +1 -1
  93. package/runtime/lib/element-template/lynx/performance.d.ts +0 -21
  94. package/runtime/lib/element-template/lynx/performance.js +4 -121
  95. package/runtime/lib/element-template/lynx/performance.js.map +1 -1
  96. package/runtime/lib/element-template/native/index.d.ts +1 -1
  97. package/runtime/lib/element-template/native/index.js +28 -2
  98. package/runtime/lib/element-template/native/index.js.map +1 -1
  99. package/runtime/lib/element-template/native/main-thread-api.js +27 -5
  100. package/runtime/lib/element-template/native/main-thread-api.js.map +1 -1
  101. package/runtime/lib/element-template/native/mts-destroy.js +2 -0
  102. package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
  103. package/runtime/lib/element-template/native/patch-listener.js +6 -2
  104. package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
  105. package/runtime/lib/element-template/native/reload-background.d.ts +1 -0
  106. package/runtime/lib/element-template/native/reload-background.js +39 -0
  107. package/runtime/lib/element-template/native/reload-background.js.map +1 -0
  108. package/runtime/lib/element-template/native/reload-main-thread.d.ts +1 -0
  109. package/runtime/lib/element-template/native/reload-main-thread.js +35 -0
  110. package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -0
  111. package/runtime/lib/element-template/prop-adapters/event.d.ts +1 -0
  112. package/runtime/lib/element-template/prop-adapters/event.js +4 -1
  113. package/runtime/lib/element-template/prop-adapters/event.js.map +1 -1
  114. package/runtime/lib/element-template/prop-adapters/ref.d.ts +26 -0
  115. package/runtime/lib/element-template/prop-adapters/ref.js +107 -0
  116. package/runtime/lib/element-template/prop-adapters/ref.js.map +1 -0
  117. package/runtime/lib/element-template/prop-adapters/spread.js +8 -1
  118. package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -1
  119. package/runtime/lib/element-template/protocol/opcodes.d.ts +4 -0
  120. package/runtime/lib/element-template/protocol/opcodes.js +4 -0
  121. package/runtime/lib/element-template/protocol/opcodes.js.map +1 -1
  122. package/runtime/lib/element-template/protocol/template-type.d.ts +6 -0
  123. package/runtime/lib/element-template/protocol/template-type.js +20 -0
  124. package/runtime/lib/element-template/protocol/template-type.js.map +1 -0
  125. package/runtime/lib/element-template/protocol/types.d.ts +74 -6
  126. package/runtime/lib/element-template/runtime/list/list.d.ts +65 -0
  127. package/runtime/lib/element-template/runtime/list/list.js +587 -0
  128. package/runtime/lib/element-template/runtime/list/list.js.map +1 -0
  129. package/runtime/lib/element-template/runtime/page/page.d.ts +5 -2
  130. package/runtime/lib/element-template/runtime/page/page.js +12 -0
  131. package/runtime/lib/element-template/runtime/page/page.js.map +1 -1
  132. package/runtime/lib/element-template/runtime/patch.js +210 -38
  133. package/runtime/lib/element-template/runtime/patch.js.map +1 -1
  134. package/runtime/lib/element-template/runtime/render/render-main-thread.d.ts +3 -1
  135. package/runtime/lib/element-template/runtime/render/render-main-thread.js +38 -7
  136. package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
  137. package/runtime/lib/element-template/runtime/render/render-opcodes.js +80 -43
  138. package/runtime/lib/element-template/runtime/render/render-opcodes.js.map +1 -1
  139. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js +41 -4
  140. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js.map +1 -1
  141. package/runtime/lib/element-template/runtime/template/attr-slot-plan.d.ts +1 -0
  142. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js +4 -0
  143. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js.map +1 -1
  144. package/runtime/lib/element-template/runtime/template/handle.d.ts +3 -2
  145. package/runtime/lib/element-template/runtime/template/handle.js +5 -1
  146. package/runtime/lib/element-template/runtime/template/handle.js.map +1 -1
  147. package/runtime/lib/element-template/runtime/template/registry.d.ts +2 -0
  148. package/runtime/lib/element-template/runtime/template/registry.js +6 -1
  149. package/runtime/lib/element-template/runtime/template/registry.js.map +1 -1
  150. package/runtime/lib/element-template/runtime-backend-marker.js +6 -0
  151. package/runtime/lib/element-template/runtime-backend-marker.js.map +1 -0
  152. package/runtime/lib/index.d.ts +1 -1
  153. package/runtime/lib/index.js +3 -1
  154. package/runtime/lib/index.js.map +1 -1
  155. package/runtime/lib/internal.d.ts +5 -4
  156. package/runtime/lib/internal.js +6 -5
  157. package/runtime/lib/internal.js.map +1 -1
  158. package/runtime/lib/lynx-api.d.ts +3 -8
  159. package/runtime/lib/lynx-api.js +8 -45
  160. package/runtime/lib/lynx-api.js.map +1 -1
  161. package/runtime/lib/runtime-backend-marker.js +6 -0
  162. package/runtime/lib/runtime-backend-marker.js.map +1 -0
  163. package/runtime/lib/snapshot/debug/vnodeSource.js +1 -1
  164. package/runtime/lib/snapshot/debug/vnodeSource.js.map +1 -1
  165. package/runtime/lib/snapshot/lifecycle/patch/commit.d.ts +0 -1
  166. package/runtime/lib/snapshot/lifecycle/patch/commit.js +4 -9
  167. package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -1
  168. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js +2 -2
  169. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -1
  170. package/runtime/lib/snapshot/lifecycle/ref/delay.d.ts +6 -13
  171. package/runtime/lib/snapshot/lifecycle/ref/delay.js +9 -30
  172. package/runtime/lib/snapshot/lifecycle/ref/delay.js.map +1 -1
  173. package/runtime/lib/snapshot/lifecycle/reload.js +2 -2
  174. package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
  175. package/runtime/lib/snapshot/list/list.js +1 -1
  176. package/runtime/lib/snapshot/list/list.js.map +1 -1
  177. package/runtime/lib/snapshot/list/listUpdateInfo.js +3 -2
  178. package/runtime/lib/snapshot/list/listUpdateInfo.js.map +1 -1
  179. package/runtime/lib/snapshot/lynx/calledByNative.js +3 -9
  180. package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -1
  181. package/runtime/lib/snapshot/lynx/env.js +5 -51
  182. package/runtime/lib/snapshot/lynx/env.js.map +1 -1
  183. package/runtime/lib/snapshot/lynx/performance.d.ts +0 -21
  184. package/runtime/lib/snapshot/lynx/performance.js +7 -121
  185. package/runtime/lib/snapshot/lynx/performance.js.map +1 -1
  186. package/runtime/lib/snapshot/lynx/runWithForce.js +9 -39
  187. package/runtime/lib/snapshot/lynx/runWithForce.js.map +1 -1
  188. package/runtime/lib/snapshot/lynx/tt.js +10 -30
  189. package/runtime/lib/snapshot/lynx/tt.js.map +1 -1
  190. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +4 -4
  191. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
  192. package/runtime/lib/snapshot/snapshot/list.js +1 -1
  193. package/runtime/lib/snapshot/snapshot/list.js.map +1 -1
  194. package/runtime/lib/snapshot/snapshot/ref.d.ts +3 -5
  195. package/runtime/lib/snapshot/snapshot/ref.js +16 -59
  196. package/runtime/lib/snapshot/snapshot/ref.js.map +1 -1
  197. package/runtime/lib/snapshot/snapshot/snapshot.js +1 -1
  198. package/runtime/lib/snapshot/snapshot/snapshot.js.map +1 -1
  199. package/runtime/lib/snapshot/snapshot/snapshotInstanceHydrationMap.js +1 -1
  200. package/runtime/lib/snapshot/snapshot/snapshotInstanceHydrationMap.js.map +1 -1
  201. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  202. package/runtime/lib/worklet-runtime/workletRuntime.js +1 -1
  203. package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
  204. package/runtime/worklet-runtime/dev.js +2 -3
  205. package/runtime/worklet-runtime/main.js +1 -1
  206. package/testing-library/dist/{rslib-runtime.js → 0~rslib-runtime.js} +14 -13
  207. package/testing-library/dist/env/index.js +2 -8
  208. package/testing-library/dist/env/vitest.js +1 -1
  209. package/testing-library/dist/plugins/index.js +13 -2
  210. package/testing-library/dist/pure.js +18 -18
  211. package/testing-library/dist/rstest-config.js +2 -4
  212. package/testing-library/dist/setupFiles/common/bootstrap.js +1 -0
  213. package/testing-library/dist/setupFiles/common/runtime-setup.js +1 -1
  214. package/testing-library/dist/setupFiles/inner/rstest.js +2 -1
  215. package/testing-library/dist/setupFiles/inner/vitest.js +2 -1
  216. package/testing-library/dist/type-entry/index.js +1 -0
  217. package/transform/dist/wasm.cjs +113 -40
  218. package/runtime/lib/element-template/hooks/react.d.ts +0 -14
  219. package/runtime/lib/element-template/hooks/react.js +0 -24
  220. package/runtime/lib/element-template/hooks/react.js.map +0 -1
  221. package/runtime/lib/element-template/runtime/components/slot.js +0 -11
  222. package/runtime/lib/element-template/runtime/components/slot.js.map +0 -1
  223. package/runtime/lib/snapshot/compat/initData.js.map +0 -1
  224. package/runtime/lib/snapshot/compat/lynxComponent.js.map +0 -1
  225. package/runtime/lib/snapshot/legacy-react-runtime/index.js.map +0 -1
  226. package/runtime/lib/snapshot/lifecycle/pass.d.ts +0 -3
  227. package/runtime/lib/snapshot/lifecycle/pass.js.map +0 -1
  228. package/runtime/lib/snapshot/lynx/component.js +0 -73
  229. package/runtime/lib/snapshot/lynx/component.js.map +0 -1
  230. package/runtime/lib/snapshot/lynx/dynamic-js.js.map +0 -1
  231. package/runtime/lib/snapshot/lynx/lazy-bundle.js.map +0 -1
  232. package/testing-library/dist/881.js +0 -1
  233. /package/runtime/lib/{snapshot/lynx/dynamic-js.d.ts → core/lynx/dynamic-import.d.ts} +0 -0
  234. /package/runtime/lib/{snapshot → core}/lynx/lazy-bundle.d.ts +0 -0
  235. /package/runtime/lib/{snapshot → core}/lynx/lazy-bundle.js +0 -0
  236. /package/runtime/lib/element-template/{runtime/components/slot.d.ts → runtime-backend-marker.d.ts} +0 -0
  237. /package/runtime/lib/{snapshot/lynx/component.d.ts → runtime-backend-marker.d.ts} +0 -0
  238. /package/testing-library/dist/{0~123.js → 0~@rstest/adapter-rsbuild.js} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initData.js","sourceRoot":"","sources":["../../src/core/initData.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAO1D,yCAAyC;AACzC,MAAM,UAAU,OAAO,CACrB,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,0BAA0B,EAAE,WAAW,EAKhF,EACD,IAAoC,EACpC,SAAiB;IAQjB,MAAM,OAAO,GAAG,aAAa,CAAC,EAAU,CAAC,CAAC;IAE1C,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAoC,EAAE,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CAAC"}
@@ -28,4 +28,4 @@ export function __dynamicImport(url, options) {
28
28
  return loadDynamicJS(url);
29
29
  }
30
30
  }
31
- //# sourceMappingURL=dynamic-js.js.map
31
+ //# sourceMappingURL=dynamic-import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-import.js","sourceRoot":"","sources":["../../../src/core/lynx/dynamic-import.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,UAAU,aAAa,CAAI,GAAW;IAC1C,IAAI,SAAS,EAAE,CAAC;QACd,YAAY,CACV,IAAI,KAAK,CAAC,yBAAyB,GAAG,+BAA+B,CAAC,EACtE,EAAE,SAAS,EAAE,GAAG,EAAE,CACnB,CAAC;QACF,2EAA2E;QAC3E,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,CAAC,kBAAkB,CAAI,GAAG,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YAC5C,IAAI,GAAG,EAAE,CAAC;gBACR,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAS,CAAC,CAAC;YACrB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,GAAW,EACX,OAA2D;IAE3D,MAAM,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC;IAC9B,IAAI,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;QACpD,OAAO,cAAc,CAAM,GAAG,CAAC,CAAC;IAClC,CAAC;SAAM,CAAC;QACN,OAAO,aAAa,CAAC,GAAG,CAAC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S,EAAQ,EAAE;YAC3B,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;QAC3B,CAAC;QACD,MAAM,EAAE,CAAC,KAAY,EAAQ,EAAE;YAC7B,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;QACzB,CAAC;QACD,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;KACZ,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const RUNTIME_BACKEND_SNAPSHOT = "Snapshot";
2
+ export declare const RUNTIME_BACKEND_ELEMENT_TEMPLATE = "Element Template";
3
+ export type RuntimeBackend = typeof RUNTIME_BACKEND_SNAPSHOT | typeof RUNTIME_BACKEND_ELEMENT_TEMPLATE;
4
+ export declare const sRuntimeBackend: symbol;
5
+ export declare function registerRuntimeBackend(backend: RuntimeBackend): void;
@@ -0,0 +1,20 @@
1
+ // Copyright 2026 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
+ export const RUNTIME_BACKEND_SNAPSHOT = 'Snapshot';
5
+ export const RUNTIME_BACKEND_ELEMENT_TEMPLATE = 'Element Template';
6
+ export const sRuntimeBackend = Symbol.for('__REACT_LYNX_RUNTIME_BACKEND__');
7
+ export function registerRuntimeBackend(backend) {
8
+ const target = (__LEPUS__ ? globalThis : lynx);
9
+ const currentBackend = target[sRuntimeBackend];
10
+ if (currentBackend !== undefined && currentBackend !== backend) {
11
+ throw new Error(`ReactLynx runtime backend mismatch: the current template uses ${currentBackend}, but this bundle was built for ${backend}. Snapshot and Element Template templates cannot share lazy bundles. Rebuild the main template and lazy bundle with the same elementTemplate setting.`);
12
+ }
13
+ Object.defineProperty(target, sRuntimeBackend, {
14
+ value: backend,
15
+ enumerable: false,
16
+ writable: false,
17
+ configurable: true,
18
+ });
19
+ }
20
+ //# sourceMappingURL=runtime-backend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-backend.js","sourceRoot":"","sources":["../../../src/core/lynx/runtime-backend.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAC;AACnD,MAAM,CAAC,MAAM,gCAAgC,GAAG,kBAAkB,CAAC;AAMnE,MAAM,CAAC,MAAM,eAAe,GAAW,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAEpF,MAAM,UAAU,sBAAsB,CAAC,OAAuB;IAC5D,MAAM,MAAM,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAgD,CAAC;IAC9F,MAAM,cAAc,GAAG,MAAM,CAAC,eAAe,CAA+B,CAAC;IAE7E,IAAI,cAAc,KAAK,SAAS,IAAI,cAAc,KAAK,OAAO,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CACb,iEAAiE,cAAc,mCAAmC,OAAO,uJAAuJ,CACjR,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,eAAe,EAAE;QAC7C,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { DataProcessorDefinition, InitData, InitDataRaw } from '../lynx-api.js';
2
+ export declare function createProcessData(dataProcessorDefinition?: DataProcessorDefinition): (data: InitDataRaw, processorName?: string) => InitData | InitDataRaw;
@@ -0,0 +1,53 @@
1
+ import { profileEnd, profileStart } from '../shared/profile.js';
2
+ export function createProcessData(dataProcessorDefinition) {
3
+ let hasDefaultDataProcessorExecuted = false;
4
+ return (data, processorName) => {
5
+ if (typeof __PROFILE__ !== 'undefined' && __PROFILE__) {
6
+ profileStart('processData');
7
+ }
8
+ let result;
9
+ try {
10
+ if (processorName) {
11
+ result = dataProcessorDefinition?.dataProcessors?.[processorName]?.(data) ?? data;
12
+ }
13
+ else {
14
+ result = dataProcessorDefinition?.defaultDataProcessor?.(data) ?? data;
15
+ }
16
+ }
17
+ catch (error) {
18
+ lynx.reportError(error);
19
+ result = {};
20
+ }
21
+ if (typeof __PROFILE__ !== 'undefined' && __PROFILE__) {
22
+ profileEnd();
23
+ }
24
+ if (!hasDefaultDataProcessorExecuted) {
25
+ result = appendInitDataMetadata(result);
26
+ }
27
+ if (!processorName) {
28
+ hasDefaultDataProcessorExecuted = true;
29
+ }
30
+ return result;
31
+ };
32
+ }
33
+ function appendInitDataMetadata(result) {
34
+ // @ts-expect-error todo: add types to i18n logic
35
+ const i18nResourceTranslation = globalThis.__I18N_RESOURCE_TRANSLATION__;
36
+ if (i18nResourceTranslation) {
37
+ result = {
38
+ ...result,
39
+ __I18N_RESOURCE_TRANSLATION__: i18nResourceTranslation,
40
+ };
41
+ }
42
+ // @ts-expect-error todo: add types to __EXTRACT_STR__
43
+ if (__EXTRACT_STR__) {
44
+ // @ts-expect-error todo: add types to __EXTRACT_STR__
45
+ const extractStrIdentFlag = __EXTRACT_STR_IDENT_FLAG__;
46
+ result = {
47
+ ...result,
48
+ _EXTRACT_STR: extractStrIdentFlag,
49
+ };
50
+ }
51
+ return result;
52
+ }
53
+ //# sourceMappingURL=lynx-data-processors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lynx-data-processors.js","sourceRoot":"","sources":["../../src/core/lynx-data-processors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,UAAU,iBAAiB,CAC/B,uBAAiD;IAEjD,IAAI,+BAA+B,GAAG,KAAK,CAAC;IAE5C,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE;QAC7B,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,WAAW,EAAE,CAAC;YACtD,YAAY,CAAC,aAAa,CAAC,CAAC;Q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are function applyUpdatePageData(data: unknown, options?: Pick<UpdatePageOption, 'resetPageData'>): void;
@@ -0,0 +1,14 @@
1
+ // Copyright 2026 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 { isEmptyObject } from '../utils.js';
5
+ export function applyUpdatePageData(data, options) {
6
+ if (options?.resetPageData) {
7
+ lynx.__initData = {};
8
+ }
9
+ if (typeof data == 'object' && data !== null && !isEmptyObject(data)) {
10
+ lynx.__initData ??= {};
11
+ Object.assign(lynx.__initData, data);
12
+ }
13
+ }
14
+ //# sourceMappingURL=lynx-page-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lynx-page-data.js","sourceRoot":"","sources":["../../src/core/lynx-page-data.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,UAAU,mBAAmB,CAAC,IAAa,EAAE,OAAiD;IAClG,IAAI,OAAO,EAAE,aAAa,EAAE,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;IACvB,CAAC;IAED,IAAI,OAAO,IAAI,IAAI,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QACrE,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC;QACvB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const NativeUpdateDataType: {
2
+ readonly UPDATE: 0;
3
+ readonly RESET: 1;
4
+ };
5
+ export type NativeUpdateDataType = (typeof NativeUpdateDataType)[keyof typeof NativeUpdateDataType];
6
+ export interface NativeUpdateDataOptions {
7
+ type?: NativeUpdateDataType | undefined;
8
+ }
9
+ type InitDataPatch = Record<string, any>;
10
+ export declare function updateCardData(newData: InitDataPatch, options?: NativeUpdateDataOptions): void;
11
+ export {};
@@ -0,0 +1,21 @@
1
+ // Copyright 2026 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
+ export const NativeUpdateDataType = {
5
+ UPDATE: 0,
6
+ RESET: 1,
7
+ };
8
+ export function updateCardData(newData, options) {
9
+ const { ['__lynx_timing_flag']: performanceTimingFlag, ...restNewData } = newData;
10
+ if (performanceTimingFlag) {
11
+ lynx.reportError(new Error(`Received unsupported updateData with \`__lynx_timing_flag\` (value "${performanceTimingFlag}"), the timing flag is ignored`));
12
+ }
13
+ const { type = NativeUpdateDataType.UPDATE } = options ?? {};
14
+ if (type == NativeUpdateDataType.RESET) {
15
+ lynx.__initData = {};
16
+ }
17
+ // COW keeps provider/consumer readers aligned with Snapshot updateData behavior.
18
+ lynx.__initData = Object.assign({}, lynx.__initData, restNewData);
19
+ lynx.getJSModule('GlobalEventEmitter').emit('onDataChanged', [restNewData]);
20
+ }
21
+ //# sourceMappingURL=lynx-update-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lynx-update-data.js","sourceRoot":"","sources":["../../src/core/lynx-update-data.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;CACA,CAAC;AAUX,MAAM,UAAU,cAAc,CAC5B,OAAsB,EACtB,OAAiC;IAEjC,MAAM,EAAE,CAAC,oBAAoB,CAAC,EAAE,qBAAqB,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;IAClF,IAAI,qBAAqB,EAAE,CAAC;QAC1B,IAAI,CAAC,WAAW,CACd,IAAI,KAAK,CACP,uEAAuE,qBAAqB,gCAAgC,CAC7H,CACF,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,IAAI,GAAG,oBAAoB,CAAC,MAAM,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAC7D,IAAI,IAAI,IAAI,oBAAoB,CAAC,KAAK,EAAE,CAAC;QACvC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;IACvB,CAAC;IAED,iFAAiF;IACjF,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAElE,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,30 @@
1
+ declare const PerformanceTimingKeys: readonly ["updateSetStateTrigger", "updateDiffVdomStart", "updateDiffVdomEnd", "diffVdomStart", "diffVdomEnd", "packChangesStart", "packChangesEnd", "parseChangesStart", "parseChangesEnd", "patchChangesStart", "patchChangesEnd", "hydrateParseSnapshotStart", "hydrateParseSnapshotEnd", "mtsRenderStart", "mtsRenderEnd"];
2
+ declare const PerformanceTimingFlags: {
3
+ readonly reactLynxHydrate: "react_lynx_hydrate";
4
+ };
5
+ declare const PipelineOrigins: {
6
+ readonly reactLynxHydrate: "reactLynxHydrate";
7
+ readonly updateTriggeredByBts: "updateTriggeredByBts";
8
+ };
9
+ type PerformanceTimingKey = typeof PerformanceTimingKeys[number];
10
+ type PipelineOrigin = typeof PipelineOrigins[keyof typeof PipelineOrigins];
11
+ /**
12
+ * @deprecated used by old timing api(setState timing flag)
13
+ */
14
+ declare const PerfSpecificKey = "__lynx_timing_flag";
15
+ declare let globalPipelineOptions: PipelineOptions | undefined;
16
+ interface TimingAPIOptions {
17
+ shouldStartUpdatePipeline: () => boolean;
18
+ beginPipeline?: typeof beginPipeline;
19
+ }
20
+ /**
21
+ * @deprecated used by old timing api(setState timing flag)
22
+ */
23
+ declare function markTimingLegacy(key: PerformanceTimingKey, timingFlag_?: string): void;
24
+ declare function beginPipeline(needTimestamps: boolean, pipelineOrigin: PipelineOrigin, timingFlag?: string): void;
25
+ declare function setPipeline(pipeline: PipelineOptions | undefined): void;
26
+ declare function resetTimingState(): void;
27
+ declare function markTiming(timestampKey: PerformanceTimingKey, force?: boolean): void;
28
+ declare function initTimingAPI(timingAPIOptions: TimingAPIOptions): void;
29
+ export { PerformanceTimingFlags, PipelineOrigins, PerfSpecificKey, markTimingLegacy, initTimingAPI, beginPipeline, markTiming, setPipeline, resetTimingState, globalPipelineOptions, };
30
+ export type { PerformanceTimingKey, PipelineOrigin };
@@ -0,0 +1,145 @@
1
+ // Copyright 2026 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 { options } from 'preact';
5
+ import { RENDER_COMPONENT, ROOT } from '../shared/render-constants.js';
6
+ import { hook, isSdkVersionGt } from '../utils.js';
7
+ const PerformanceTimingKeys = [
8
+ 'updateSetStateTrigger',
9
+ 'updateDiffVdomStart',
10
+ 'updateDiffVdomEnd',
11
+ // updateSetStateTrigger, updateDiffVdomStart and updateDiffVdomEnd is deprecated
12
+ 'diffVdomStart',
13
+ 'diffVdomEnd',
14
+ 'packChangesStart',
15
+ 'packChangesEnd',
16
+ 'parseChangesStart',
17
+ 'parseChangesEnd',
18
+ 'patchChangesStart',
19
+ 'patchChangesEnd',
20
+ 'hydrateParseSnapshotStart',
21
+ 'hydrateParseSnapshotEnd',
22
+ 'mtsRenderStart',
23
+ 'mtsRenderEnd',
24
+ ];
25
+ const PerformanceTimingFlags = {
26
+ reactLynxHydrate: 'react_lynx_hydrate',
27
+ };
28
+ const PipelineOrigins = {
29
+ reactLynxHydrate: 'reactLynxHydrate',
30
+ updateTriggeredByBts: 'updateTriggeredByBts',
31
+ };
32
+ /**
33
+ * @deprecated used by old timing api(setState timing flag)
34
+ */
35
+ const PerfSpecificKey = '__lynx_timing_flag';
36
+ let timingFlag;
37
+ let shouldMarkDiffVdomStart = false;
38
+ let shouldMarkDiffVdomEnd = false;
39
+ let globalPipelineOptions;
40
+ let activeTimingAPIOptions;
41
+ let didInstallTimingAPIHooks = false;
42
+ /**
43
+ * @deprecated used by old timing api(setState timing flag)
44
+ */
45
+ function markTimingLegacy(key, timingFlag_) {
46
+ switch (key) {
47
+ case 'updateSetStateTrigger': {
48
+ shouldMarkDiffVdomStart = true;
49
+ shouldMarkDiffVdomEnd = true;
50
+ timingFlag = timingFlag_;
51
+ break;
52
+ }
53
+ case 'updateDiffVdomStart': {
54
+ if (!shouldMarkDiffVdomStart) {
55
+ return;
56
+ }
57
+ shouldMarkDiffVdomStart = false;
58
+ break;
59
+ }
60
+ case 'updateDiffVdomEnd': {
61
+ if (!shouldMarkDiffVdomEnd) {
62
+ return;
63
+ }
64
+ shouldMarkDiffVdomEnd = false;
65
+ break;
66
+ }
67
+ }
68
+ lynx.getNativeApp().markTiming?.(timingFlag, key);
69
+ }
70
+ function beginPipeline(needTimestamps, pipelineOrigin, timingFlag) {
71
+ globalPipelineOptions = lynx.performance?._generatePipelineOptions?.();
72
+ if (globalPipelineOptions) {
73
+ globalPipelineOptions.needTimestamps = needTimestamps;
74
+ globalPipelineOptions.pipelineOrigin = pipelineOrigin;
75
+ globalPipelineOptions.dsl = 'reactLynx';
76
+ switch (pipelineOrigin) {
77
+ case PipelineOrigins.reactLynxHydrate:
78
+ globalPipelineOptions.stage = 'hydrate';
79
+ break;
80
+ case PipelineOrigins.updateTriggeredByBts:
81
+ globalPipelineOptions.stage = 'update';
82
+ break;
83
+ }
84
+ if (isSdkVersionGt(3, 0)) {
85
+ lynx.performance?._onPipelineStart?.(globalPipelineOptions.pipelineID, globalPipelineOptions);
86
+ }
87
+ else {
88
+ lynx.performance?._onPipelineStart?.(globalPipelineOptions.pipelineID);
89
+ }
90
+ if (timingFlag) {
91
+ lynx.performance?._bindPipelineIdWithTimingFlag?.(globalPipelineOptions.pipelineID, timingFlag);
92
+ }
93
+ }
94
+ }
95
+ function setPipeline(pipeline) {
96
+ globalPipelineOptions = pipeline;
97
+ }
98
+ function resetTimingState() {
99
+ timingFlag = undefined;
100
+ shouldMarkDiffVdomStart = false;
101
+ shouldMarkDiffVdomEnd = false;
102
+ globalPipelineOptions = undefined;
103
+ }
104
+ function markTiming(timestampKey, force) {
105
+ if (globalPipelineOptions && (force || globalPipelineOptions.needTimestamps)) {
106
+ lynx.performance?._markTiming?.(globalPipelineOptions.pipelineID, timestampKey);
107
+ }
108
+ }
109
+ function initTimingAPI(timingAPIOptions) {
110
+ activeTimingAPIOptions = timingAPIOptions;
111
+ resetTimingState();
112
+ if (didInstallTimingAPIHooks) {
113
+ return;
114
+ }
115
+ didInstallTimingAPIHooks = true;
116
+ const helper = () => {
117
+ const timingAPIOptions = activeTimingAPIOptions;
118
+ /* v8 ignore start */
119
+ if (!timingAPIOptions) {
120
+ return;
121
+ }
122
+ /* v8 ignore stop */
123
+ const startPipeline = timingAPIOptions.beginPipeline ?? beginPipeline;
124
+ if (__JS__ && timingAPIOptions.shouldStartUpdatePipeline()) {
125
+ if (!globalPipelineOptions) {
126
+ startPipeline(false, PipelineOrigins.updateTriggeredByBts);
127
+ markTiming('diffVdomStart', true);
128
+ }
129
+ if (shouldMarkDiffVdomStart) {
130
+ markTimingLegacy('updateDiffVdomStart');
131
+ }
132
+ }
133
+ };
134
+ const onHook = (old, ...args) => {
135
+ helper();
136
+ /* v8 ignore start */
137
+ if (old)
138
+ old(...args);
139
+ /* v8 ignore stop */
140
+ };
141
+ hook(options, RENDER_COMPONENT, onHook);
142
+ hook(options, ROOT, onHook);
143
+ }
144
+ export { PerformanceTimingFlags, PipelineOrigins, PerfSpecificKey, markTimingLegacy, initTimingAPI, beginPipeline, markTiming, setPipeline, resetTimingState, globalPipelineOptions, };
145
+ //# sourceMappingURL=performance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performance.js","sourceRoot":"","sources":["../../src/core/performance.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD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C1C,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,CAAsB,GAAuC,EAAE,GAAG,IAAO,EAAE,EAAE;QAC1F,MAAM,EAAE,CAAC;QACT,qBAAqB;QACrB,IAAI,GAAG;YAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;QACtB,oBAAoB;IACtB,CAAC,CAAC;IAEF,IAAI,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;IACxC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,qBAAqB,GACtB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { NodesRef } from '@lynx-js/types';
2
+ export type RefCleanup = (() => void) | void;
3
+ export type RefCallback<T> = ((ref: T | null) => RefCleanup) & {
4
+ _unmount?: RefCleanup;
5
+ };
6
+ export interface RefObject<T> {
7
+ current: T | null;
8
+ }
9
+ export type OrdinaryRef<T> = RefCallback<T> | RefObject<T>;
10
+ type FunctionPropertyNames<T> = {
11
+ [K in keyof T]: T[K] extends (...args: unknown[]) => unknown ? K : never;
12
+ }[keyof T];
13
+ export type ForwardableNodesRefMethod = Exclude<FunctionPropertyNames<NodesRef>, 'exec'>;
14
+ export type RefProxyForwardedMethods<TProxy> = {
15
+ [K in ForwardableNodesRefMethod]: (...args: Parameters<NodesRef[K]>) => TProxy;
16
+ };
17
+ export declare function assertValidRef<T>(value: unknown): OrdinaryRef<T>;
18
+ export declare function normalizeRefValue<T>(value: unknown): OrdinaryRef<T> | null | undefined;
19
+ export declare function applyOrdinaryRef<T>(ref: OrdinaryRef<T>, value: T | null): void;
20
+ export declare class OrdinaryRefEffectQueue<TProxy, TToken> {
21
+ private readonly refsToClear;
22
+ private readonly refsToApply;
23
+ queue(oldRef: OrdinaryRef<TProxy> | null | undefined, newRef: OrdinaryRef<TProxy> | null | undefined, token: TToken): void;
24
+ flush(createValue: (token: TToken) => TProxy): void;
25
+ clear(): void;
26
+ hasPending(): boolean;
27
+ }
28
+ export declare abstract class SelectorRefProxy<TProxy extends SelectorRefProxy<TProxy>> {
29
+ private task;
30
+ protected createProxy(): TProxy;
31
+ protected abstract createProxyTarget(): TProxy;
32
+ protected abstract runOrDelay(task: () => void): void;
33
+ abstract get selector(): string;
34
+ private setTask;
35
+ exec(): void;
36
+ }
37
+ export {};
@@ -0,0 +1,108 @@
1
+ // Copyright 2026 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
+ export function assertValidRef(value) {
5
+ if (typeof value === 'function'
6
+ || (typeof value === 'object' && value !== null && 'current' in value)) {
7
+ return value;
8
+ }
9
+ throw new Error(`Elements' "ref" property should be a function, or an object created `
10
+ + `by createRef(), but got [${typeof value}] instead`);
11
+ }
12
+ export function normalizeRefValue(value) {
13
+ if (value === null || value === undefined) {
14
+ return value;
15
+ }
16
+ return assertValidRef(value);
17
+ }
18
+ export function applyOrdinaryRef(ref, value) {
19
+ try {
20
+ if (typeof ref === 'function') {
21
+ const cleanup = ref._unmount;
22
+ const hasCleanup = typeof cleanup === 'function';
23
+ if (hasCleanup) {
24
+ cleanup();
25
+ }
26
+ ref._unmount = undefined;
27
+ if (!hasCleanup || value !== null) {
28
+ const nextCleanup = ref(value);
29
+ if (typeof nextCleanup === 'function') {
30
+ ref._unmount = nextCleanup;
31
+ }
32
+ }
33
+ }
34
+ else {
35
+ ref.current = value;
36
+ }
37
+ }
38
+ catch (error) {
39
+ lynx.reportError(error);
40
+ }
41
+ }
42
+ // Keeps the Snapshot/ET ordinary ref ordering shared without owning backend
43
+ // timing: each backend decides when to queue/flush and how to build the proxy.
44
+ export class OrdinaryRefEffectQueue {
45
+ refsToClear = [];
46
+ refsToApply = [];
47
+ queue(oldRef, newRef, token) {
48
+ if (oldRef === newRef) {
49
+ return;
50
+ }
51
+ if (oldRef) {
52
+ this.refsToClear.push(oldRef);
53
+ }
54
+ if (newRef) {
55
+ this.refsToApply.push([newRef, token]);
56
+ }
57
+ }
58
+ flush(createValue) {
59
+ // Ref callbacks can synchronously trigger more work; detach this batch from
60
+ // the queue before invoking user code so later effects stay in the next batch.
61
+ const refsToClearNow = this.refsToClear.splice(0);
62
+ const refsToApplyNow = this.refsToApply.splice(0);
63
+ for (const ref of refsToClearNow) {
64
+ applyOrdinaryRef(ref, null);
65
+ }
66
+ for (const [ref, token] of refsToApplyNow) {
67
+ applyOrdinaryRef(ref, createValue(token));
68
+ }
69
+ }
70
+ clear() {
71
+ this.refsToClear.length = 0;
72
+ this.refsToApply.length = 0;
73
+ }
74
+ hasPending() {
75
+ return this.refsToClear.length > 0 || this.refsToApply.length > 0;
76
+ }
77
+ }
78
+ export class SelectorRefProxy {
79
+ task;
80
+ createProxy() {
81
+ return new Proxy(this, {
82
+ get: (target, prop, receiver) => {
83
+ if (typeof prop === 'symbol'
84
+ || prop === 'then'
85
+ || prop in target
86
+ || typeof prop !== 'string') {
87
+ return Reflect.get(target, prop, receiver);
88
+ }
89
+ return (...args) => {
90
+ return target.createProxyTarget().setTask(prop, args);
91
+ };
92
+ },
93
+ });
94
+ }
95
+ setTask(method, args) {
96
+ this.task = (nodesRef) => {
97
+ const nodesRefMethod = nodesRef[method];
98
+ return nodesRefMethod.apply(nodesRef, args);
99
+ };
100
+ return this;
101
+ }
102
+ exec() {
103
+ this.runOrDelay(() => {
104
+ this.task(lynx.createSelectorQuery().select(this.selector)).exec();
105
+ });
106
+ }
107
+ }
108
+ //# sourceMappingURL=ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref.js","sourceRoot":"","sources":["../../src/core/ref.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAwB1D,MAAM,UAAU,cAAc,CA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AAgB,gBAAgB;IAC5B,IAAI,CAAsB;IAExB,WAAW;QACnB,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACrB,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;gBAC9B,IACE,OAAO,IAAI,KAAK,QAAQ;uBACrB,IAAI,KAAK,MAAM;uBACf,IAAI,IAAI,MAAM;uBACd,OAAO,IAAI,KAAK,QAAQ,EAC3B,CAAC;oBACD,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;gBAC7C,CAAC;gBAED,OAAO,CAAsC,GAAG,IAA6B,EAAE,EAAE;oBAC/E,OAAO,MAAM,CAAC,iBAAiB,EAAE,CAAC,OAAO,CAAC,IAAiC,EAAE,IAAI,CAAC,CAAC;gBACrF,CAAC,CAAC;YACJ,CAAC;SACF,CAAsB,CAAC;IAC1B,CAAC;IAQO,OAAO,CACb,MAAS,EACT,IAA6B;QAE7B,IAAI,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,EAAE;YACvB,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAA0D,CAAC;YACjG,OAAO,cAAc,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC,CAAC;QACF,OAAO,IAAyB,CAAC;IACnC,CAAC;IAED,IAAI;QACF,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,IAAK,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACtE,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export declare function getReloadVersion(): number;
2
+ export declare function increaseReloadVersion(): number;
@@ -1,12 +1,11 @@
1
- // Copyright 2024 The Lynx Authors. All rights reserved.
1
+ // Copyright 2026 The Lynx Authors. All rights reserved.
2
2
  // Licensed under the Apache License Version 2.0 that can be found in the
3
3
  // LICENSE file in the root directory of this source tree.
4
4
  let reloadVersion = 0;
5
- function getReloadVersion() {
5
+ export function getReloadVersion() {
6
6
  return reloadVersion;
7
7
  }
8
- function increaseReloadVersion() {
8
+ export function increaseReloadVersion() {
9
9
  return ++reloadVersion;
10
10
  }
11
- export { getReloadVersion, increaseReloadVersion };
12
- //# sourceMappingURL=pass.js.map
11
+ //# sourceMappingURL=reload-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reload-version.js","sourceRoot":"","sources":["../../src/core/reload-version.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB,MAAM,UAAU,gBAAgB;IAC9B,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,EAAE,aAAa,CAAC;AACzB,CAAC"}
@@ -1,2 +1,7 @@
1
1
  import type { SerializableValue } from '../protocol/types.js';
2
- export declare function prepareAttributeSlots(templateKey: string, handleId: number, rawSlots: readonly unknown[]): SerializableValue[];
2
+ export interface PrepareAttributeSlotsOptions {
3
+ previousRawSlots?: readonly unknown[];
4
+ queueRefEffects?: boolean;
5
+ }
6
+ export declare function prepareAttributeSlots(templateKey: string, handleId: number, rawSlots: readonly unknown[], options?: PrepareAttributeSlotsOptions): SerializableValue[];
7
+ export declare function queueRefAttributeSlotUpdates(templateKey: string, handleId: number, previousRawSlots?: readonly unknown[], nextRawSlots?: readonly unknown[]): void;
@@ -1,7 +1,8 @@
1
1
  // Copyright 2026 The Lynx Authors. All rights reserved.
2
2
  // Licensed under the Apache License Version 2.0 that can be found in the
3
3
  // LICENSE file in the root directory of this source tree.
4
- import { __etAttrPlanMap } from '../runtime/template/attr-slot-plan.js';
4
+ import { getSpreadRefFromValue, queueRefAttrUpdate } from '../prop-adapters/ref.js';
5
+ import { __etAttrPlanMap, adaptRefAttrSlot, adaptSpreadAttrSlot } from '../runtime/template/attr-slot-plan.js';
5
6
  function normalizeAttributeSlots(rawSlots) {
6
7
  let normalizedSlots;
7
8
  for (let slotIndex = 0; slotIndex < rawSlots.length; slotIndex += 1) {
@@ -14,7 +15,25 @@ function normalizeAttributeSlots(rawSlots) {
14
15
  }
15
16
  return normalizedSlots ?? rawSlots;
16
17
  }
17
- export function prepareAttributeSlots(templateKey, handleId, rawSlots) {
18
+ function queuePlannedRefAttributeSlotUpdates(handleId, attrPlan, previousRawSlots, nextRawSlots) {
19
+ for (let planIndex = 0; planIndex < attrPlan.length; planIndex += 2) {
20
+ const attrSlotIndex = attrPlan[planIndex];
21
+ const adapter = attrPlan[planIndex + 1];
22
+ if (adapter === adaptRefAttrSlot) {
23
+ queueRefAttrUpdate(previousRawSlots?.[attrSlotIndex], nextRawSlots?.[attrSlotIndex], handleId, attrSlotIndex);
24
+ continue;
25
+ }
26
+ if (adapter === adaptSpreadAttrSlot) {
27
+ const previousSpreadRef = getSpreadRefFromValue(previousRawSlots?.[attrSlotIndex]);
28
+ const nextSpreadRef = getSpreadRefFromValue(nextRawSlots?.[attrSlotIndex]);
29
+ if (previousSpreadRef === undefined && nextSpreadRef === undefined) {
30
+ continue;
31
+ }
32
+ queueRefAttrUpdate(previousSpreadRef, nextSpreadRef ?? null, handleId, attrSlotIndex);
33
+ }
34
+ }
35
+ }
36
+ export function prepareAttributeSlots(templateKey, handleId, rawSlots, options) {
18
37
  const attrPlan = __etAttrPlanMap[templateKey];
19
38
  if (!attrPlan || attrPlan.length === 0) {
20
39
  return normalizeAttributeSlots(rawSlots);
@@ -23,12 +42,26 @@ export function prepareAttributeSlots(templateKey, handleId, rawSlots) {
23
42
  const preparedSlots = normalizedSlots === rawSlots
24
43
  ? rawSlots.slice()
25
44
  : normalizedSlots;
45
+ const shouldQueueRefEffects = options?.queueRefEffects === true;
46
+ const previousRawSlots = options?.previousRawSlots;
26
47
  for (let planIndex = 0; planIndex < attrPlan.length; planIndex += 2) {
27
48
  const attrSlotIndex = attrPlan[planIndex];
28
49
  const adapter = attrPlan[planIndex + 1];
29
50
  const rawValue = rawSlots[attrSlotIndex];
30
51
  preparedSlots[attrSlotIndex] = adapter(handleId, attrSlotIndex, rawValue);
31
52
  }
53
+ if (shouldQueueRefEffects) {
54
+ // Ref effects compare raw user refs, not prepared marker strings or the
55
+ // spread wrapper object.
56
+ queuePlannedRefAttributeSlotUpdates(handleId, attrPlan, previousRawSlots, rawSlots);
57
+ }
32
58
  return preparedSlots;
33
59
  }
60
+ export function queueRefAttributeSlotUpdates(templateKey, handleId, previousRawSlots, nextRawSlots) {
61
+ const attrPlan = __etAttrPlanMap[templateKey];
62
+ if (!attrPlan || attrPlan.length === 0) {
63
+ return;
64
+ }
65
+ queuePlannedRefAttributeSlotUpdates(handleId, attrPlan, previousRawSlots, nextRawSlots);
66
+ }
34
67
  //# sourceMappingURL=attr-slots.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attr-slots.js","sourceRoot":"","sources":["../../../src/element-template/background/attr-slots.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,SAAS,uBAAuB,CAAC,QAA4B;IAC3D,IAAI,eAAgD,CAAC;IACrD,KAAK,IAAI,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE,SAAS,IAAI,CAAC,EAAE,CAAC;QACpE,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,SAAS;QACX,CAAC;QACD,eAAe,KAAK,QAAQ,CAAC,KAAK,EAAyB,CAAC;QAC5D,eAAe,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IACpC,CAAC;IACD,OAAO,eAAe,IAAI,QAA+B,CAAC;AAC5D,CAAC;AAED,MAAM,U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