@lynx-js/react 0.119.0 → 0.121.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 (549) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/package.json +39 -11
  3. package/runtime/lazy/compat.js +1 -0
  4. package/runtime/lazy/internal.js +3 -0
  5. package/runtime/lazy/react.js +1 -0
  6. package/runtime/lib/core/hooks/mainThread.d.ts +1 -0
  7. package/runtime/lib/core/hooks/mainThread.js +7 -0
  8. package/runtime/lib/core/hooks/mainThread.js.map +1 -0
  9. package/runtime/lib/{hooks/mainThread.d.ts → core/hooks/mainThreadImpl.d.ts} +2 -1
  10. package/runtime/lib/{hooks/mainThread.js → core/hooks/mainThreadImpl.js} +46 -35
  11. package/runtime/lib/core/hooks/mainThreadImpl.js.map +1 -0
  12. package/runtime/lib/{hooks → core/hooks}/react.js +1 -1
  13. package/runtime/lib/core/hooks/react.js.map +1 -0
  14. package/runtime/lib/{hooks → core/hooks}/useLynxGlobalEventListener.d.ts +1 -1
  15. package/runtime/lib/{hooks → core/hooks}/useLynxGlobalEventListener.js +1 -1
  16. package/runtime/lib/core/hooks/useLynxGlobalEventListener.js.map +1 -0
  17. package/runtime/lib/document.d.ts +4 -4
  18. package/runtime/lib/document.js +14 -12
  19. package/runtime/lib/document.js.map +1 -1
  20. package/runtime/lib/element-template/background/attr-slots.d.ts +2 -0
  21. package/runtime/lib/element-template/background/attr-slots.js +34 -0
  22. package/runtime/lib/element-template/background/attr-slots.js.map +1 -0
  23. package/runtime/lib/element-template/background/commit-context.d.ts +13 -0
  24. package/runtime/lib/element-template/background/commit-context.js +25 -0
  25. package/runtime/lib/element-template/background/commit-context.js.map +1 -0
  26. package/runtime/lib/element-template/background/commit-hook.d.ts +7 -0
  27. package/runtime/lib/element-template/background/commit-hook.js +96 -0
  28. package/runtime/lib/element-template/background/commit-hook.js.map +1 -0
  29. package/runtime/lib/element-template/background/destroy.d.ts +1 -0
  30. package/runtime/lib/element-template/background/destroy.js +17 -0
  31. package/runtime/lib/element-template/background/destroy.js.map +1 -0
  32. package/runtime/lib/element-template/background/document.d.ts +7 -0
  33. package/runtime/lib/element-template/background/document.js +27 -0
  34. package/runtime/lib/element-template/background/document.js.map +1 -0
  35. package/runtime/lib/element-template/background/hydrate.d.ts +4 -0
  36. package/runtime/lib/element-template/background/hydrate.js +219 -0
  37. package/runtime/lib/element-template/background/hydrate.js.map +1 -0
  38. package/runtime/lib/element-template/background/hydration-listener.d.ts +2 -0
  39. package/runtime/lib/element-template/background/hydration-listener.js +93 -0
  40. package/runtime/lib/element-template/background/hydration-listener.js.map +1 -0
  41. package/runtime/lib/element-template/background/instance.d.ts +39 -0
  42. package/runtime/lib/element-template/background/instance.js +349 -0
  43. package/runtime/lib/element-template/background/instance.js.map +1 -0
  44. package/runtime/lib/element-template/background/manager.d.ts +10 -0
  45. package/runtime/lib/element-template/background/manager.js +60 -0
  46. package/runtime/lib/element-template/background/manager.js.map +1 -0
  47. package/runtime/lib/element-template/client/root.d.ts +36 -0
  48. package/runtime/lib/element-template/client/root.js +33 -0
  49. package/runtime/lib/element-template/client/root.js.map +1 -0
  50. package/runtime/lib/element-template/debug/alog.d.ts +34 -0
  51. package/runtime/lib/element-template/debug/alog.js +93 -0
  52. package/runtime/lib/element-template/debug/alog.js.map +1 -0
  53. package/runtime/lib/element-template/debug/elementPAPICall.d.ts +1 -0
  54. package/runtime/lib/element-template/debug/elementPAPICall.js +75 -0
  55. package/runtime/lib/element-template/debug/elementPAPICall.js.map +1 -0
  56. package/runtime/lib/element-template/debug/profile.d.ts +3 -0
  57. package/runtime/lib/element-template/debug/profile.js +141 -0
  58. package/runtime/lib/element-template/debug/profile.js.map +1 -0
  59. package/runtime/lib/element-template/hooks/react.d.ts +14 -0
  60. package/runtime/lib/element-template/hooks/react.js +24 -0
  61. package/runtime/lib/element-template/hooks/react.js.map +1 -0
  62. package/runtime/lib/element-template/index.d.ts +7 -0
  63. package/runtime/lib/element-template/index.js +45 -0
  64. package/runtime/lib/element-template/index.js.map +1 -0
  65. package/runtime/lib/element-template/internal.d.ts +6 -0
  66. package/runtime/lib/element-template/internal.js +44 -0
  67. package/runtime/lib/element-template/internal.js.map +1 -0
  68. package/runtime/lib/element-template/jsx-dev-runtime/index.d.ts +1 -0
  69. package/runtime/lib/element-template/jsx-dev-runtime/index.js +5 -0
  70. package/runtime/lib/element-template/jsx-dev-runtime/index.js.map +1 -0
  71. package/runtime/lib/element-template/jsx-runtime/index.d.ts +19 -0
  72. package/runtime/lib/element-template/jsx-runtime/index.js +60 -0
  73. package/runtime/lib/element-template/jsx-runtime/index.js.map +1 -0
  74. package/runtime/lib/element-template/lynx/env.js +89 -0
  75. package/runtime/lib/element-template/lynx/env.js.map +1 -0
  76. package/runtime/lib/element-template/lynx/performance.d.ts +23 -0
  77. package/runtime/lib/element-template/lynx/performance.js +135 -0
  78. package/runtime/lib/element-template/lynx/performance.js.map +1 -0
  79. package/runtime/lib/element-template/native/callDestroyLifetimeFun.d.ts +1 -0
  80. package/runtime/lib/element-template/native/callDestroyLifetimeFun.js +8 -0
  81. package/runtime/lib/element-template/native/callDestroyLifetimeFun.js.map +1 -0
  82. package/runtime/lib/element-template/native/index.d.ts +1 -0
  83. package/runtime/lib/element-template/native/index.js +53 -0
  84. package/runtime/lib/element-template/native/index.js.map +1 -0
  85. package/runtime/lib/element-template/native/main-thread-api.js +27 -0
  86. package/runtime/lib/element-template/native/main-thread-api.js.map +1 -0
  87. package/runtime/lib/element-template/native/mts-destroy.d.ts +3 -0
  88. package/runtime/lib/element-template/native/mts-destroy.js +37 -0
  89. package/runtime/lib/element-template/native/mts-destroy.js.map +1 -0
  90. package/runtime/lib/element-template/native/patch-listener.d.ts +2 -0
  91. package/runtime/lib/element-template/native/patch-listener.js +66 -0
  92. package/runtime/lib/element-template/native/patch-listener.js.map +1 -0
  93. package/runtime/lib/element-template/prop-adapters/event-value.d.ts +1 -0
  94. package/runtime/lib/element-template/prop-adapters/event-value.js +7 -0
  95. package/runtime/lib/element-template/prop-adapters/event-value.js.map +1 -0
  96. package/runtime/lib/element-template/prop-adapters/event.d.ts +7 -0
  97. package/runtime/lib/element-template/prop-adapters/event.js +61 -0
  98. package/runtime/lib/element-template/prop-adapters/event.js.map +1 -0
  99. package/runtime/lib/element-template/prop-adapters/spread.d.ts +5 -0
  100. package/runtime/lib/element-template/prop-adapters/spread.js +45 -0
  101. package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -0
  102. package/runtime/lib/element-template/protocol/lifecycle-constant.d.ts +4 -0
  103. package/runtime/lib/element-template/protocol/lifecycle-constant.js +9 -0
  104. package/runtime/lib/element-template/protocol/lifecycle-constant.js.map +1 -0
  105. package/runtime/lib/element-template/protocol/opcodes.d.ts +7 -0
  106. package/runtime/lib/element-template/protocol/opcodes.js +10 -0
  107. package/runtime/lib/element-template/protocol/opcodes.js.map +1 -0
  108. package/runtime/lib/element-template/protocol/types.d.ts +50 -0
  109. package/runtime/lib/element-template/protocol/types.js +5 -0
  110. package/runtime/lib/element-template/protocol/types.js.map +1 -0
  111. package/runtime/lib/element-template/runtime/components/slot.js +11 -0
  112. package/runtime/lib/element-template/runtime/components/slot.js.map +1 -0
  113. package/runtime/lib/element-template/runtime/page/page.d.ts +2 -0
  114. package/runtime/lib/element-template/runtime/page/page.js +8 -0
  115. package/runtime/lib/element-template/runtime/page/page.js.map +1 -0
  116. package/runtime/lib/element-template/runtime/page/root-instance.d.ts +10 -0
  117. package/runtime/lib/element-template/runtime/page/root-instance.js +17 -0
  118. package/runtime/lib/element-template/runtime/page/root-instance.js.map +1 -0
  119. package/runtime/lib/element-template/runtime/patch.d.ts +3 -0
  120. package/runtime/lib/element-template/runtime/patch.js +145 -0
  121. package/runtime/lib/element-template/runtime/patch.js.map +1 -0
  122. package/runtime/lib/element-template/runtime/render/render-main-thread.js +53 -0
  123. package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -0
  124. package/runtime/lib/element-template/runtime/render/render-opcodes.d.ts +4 -0
  125. package/runtime/lib/element-template/runtime/render/render-opcodes.js +134 -0
  126. package/runtime/lib/element-template/runtime/render/render-opcodes.js.map +1 -0
  127. package/runtime/lib/element-template/runtime/render/render-to-opcodes.d.ts +14 -0
  128. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js +272 -0
  129. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js.map +1 -0
  130. package/runtime/lib/element-template/runtime/template/attr-slot-plan.d.ts +11 -0
  131. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js +23 -0
  132. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js.map +1 -0
  133. package/runtime/lib/element-template/runtime/template/handle.d.ts +5 -0
  134. package/runtime/lib/element-template/runtime/template/handle.js +23 -0
  135. package/runtime/lib/element-template/runtime/template/handle.js.map +1 -0
  136. package/runtime/lib/element-template/runtime/template/registry.d.ts +13 -0
  137. package/runtime/lib/element-template/runtime/template/registry.js +46 -0
  138. package/runtime/lib/element-template/runtime/template/registry.js.map +1 -0
  139. package/runtime/lib/index.d.ts +7 -5
  140. package/runtime/lib/index.js +9 -6
  141. package/runtime/lib/index.js.map +1 -1
  142. package/runtime/lib/internal.d.ts +22 -20
  143. package/runtime/lib/internal.js +26 -23
  144. package/runtime/lib/internal.js.map +1 -1
  145. package/runtime/lib/lynx-api.d.ts +5 -5
  146. package/runtime/lib/lynx-api.js +9 -9
  147. package/runtime/lib/lynx-api.js.map +1 -1
  148. package/runtime/lib/lynx.d.ts +2 -2
  149. package/runtime/lib/lynx.js +17 -17
  150. package/runtime/lib/lynx.js.map +1 -1
  151. package/runtime/lib/root.d.ts +2 -2
  152. package/runtime/lib/root.js +2 -2
  153. package/runtime/lib/root.js.map +1 -1
  154. package/runtime/lib/{debug → shared}/component-stack.js +1 -1
  155. package/runtime/lib/shared/component-stack.js.map +1 -0
  156. package/runtime/lib/{debug → shared}/profile.js +6 -4
  157. package/runtime/lib/shared/profile.js.map +1 -0
  158. package/runtime/lib/{renderToOpcodes/constants.js → shared/render-constants.js} +1 -1
  159. package/runtime/lib/shared/render-constants.js.map +1 -0
  160. package/runtime/lib/{alog → snapshot/alog}/elementPAPICall.js +1 -1
  161. package/runtime/lib/snapshot/alog/elementPAPICall.js.map +1 -0
  162. package/runtime/lib/snapshot/alog/index.js.map +1 -0
  163. package/runtime/lib/{alog → snapshot/alog}/render.js +2 -2
  164. package/runtime/lib/snapshot/alog/render.js.map +1 -0
  165. package/runtime/lib/snapshot/compat/componentIs.js.map +1 -0
  166. package/runtime/lib/{compat → snapshot/compat}/initData.d.ts +2 -2
  167. package/runtime/lib/{compat → snapshot/compat}/initData.js +1 -1
  168. package/runtime/lib/snapshot/compat/initData.js.map +1 -0
  169. package/runtime/lib/snapshot/compat/lynxComponent.js.map +1 -0
  170. package/runtime/lib/snapshot/debug/debug.js.map +1 -0
  171. package/runtime/lib/snapshot/debug/describeInvalidValue.js.map +1 -0
  172. package/runtime/lib/snapshot/debug/formatPatch.js.map +1 -0
  173. package/runtime/lib/snapshot/debug/printSnapshot.js.map +1 -0
  174. package/runtime/lib/{debug → snapshot/debug}/profileHooks.js +2 -2
  175. package/runtime/lib/snapshot/debug/profileHooks.js.map +1 -0
  176. package/runtime/lib/{debug → snapshot/debug}/vnodeSource.js +1 -1
  177. package/runtime/lib/snapshot/debug/vnodeSource.js.map +1 -0
  178. package/runtime/lib/{gesture → snapshot/gesture}/processGesture.d.ts +2 -0
  179. package/runtime/lib/{gesture → snapshot/gesture}/processGesture.js +40 -3
  180. package/runtime/lib/snapshot/gesture/processGesture.js.map +1 -0
  181. package/runtime/lib/snapshot/gesture/processGestureBagkround.d.ts +9 -0
  182. package/runtime/lib/snapshot/gesture/processGestureBagkround.js +80 -0
  183. package/runtime/lib/snapshot/gesture/processGestureBagkround.js.map +1 -0
  184. package/runtime/lib/snapshot/gesture/types.js.map +1 -0
  185. package/runtime/lib/snapshot/index.d.ts +1 -4
  186. package/runtime/lib/snapshot/index.js +2 -5
  187. package/runtime/lib/snapshot/index.js.map +1 -1
  188. package/runtime/lib/{legacy-react-runtime → snapshot/legacy-react-runtime}/index.d.ts +2 -2
  189. package/runtime/lib/{legacy-react-runtime → snapshot/legacy-react-runtime}/index.js +2 -2
  190. package/runtime/lib/snapshot/legacy-react-runtime/index.js.map +1 -0
  191. package/runtime/lib/snapshot/lifecycle/constant.js.map +1 -0
  192. package/runtime/lib/{lifecycle → snapshot/lifecycle}/destroy.js +2 -2
  193. package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -0
  194. package/runtime/lib/snapshot/lifecycle/event/delayEvents.js.map +1 -0
  195. package/runtime/lib/snapshot/lifecycle/event/delayLifecycleEvents.js.map +1 -0
  196. package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/jsReady.js +2 -2
  197. package/runtime/lib/snapshot/lifecycle/event/jsReady.js.map +1 -0
  198. package/runtime/lib/{lifecycle → snapshot/lifecycle}/isRendering.js +2 -2
  199. package/runtime/lib/snapshot/lifecycle/isRendering.js.map +1 -0
  200. package/runtime/lib/snapshot/lifecycle/pass.js.map +1 -0
  201. package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/commit.js +3 -3
  202. package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -0
  203. package/runtime/lib/snapshot/lifecycle/patch/error.js.map +1 -0
  204. package/runtime/lib/snapshot/lifecycle/patch/globalState.js.map +1 -0
  205. package/runtime/lib/snapshot/lifecycle/patch/isMainThreadHydrating.js.map +1 -0
  206. package/runtime/lib/snapshot/lifecycle/patch/nodesRefApply.d.ts +15 -0
  207. package/runtime/lib/snapshot/lifecycle/patch/nodesRefApply.js +102 -0
  208. package/runtime/lib/snapshot/lifecycle/patch/nodesRefApply.js.map +1 -0
  209. package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/snapshotPatch.d.ts +2 -0
  210. package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/snapshotPatch.js +27 -2
  211. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js.map +1 -0
  212. package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/snapshotPatchApply.js +28 -0
  213. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js.map +1 -0
  214. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -0
  215. package/runtime/lib/{lifecycle → snapshot/lifecycle}/ref/delay.d.ts +1 -0
  216. package/runtime/lib/{lifecycle → snapshot/lifecycle}/ref/delay.js +5 -3
  217. package/runtime/lib/snapshot/lifecycle/ref/delay.js.map +1 -0
  218. package/runtime/lib/{lifecycle → snapshot/lifecycle}/reload.js +3 -3
  219. package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -0
  220. package/runtime/lib/snapshot/lifecycle/render.d.ts +2 -0
  221. package/runtime/lib/{lifecycle → snapshot/lifecycle}/render.js +2 -2
  222. package/runtime/lib/snapshot/lifecycle/render.js.map +1 -0
  223. package/runtime/lib/{list → snapshot/list}/list.js +5 -2
  224. package/runtime/lib/snapshot/list/list.js.map +1 -0
  225. package/runtime/lib/{list → snapshot/list}/listUpdateInfo.js +1 -1
  226. package/runtime/lib/snapshot/list/listUpdateInfo.js.map +1 -0
  227. package/runtime/lib/snapshot/list/pendingListUpdates.js.map +1 -0
  228. package/runtime/lib/snapshot/lynx/calledByNative.d.ts +2 -0
  229. package/runtime/lib/{lynx → snapshot/lynx}/calledByNative.js +2 -2
  230. package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -0
  231. package/runtime/lib/{lynx → snapshot/lynx}/component.js +1 -1
  232. package/runtime/lib/snapshot/lynx/component.js.map +1 -0
  233. package/runtime/lib/snapshot/lynx/dynamic-js.js.map +1 -0
  234. package/runtime/lib/snapshot/lynx/element.d.ts +6 -0
  235. package/runtime/lib/snapshot/lynx/element.js +35 -0
  236. package/runtime/lib/snapshot/lynx/element.js.map +1 -0
  237. package/runtime/lib/snapshot/lynx/env.d.ts +1 -0
  238. package/runtime/lib/{lynx → snapshot/lynx}/env.js +1 -4
  239. package/runtime/lib/snapshot/lynx/env.js.map +1 -0
  240. package/runtime/lib/snapshot/lynx/injectLepusMethods.js.map +1 -0
  241. package/runtime/lib/snapshot/lynx/lazy-bundle.js.map +1 -0
  242. package/runtime/lib/snapshot/lynx/nodesRef.d.ts +6 -0
  243. package/runtime/lib/snapshot/lynx/nodesRef.js +31 -0
  244. package/runtime/lib/snapshot/lynx/nodesRef.js.map +1 -0
  245. package/runtime/lib/{lynx → snapshot/lynx}/performance.js +2 -2
  246. package/runtime/lib/snapshot/lynx/performance.js.map +1 -0
  247. package/runtime/lib/snapshot/lynx/portals.d.ts +9 -0
  248. package/runtime/lib/snapshot/lynx/portals.js +120 -0
  249. package/runtime/lib/snapshot/lynx/portals.js.map +1 -0
  250. package/runtime/lib/snapshot/lynx/portalsPending.d.ts +10 -0
  251. package/runtime/lib/snapshot/lynx/portalsPending.js +38 -0
  252. package/runtime/lib/snapshot/lynx/portalsPending.js.map +1 -0
  253. package/runtime/lib/{lynx → snapshot/lynx}/runWithForce.js +2 -2
  254. package/runtime/lib/snapshot/lynx/runWithForce.js.map +1 -0
  255. package/runtime/lib/{lynx → snapshot/lynx}/suspense.js +27 -17
  256. package/runtime/lib/snapshot/lynx/suspense.js.map +1 -0
  257. package/runtime/lib/{lynx → snapshot/lynx}/tt.js +3 -3
  258. package/runtime/lib/snapshot/lynx/tt.js.map +1 -0
  259. package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/hydrate.js +22 -5
  260. package/runtime/lib/snapshot/renderToOpcodes/hydrate.js.map +1 -0
  261. package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/index.js +35 -14
  262. package/runtime/lib/snapshot/renderToOpcodes/index.js.map +1 -0
  263. package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/opcodes.js +5 -3
  264. package/runtime/lib/snapshot/renderToOpcodes/opcodes.js.map +1 -0
  265. package/runtime/lib/snapshot/{backgroundSnapshot.d.ts → snapshot/backgroundSnapshot.d.ts} +2 -1
  266. package/runtime/lib/snapshot/{backgroundSnapshot.js → snapshot/backgroundSnapshot.js} +101 -73
  267. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -0
  268. package/runtime/lib/snapshot/{constants.d.ts → snapshot/constants.d.ts} +4 -0
  269. package/runtime/lib/snapshot/{constants.js → snapshot/constants.js} +4 -0
  270. package/runtime/lib/snapshot/snapshot/constants.js.map +1 -0
  271. package/runtime/lib/snapshot/{definition.d.ts → snapshot/definition.d.ts} +2 -0
  272. package/runtime/lib/snapshot/{definition.js → snapshot/definition.js} +55 -3
  273. package/runtime/lib/snapshot/snapshot/definition.js.map +1 -0
  274. package/runtime/lib/snapshot/{dynamicPartType.d.ts → snapshot/dynamicPartType.d.ts} +14 -0
  275. package/runtime/lib/snapshot/{dynamicPartType.js → snapshot/dynamicPartType.js} +14 -0
  276. package/runtime/lib/snapshot/snapshot/dynamicPartType.js.map +1 -0
  277. package/runtime/lib/snapshot/{event.d.ts → snapshot/event.d.ts} +1 -1
  278. package/runtime/lib/snapshot/{event.js → snapshot/event.js} +0 -4
  279. package/runtime/lib/snapshot/snapshot/event.js.map +1 -0
  280. package/runtime/lib/snapshot/{gesture.js → snapshot/gesture.js} +9 -3
  281. package/runtime/lib/snapshot/snapshot/gesture.js.map +1 -0
  282. package/runtime/lib/snapshot/snapshot/index.d.ts +4 -0
  283. package/runtime/lib/snapshot/snapshot/index.js +8 -0
  284. package/runtime/lib/snapshot/snapshot/index.js.map +1 -0
  285. package/runtime/lib/snapshot/snapshot/list.js.map +1 -0
  286. package/runtime/lib/snapshot/snapshot/platformInfo.js.map +1 -0
  287. package/runtime/lib/snapshot/snapshot/reconstructInstanceTree.d.ts +14 -0
  288. package/runtime/lib/snapshot/snapshot/reconstructInstanceTree.js +27 -0
  289. package/runtime/lib/snapshot/snapshot/reconstructInstanceTree.js.map +1 -0
  290. package/runtime/lib/snapshot/{ref.d.ts → snapshot/ref.d.ts} +1 -0
  291. package/runtime/lib/snapshot/{ref.js → snapshot/ref.js} +13 -1
  292. package/runtime/lib/snapshot/snapshot/ref.js.map +1 -0
  293. package/runtime/lib/snapshot/{snapshot.d.ts → snapshot/snapshot.d.ts} +1 -0
  294. package/runtime/lib/snapshot/{snapshot.js → snapshot/snapshot.js} +90 -11
  295. package/runtime/lib/snapshot/snapshot/snapshot.js.map +1 -0
  296. package/runtime/lib/snapshot/snapshot/snapshotInstanceHydrationMap.js.map +1 -0
  297. package/runtime/lib/snapshot/{spread.d.ts → snapshot/spread.d.ts} +1 -1
  298. package/runtime/lib/snapshot/{spread.js → snapshot/spread.js} +35 -4
  299. package/runtime/lib/snapshot/snapshot/spread.js.map +1 -0
  300. package/runtime/lib/snapshot/{types.d.ts → snapshot/types.d.ts} +1 -0
  301. package/runtime/lib/snapshot/snapshot/types.js.map +1 -0
  302. package/runtime/lib/snapshot/{utils.d.ts → snapshot/utils.d.ts} +1 -3
  303. package/runtime/lib/snapshot/{utils.js → snapshot/utils.js} +5 -0
  304. package/runtime/lib/snapshot/snapshot/utils.js.map +1 -0
  305. package/runtime/lib/snapshot/{workletEvent.d.ts → snapshot/workletEvent.d.ts} +1 -1
  306. package/runtime/lib/snapshot/{workletEvent.js → snapshot/workletEvent.js} +10 -5
  307. package/runtime/lib/snapshot/snapshot/workletEvent.js.map +1 -0
  308. package/runtime/lib/snapshot/{workletRef.d.ts → snapshot/workletRef.d.ts} +1 -1
  309. package/runtime/lib/snapshot/{workletRef.js → snapshot/workletRef.js} +6 -3
  310. package/runtime/lib/snapshot/snapshot/workletRef.js.map +1 -0
  311. package/runtime/lib/snapshot/worklet/call/delayedRunOnMainThreadData.js.map +1 -0
  312. package/runtime/lib/snapshot/worklet/call/execMap.js.map +1 -0
  313. package/runtime/lib/snapshot/worklet/call/functionCall.js.map +1 -0
  314. package/runtime/lib/snapshot/worklet/call/runOnBackground.js.map +1 -0
  315. package/runtime/lib/snapshot/worklet/call/runOnMainThread.js.map +1 -0
  316. package/runtime/lib/snapshot/worklet/call/transformToWorklet.js.map +1 -0
  317. package/runtime/lib/snapshot/worklet/ctx.d.ts +1 -0
  318. package/runtime/lib/snapshot/worklet/ctx.js.map +1 -0
  319. package/runtime/lib/snapshot/worklet/destroy.js.map +1 -0
  320. package/runtime/lib/{worklet → snapshot/worklet}/functionality.js +1 -1
  321. package/runtime/lib/snapshot/worklet/functionality.js.map +1 -0
  322. package/runtime/lib/snapshot/worklet/hmr.js.map +1 -0
  323. package/runtime/lib/snapshot/worklet/indexMap.js.map +1 -0
  324. package/runtime/lib/snapshot/worklet/ref/updateInitValue.js.map +1 -0
  325. package/runtime/lib/{worklet → snapshot/worklet}/ref/workletRef.js +1 -1
  326. package/runtime/lib/snapshot/worklet/ref/workletRef.js.map +1 -0
  327. package/runtime/lib/snapshot/worklet/ref/workletRefPool.js.map +1 -0
  328. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  329. package/runtime/lib/utils.js +1 -1
  330. package/runtime/lib/utils.js.map +1 -1
  331. package/runtime/lib/worklet-runtime/bindings/observers.d.ts +1 -0
  332. package/runtime/lib/worklet-runtime/bindings/observers.js +5 -3
  333. package/runtime/lib/worklet-runtime/bindings/observers.js.map +1 -1
  334. package/runtime/lib/worklet-runtime/bindings/types.d.ts +1 -1
  335. package/runtime/lib/worklet-runtime/bindings/types.js.map +1 -1
  336. package/runtime/lib/worklet-runtime/hydrate.js +1 -1
  337. package/runtime/lib/worklet-runtime/hydrate.js.map +1 -1
  338. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.d.ts +1 -0
  339. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js +5 -0
  340. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +1 -1
  341. package/runtime/lib/worklet-runtime/workletRuntime.js +1 -2
  342. package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
  343. package/runtime/worklet-runtime/dev.js +8 -4
  344. package/runtime/worklet-runtime/main.js +1 -1
  345. package/testing-library/dist/env/index.js +25 -7
  346. package/testing-library/dist/fire-event.d.ts +21 -7
  347. package/testing-library/dist/index.d.ts +2 -0
  348. package/testing-library/dist/pure.js +29 -11
  349. package/testing-library/dist/setupFiles/common/runtime-setup.js +14 -49
  350. package/testing-library/dist/type-entry/index.js +0 -0
  351. package/transform/dist/wasm.cjs +1274 -665
  352. package/transform/index.d.ts +28 -1
  353. package/types/react.docs.d.ts +9 -1
  354. package/refresh/.gitignore +0 -1
  355. package/refresh/.npmignore +0 -3
  356. package/refresh/.turbo/turbo-build.log +0 -12
  357. package/refresh/package.json +0 -20
  358. package/refresh/rslib.config.ts +0 -24
  359. package/refresh/tsconfig.json +0 -4
  360. package/refresh/turbo.json +0 -15
  361. package/runtime/lib/alog/elementPAPICall.js.map +0 -1
  362. package/runtime/lib/alog/index.js.map +0 -1
  363. package/runtime/lib/alog/render.js.map +0 -1
  364. package/runtime/lib/compat/componentIs.js.map +0 -1
  365. package/runtime/lib/compat/initData.js.map +0 -1
  366. package/runtime/lib/compat/lynxComponent.js.map +0 -1
  367. package/runtime/lib/debug/component-stack.js.map +0 -1
  368. package/runtime/lib/debug/debug.js.map +0 -1
  369. package/runtime/lib/debug/describeInvalidValue.js.map +0 -1
  370. package/runtime/lib/debug/formatPatch.js.map +0 -1
  371. package/runtime/lib/debug/printSnapshot.js.map +0 -1
  372. package/runtime/lib/debug/profile.js.map +0 -1
  373. package/runtime/lib/debug/profileHooks.js.map +0 -1
  374. package/runtime/lib/debug/vnodeSource.js.map +0 -1
  375. package/runtime/lib/gesture/processGesture.js.map +0 -1
  376. package/runtime/lib/gesture/processGestureBagkround.d.ts +0 -2
  377. package/runtime/lib/gesture/processGestureBagkround.js +0 -19
  378. package/runtime/lib/gesture/processGestureBagkround.js.map +0 -1
  379. package/runtime/lib/gesture/types.js.map +0 -1
  380. package/runtime/lib/hooks/mainThread.js.map +0 -1
  381. package/runtime/lib/hooks/react.js.map +0 -1
  382. package/runtime/lib/hooks/useLynxGlobalEventListener.js.map +0 -1
  383. package/runtime/lib/legacy-react-runtime/index.js.map +0 -1
  384. package/runtime/lib/lifecycle/constant.js.map +0 -1
  385. package/runtime/lib/lifecycle/destroy.js.map +0 -1
  386. package/runtime/lib/lifecycle/event/delayEvents.js.map +0 -1
  387. package/runtime/lib/lifecycle/event/delayLifecycleEvents.js.map +0 -1
  388. package/runtime/lib/lifecycle/event/jsReady.js.map +0 -1
  389. package/runtime/lib/lifecycle/isRendering.js.map +0 -1
  390. package/runtime/lib/lifecycle/pass.js.map +0 -1
  391. package/runtime/lib/lifecycle/patch/commit.js.map +0 -1
  392. package/runtime/lib/lifecycle/patch/error.js.map +0 -1
  393. package/runtime/lib/lifecycle/patch/globalState.js.map +0 -1
  394. package/runtime/lib/lifecycle/patch/isMainThreadHydrating.js.map +0 -1
  395. package/runtime/lib/lifecycle/patch/snapshotPatch.js.map +0 -1
  396. package/runtime/lib/lifecycle/patch/snapshotPatchApply.js.map +0 -1
  397. package/runtime/lib/lifecycle/patch/updateMainThread.js.map +0 -1
  398. package/runtime/lib/lifecycle/ref/delay.js.map +0 -1
  399. package/runtime/lib/lifecycle/reload.js.map +0 -1
  400. package/runtime/lib/lifecycle/render.js.map +0 -1
  401. package/runtime/lib/list/list.js.map +0 -1
  402. package/runtime/lib/list/listUpdateInfo.js.map +0 -1
  403. package/runtime/lib/list/pendingListUpdates.js.map +0 -1
  404. package/runtime/lib/lynx/calledByNative.js.map +0 -1
  405. package/runtime/lib/lynx/component.js.map +0 -1
  406. package/runtime/lib/lynx/dynamic-js.js.map +0 -1
  407. package/runtime/lib/lynx/env.js.map +0 -1
  408. package/runtime/lib/lynx/injectLepusMethods.js.map +0 -1
  409. package/runtime/lib/lynx/lazy-bundle.js.map +0 -1
  410. package/runtime/lib/lynx/performance.js.map +0 -1
  411. package/runtime/lib/lynx/runWithForce.js.map +0 -1
  412. package/runtime/lib/lynx/suspense.js.map +0 -1
  413. package/runtime/lib/lynx/tt.js.map +0 -1
  414. package/runtime/lib/renderToOpcodes/constants.js.map +0 -1
  415. package/runtime/lib/renderToOpcodes/hydrate.js.map +0 -1
  416. package/runtime/lib/renderToOpcodes/index.js.map +0 -1
  417. package/runtime/lib/renderToOpcodes/opcodes.js.map +0 -1
  418. package/runtime/lib/snapshot/backgroundSnapshot.js.map +0 -1
  419. package/runtime/lib/snapshot/constants.js.map +0 -1
  420. package/runtime/lib/snapshot/definition.js.map +0 -1
  421. package/runtime/lib/snapshot/dynamicPartType.js.map +0 -1
  422. package/runtime/lib/snapshot/event.js.map +0 -1
  423. package/runtime/lib/snapshot/gesture.js.map +0 -1
  424. package/runtime/lib/snapshot/list.js.map +0 -1
  425. package/runtime/lib/snapshot/platformInfo.js.map +0 -1
  426. package/runtime/lib/snapshot/ref.js.map +0 -1
  427. package/runtime/lib/snapshot/snapshot.js.map +0 -1
  428. package/runtime/lib/snapshot/snapshotInstanceHydrationMap.js.map +0 -1
  429. package/runtime/lib/snapshot/spread.js.map +0 -1
  430. package/runtime/lib/snapshot/types.js.map +0 -1
  431. package/runtime/lib/snapshot/utils.js.map +0 -1
  432. package/runtime/lib/snapshot/workletEvent.js.map +0 -1
  433. package/runtime/lib/snapshot/workletRef.js.map +0 -1
  434. package/runtime/lib/worklet/call/delayedRunOnMainThreadData.js.map +0 -1
  435. package/runtime/lib/worklet/call/execMap.js.map +0 -1
  436. package/runtime/lib/worklet/call/functionCall.js.map +0 -1
  437. package/runtime/lib/worklet/call/runOnBackground.js.map +0 -1
  438. package/runtime/lib/worklet/call/runOnMainThread.js.map +0 -1
  439. package/runtime/lib/worklet/call/transformToWorklet.js.map +0 -1
  440. package/runtime/lib/worklet/ctx.js.map +0 -1
  441. package/runtime/lib/worklet/destroy.js.map +0 -1
  442. package/runtime/lib/worklet/functionality.js.map +0 -1
  443. package/runtime/lib/worklet/hmr.js.map +0 -1
  444. package/runtime/lib/worklet/indexMap.js.map +0 -1
  445. package/runtime/lib/worklet/ref/updateInitValue.js.map +0 -1
  446. package/runtime/lib/worklet/ref/workletRef.js.map +0 -1
  447. package/runtime/lib/worklet/ref/workletRefPool.js.map +0 -1
  448. package/testing-library/README.md +0 -109
  449. /package/runtime/lib/{hooks → core/hooks}/react.d.ts +0 -0
  450. /package/runtime/lib/{lynx → element-template/lynx}/env.d.ts +0 -0
  451. /package/runtime/lib/{lynx/calledByNative.d.ts → element-template/native/main-thread-api.d.ts} +0 -0
  452. /package/runtime/lib/{lynx/component.d.ts → element-template/runtime/components/slot.d.ts} +0 -0
  453. /package/runtime/lib/{lifecycle/render.d.ts → element-template/runtime/render/render-main-thread.d.ts} +0 -0
  454. /package/runtime/lib/{debug → shared}/component-stack.d.ts +0 -0
  455. /package/runtime/lib/{debug → shared}/profile.d.ts +0 -0
  456. /package/runtime/lib/{renderToOpcodes/constants.d.ts → shared/render-constants.d.ts} +0 -0
  457. /package/runtime/lib/{alog → snapshot/alog}/elementPAPICall.d.ts +0 -0
  458. /package/runtime/lib/{alog → snapshot/alog}/index.d.ts +0 -0
  459. /package/runtime/lib/{alog → snapshot/alog}/index.js +0 -0
  460. /package/runtime/lib/{alog → snapshot/alog}/render.d.ts +0 -0
  461. /package/runtime/lib/{compat → snapshot/compat}/componentIs.d.ts +0 -0
  462. /package/runtime/lib/{compat → snapshot/compat}/componentIs.js +0 -0
  463. /package/runtime/lib/{compat → snapshot/compat}/lynxComponent.d.ts +0 -0
  464. /package/runtime/lib/{compat → snapshot/compat}/lynxComponent.js +0 -0
  465. /package/runtime/lib/{debug → snapshot/debug}/debug.d.ts +0 -0
  466. /package/runtime/lib/{debug → snapshot/debug}/debug.js +0 -0
  467. /package/runtime/lib/{debug → snapshot/debug}/describeInvalidValue.d.ts +0 -0
  468. /package/runtime/lib/{debug → snapshot/debug}/describeInvalidValue.js +0 -0
  469. /package/runtime/lib/{debug → snapshot/debug}/formatPatch.d.ts +0 -0
  470. /package/runtime/lib/{debug → snapshot/debug}/formatPatch.js +0 -0
  471. /package/runtime/lib/{debug → snapshot/debug}/printSnapshot.d.ts +0 -0
  472. /package/runtime/lib/{debug → snapshot/debug}/printSnapshot.js +0 -0
  473. /package/runtime/lib/{debug → snapshot/debug}/profileHooks.d.ts +0 -0
  474. /package/runtime/lib/{debug → snapshot/debug}/vnodeSource.d.ts +0 -0
  475. /package/runtime/lib/{gesture → snapshot/gesture}/types.d.ts +0 -0
  476. /package/runtime/lib/{gesture → snapshot/gesture}/types.js +0 -0
  477. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/constant.d.ts +0 -0
  478. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/constant.js +0 -0
  479. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/destroy.d.ts +0 -0
  480. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/delayEvents.d.ts +0 -0
  481. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/delayEvents.js +0 -0
  482. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/delayLifecycleEvents.d.ts +0 -0
  483. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/delayLifecycleEvents.js +0 -0
  484. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/event/jsReady.d.ts +0 -0
  485. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/isRendering.d.ts +0 -0
  486. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/pass.d.ts +0 -0
  487. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/pass.js +0 -0
  488. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/commit.d.ts +0 -0
  489. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/error.d.ts +0 -0
  490. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/error.js +0 -0
  491. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/globalState.d.ts +0 -0
  492. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/globalState.js +0 -0
  493. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/isMainThreadHydrating.d.ts +0 -0
  494. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/isMainThreadHydrating.js +0 -0
  495. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/snapshotPatchApply.d.ts +0 -0
  496. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/updateMainThread.d.ts +0 -0
  497. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/patch/updateMainThread.js +0 -0
  498. /package/runtime/lib/{lifecycle → snapshot/lifecycle}/reload.d.ts +0 -0
  499. /package/runtime/lib/{list → snapshot/list}/list.d.ts +0 -0
  500. /package/runtime/lib/{list → snapshot/list}/listUpdateInfo.d.ts +0 -0
  501. /package/runtime/lib/{list → snapshot/list}/pendingListUpdates.d.ts +0 -0
  502. /package/runtime/lib/{list → snapshot/list}/pendingListUpdates.js +0 -0
  503. /package/runtime/lib/{worklet/call/execMap.d.ts → snapshot/lynx/component.d.ts} +0 -0
  504. /package/runtime/lib/{lynx → snapshot/lynx}/dynamic-js.d.ts +0 -0
  505. /package/runtime/lib/{lynx → snapshot/lynx}/dynamic-js.js +0 -0
  506. /package/runtime/lib/{lynx → snapshot/lynx}/injectLepusMethods.d.ts +0 -0
  507. /package/runtime/lib/{lynx → snapshot/lynx}/injectLepusMethods.js +0 -0
  508. /package/runtime/lib/{lynx → snapshot/lynx}/lazy-bundle.d.ts +0 -0
  509. /package/runtime/lib/{lynx → snapshot/lynx}/lazy-bundle.js +0 -0
  510. /package/runtime/lib/{lynx → snapshot/lynx}/performance.d.ts +0 -0
  511. /package/runtime/lib/{lynx → snapshot/lynx}/runWithForce.d.ts +0 -0
  512. /package/runtime/lib/{lynx → snapshot/lynx}/suspense.d.ts +0 -0
  513. /package/runtime/lib/{lynx → snapshot/lynx}/tt.d.ts +0 -0
  514. /package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/hydrate.d.ts +0 -0
  515. /package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/index.d.ts +0 -0
  516. /package/runtime/lib/{renderToOpcodes → snapshot/renderToOpcodes}/opcodes.d.ts +0 -0
  517. /package/runtime/lib/snapshot/{gesture.d.ts → snapshot/gesture.d.ts} +0 -0
  518. /package/runtime/lib/snapshot/{list.d.ts → snapshot/list.d.ts} +0 -0
  519. /package/runtime/lib/snapshot/{list.js → snapshot/list.js} +0 -0
  520. /package/runtime/lib/snapshot/{platformInfo.d.ts → snapshot/platformInfo.d.ts} +0 -0
  521. /package/runtime/lib/snapshot/{platformInfo.js → snapshot/platformInfo.js} +0 -0
  522. /package/runtime/lib/snapshot/{snapshotInstanceHydrationMap.d.ts → snapshot/snapshotInstanceHydrationMap.d.ts} +0 -0
  523. /package/runtime/lib/snapshot/{snapshotInstanceHydrationMap.js → snapshot/snapshotInstanceHydrationMap.js} +0 -0
  524. /package/runtime/lib/snapshot/{types.js → snapshot/types.js} +0 -0
  525. /package/runtime/lib/{worklet → snapshot/worklet}/call/delayedRunOnMainThreadData.d.ts +0 -0
  526. /package/runtime/lib/{worklet → snapshot/worklet}/call/delayedRunOnMainThreadData.js +0 -0
  527. /package/runtime/lib/{worklet/call/transformToWorklet.d.ts → snapshot/worklet/call/execMap.d.ts} +0 -0
  528. /package/runtime/lib/{worklet → snapshot/worklet}/call/execMap.js +0 -0
  529. /package/runtime/lib/{worklet → snapshot/worklet}/call/functionCall.d.ts +0 -0
  530. /package/runtime/lib/{worklet → snapshot/worklet}/call/functionCall.js +0 -0
  531. /package/runtime/lib/{worklet → snapshot/worklet}/call/runOnBackground.d.ts +0 -0
  532. /package/runtime/lib/{worklet → snapshot/worklet}/call/runOnBackground.js +0 -0
  533. /package/runtime/lib/{worklet → snapshot/worklet}/call/runOnMainThread.d.ts +0 -0
  534. /package/runtime/lib/{worklet → snapshot/worklet}/call/runOnMainThread.js +0 -0
  535. /package/runtime/lib/{worklet/ctx.d.ts → snapshot/worklet/call/transformToWorklet.d.ts} +0 -0
  536. /package/runtime/lib/{worklet → snapshot/worklet}/call/transformToWorklet.js +0 -0
  537. /package/runtime/lib/{worklet → snapshot/worklet}/ctx.js +0 -0
  538. /package/runtime/lib/{worklet → snapshot/worklet}/destroy.d.ts +0 -0
  539. /package/runtime/lib/{worklet → snapshot/worklet}/destroy.js +0 -0
  540. /package/runtime/lib/{worklet → snapshot/worklet}/functionality.d.ts +0 -0
  541. /package/runtime/lib/{worklet → snapshot/worklet}/hmr.d.ts +0 -0
  542. /package/runtime/lib/{worklet → snapshot/worklet}/hmr.js +0 -0
  543. /package/runtime/lib/{worklet → snapshot/worklet}/indexMap.d.ts +0 -0
  544. /package/runtime/lib/{worklet → snapshot/worklet}/indexMap.js +0 -0
  545. /package/runtime/lib/{worklet → snapshot/worklet}/ref/updateInitValue.d.ts +0 -0
  546. /package/runtime/lib/{worklet → snapshot/worklet}/ref/updateInitValue.js +0 -0
  547. /package/runtime/lib/{worklet → snapshot/worklet}/ref/workletRef.d.ts +0 -0
  548. /package/runtime/lib/{worklet → snapshot/worklet}/ref/workletRefPool.d.ts +0 -0
  549. /package/runtime/lib/{worklet → snapshot/worklet}/ref/workletRefPool.js +0 -0
@@ -0,0 +1,135 @@
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 { options } from 'preact';
5
+ import { RENDER_COMPONENT, ROOT } from '../../shared/render-constants.js';
6
+ import { hook } from '../../utils.js';
7
+ import { globalCommitContext } from '../background/commit-context.js';
8
+ const PerformanceTimingKeys = [
9
+ 'updateSetStateTrigger',
10
+ 'updateDiffVdomStart',
11
+ 'updateDiffVdomEnd',
12
+ // updateSetStateTrigger, updateDiffVdomStart and updateDiffVdomEnd is deprecated
13
+ 'diffVdomStart',
14
+ 'diffVdomEnd',
15
+ 'packChangesStart',
16
+ 'packChangesEnd',
17
+ 'parseChangesStart',
18
+ 'parseChangesEnd',
19
+ 'patchChangesStart',
20
+ 'patchChangesEnd',
21
+ 'hydrateParsePayloadStart',
22
+ 'hydrateParsePayloadEnd',
23
+ 'mtsRenderStart',
24
+ 'mtsRenderEnd',
25
+ ];
26
+ const PerformanceTimingFlags = {
27
+ reactLynxHydrate: 'react_lynx_hydrate',
28
+ };
29
+ const PipelineOrigins = {
30
+ reactLynxHydrate: 'reactLynxHydrate',
31
+ updateTriggeredByBts: 'updateTriggeredByBts',
32
+ };
33
+ /**
34
+ * @deprecated used by old timing api(setState timing flag)
35
+ */
36
+ const PerfSpecificKey = '__lynx_timing_flag';
37
+ let timingFlag;
38
+ let shouldMarkDiffVdomStart = false;
39
+ let shouldMarkDiffVdomEnd = false;
40
+ let globalPipelineOptions;
41
+ /**
42
+ * @deprecated used by old timing api(setState timing flag)
43
+ */
44
+ function markTimingLegacy(key, timingFlag_) {
45
+ switch (key) {
46
+ case 'updateSetStateTrigger': {
47
+ shouldMarkDiffVdomStart = true;
48
+ shouldMarkDiffVdomEnd = true;
49
+ timingFlag = timingFlag_;
50
+ break;
51
+ }
52
+ case 'updateDiffVdomStart': {
53
+ if (!shouldMarkDiffVdomStart) {
54
+ return;
55
+ }
56
+ shouldMarkDiffVdomStart = false;
57
+ break;
58
+ }
59
+ case 'updateDiffVdomEnd': {
60
+ if (!shouldMarkDiffVdomEnd) {
61
+ return;
62
+ }
63
+ shouldMarkDiffVdomEnd = false;
64
+ break;
65
+ }
66
+ }
67
+ lynx.getNativeApp().markTiming?.(timingFlag, key);
68
+ }
69
+ function beginPipeline(needTimestamps, pipelineOrigin, timingFlag) {
70
+ globalPipelineOptions = lynx.performance?._generatePipelineOptions?.();
71
+ if (globalPipelineOptions) {
72
+ globalPipelineOptions.needTimestamps = needTimestamps;
73
+ globalPipelineOptions.pipelineOrigin = pipelineOrigin;
74
+ globalPipelineOptions.dsl = 'reactLynx';
75
+ switch (pipelineOrigin) {
76
+ case PipelineOrigins.reactLynxHydrate:
77
+ globalPipelineOptions.stage = 'hydrate';
78
+ break;
79
+ case PipelineOrigins.updateTriggeredByBts:
80
+ globalPipelineOptions.stage = 'update';
81
+ break;
82
+ }
83
+ lynx.performance?._onPipelineStart?.(globalPipelineOptions.pipelineID, globalPipelineOptions);
84
+ if (timingFlag) {
85
+ lynx.performance?._bindPipelineIdWithTimingFlag?.(globalPipelineOptions.pipelineID, timingFlag);
86
+ }
87
+ }
88
+ }
89
+ function setPipeline(pipeline) {
90
+ globalPipelineOptions = pipeline;
91
+ }
92
+ function markTiming(timestampKey, force) {
93
+ if (globalPipelineOptions && (force || globalPipelineOptions.needTimestamps)) {
94
+ lynx.performance?._markTiming?.(globalPipelineOptions.pipelineID, timestampKey);
95
+ }
96
+ }
97
+ function shouldStartUpdatePipeline() {
98
+ return globalCommitContext.ops.length > 0;
99
+ }
100
+ function initTimingAPI() {
101
+ // eslint-disable-next-line unicorn/consistent-function-scoping
102
+ const helper = () => {
103
+ // Check update ops to make sure this only runs after hydrate
104
+ if (__JS__ && shouldStartUpdatePipeline()) {
105
+ if (!globalPipelineOptions) {
106
+ beginPipeline(false, PipelineOrigins.updateTriggeredByBts);
107
+ markTiming('diffVdomStart', true);
108
+ }
109
+ if (shouldMarkDiffVdomStart) {
110
+ markTimingLegacy('updateDiffVdomStart');
111
+ }
112
+ }
113
+ };
114
+ hook(options, RENDER_COMPONENT, (old, vnode, c) => {
115
+ helper();
116
+ /* v8 ignore start */
117
+ if (old) {
118
+ old(vnode, c);
119
+ }
120
+ /* v8 ignore stop */
121
+ });
122
+ hook(options, ROOT, (old, vnode, parentDom) => {
123
+ helper();
124
+ /* v8 ignore start */
125
+ if (old) {
126
+ old(vnode, parentDom);
127
+ }
128
+ /* v8 ignore stop */
129
+ });
130
+ }
131
+ /**
132
+ * @internal
133
+ */
134
+ export { PerformanceTimingFlags, PipelineOrigins, PerfSpecificKey, markTimingLegacy, initTimingAPI, beginPipeline, markTiming, setPipeline, globalPipelineOptions, };
135
+ //# sourceMappingURL=performance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performance.js","sourceRoot":"","sources":["../../../src/element-template/lynx/performance.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,OAAO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ACb,UAAU,EACV,WAAW,EACX,qBAAqB,GACtB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function callDestroyLifetimeFun(): void;
@@ -0,0 +1,8 @@
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 { destroyElementTemplateBackgroundRuntime } from '../background/destroy.js';
5
+ export function callDestroyLifetimeFun() {
6
+ destroyElementTemplateBackgroundRuntime();
7
+ }
8
+ //# sourceMappingURL=callDestroyLifetimeFun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callDestroyLifetimeFun.js","sourceRoot":"","sources":["../../../src/element-template/native/callDestroyLifetimeFun.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,uCAAuC,EAAE,MAAM,0BAA0B,CAAC;AAEnF,MAAM,UAAU,sBAAsB;IACpC,uCAAuC,EAAE,CAAC;AAC5C,CAAC"}
@@ -0,0 +1 @@
1
+ import '../hooks/react.js';
@@ -0,0 +1,53 @@
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 '../hooks/react.js';
5
+ import { callDestroyLifetimeFun } from './callDestroyLifetimeFun.js';
6
+ import { injectCalledByNative } from './main-thread-api.js';
7
+ import { installOnMtsDestruction } from './mts-destroy.js';
8
+ import { installElementTemplatePatchListener } from './patch-listener.js';
9
+ import { installMainThreadHooks } from '../../core/hooks/mainThreadImpl.js';
10
+ import { installElementTemplateCommitHook } from '../background/commit-hook.js';
11
+ import { setupBackgroundElementTemplateDocument } from '../background/document.js';
12
+ import { installElementTemplateHydrationListener } from '../background/hydration-listener.js';
13
+ import { BackgroundElementTemplateInstance } from '../background/instance.js';
14
+ import { initElementTemplatePAPICallAlog } from '../debug/elementPAPICall.js';
15
+ import { initProfileHook } from '../debug/profile.js';
16
+ import { setupLynxEnv } from '../lynx/env.js';
17
+ import { initTimingAPI } from '../lynx/performance.js';
18
+ import { publicComponentEvent, publishEvent, resetEventStateForRuntime } from '../prop-adapters/event.js';
19
+ import { setRoot } from '../runtime/page/root-instance.js';
20
+ function init() {
21
+ if (typeof __ALOG_ELEMENT_API__ !== 'undefined' && __ALOG_ELEMENT_API__) {
22
+ initElementTemplatePAPICallAlog();
23
+ }
24
+ if (__MAIN_THREAD__) {
25
+ installMainThreadHooks();
26
+ injectCalledByNative();
27
+ installElementTemplatePatchListener();
28
+ installOnMtsDestruction();
29
+ if (__PROFILE__) {
30
+ initProfileHook();
31
+ }
32
+ }
33
+ if (__BACKGROUND__) {
34
+ console.log('experimental_useElementTemplate:', __USE_ELEMENT_TEMPLATE__);
35
+ setRoot(new BackgroundElementTemplateInstance('root'));
36
+ setupBackgroundElementTemplateDocument();
37
+ installElementTemplateHydrationListener();
38
+ resetEventStateForRuntime();
39
+ lynxCoreInject.tt.callDestroyLifetimeFun = callDestroyLifetimeFun;
40
+ lynxCoreInject.tt.publishEvent = publishEvent;
41
+ lynxCoreInject.tt.publicComponentEvent = publicComponentEvent;
42
+ installElementTemplateCommitHook();
43
+ if (process.env['NODE_ENV'] !== 'test') {
44
+ initTimingAPI();
45
+ if (lynx.performance?.isProfileRecording?.()) {
46
+ initProfileHook();
47
+ }
48
+ }
49
+ }
50
+ setupLynxEnv();
51
+ }
52
+ init();
53
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/element-template/native/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBA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,EAAE,CAAC;QAC5B,cAAc,CAAC,EAAE,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;QAClE,cAAc,CAAC,EAAE,CAAC,YAAY,GAAG,YAAY,CAAC;QAC9C,cAAc,CAAC,EAAE,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;QAC9D,gCAAgC,EAAE,CAAC;QACnC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,EAAE,CAAC;YACvC,aAAa,EAAE,CAAC;YAChB,IAAI,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC;gBAC7C,eAAe,EAAE,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IAED,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,27 @@
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 { setupPage } from '../runtime/page/page.js';
5
+ import { renderMainThread } from '../runtime/render/render-main-thread.js';
6
+ function injectCalledByNative() {
7
+ const calledByNative = {
8
+ renderPage,
9
+ updatePage: function () { },
10
+ updateGlobalProps: function () { },
11
+ getPageData: function () {
12
+ return null;
13
+ },
14
+ removeComponents: function () { },
15
+ };
16
+ Object.assign(globalThis, calledByNative);
17
+ }
18
+ function renderPage(data) {
19
+ lynx.__initData = data ?? {};
20
+ setupPage(__CreatePage('0', 0));
21
+ renderMainThread();
22
+ }
23
+ /**
24
+ * @internal
25
+ */
26
+ export { injectCalledByNative };
27
+ //# sourceMappingURL=main-thread-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main-thread-api.js","sourceRoot":"","sources":["../../../src/element-template/native/main-thread-api.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,SAAS,oBAAoB;IAC3B,MAAM,cAAc,GAAqB;QACvC,UAAU;QACV,UAAU,EAAE,cAAkB,CAAC;QAC/B,iBAAiB,EAAE,cAAkB,CAAC;QACtC,WAAW,EAAE;YACX,OAAO,IAAI,CAAC;QACd,CAAC;QACD,gBAAgB,EAAE,cAAkB,CAAC;KACtC,CAAC;IAEF,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,UAAU,CAAC,IAAyC;IAC3D,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAChC,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function installOnMtsDestruction(): void;
2
+ export declare function onMtsDestruction(): void;
3
+ export declare function destroyElementTemplateMainThreadRuntime(): void;
@@ -0,0 +1,37 @@
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 { resetElementTemplatePatchListener } from './patch-listener.js';
5
+ import { elementTemplateRegistry } from '../runtime/template/registry.js';
6
+ export function installOnMtsDestruction() {
7
+ lynx.getNative?.().addEventListener('__DestroyLifetime', onMtsDestruction);
8
+ }
9
+ export function onMtsDestruction() {
10
+ const performance = lynx.performance;
11
+ performance?.profileStart?.('ReactLynx::onMtsDestruction');
12
+ try {
13
+ destroyElementTemplateMainThreadRuntime();
14
+ }
15
+ finally {
16
+ performance?.profileEnd?.();
17
+ lynx.getNative?.().removeEventListener('__DestroyLifetime', onMtsDestruction);
18
+ }
19
+ }
20
+ export function destroyElementTemplateMainThreadRuntime() {
21
+ let patchListenerResetError;
22
+ let didPatchListenerResetThrow = false;
23
+ try {
24
+ resetElementTemplatePatchListener();
25
+ }
26
+ catch (error) {
27
+ patchListenerResetError = error;
28
+ didPatchListenerResetThrow = true;
29
+ }
30
+ // The registry is the main-thread strong-reference owner for ET refs. Clear it
31
+ // even if listener reset fails so destroy does not leave removed pages retained.
32
+ elementTemplateRegistry.clear();
33
+ if (didPatchListenerResetThrow) {
34
+ throw patchListenerResetError;
35
+ }
36
+ }
37
+ //# sourceMappingURL=mts-destroy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mts-destroy.js","sourceRoot":"","sources":["../../../src/element-template/native/mts-destroy.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,MAAM,UAAU,uBAAuB;IACrC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACrC,WAAW,EAAE,YAAY,EAAE,CAAC,6BAA6B,CAAC,CAAC;IAC3D,IAAI,CAAC;QACH,uCAAuC,EAAE,CAAC;IAC5C,CAAC;YAAS,CAAC;QACT,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;QAC5B,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;IAChF,CAAC;AACH,CAAC;AAED,MAAM,UAAU,uCAAuC;IACrD,IAAI,uBAAgC,CAAC;IACrC,IAAI,0BAA0B,GAAG,KAAK,CAAC;IACvC,IAAI,CAAC;QACH,iCAAiC,EAAE,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,uBAAuB,GAAG,KAAK,CAAC;QAChC,0BAA0B,GAAG,IAAI,CAAC;IACpC,CAAC;IAED,+EAA+E;IAC/E,iFAAiF;IACjF,uBAAuB,CAAC,KAAK,EAAE,CAAC;IAEhC,IAAI,0BAA0B,EAAE,CAAC;QAC/B,MAAM,uBAAuB,CAAC;IAChC,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function installElementTemplatePatchListener(): void;
2
+ export declare function resetElementTemplatePatchListener(): void;
@@ -0,0 +1,66 @@
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 { formatElementTemplateUpdateCommands } from '../debug/alog.js';
5
+ import { markTiming, setPipeline } from '../lynx/performance.js';
6
+ import { ElementTemplateLifecycleConstant } from '../protocol/lifecycle-constant.js';
7
+ import { __page } from '../runtime/page/page.js';
8
+ import { applyElementTemplateUpdateCommands } from '../runtime/patch.js';
9
+ let listener;
10
+ export function installElementTemplatePatchListener() {
11
+ resetElementTemplatePatchListener();
12
+ listener = (event) => {
13
+ const { data } = event;
14
+ const payload = data;
15
+ const hasOps = Array.isArray(payload?.ops);
16
+ const flushOptions = payload?.flushOptions ?? {};
17
+ const pipelineOptions = flushOptions.pipelineOptions;
18
+ setPipeline(pipelineOptions);
19
+ const flowIds = Array.isArray(payload?.flowIds) && payload.flowIds.length > 0
20
+ ? payload.flowIds
21
+ : undefined;
22
+ const shouldProfilePatch = hasOps
23
+ && !!flowIds
24
+ && typeof lynx.performance?.profileStart === 'function'
25
+ && typeof lynx.performance?.profileEnd === 'function';
26
+ if (shouldProfilePatch) {
27
+ lynx.performance.profileStart('ReactLynx::patch', {
28
+ flowId: flowIds[0],
29
+ flowIds,
30
+ });
31
+ }
32
+ if (hasOps) {
33
+ if (typeof __ALOG__ !== 'undefined' && __ALOG__) {
34
+ console.alog?.('[ReactLynxDebug] ElementTemplate main-thread patch:\n'
35
+ + JSON.stringify({
36
+ ops: formatElementTemplateUpdateCommands(payload.ops),
37
+ flushOptions,
38
+ flowIds,
39
+ }, null, 2));
40
+ }
41
+ markTiming('mtsRenderStart');
42
+ markTiming('parseChangesStart');
43
+ markTiming('parseChangesEnd');
44
+ markTiming('patchChangesStart');
45
+ try {
46
+ applyElementTemplateUpdateCommands(payload.ops);
47
+ }
48
+ finally {
49
+ markTiming('patchChangesEnd');
50
+ markTiming('mtsRenderEnd');
51
+ }
52
+ }
53
+ __FlushElementTree(__page, flushOptions);
54
+ if (shouldProfilePatch) {
55
+ lynx.performance.profileEnd();
56
+ }
57
+ };
58
+ lynx.getJSContext().addEventListener(ElementTemplateLifecycleConstant.update, listener);
59
+ }
60
+ export function resetElementTemplatePatchListener() {
61
+ if (listener) {
62
+ lynx.getJSContext().removeEventListener(ElementTemplateLifecycleConstant.update, listener);
63
+ }
64
+ listener = undefined;
65
+ }
66
+ //# sourceMappingURL=patch-listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch-listener.js","sourceRoot":"","sources":["../../../src/element-template/native/patch-listener.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,mCAAmC,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AAErF,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AAEzE,IAAI,QAES,CAAC;AAEd,MAAM,UAAU,mCAAmC;IACjD,iCAAiC,EAAE,CAAC;IAEpC,QAAQ,GAAG,CAAC,KAAwB,EAAE,EAAE;QACtC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;QACvB,MAAM,OAAO,GAAG,IAA0C,CAAC;QAC3D,MAAM,M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AkC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAClD,CAAC;oBAAS,CAAC;gBACT,UAAU,CAAC,iBAAiB,CAAC,CAAC;gBAC9B,UAAU,CAAC,cAAc,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QAED,kBAAkB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QAEzC,IAAI,kBAAkB,EAAE,CAAC;YACvB,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;QAChC,CAAC;IACH,CAAC,CAAC;IAEF,IAAI,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAClC,gCAAgC,CAAC,MAAM,EACvC,QAAQ,CACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC;IAC/C,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,YAAY,EAAE,CAAC,mBAAmB,CACrC,gCAAgC,CAAC,MAAM,EACvC,QAAQ,CACT,CAAC;IACJ,CAAC;IACD,QAAQ,GAAG,SAAS,CAAC;AACvB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function getEventValue(handleId: number, attrSlotIndex: number, eventKey?: string): string;
@@ -0,0 +1,7 @@
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 getEventValue(handleId, attrSlotIndex, eventKey = '') {
5
+ return `${handleId}:${attrSlotIndex}:${eventKey}`;
6
+ }
7
+ //# sourceMappingURL=event-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-value.js","sourceRoot":"","sources":["../../../src/element-template/prop-adapters/event-value.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,MAAM,UAAU,aAAa,CAC3B,QAAgB,EAChB,aAAqB,EACrB,QAAQ,GAAG,EAAE;IAEb,OAAO,GAAG,QAAQ,IAAI,aAAa,IAAI,QAAQ,EAAE,CAAC;AACpD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export type EtEventHandler = (data: EventDataType) => unknown;
2
+ export declare function clearEventState(): void;
3
+ export declare function resetEventStateForRuntime(): void;
4
+ export declare function getEventHandlerForEventValue(eventValue: string): EtEventHandler | undefined;
5
+ export declare function publishEvent(eventValue: string, data: EventDataType): void;
6
+ export declare function publicComponentEvent(_componentId: string, eventValue: string, data: EventDataType): void;
7
+ export declare function flushPendingEvents(): void;
@@ -0,0 +1,61 @@
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 { backgroundElementTemplateInstanceManager } from '../background/manager.js';
5
+ const pendingEvents = [];
6
+ let queuePendingEvents = false;
7
+ function dispatchEvent(eventValue, data) {
8
+ const handler = backgroundElementTemplateInstanceManager.getRawAttributeValueByEventValue(eventValue);
9
+ if (typeof __ALOG__ !== 'undefined' && __ALOG__) {
10
+ console.alog?.(`[ReactLynxDebug] ElementTemplate BTS received event:\n${JSON.stringify({
11
+ eventValue,
12
+ type: data.type,
13
+ jsFunctionName: typeof handler === 'function' ? handler.name : '',
14
+ hasHandler: typeof handler === 'function',
15
+ }, null, 2)}`);
16
+ }
17
+ if (typeof handler !== 'function') {
18
+ return false;
19
+ }
20
+ try {
21
+ handler(data);
22
+ }
23
+ catch (error) {
24
+ lynx.reportError(error);
25
+ }
26
+ return true;
27
+ }
28
+ export function clearEventState() {
29
+ pendingEvents.length = 0;
30
+ queuePendingEvents = false;
31
+ }
32
+ export function resetEventStateForRuntime() {
33
+ clearEventState();
34
+ queuePendingEvents = true;
35
+ }
36
+ export function getEventHandlerForEventValue(eventValue) {
37
+ const handler = backgroundElementTemplateInstanceManager.getRawAttributeValueByEventValue(eventValue);
38
+ return typeof handler === 'function' ? handler : undefined;
39
+ }
40
+ export function publishEvent(eventValue, data) {
41
+ if (dispatchEvent(eventValue, data)) {
42
+ return;
43
+ }
44
+ if (queuePendingEvents) {
45
+ pendingEvents.push([eventValue, data]);
46
+ }
47
+ }
48
+ export function publicComponentEvent(_componentId, eventValue, data) {
49
+ publishEvent(eventValue, data);
50
+ }
51
+ export function flushPendingEvents() {
52
+ queuePendingEvents = false;
53
+ if (pendingEvents.length === 0) {
54
+ return;
55
+ }
56
+ const events = pendingEvents.splice(0);
57
+ for (const [eventValue, data] of events) {
58
+ dispatchEvent(eventValue, data);
59
+ }
60
+ }
61
+ //# sourceMappingURL=event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/element-template/prop-adapters/event.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,wCAAwC,EAAE,MAAM,0BAA0B,CAAC;AAIpF,MAAM,aAAa,GAAqD,EAAE,CAAC;AAC3E,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAE/B,SAAS,aAAa,CAAC,UAAkB,EAAE,IAAmB;IAC5D,MAAM,OAAO,GAAG,wCAAwC,CAAC,gCAAgC,CAAC,UAAU,CAAC,CAAC;IACtG,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,EAAE,CAAC;QAChD,OAAO,CAAC,IAAI,EAAE,CACZ,yDACE,IAAI,CAAC,SAAS,CACZ;YACE,UAAU;YACV,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,cAAc,EAAE,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;YACjE,UAAU,EAAE,OAAO,OAAO,KAAK,UAAU;SAC1C,EACD,IAAI,EACJ,CAAC,CAEL,EAAE,CACH,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACF,OAA0B,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,E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IAClC,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { SerializableValue } from '../protocol/types.js';
2
+ export interface SpreadAttrAdapterContext {
3
+ previousPreparedValue?: unknown;
4
+ }
5
+ export declare function prepareSpreadAttrSlot(handleId: number, attrSlotIndex: number, value: unknown, _context?: SpreadAttrAdapterContext): SerializableValue | null;
@@ -0,0 +1,45 @@
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 { getEventValue } from './event-value.js';
5
+ const eventPropKeyRegExp = /^(?:global-bind|bind|catch|capture-bind|capture-catch)[A-Za-z]+$/;
6
+ const namespacedEventKeyRegExp = /^[A-Za-z-]+:(?:global-bind|bind|catch|capture-bind|capture-catch)[A-Za-z]+$/;
7
+ function isEventPropKey(key) {
8
+ return eventPropKeyRegExp.test(key);
9
+ }
10
+ function isSpreadRecord(value) {
11
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
12
+ }
13
+ export function prepareSpreadAttrSlot(handleId, attrSlotIndex, value, _context) {
14
+ if (value === false || !isSpreadRecord(value)) {
15
+ return null;
16
+ }
17
+ const prepared = {};
18
+ for (const key in value) {
19
+ const spreadValue = value[key];
20
+ if (key === '__spread' || key === '__self' || key === '__source') {
21
+ continue;
22
+ }
23
+ if (key === 'class' || key === 'className') {
24
+ prepared['class'] = (spreadValue ?? '');
25
+ continue;
26
+ }
27
+ if (isEventPropKey(key)) {
28
+ prepared[key] = spreadValue === null || spreadValue === undefined || spreadValue === false
29
+ ? null
30
+ : getEventValue(handleId, attrSlotIndex, key);
31
+ continue;
32
+ }
33
+ if (spreadValue === undefined
34
+ || key === 'ref'
35
+ || key.endsWith(':ref')
36
+ || key.endsWith(':gesture')
37
+ || namespacedEventKeyRegExp.test(key)
38
+ || typeof spreadValue === 'function') {
39
+ continue;
40
+ }
41
+ prepared[key] = spreadValue;
42
+ }
43
+ return prepared;
44
+ }
45
+ //# sourceMappingURL=spread.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spread.js","sourceRoot":"","sources":["../../../src/element-template/prop-adapters/spread.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOjD,MAAM,kBAAkB,GAAG,kEAAkE,CAAC;AAC9F,MAAM,wBAAwB,GAAG,6EAA6E,CAAC;AAE/G,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,QAAgB,EAChB,aAAqB,EACrB,KAAc,EACd,QAAmC;IAEnC,IAAI,KAAK,KAAK,KAAK,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAsC,EAAE,CAAC;IAEvD,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;YACjE,SAAS;QACX,CAAC;QAED,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YAC3C,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAsB,CAAC;YAC7D,SAAS;QACX,CAAC;QAED,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,QAAQ,CAAC,GAAG,CAAC,GAAG,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,KAAK;gBACxF,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;YAChD,SAAS;QACX,CAAC;QAED,IACE,WAAW,KAAK,SAAS;eACtB,GAAG,KAAK,KAAK;eACb,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;eACpB,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC;eACxB,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC;eAClC,OAAO,WAAW,KAAK,UAAU,EACpC,CAAC;YACD,SAAS;QACX,CAAC;QAED,QAAQ,CAAC,GAAG,CAAC,GAAG,WAAgC,CAAC;IACnD,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const enum ElementTemplateLifecycleConstant {
2
+ hydrate = "rLynxElementTemplateHydrate",
3
+ update = "rLynxElementTemplateUpdate"
4
+ }
@@ -0,0 +1,9 @@
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
+ export var ElementTemplateLifecycleConstant;
5
+ (function (ElementTemplateLifecycleConstant) {
6
+ ElementTemplateLifecycleConstant["hydrate"] = "rLynxElementTemplateHydrate";
7
+ ElementTemplateLifecycleConstant["update"] = "rLynxElementTemplateUpdate";
8
+ })(ElementTemplateLifecycleConstant || (ElementTemplateLifecycleConstant = {}));
9
+ //# sourceMappingURL=lifecycle-constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-constant.js","sourceRoot":"","sources":["../../../src/element-template/protocol/lifecycle-constant.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,MAAM,CAAN,IAAkB,gCAGjB;AAHD,WAAkB,gCAAgC;IAChD,2EAAuC,CAAA;IACvC,yEAAqC,CAAA;AACvC,CAAC,EAHiB,gCAAgC,KAAhC,gCAAgC,QAGjD"}
@@ -0,0 +1,7 @@
1
+ export declare const ElementTemplateUpdateOps: {
2
+ readonly createTemplate: 1;
3
+ readonly setAttribute: 2;
4
+ readonly insertNode: 3;
5
+ readonly removeNode: 4;
6
+ };
7
+ export type ElementTemplateUpdateOp = typeof ElementTemplateUpdateOps[keyof typeof ElementTemplateUpdateOps];
@@ -0,0 +1,10 @@
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 ElementTemplateUpdateOps = {
5
+ createTemplate: 1,
6
+ setAttribute: 2,
7
+ insertNode: 3,
8
+ removeNode: 4,
9
+ };
10
+ //# sourceMappingURL=opcodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opcodes.js","sourceRoot":"","sources":["../../../src/element-template/protocol/opcodes.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;IACb,UAAU,EAAE,CAAC;CACL,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { ElementTemplateUpdateOps } from './opcodes.js';
2
+ export type SerializableValue = string | number | boolean | null | SerializableValue[] | {
3
+ [key: string]: SerializableValue;
4
+ };
5
+ export type RuntimeOptions = Record<string, SerializableValue>;
6
+ export interface SerializedElementTemplate {
7
+ templateKey: string;
8
+ bundleUrl?: string;
9
+ attributeSlots?: SerializableValue[] | null;
10
+ elementSlots?: SerializedElementTemplate[][] | null;
11
+ uid: number | string;
12
+ }
13
+ export type CreateTemplateCommand = [
14
+ typeof ElementTemplateUpdateOps.createTemplate,
15
+ handleId: number,
16
+ templateKey: string,
17
+ bundleUrl: string | null | undefined,
18
+ attributeSlots: SerializableValue[] | null | undefined,
19
+ elementSlots: number[][] | null | undefined
20
+ ];
21
+ export type SetAttributeCommand = [
22
+ typeof ElementTemplateUpdateOps.setAttribute,
23
+ targetHandleId: number,
24
+ attrSlotIndex: number,
25
+ value: SerializableValue | null
26
+ ];
27
+ export type InsertNodeCommand = [
28
+ typeof ElementTemplateUpdateOps.insertNode,
29
+ targetHandleId: number,
30
+ elementSlotIndex: number,
31
+ childHandleId: number,
32
+ referenceHandleId: number
33
+ ];
34
+ export type RemoveNodeCommand = [
35
+ typeof ElementTemplateUpdateOps.removeNode,
36
+ targetHandleId: number,
37
+ elementSlotIndex: number,
38
+ childHandleId: number,
39
+ removedSubtreeHandleIds: number[]
40
+ ];
41
+ export type ElementTemplateUpdateCommand = CreateTemplateCommand | SetAttributeCommand | InsertNodeCommand | RemoveNodeCommand;
42
+ export type ElementTemplateUpdateCommandStream = ElementTemplateUpdateCommand[number][];
43
+ export interface ElementTemplateFlushOptions {
44
+ pipelineOptions?: PipelineOptions;
45
+ }
46
+ export interface ElementTemplateUpdateCommitContext {
47
+ ops: ElementTemplateUpdateCommandStream;
48
+ flushOptions: ElementTemplateFlushOptions;
49
+ flowIds?: number[];
50
+ }
@@ -0,0 +1,5 @@
1
+ // Copyright 2025 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 { ElementTemplateUpdateOps } from './opcodes.js';
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/element-template/protocol/types.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}