@lynx-js/react 0.129.3 → 0.129.5

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 (494) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/components/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +10 -2
  4. package/refresh/.turbo/turbo-build.log +3 -3
  5. package/refresh/dist/index.js +113 -20
  6. package/refresh/rslib.config.ts +13 -3
  7. package/refresh/src/index.ts +100 -0
  8. package/refresh/src/self.ts +38 -0
  9. package/runtime/__test__/{snapshot → core}/attribute-name.test.ts +1 -1
  10. package/runtime/__test__/core/background-function.test.ts +37 -0
  11. package/runtime/__test__/{shared → core}/component-stack.test.ts +4 -4
  12. package/runtime/__test__/core/lynx/env.test.ts +146 -0
  13. package/runtime/__test__/core/ref.test.ts +218 -1
  14. package/runtime/__test__/core/sync-effect-flush.test.ts +58 -0
  15. package/runtime/__test__/element-template/debug/alog.test.ts +20 -12
  16. package/runtime/__test__/element-template/fixtures/background/hydrate/_shared.tsx +15 -34
  17. package/runtime/__test__/element-template/fixtures/background/hydrate/children.creates-missing-nodes-recursively/output.txt +2 -0
  18. package/runtime/__test__/element-template/fixtures/background/hydrate/children.iterates-existing-slots/output.txt +1 -0
  19. package/runtime/__test__/element-template/fixtures/background/hydrate/children.missing-attrs-element/output.txt +6 -1
  20. package/runtime/__test__/element-template/fixtures/background/hydrate/children.missing-slot-record-on-main/output.txt +1 -0
  21. package/runtime/__test__/element-template/fixtures/background/hydrate/{coverage.move-before-child → children.reconciles-raw-text-slots}/case.tsx +1 -1
  22. package/runtime/__test__/element-template/fixtures/background/hydrate/coverage.emit-create-raw-text/output.txt +1 -0
  23. package/runtime/__test__/element-template/fixtures/background/hydrate/coverage.emit-create-raw-text-non-text/output.txt +1 -0
  24. package/runtime/__test__/element-template/fixtures/background/hydrate/root-key-mismatch-reconciles/output.txt +1 -0
  25. package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/children.creates-and-inserts-new/output.txt +1 -0
  26. package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/children.inserts-before-existing-sibling/output.txt +1 -0
  27. package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/children.mixed-operations/output.txt +1 -0
  28. package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/children.non-string-raw-text-key-on-main/output.txt +1 -0
  29. package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/complex-trees.deeply-nested-dynamic-content/output.txt +1 -0
  30. package/runtime/__test__/element-template/fixtures/background/instance/ops/emits-bundle-url-in-create-template/output.txt +1 -0
  31. package/runtime/__test__/element-template/fixtures/list/mts/index.tsx +185 -0
  32. package/runtime/__test__/element-template/fixtures/page/render-page/native-log.txt +1 -0
  33. package/runtime/__test__/element-template/fixtures/patch/detaches-node-when-moving-between-slots/case.tsx +2 -0
  34. package/runtime/__test__/element-template/fixtures/patch-compiled/applies-insert-before-with-reference/ops.txt +1 -0
  35. package/runtime/__test__/element-template/fixtures/patch-compiled/apply-hydration-ops/ops.txt +1 -0
  36. package/runtime/__test__/element-template/fixtures/render/child-siblings/papi.txt +10 -5
  37. package/runtime/__test__/element-template/fixtures/render/component/papi.txt +6 -3
  38. package/runtime/__test__/element-template/fixtures/render/component-slot-content/papi.txt +6 -3
  39. package/runtime/__test__/element-template/fixtures/render/css-scope-dynamic-bundle-url/papi.txt +2 -1
  40. package/runtime/__test__/element-template/fixtures/render/direct-native/appends-root-text-via-append-element/native-log.txt +1 -0
  41. package/runtime/__test__/element-template/fixtures/render/direct-native/creates-template-from-attrs-and-slot-text/native-log.txt +2 -0
  42. package/runtime/__test__/element-template/fixtures/render/direct-native/handles-multiple-template-children-in-the-same-slot/native-log.txt +3 -0
  43. package/runtime/__test__/element-template/fixtures/render/direct-native/handles-multiple-text-nodes-in-the-same-slot/native-log.txt +3 -0
  44. package/runtime/__test__/element-template/fixtures/render/direct-native/inserts-nested-templates-into-parent-slots/native-log.txt +3 -0
  45. package/runtime/__test__/element-template/fixtures/render/direct-native/keeps-slot-children-separated-and-ordered/native-log.txt +3 -0
  46. package/runtime/__test__/element-template/fixtures/render/direct-native/passes-bundle-url-to-native-create/native-log.txt +1 -0
  47. package/runtime/__test__/element-template/fixtures/render/mapped-view-children/papi.txt +14 -7
  48. package/runtime/__test__/element-template/fixtures/render/mixed-children/papi.txt +8 -4
  49. package/runtime/__test__/element-template/fixtures/render/multiple-text/papi.txt +38 -19
  50. package/runtime/__test__/element-template/fixtures/render/nested-templates/papi.txt +6 -3
  51. package/runtime/__test__/element-template/fixtures/render/react-example/papi.txt +6 -3
  52. package/runtime/__test__/element-template/fixtures/render/sparse-element-slot/papi.txt +6 -3
  53. package/runtime/__test__/element-template/fixtures/render/template-dedupe/papi.txt +10 -5
  54. package/runtime/__test__/element-template/imports/suspense-lazy.test.ts +47 -4
  55. package/runtime/__test__/element-template/lynx/performance.test.ts +1 -0
  56. package/runtime/__test__/element-template/native/callDestroyLifetimeFun.test.ts +1 -0
  57. package/runtime/__test__/element-template/native/index.test.ts +9 -9
  58. package/runtime/__test__/element-template/native/mts-destroy.test.ts +65 -17
  59. package/runtime/__test__/element-template/native/reload.test.ts +19 -12
  60. package/runtime/__test__/element-template/runtime/background/adapter/background-adapter.et.test.tsx +0 -32
  61. package/runtime/__test__/element-template/runtime/background/commit-context.test.ts +0 -14
  62. package/runtime/__test__/element-template/runtime/background/commit-hook.test.ts +10 -0
  63. package/runtime/__test__/element-template/runtime/background/event/compiled-fixtures.test.tsx +22 -0
  64. package/runtime/__test__/element-template/runtime/background/hydrate.test.ts +197 -252
  65. package/runtime/__test__/element-template/runtime/background/instance.test.ts +277 -126
  66. package/runtime/__test__/element-template/runtime/background/main-thread-function/compiled-fixtures.test.tsx +1 -1
  67. package/runtime/__test__/element-template/runtime/background/passive-update-depth.test.tsx +496 -0
  68. package/runtime/__test__/element-template/runtime/background/render/preact.test.tsx +16 -22
  69. package/runtime/__test__/element-template/runtime/background/root-render.test.tsx +5 -3
  70. package/runtime/__test__/element-template/runtime/background/suspense.test.tsx +2 -0
  71. package/runtime/__test__/element-template/runtime/background/update/compiled-fixtures.test.tsx +1 -0
  72. package/runtime/__test__/element-template/runtime/background/update-timing.test.ts +1 -0
  73. package/runtime/__test__/element-template/runtime/hydration/hydration-listener.test.ts +4 -5
  74. package/runtime/__test__/element-template/runtime/list/list-mts-compiled.test.ts +525 -0
  75. package/runtime/__test__/element-template/runtime/page/compiled-fixtures.test.tsx +2 -0
  76. package/runtime/__test__/element-template/runtime/page/root-instance.test.ts +2 -14
  77. package/runtime/__test__/element-template/runtime/patch/element-template-patch.test.tsx +425 -1032
  78. package/runtime/__test__/element-template/runtime/patch/patch-listener-alog.test.ts +1 -0
  79. package/runtime/__test__/element-template/runtime/patch/update-timing.test.ts +1 -0
  80. package/runtime/__test__/element-template/runtime/prop-adapters/event.test.ts +0 -20
  81. package/runtime/__test__/element-template/runtime/prop-adapters/gesture.test.ts +2 -1
  82. package/runtime/__test__/element-template/runtime/prop-adapters/hydrate.test.ts +1 -0
  83. package/runtime/__test__/element-template/runtime/prop-adapters/ref.test.ts +65 -0
  84. package/runtime/__test__/element-template/runtime/prop-adapters/spread-mts-compiled.test.ts +12 -4
  85. package/runtime/__test__/element-template/runtime/render/render-components.test.jsx +2 -5
  86. package/runtime/__test__/element-template/runtime/render/render-direct-native.test.tsx +56 -121
  87. package/runtime/__test__/element-template/runtime/render/render-direct-suspense.test.ts +18 -17
  88. package/runtime/__test__/element-template/runtime/render/render-direct.test.ts +5 -4
  89. package/runtime/__test__/element-template/runtime/render/render-main-thread.contract.test.ts +2 -0
  90. package/runtime/__test__/element-template/runtime/render/render-main-thread.test.ts +1 -60
  91. package/runtime/__test__/element-template/runtime/render/render-transform.contract.test.ts +65 -89
  92. package/runtime/__test__/element-template/runtime/template/element-template-handle.test.ts +8 -6
  93. package/runtime/__test__/element-template/runtime/template/main-thread-dynamic-attr-state.test.ts +34 -6
  94. package/runtime/__test__/element-template/test-utils/debug/updateRunner.test.tsx +20 -12
  95. package/runtime/__test__/element-template/test-utils/debug/updateRunner.ts +2 -28
  96. package/runtime/__test__/element-template/test-utils/mock/mockNativePapi/templateTree.test.ts +14 -5
  97. package/runtime/__test__/element-template/test-utils/mock/mockNativePapi/templateTree.ts +1 -57
  98. package/runtime/__test__/element-template/test-utils/mock/mockNativePapi.ts +29 -13
  99. package/runtime/__test__/element-template/vitest.config.ts +2 -1
  100. package/runtime/__test__/guardrails/snapshot-containment.test.ts +98 -77
  101. package/runtime/__test__/snapshot/debug/passive-update-depth.test.jsx +549 -0
  102. package/runtime/__test__/snapshot/debug/profile.test.jsx +147 -26
  103. package/runtime/__test__/snapshot/debug/react-hooks-profile.test.jsx +3 -3
  104. package/runtime/__test__/snapshot/lifecycle/reload-background-function.test.jsx +138 -1
  105. package/runtime/__test__/snapshot/lifecycle/reload-delayed-background.test.jsx +55 -1
  106. package/runtime/__test__/snapshot/lifecycle/transfer.mts.test.jsx +286 -0
  107. package/runtime/__test__/snapshot/lifecycle/transfer.test.jsx +415 -0
  108. package/runtime/__test__/snapshot/list.test.jsx +109 -0
  109. package/runtime/__test__/snapshot/lynx/suspense.test.jsx +48 -0
  110. package/runtime/__test__/snapshot/lynxQueueMicrotask.test.jsx +2 -2
  111. package/runtime/__test__/snapshot/ref.test.jsx +124 -1
  112. package/runtime/__test__/snapshot/utils/envManager.ts +7 -0
  113. package/runtime/__test__/snapshot/utils/globals.js +1 -0
  114. package/runtime/__test__/worklet-runtime/delayWorkletEvent.test.js +43 -11
  115. package/runtime/__test__/worklet-runtime/hydrate.test.js +1 -0
  116. package/runtime/__test__/worklet-runtime/jsFunctionLifecycle.test.js +24 -16
  117. package/runtime/__test__/worklet-runtime/lifecycle.test.js +297 -0
  118. package/runtime/__test__/worklet-runtime/profile.test.js +12 -6
  119. package/runtime/__test__/worklet-runtime/runOnBackground.test.js +188 -0
  120. package/runtime/__test__/worklet-runtime/workletRef.test.js +16 -0
  121. package/runtime/__test__/worklet-runtime/workletRuntime.test.js +53 -1
  122. package/runtime/lazy/element-template-internal.js +1 -0
  123. package/runtime/lazy/internal.js +1 -0
  124. package/runtime/lib/core/attribute-name.js.map +1 -0
  125. package/runtime/lib/core/background-function/run-on-background.js +7 -7
  126. package/runtime/lib/core/background-function/run-on-background.js.map +1 -1
  127. package/runtime/lib/core/compat/componentIs.d.ts +1 -0
  128. package/runtime/lib/core/compat/componentIs.js +20 -0
  129. package/runtime/lib/core/compat/componentIs.js.map +1 -0
  130. package/runtime/lib/{shared → core}/component-stack.js +1 -1
  131. package/runtime/lib/core/component-stack.js.map +1 -0
  132. package/runtime/lib/core/deep-equal.d.ts +1 -0
  133. package/runtime/lib/core/deep-equal.js +31 -0
  134. package/runtime/lib/core/deep-equal.js.map +1 -0
  135. package/runtime/lib/core/hooks/mainThreadImpl.js +1 -1
  136. package/runtime/lib/core/hooks/mainThreadImpl.js.map +1 -1
  137. package/runtime/lib/core/lynx/env.d.ts +1 -0
  138. package/runtime/lib/{element-template → core}/lynx/env.js +3 -2
  139. package/runtime/lib/core/lynx/env.js.map +1 -0
  140. package/runtime/lib/core/lynx-page-data.js +1 -1
  141. package/runtime/lib/core/lynx-page-data.js.map +1 -1
  142. package/runtime/lib/core/mts-capability.js +1 -1
  143. package/runtime/lib/core/mts-capability.js.map +1 -1
  144. package/runtime/lib/core/performance.js +2 -1
  145. package/runtime/lib/core/performance.js.map +1 -1
  146. package/runtime/lib/core/ref.d.ts +1 -2
  147. package/runtime/lib/core/ref.js +60 -9
  148. package/runtime/lib/core/ref.js.map +1 -1
  149. package/runtime/lib/core/sync-effect-flush.d.ts +9 -0
  150. package/runtime/lib/core/sync-effect-flush.js +31 -0
  151. package/runtime/lib/core/sync-effect-flush.js.map +1 -0
  152. package/runtime/lib/core/thread-function-call/main-thread.d.ts +1 -0
  153. package/runtime/lib/core/thread-function-call/main-thread.js +5 -2
  154. package/runtime/lib/core/thread-function-call/main-thread.js.map +1 -1
  155. package/runtime/lib/element-template/background/attr-slots.d.ts +1 -0
  156. package/runtime/lib/element-template/background/attr-slots.js.map +1 -1
  157. package/runtime/lib/element-template/background/commit-event.d.ts +6 -0
  158. package/runtime/lib/element-template/background/commit-event.js +36 -0
  159. package/runtime/lib/element-template/background/commit-event.js.map +1 -0
  160. package/runtime/lib/element-template/background/commit-hook.js +4 -24
  161. package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
  162. package/runtime/lib/element-template/background/destroy.js +2 -2
  163. package/runtime/lib/element-template/background/destroy.js.map +1 -1
  164. package/runtime/lib/element-template/background/hydrate.js +174 -87
  165. package/runtime/lib/element-template/background/hydrate.js.map +1 -1
  166. package/runtime/lib/element-template/background/hydration-listener.js +5 -25
  167. package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
  168. package/runtime/lib/element-template/background/instance.d.ts +7 -10
  169. package/runtime/lib/element-template/background/instance.js +65 -58
  170. package/runtime/lib/element-template/background/instance.js.map +1 -1
  171. package/runtime/lib/element-template/{runtime/template → background}/main-thread-function.js +4 -4
  172. package/runtime/lib/element-template/background/main-thread-function.js.map +1 -0
  173. package/runtime/lib/element-template/background/render-scope.js +2 -1
  174. package/runtime/lib/element-template/background/render-scope.js.map +1 -1
  175. package/runtime/lib/element-template/debug/alog.d.ts +1 -10
  176. package/runtime/lib/element-template/debug/alog.js +1 -16
  177. package/runtime/lib/element-template/debug/alog.js.map +1 -1
  178. package/runtime/lib/element-template/debug/profile.js +1 -1
  179. package/runtime/lib/element-template/debug/profile.js.map +1 -1
  180. package/runtime/lib/element-template/index.d.ts +1 -1
  181. package/runtime/lib/element-template/index.js +1 -1
  182. package/runtime/lib/element-template/index.js.map +1 -1
  183. package/runtime/lib/element-template/internal.js +3 -0
  184. package/runtime/lib/element-template/internal.js.map +1 -1
  185. package/runtime/lib/element-template/native/index.js +4 -4
  186. package/runtime/lib/element-template/native/index.js.map +1 -1
  187. package/runtime/lib/element-template/native/mts-destroy.d.ts +2 -1
  188. package/runtime/lib/element-template/native/mts-destroy.js +15 -4
  189. package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
  190. package/runtime/lib/element-template/native/patch-listener.js +4 -8
  191. package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
  192. package/runtime/lib/element-template/native/reload-main-thread.js +2 -6
  193. package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -1
  194. package/runtime/lib/element-template/prop-adapters/ref.d.ts +2 -1
  195. package/runtime/lib/element-template/prop-adapters/ref.js +4 -4
  196. package/runtime/lib/element-template/prop-adapters/ref.js.map +1 -1
  197. package/runtime/lib/element-template/prop-adapters/spread.js +1 -1
  198. package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -1
  199. package/runtime/lib/element-template/protocol/opcodes.d.ts +0 -2
  200. package/runtime/lib/element-template/protocol/opcodes.js +0 -2
  201. package/runtime/lib/element-template/protocol/opcodes.js.map +1 -1
  202. package/runtime/lib/element-template/protocol/types.d.ts +8 -30
  203. package/runtime/lib/element-template/protocol/types.js.map +1 -1
  204. package/runtime/lib/element-template/runtime/list/list.d.ts +14 -54
  205. package/runtime/lib/element-template/runtime/list/list.js +82 -546
  206. package/runtime/lib/element-template/runtime/list/list.js.map +1 -1
  207. package/runtime/lib/element-template/runtime/list/platform-info.d.ts +2 -0
  208. package/runtime/lib/element-template/runtime/list/platform-info.js +26 -0
  209. package/runtime/lib/element-template/runtime/list/platform-info.js.map +1 -0
  210. package/runtime/lib/element-template/runtime/patch.js +44 -128
  211. package/runtime/lib/element-template/runtime/patch.js.map +1 -1
  212. package/runtime/lib/element-template/runtime/render/create-rendered-host.d.ts +1 -1
  213. package/runtime/lib/element-template/runtime/render/create-rendered-host.js +24 -21
  214. package/runtime/lib/element-template/runtime/render/create-rendered-host.js.map +1 -1
  215. package/runtime/lib/element-template/runtime/render/render-components.d.ts +1 -1
  216. package/runtime/lib/element-template/runtime/render/render-components.js +3 -6
  217. package/runtime/lib/element-template/runtime/render/render-components.js.map +1 -1
  218. package/runtime/lib/element-template/runtime/render/render-direct.js +21 -20
  219. package/runtime/lib/element-template/runtime/render/render-direct.js.map +1 -1
  220. package/runtime/lib/element-template/runtime/render/render-main-thread.js +0 -13
  221. package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
  222. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js +8 -0
  223. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js.map +1 -1
  224. package/runtime/lib/element-template/runtime/template/handle.d.ts +3 -3
  225. package/runtime/lib/element-template/runtime/template/handle.js +3 -3
  226. package/runtime/lib/element-template/runtime/template/handle.js.map +1 -1
  227. package/runtime/lib/element-template/runtime/template/main-thread-background-function.d.ts +1 -0
  228. package/runtime/lib/element-template/runtime/template/main-thread-background-function.js +8 -8
  229. package/runtime/lib/element-template/runtime/template/main-thread-background-function.js.map +1 -1
  230. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.d.ts +2 -1
  231. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js +44 -28
  232. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js.map +1 -1
  233. package/runtime/lib/element-template/runtime/template/typed-attributes.d.ts +2 -0
  234. package/runtime/lib/element-template/runtime/template/typed-attributes.js +8 -1
  235. package/runtime/lib/element-template/runtime/template/typed-attributes.js.map +1 -1
  236. package/runtime/lib/internal.d.ts +1 -0
  237. package/runtime/lib/internal.js +5 -10
  238. package/runtime/lib/internal.js.map +1 -1
  239. package/runtime/lib/lynx-api.js +6 -1
  240. package/runtime/lib/lynx-api.js.map +1 -1
  241. package/runtime/lib/lynx.js +4 -4
  242. package/runtime/lib/lynx.js.map +1 -1
  243. package/runtime/lib/root.d.ts +5 -1
  244. package/runtime/lib/root.js +12 -1
  245. package/runtime/lib/root.js.map +1 -1
  246. package/runtime/lib/shared/microtask.d.ts +1 -0
  247. package/runtime/lib/shared/microtask.js +28 -0
  248. package/runtime/lib/shared/microtask.js.map +1 -0
  249. package/runtime/lib/shared/utils.d.ts +8 -0
  250. package/runtime/lib/shared/utils.js +27 -0
  251. package/runtime/lib/shared/utils.js.map +1 -0
  252. package/runtime/lib/{worklet-runtime/utils → shared}/version.d.ts +1 -0
  253. package/runtime/lib/{worklet-runtime/utils → shared}/version.js +4 -2
  254. package/runtime/lib/shared/version.js.map +1 -0
  255. package/runtime/lib/snapshot/alog/render.js +1 -1
  256. package/runtime/lib/snapshot/alog/render.js.map +1 -1
  257. package/runtime/lib/snapshot/debug/profileHooks.js +28 -63
  258. package/runtime/lib/snapshot/debug/profileHooks.js.map +1 -1
  259. package/runtime/lib/snapshot/lifecycle/destroy.js +2 -2
  260. package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -1
  261. package/runtime/lib/snapshot/lifecycle/isRendering.js +2 -1
  262. package/runtime/lib/snapshot/lifecycle/isRendering.js.map +1 -1
  263. package/runtime/lib/snapshot/lifecycle/patch/commit.d.ts +7 -2
  264. package/runtime/lib/snapshot/lifecycle/patch/commit.js +11 -6
  265. package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -1
  266. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.d.ts +5 -0
  267. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js +1 -1
  268. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -1
  269. package/runtime/lib/snapshot/lifecycle/ref/delay.d.ts +1 -1
  270. package/runtime/lib/snapshot/lifecycle/ref/delay.js +2 -2
  271. package/runtime/lib/snapshot/lifecycle/ref/delay.js.map +1 -1
  272. package/runtime/lib/snapshot/lifecycle/reload.js +3 -3
  273. package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
  274. package/runtime/lib/snapshot/list/list.js +12 -3
  275. package/runtime/lib/snapshot/list/list.js.map +1 -1
  276. package/runtime/lib/snapshot/lynx/env.js +2 -32
  277. package/runtime/lib/snapshot/lynx/env.js.map +1 -1
  278. package/runtime/lib/snapshot/lynx/tt.d.ts +3 -1
  279. package/runtime/lib/snapshot/lynx/tt.js +7 -3
  280. package/runtime/lib/snapshot/lynx/tt.js.map +1 -1
  281. package/runtime/lib/snapshot/renderToOpcodes/hydrate.js +1 -1
  282. package/runtime/lib/snapshot/renderToOpcodes/hydrate.js.map +1 -1
  283. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +1 -1
  284. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
  285. package/runtime/lib/snapshot/snapshot/platformInfo.js +1 -1
  286. package/runtime/lib/snapshot/snapshot/platformInfo.js.map +1 -1
  287. package/runtime/lib/snapshot/snapshot/ref.d.ts +1 -0
  288. package/runtime/lib/snapshot/snapshot/ref.js +2 -2
  289. package/runtime/lib/snapshot/snapshot/ref.js.map +1 -1
  290. package/runtime/lib/snapshot/snapshot/snapshot.js +1 -1
  291. package/runtime/lib/snapshot/snapshot/snapshot.js.map +1 -1
  292. package/runtime/lib/snapshot/snapshot/spread.js +3 -2
  293. package/runtime/lib/snapshot/snapshot/spread.js.map +1 -1
  294. package/runtime/lib/snapshot/transfer.d.ts +21 -0
  295. package/runtime/lib/snapshot/transfer.js +486 -0
  296. package/runtime/lib/snapshot/transfer.js.map +1 -0
  297. package/runtime/lib/snapshot/worklet/functionality.js +1 -1
  298. package/runtime/lib/snapshot/worklet/functionality.js.map +1 -1
  299. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  300. package/runtime/lib/worklet-runtime/api/element.js +1 -1
  301. package/runtime/lib/worklet-runtime/api/element.js.map +1 -1
  302. package/runtime/lib/worklet-runtime/api/lynxApi.js +1 -1
  303. package/runtime/lib/worklet-runtime/api/lynxApi.js.map +1 -1
  304. package/runtime/lib/worklet-runtime/bindings/bindings.d.ts +3 -2
  305. package/runtime/lib/worklet-runtime/bindings/bindings.js +11 -1
  306. package/runtime/lib/worklet-runtime/bindings/bindings.js.map +1 -1
  307. package/runtime/lib/worklet-runtime/bindings/lifecycle.d.ts +19 -0
  308. package/runtime/lib/worklet-runtime/bindings/lifecycle.js +49 -0
  309. package/runtime/lib/worklet-runtime/bindings/lifecycle.js.map +1 -0
  310. package/runtime/lib/worklet-runtime/bindings/observers.js +9 -1
  311. package/runtime/lib/worklet-runtime/bindings/observers.js.map +1 -1
  312. package/runtime/lib/worklet-runtime/bindings/types.d.ts +1 -0
  313. package/runtime/lib/worklet-runtime/bindings/types.js.map +1 -1
  314. package/runtime/lib/worklet-runtime/delayWorkletEvent.d.ts +3 -5
  315. package/runtime/lib/worklet-runtime/delayWorkletEvent.js +49 -43
  316. package/runtime/lib/worklet-runtime/delayWorkletEvent.js.map +1 -1
  317. package/runtime/lib/worklet-runtime/global.d.ts +1 -2
  318. package/runtime/lib/worklet-runtime/global.js.map +1 -1
  319. package/runtime/lib/worklet-runtime/hydrate.js +2 -32
  320. package/runtime/lib/worklet-runtime/hydrate.js.map +1 -1
  321. package/runtime/lib/worklet-runtime/run-on-background/index.d.ts +28 -0
  322. package/runtime/lib/worklet-runtime/run-on-background/index.js +103 -0
  323. package/runtime/lib/worklet-runtime/run-on-background/index.js.map +1 -0
  324. package/runtime/lib/worklet-runtime/{jsFunctionLifecycle.d.ts → run-on-background/lifecycle.d.ts} +2 -2
  325. package/runtime/lib/worklet-runtime/{jsFunctionLifecycle.js → run-on-background/lifecycle.js} +12 -9
  326. package/runtime/lib/worklet-runtime/run-on-background/lifecycle.js.map +1 -0
  327. package/runtime/lib/worklet-runtime/utils/profile.js +1 -3
  328. package/runtime/lib/worklet-runtime/utils/profile.js.map +1 -1
  329. package/runtime/lib/worklet-runtime/workletRef.js +51 -54
  330. package/runtime/lib/worklet-runtime/workletRef.js.map +1 -1
  331. package/runtime/lib/worklet-runtime/workletRuntime.js +5 -6
  332. package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
  333. package/runtime/src/core/background-function/run-on-background.ts +7 -7
  334. package/runtime/src/core/compat/componentIs.ts +32 -0
  335. package/runtime/src/{shared → core}/component-stack.ts +1 -1
  336. package/runtime/src/core/deep-equal.ts +33 -0
  337. package/runtime/src/core/hooks/mainThreadImpl.ts +1 -1
  338. package/runtime/src/{element-template → core}/lynx/env.ts +6 -4
  339. package/runtime/src/core/lynx-page-data.ts +1 -1
  340. package/runtime/src/core/mts-capability.ts +1 -1
  341. package/runtime/src/core/performance.ts +2 -1
  342. package/runtime/src/core/ref.ts +92 -15
  343. package/runtime/src/core/sync-effect-flush.ts +30 -0
  344. package/runtime/src/core/thread-function-call/main-thread.ts +6 -2
  345. package/runtime/src/element-template/background/attr-slots.ts +2 -2
  346. package/runtime/src/element-template/background/commit-event.ts +52 -0
  347. package/runtime/src/element-template/background/commit-hook.ts +5 -32
  348. package/runtime/src/element-template/background/destroy.ts +2 -2
  349. package/runtime/src/element-template/background/hydrate.ts +234 -122
  350. package/runtime/src/element-template/background/hydration-listener.ts +7 -32
  351. package/runtime/src/element-template/background/instance.ts +82 -82
  352. package/runtime/src/element-template/{runtime/template → background}/main-thread-function.ts +4 -7
  353. package/runtime/src/element-template/background/render-scope.ts +2 -1
  354. package/runtime/src/element-template/debug/alog.ts +2 -30
  355. package/runtime/src/element-template/debug/profile.ts +1 -1
  356. package/runtime/src/element-template/index.ts +1 -1
  357. package/runtime/src/element-template/internal.ts +4 -0
  358. package/runtime/src/element-template/native/index.ts +4 -4
  359. package/runtime/src/element-template/native/mts-destroy.ts +21 -4
  360. package/runtime/src/element-template/native/patch-listener.ts +6 -7
  361. package/runtime/src/element-template/native/reload-main-thread.ts +2 -6
  362. package/runtime/src/element-template/prop-adapters/ref.ts +12 -5
  363. package/runtime/src/element-template/prop-adapters/spread.ts +1 -1
  364. package/runtime/src/element-template/protocol/opcodes.ts +0 -2
  365. package/runtime/src/element-template/protocol/types.ts +10 -38
  366. package/runtime/src/element-template/runtime/list/list.ts +115 -744
  367. package/runtime/src/element-template/runtime/list/platform-info.ts +31 -0
  368. package/runtime/src/element-template/runtime/patch.ts +78 -197
  369. package/runtime/src/element-template/runtime/render/create-rendered-host.ts +27 -31
  370. package/runtime/src/element-template/runtime/render/render-components.ts +2 -5
  371. package/runtime/src/element-template/runtime/render/render-direct.ts +19 -18
  372. package/runtime/src/element-template/runtime/render/render-main-thread.ts +0 -14
  373. package/runtime/src/element-template/runtime/template/attr-slot-plan.ts +9 -0
  374. package/runtime/src/element-template/runtime/template/handle.ts +5 -2
  375. package/runtime/src/element-template/runtime/template/main-thread-background-function.ts +9 -8
  376. package/runtime/src/element-template/runtime/template/main-thread-dynamic-attr-state.ts +44 -30
  377. package/runtime/src/element-template/runtime/template/typed-attributes.ts +17 -1
  378. package/runtime/src/element-template/types.d.ts +6 -22
  379. package/runtime/src/internal.ts +6 -13
  380. package/runtime/src/lynx-api.ts +6 -1
  381. package/runtime/src/lynx.ts +4 -4
  382. package/runtime/src/root.ts +17 -1
  383. package/runtime/src/shared/microtask.ts +26 -0
  384. package/runtime/src/shared/utils.ts +37 -0
  385. package/runtime/src/{worklet-runtime/utils → shared}/version.ts +6 -4
  386. package/runtime/src/snapshot/alog/render.ts +1 -1
  387. package/runtime/src/snapshot/debug/profileHooks.ts +31 -92
  388. package/runtime/src/snapshot/lifecycle/destroy.ts +2 -2
  389. package/runtime/src/snapshot/lifecycle/isRendering.ts +2 -1
  390. package/runtime/src/snapshot/lifecycle/patch/commit.ts +28 -7
  391. package/runtime/src/snapshot/lifecycle/patch/updateMainThread.ts +1 -1
  392. package/runtime/src/snapshot/lifecycle/ref/delay.ts +5 -2
  393. package/runtime/src/snapshot/lifecycle/reload.ts +3 -4
  394. package/runtime/src/snapshot/list/list.ts +12 -3
  395. package/runtime/src/snapshot/lynx/env.ts +3 -43
  396. package/runtime/src/snapshot/lynx/tt.ts +8 -3
  397. package/runtime/src/snapshot/renderToOpcodes/hydrate.ts +1 -1
  398. package/runtime/src/snapshot/snapshot/backgroundSnapshot.ts +1 -1
  399. package/runtime/src/snapshot/snapshot/platformInfo.ts +1 -1
  400. package/runtime/src/snapshot/snapshot/ref.ts +7 -4
  401. package/runtime/src/snapshot/snapshot/snapshot.ts +1 -1
  402. package/runtime/src/snapshot/snapshot/spread.ts +3 -2
  403. package/runtime/src/snapshot/transfer.ts +535 -0
  404. package/runtime/src/snapshot/worklet/functionality.ts +1 -1
  405. package/runtime/src/worklet-runtime/api/element.ts +1 -1
  406. package/runtime/src/worklet-runtime/api/lynxApi.ts +1 -1
  407. package/runtime/src/worklet-runtime/bindings/bindings.ts +12 -0
  408. package/runtime/src/worklet-runtime/bindings/lifecycle.ts +51 -0
  409. package/runtime/src/worklet-runtime/bindings/observers.ts +9 -1
  410. package/runtime/src/worklet-runtime/bindings/types.ts +1 -0
  411. package/runtime/src/worklet-runtime/delayWorkletEvent.ts +57 -54
  412. package/runtime/src/worklet-runtime/global.ts +1 -2
  413. package/runtime/src/worklet-runtime/hydrate.ts +2 -35
  414. package/runtime/src/worklet-runtime/run-on-background/index.ts +145 -0
  415. package/runtime/src/worklet-runtime/{jsFunctionLifecycle.ts → run-on-background/lifecycle.ts} +11 -9
  416. package/runtime/src/worklet-runtime/utils/profile.ts +1 -3
  417. package/runtime/src/worklet-runtime/workletRef.ts +63 -62
  418. package/runtime/src/worklet-runtime/workletRuntime.ts +10 -10
  419. package/runtime/types/internal-preact.d.ts +2 -0
  420. package/runtime/vitest.config.ts +0 -1
  421. package/testing-library/.turbo/turbo-build.log +11 -11
  422. package/testing-library/dist/pure.js +7 -4
  423. package/testing-library/dist/setupFiles/common/runtime-setup.js +3 -1
  424. package/testing-library/dist/setupFiles/inner/rstest.js +1 -1
  425. package/testing-library/dist/setupFiles/inner/vitest.js +1 -1
  426. package/testing-library/src/__tests__/events.test.jsx +1 -1
  427. package/testing-library/src/__tests__/list.test.jsx +52 -0
  428. package/testing-library/src/__tests__/worklet.test.jsx +81 -0
  429. package/testing-library/src/fire-event.ts +1 -1
  430. package/testing-library/src/pure.jsx +5 -2
  431. package/testing-library/src/setupFiles/common/runtime-setup.js +2 -0
  432. package/transform/.turbo/turbo-build$colon$wasm.log +45 -44
  433. package/transform/__test__/fixture.spec.js +1 -1
  434. package/transform/cjs/browser.cjs +11 -0
  435. package/transform/crates/swc_plugin_compat/lib.rs +20 -2
  436. package/transform/crates/swc_plugin_compat/napi.rs +7 -0
  437. package/transform/crates/swc_plugin_dynamic_import/lib.rs +15 -4
  438. package/transform/crates/swc_plugin_element_template/attr_name.rs +0 -3
  439. package/transform/crates/swc_plugin_element_template/extractor.rs +0 -8
  440. package/transform/crates/swc_plugin_element_template/lib.rs +12 -1
  441. package/transform/crates/swc_plugin_element_template/tests/element_template.rs +19 -45
  442. package/transform/crates/swc_plugin_element_template/tests/element_template_contract.rs +35 -19
  443. package/transform/crates/swc_plugin_worklet/lib.rs +11 -7
  444. package/transform/dist/wasm.cjs +1 -1
  445. package/transform/rspack-napi/lib/index.js +1 -4
  446. package/transform/rspack-napi/lib/index.js.map +1 -1
  447. package/transform/rspack-napi/src/index.ts +1 -4
  448. package/transform/rspack-napi/tsconfig.tsbuildinfo +1 -1
  449. package/transform/src/lib.rs +394 -27
  450. package/transform/swc-plugin-reactlynx/.turbo/turbo-build.log +415 -107
  451. package/transform/swc-plugin-reactlynx/src/lib.rs +99 -22
  452. package/transform/swc-plugin-reactlynx/swc_plugin_reactlynx.wasm +0 -0
  453. package/transform/swc-plugin-reactlynx-compat/.turbo/turbo-build.log +29 -339
  454. package/transform/swc-plugin-reactlynx-compat/swc_plugin_reactlynx_compat.wasm +0 -0
  455. package/runtime/__test__/element-template/fixtures/background/hydrate/coverage.move-before-child/output.txt +0 -10
  456. package/runtime/__test__/element-template/fixtures/background/hydrate/coverage.raw-text-key-branches/case.tsx +0 -5
  457. package/runtime/__test__/element-template/fixtures/background/instance/ops/supports-silent-insert-before/case.ts +0 -11
  458. package/runtime/__test__/element-template/fixtures/background/instance/ops/supports-silent-insert-before/output.txt +0 -1
  459. package/runtime/__test__/element-template/fixtures/background/instance/ops/treats-nullish-attrs-as-empty-object/case.ts +0 -23
  460. package/runtime/__test__/element-template/fixtures/background/instance/ops/treats-nullish-attrs-as-empty-object/output.txt +0 -6
  461. package/runtime/__test__/element-template/lynx/env.test.ts +0 -242
  462. package/runtime/__test__/element-template/runtime/page/authored-page.test.ts +0 -35
  463. package/runtime/__test__/element-template/runtime/patch/update-fixture-helper.test.tsx +0 -40
  464. package/runtime/__test__/snapshot/lynx-data-processors.test.ts +0 -3
  465. package/runtime/lib/element-template/lynx/env.d.ts +0 -1
  466. package/runtime/lib/element-template/lynx/env.js.map +0 -1
  467. package/runtime/lib/element-template/runtime/template/main-thread-function.js.map +0 -1
  468. package/runtime/lib/shared/attribute-name.js.map +0 -1
  469. package/runtime/lib/shared/component-stack.js.map +0 -1
  470. package/runtime/lib/snapshot/alog/index.d.ts +0 -1
  471. package/runtime/lib/snapshot/alog/index.js +0 -8
  472. package/runtime/lib/snapshot/alog/index.js.map +0 -1
  473. package/runtime/lib/snapshot/compat/componentIs.d.ts +0 -4
  474. package/runtime/lib/snapshot/compat/componentIs.js +0 -20
  475. package/runtime/lib/snapshot/compat/componentIs.js.map +0 -1
  476. package/runtime/lib/utils.d.ts +0 -19
  477. package/runtime/lib/utils.js +0 -119
  478. package/runtime/lib/utils.js.map +0 -1
  479. package/runtime/lib/worklet-runtime/delayRunOnBackground.d.ts +0 -13
  480. package/runtime/lib/worklet-runtime/delayRunOnBackground.js +0 -29
  481. package/runtime/lib/worklet-runtime/delayRunOnBackground.js.map +0 -1
  482. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +0 -1
  483. package/runtime/lib/worklet-runtime/utils/version.js.map +0 -1
  484. package/runtime/src/snapshot/alog/index.ts +0 -8
  485. package/runtime/src/snapshot/compat/componentIs.ts +0 -30
  486. package/runtime/src/utils.ts +0 -134
  487. package/runtime/src/worklet-runtime/delayRunOnBackground.ts +0 -53
  488. /package/runtime/__test__/element-template/fixtures/background/hydrate/{coverage.raw-text-key-branches → children.reconciles-raw-text-slots}/output.txt +0 -0
  489. /package/runtime/__test__/element-template/runtime/{template → background}/main-thread-function.test.ts +0 -0
  490. /package/runtime/lib/{shared → core}/attribute-name.d.ts +0 -0
  491. /package/runtime/lib/{shared → core}/attribute-name.js +0 -0
  492. /package/runtime/lib/{shared → core}/component-stack.d.ts +0 -0
  493. /package/runtime/lib/element-template/{runtime/template → background}/main-thread-function.d.ts +0 -0
  494. /package/runtime/src/{shared → core}/attribute-name.ts +0 -0
@@ -1,15 +1,15 @@
1
1
  $ rslib
2
- Rslib v1.0.2
2
+ Rslib v1.0.7
3
3
 
4
4
  info build started...
5
- start generating declaration files... (esm0)
6
5
  start generating declaration files... (esm2)
7
- ready built in 0.57s (esm2)
8
- ready built in 0.67s (esm1)
9
- ready built in 0.84s (esm0)
10
- info declaration files prepared with tsgo in 1.25 s (esm2)
11
- ready declaration files bundled successfully: dist/index.d.ts in 1.96 s (esm2)
12
- ready declaration files generated in 4.87 s (esm0)
6
+ start generating declaration files... (esm0)
7
+ ready built in 0.40s (esm2)
8
+ ready built in 0.49s (esm1)
9
+ ready built in 0.85s (esm0)
10
+ info declaration files prepared with tsgo in 0.88 s (esm2)
11
+ ready declaration files bundled successfully: dist/index.d.ts in 2.15 s (esm2)
12
+ ready declaration files generated in 4.14 s (esm0)
13
13
 
14
14
  File (esm0) Size
15
15
  dist/rslib-runtime-0.js 1.6 kB
@@ -17,11 +17,11 @@ dist/@rstest/adapter-rsbuild~0.js 3.7 kB
17
17
  dist/rstest-config.js 3.8 kB
18
18
  dist/plugins/index.js 12.6 kB
19
19
  dist/env/index.js 26.1 kB
20
- dist/pure.js 539.1 kB
20
+ dist/pure.js 539.3 kB
21
21
 
22
- Total: 586.8 kB
22
+ Total: 586.9 kB
23
23
 
24
- 11 files generated in dist, total: 8.9 kB (esm1)
24
+ 11 files generated in dist, total: 8.8 kB (esm1)
25
25
 
26
26
  File (esm2) Size
27
27
  dist/type-entry/index.js 0.01 kB
@@ -4,6 +4,7 @@ import { cloneElement, createRef, h, render } from "preact";
4
4
  import { useEffect } from "preact/hooks";
5
5
  import { act } from "preact/test-utils";
6
6
  import { __root } from "@lynx-js/react/internal";
7
+ import { clearDelayedRunOnBackgroundFunctions } from "@lynx-js/react/worklet-runtime/bindings";
7
8
  import { flushDelayedLifecycleEvents } from "../../runtime/lib/snapshot/lynx/tt.js";
8
9
  import { clearPage } from "../../runtime/lib/snapshot/index.js";
9
10
  import { __webpack_require__ } from "./rslib-runtime-0.js";
@@ -12409,7 +12410,7 @@ const shouldHighlight = ()=>{
12409
12410
  if ('boolean' == typeof colors) return colors;
12410
12411
  else return void 0 !== process.versions && void 0 !== process.versions.node;
12411
12412
  };
12412
- const { DOMCollection: DOMCollection } = build.plugins;
12413
+ const { DOMCollection } = build.plugins;
12413
12414
  const ELEMENT_NODE = 1;
12414
12415
  const COMMENT_NODE = 8;
12415
12416
  function filterCommentsAndDefaultIgnoreTagsTags(value) {
@@ -14270,8 +14271,8 @@ const logTestingPlaygroundURL = function(element) {
14270
14271
  return playgroundUrl;
14271
14272
  };
14272
14273
  const dom_esm_initialValue = {
14273
- debug: debug,
14274
- logTestingPlaygroundURL: logTestingPlaygroundURL
14274
+ debug,
14275
+ logTestingPlaygroundURL
14275
14276
  };
14276
14277
  const screen = "u" > typeof document && document.body ? getQueriesForElement(document.body, dom_esm_queries, dom_esm_initialValue) : Object.keys(dom_esm_queries).reduce((helpers, key)=>{
14277
14278
  helpers[key] = ()=>{
@@ -14514,10 +14515,12 @@ function cleanup() {
14514
14515
  act(()=>{
14515
14516
  render(null, __root);
14516
14517
  });
14518
+ globalThis.lynxTestingEnv.switchToMainThread();
14517
14519
  lynxTestingEnv.mainThread.elementTree.root = void 0;
14518
14520
  clearPage();
14521
+ clearDelayedRunOnBackgroundFunctions();
14519
14522
  lynxTestingEnv.env.window.document.body.innerHTML = '';
14520
- if (isMainThread) globalThis.lynxTestingEnv.switchToMainThread();
14523
+ if (!isMainThread) globalThis.lynxTestingEnv.switchToBackgroundThread();
14521
14524
  }
14522
14525
  function renderHook(renderCallback, options) {
14523
14526
  const { initialProps, wrapper } = options || {};
@@ -10,11 +10,12 @@ import { addCtxNotFoundEventListener } from "../../../../runtime/lib/snapshot/li
10
10
  import { setRoot } from "../../../../runtime/lib/root.js";
11
11
  import { BackgroundSnapshotInstance, SnapshotInstance, backgroundSnapshotInstanceManager, snapshotInstanceManager } from "../../../../runtime/lib/snapshot/index.js";
12
12
  import { destroyWorklet } from "../../../../runtime/lib/snapshot/worklet/destroy.js";
13
+ import { clearDelayedRunOnBackgroundFunctions } from "../../../../runtime/lib/worklet-runtime/bindings/observers.js";
13
14
  import { initApiEnv } from "../../../../runtime/lib/worklet-runtime/api/lynxApi.js";
14
15
  import { initEventListeners } from "../../../../runtime/lib/worklet-runtime/listeners.js";
15
16
  import { initWorklet } from "../../../../runtime/lib/worklet-runtime/workletRuntime.js";
16
17
  import { setupBackgroundDocument, setupDocument } from "../../../../runtime/lib/document.js";
17
- const { onInjectMainThreadGlobals: onInjectMainThreadGlobals, onInjectBackgroundThreadGlobals: onInjectBackgroundThreadGlobals, onResetLynxTestingEnv: onResetLynxTestingEnv, onSwitchedToMainThread: onSwitchedToMainThread, onSwitchedToBackgroundThread: onSwitchedToBackgroundThread, onInitWorkletRuntime: onInitWorkletRuntime } = globalThis;
18
+ const { onInjectMainThreadGlobals, onInjectBackgroundThreadGlobals, onResetLynxTestingEnv, onSwitchedToMainThread, onSwitchedToBackgroundThread, onInitWorkletRuntime } = globalThis;
18
19
  injectCalledByNative();
19
20
  injectUpdateMainThread();
20
21
  injectUpdateMTRefInitValue();
@@ -66,6 +67,7 @@ globalThis.onResetLynxTestingEnv = ()=>{
66
67
  flushDelayedLifecycleEvents();
67
68
  destroyWorklet();
68
69
  lynxTestingEnv.switchToMainThread();
70
+ clearDelayedRunOnBackgroundFunctions();
69
71
  initEventListeners();
70
72
  lynxTestingEnv.switchToBackgroundThread();
71
73
  injectTt();
@@ -1,4 +1,4 @@
1
- const { onInjectBackgroundThreadGlobals: onInjectBackgroundThreadGlobals } = globalThis;
1
+ const { onInjectBackgroundThreadGlobals } = globalThis;
2
2
  globalThis.onInjectBackgroundThreadGlobals = (target)=>{
3
3
  if (onInjectBackgroundThreadGlobals) onInjectBackgroundThreadGlobals(target);
4
4
  target.lynx.requireModuleAsync = async (url, _callback)=>{
@@ -1,4 +1,4 @@
1
- const { onInjectBackgroundThreadGlobals: onInjectBackgroundThreadGlobals } = globalThis;
1
+ const { onInjectBackgroundThreadGlobals } = globalThis;
2
2
  globalThis.onInjectBackgroundThreadGlobals = (target)=>{
3
3
  if (onInjectBackgroundThreadGlobals) onInjectBackgroundThreadGlobals(target);
4
4
  target.lynx.requireModuleAsync = async (url, callback)=>{
@@ -308,7 +308,7 @@ describe('Event handler property semantics', () => {
308
308
  expect(parent).toHaveBeenCalledTimes(1);
309
309
  });
310
310
 
311
- // https://lynx.bytedance.net/next/zh/api/lynx-api/event/touch-event.html
311
+ // https://lynxjs.org/api/lynx-api/event/touch-event.html
312
312
  // Every TouchEvent-family event (BaseTouchEvent in @lynx-js/types)
313
313
  // bubbles in Lynx: touch{start,move,end,cancel}, longpress.
314
314
  it.each(['touchstart', 'touchmove', 'touchend', 'touchcancel', 'longpress'])(
@@ -1013,3 +1013,55 @@ test('should replace a keyed list in a dynamic slot without corrupting the slot
1013
1013
  expect(nextList.querySelector('list-item').getAttribute('estimated-height-px')).toBe('20');
1014
1014
  expect(container.textContent).toBe('headerafterfooter');
1015
1015
  });
1016
+
1017
+ test('should not update a shown nested list-item when reusing an outer list-item', () => {
1018
+ const Comp = () => (
1019
+ <list>
1020
+ {[0, 1].map((row) => (
1021
+ <list-item key={row} item-key={`row-${row}`} reuse-identifier='row'>
1022
+ <list>
1023
+ <list-item item-key={`cell-${row}`}>
1024
+ <text>{`cell-${row}`}</text>
1025
+ </list-item>
1026
+ </list>
1027
+ </list-item>
1028
+ ))}
1029
+ </list>
1030
+ );
1031
+
1032
+ const show = (list, index) => elementTree.enterListItemAtIndex(list, index);
1033
+ const recycle = (list, sign) => elementTree.leaveListItem(list, sign);
1034
+ const element = (sign) => elementTree.__GetElementByUniqueId(sign);
1035
+ const text = (sign) => element(sign).textContent;
1036
+ const itemKey = (sign) => element(sign).getAttribute('item-key');
1037
+ const innerListOf = (rowSign) => element(rowSign).querySelector('list');
1038
+
1039
+ const { container } = render(<Comp />);
1040
+ const outerList = container.firstChild;
1041
+
1042
+ // row-0: firstRow > firstInnerList > firstCell
1043
+ const firstRow = show(outerList, 0);
1044
+ const firstInnerList = innerListOf(firstRow);
1045
+ const firstCell = show(firstInnerList, 0);
1046
+ expect(itemKey(firstRow)).toBe('row-0');
1047
+ expect(text(firstCell)).toBe('cell-0');
1048
+
1049
+ // row-1 reuses firstRow and firstInnerList; firstCell goes to the pool of firstInnerList
1050
+ recycle(outerList, firstRow);
1051
+ expect(show(outerList, 1)).toBe(firstRow);
1052
+ expect(itemKey(firstRow)).toBe('row-1');
1053
+ expect(innerListOf(firstRow)).toBe(firstInnerList);
1054
+ recycle(firstInnerList, firstCell);
1055
+
1056
+ // row-0 comes back on a new row with a new nested list
1057
+ const secondRow = show(outerList, 0);
1058
+ expect(secondRow).not.toBe(firstRow);
1059
+ expect(itemKey(secondRow)).toBe('row-0');
1060
+ const secondCell = show(innerListOf(secondRow), 0);
1061
+ expect(text(secondCell)).toBe('cell-0');
1062
+
1063
+ // row-1 reuses firstCell for cell-1
1064
+ expect(show(firstInnerList, 0)).toBe(firstCell);
1065
+ expect(text(firstCell)).toBe('cell-1');
1066
+ expect(text(secondCell)).toBe('cell-0');
1067
+ });
@@ -7,6 +7,7 @@ import {
7
7
  runOnMainThread,
8
8
  useMainThreadObject,
9
9
  useMainThreadRef,
10
+ useState,
10
11
  } from '@lynx-js/react';
11
12
 
12
13
  expect.addSnapshotSerializer({
@@ -723,4 +724,84 @@ describe('worklet', () => {
723
724
  expect(globalThis.optionalCaptureCb).toHaveBeenCalledTimes(3);
724
725
  expect(globalThis.optionalCaptureCb).toHaveBeenLastCalledWith('nested-started');
725
726
  });
727
+
728
+ it('keeps a retained first-screen main-thread:ref runOnBackground handle usable across hydration and rerenders', async () => {
729
+ const { transformToWorklet } = await import('@lynx-js/react/internal');
730
+ const { registerWorklet } = await import('@lynx-js/react/worklet-runtime/init');
731
+ registerWorklet('main-thread', 'first-screen-ref-4361', function(element) {
732
+ if (!element || this._c.started.current) return;
733
+ this._c.started.current = true;
734
+ const { onTick } = this._jsFn;
735
+ let n = 0;
736
+ globalThis.__triggerFirstScreenTick = () => {
737
+ n += 1;
738
+ return runOnBackground(onTick)(n);
739
+ };
740
+ void globalThis.__triggerFirstScreenTick();
741
+ });
742
+
743
+ const sharedMtsHandle = { _isFirstScreen: true };
744
+ const receivedValues = [];
745
+ const Comp = () => {
746
+ const [received, setReceived] = useState(0);
747
+ const started = useMainThreadRef(false);
748
+
749
+ const onTick = (n) => {
750
+ receivedValues.push(n);
751
+ setReceived(n);
752
+ };
753
+
754
+ const onRef = {
755
+ _wkltId: 'first-screen-ref-4361',
756
+ _c: { started },
757
+ _jsFn: {
758
+ onTick: __MAIN_THREAD__ ? sharedMtsHandle : transformToWorklet(onTick),
759
+ },
760
+ };
761
+
762
+ return (
763
+ <view main-thread:ref={onRef}>
764
+ <text>{`BTS received: ${received}`}</text>
765
+ </view>
766
+ );
767
+ };
768
+
769
+ let unmount;
770
+ try {
771
+ for (const round of [0, 1]) {
772
+ receivedValues.length = 0;
773
+ const rendered = render(<Comp />, {
774
+ enableMainThread: true,
775
+ enableBackgroundThread: true,
776
+ });
777
+ unmount = rendered.unmount;
778
+
779
+ await waitSchedule();
780
+ expect(receivedValues, `round ${round}`).toEqual([1]);
781
+ expect(rendered.getByText('BTS received: 1')).toBeTruthy();
782
+
783
+ for (const expected of [2, 3]) {
784
+ let pendingTick;
785
+ lynxTestingEnv.switchToMainThread();
786
+ try {
787
+ pendingTick = globalThis.__triggerFirstScreenTick();
788
+ expect(globalThis.lynxWorkletImpl._runOnBackgroundDelayImpl.delayedBackgroundFunctionArray).toHaveLength(0);
789
+ } finally {
790
+ lynxTestingEnv.switchToBackgroundThread();
791
+ }
792
+ await pendingTick;
793
+ await waitSchedule();
794
+ expect(rendered.getByText(`BTS received: ${expected}`)).toBeTruthy();
795
+ }
796
+ expect(receivedValues, `round ${round}`).toEqual([1, 2, 3]);
797
+ unmount();
798
+ unmount = undefined;
799
+ }
800
+ } finally {
801
+ unmount?.();
802
+ delete lynxTestingEnv.mainThread.globalThis.__triggerFirstScreenTick;
803
+ delete globalThis.__triggerFirstScreenTick;
804
+ delete globalThis.lynxWorkletImpl._workletMap['first-screen-ref-4361'];
805
+ }
806
+ });
726
807
  });
@@ -42,7 +42,7 @@ export const fireEvent: any = (elemOrNodesRef, ...args) => {
42
42
 
43
43
  export const eventMap = {
44
44
  // LynxBindCatchEvent — TouchEvent family, bubble/capture per
45
- // https://lynx.bytedance.net/next/zh/api/lynx-api/event/touch-event.html
45
+ // https://lynxjs.org/api/lynx-api/event/touch-event.html
46
46
  tap: {
47
47
  defaultInit: { bubbles: true },
48
48
  },
@@ -7,6 +7,7 @@ import { useEffect } from 'preact/hooks';
7
7
  import { act } from 'preact/test-utils';
8
8
 
9
9
  import { __root } from '@lynx-js/react/internal';
10
+ import { clearDelayedRunOnBackgroundFunctions } from '@lynx-js/react/worklet-runtime/bindings';
10
11
 
11
12
  import { flushDelayedLifecycleEvents } from '../../runtime/lib/snapshot/lynx/tt.js';
12
13
  import { clearPage } from '../../runtime/lib/snapshot/index.js';
@@ -117,12 +118,14 @@ export function cleanup() {
117
118
  preactRender(null, __root);
118
119
  });
119
120
 
121
+ globalThis.lynxTestingEnv.switchToMainThread();
120
122
  lynxTestingEnv.mainThread.elementTree.root = undefined;
121
123
  clearPage();
124
+ clearDelayedRunOnBackgroundFunctions();
122
125
  lynxTestingEnv.env.window.document.body.innerHTML = '';
123
126
 
124
- if (isMainThread) {
125
- globalThis.lynxTestingEnv.switchToMainThread();
127
+ if (!isMainThread) {
128
+ globalThis.lynxTestingEnv.switchToBackgroundThread();
126
129
  }
127
130
  }
128
131
 
@@ -16,6 +16,7 @@ import {
16
16
  snapshotInstanceManager,
17
17
  } from '../../../../runtime/lib/snapshot/index.js';
18
18
  import { destroyWorklet } from '../../../../runtime/lib/snapshot/worklet/destroy.js';
19
+ import { clearDelayedRunOnBackgroundFunctions } from '../../../../runtime/lib/worklet-runtime/bindings/observers.js';
19
20
  import { initApiEnv } from '../../../../runtime/lib/worklet-runtime/api/lynxApi.js';
20
21
  import { initEventListeners } from '../../../../runtime/lib/worklet-runtime/listeners.js';
21
22
  import { initWorklet } from '../../../../runtime/lib/worklet-runtime/workletRuntime.js';
@@ -111,6 +112,7 @@ globalThis.onResetLynxTestingEnv = () => {
111
112
  destroyWorklet();
112
113
 
113
114
  lynxTestingEnv.switchToMainThread();
115
+ clearDelayedRunOnBackgroundFunctions();
114
116
  initEventListeners();
115
117
  lynxTestingEnv.switchToBackgroundThread();
116
118
  injectTt();
@@ -3,15 +3,16 @@ $ node ./scripts/build_wasm.js
3
3
  Blocking waiting for file lock on package cache
4
4
  Blocking waiting for file lock on package cache
5
5
  Downloading crates ...
6
- Downloaded convert_case v0.6.0
7
6
  Downloaded bitflags v1.3.2
8
7
  Downloaded ctor v0.1.26
9
- Downloaded napi v2.10.4
8
+ Downloaded convert_case v0.6.0
9
+ Downloaded napi-sys v2.4.0
10
10
  Downloaded napi-build v2.3.2
11
+ Downloaded napi v2.10.4
11
12
  Downloaded napi-derive v2.9.3
12
- Downloaded napi-sys v2.4.0
13
13
  Downloaded napi-derive-backend v1.0.40
14
14
  Downloaded version-compare v0.2.1
15
+ Blocking waiting for file lock on package cache
15
16
  Blocking waiting for file lock on build directory
16
17
  Compiling cfg-if v1.0.4
17
18
  Compiling serde_core v1.0.229
@@ -21,12 +22,12 @@ $ node ./scripts/build_wasm.js
21
22
  Compiling memchr v2.8.3
22
23
  Compiling stable_deref_trait v1.2.1
23
24
  Compiling zerofrom v0.1.8
24
- Compiling equivalent v1.0.2
25
25
  Compiling foldhash v0.2.0
26
+ Compiling equivalent v1.0.2
26
27
  Compiling yoke v0.8.3
27
28
  Compiling hashbrown v0.17.1
28
- Compiling zerovec v0.11.6
29
29
  Compiling smallvec v1.15.2
30
+ Compiling zerovec v0.11.6
30
31
  Compiling getrandom v0.3.4
31
32
  Compiling zerocopy v0.8.55
32
33
  Compiling ahash v0.8.12
@@ -37,15 +38,15 @@ $ node ./scripts/build_wasm.js
37
38
  Compiling litemap v0.8.2
38
39
  Compiling writeable v0.6.3
39
40
  Compiling potential_utf v0.1.5
40
- Compiling icu_locale_core v2.2.0
41
41
  Compiling zerotrie v0.2.4
42
+ Compiling icu_locale_core v2.2.0
42
43
  Compiling utf8_iter v1.0.4
43
44
  Compiling icu_collections v2.2.0
44
45
  Compiling indexmap v2.14.0
45
46
  Compiling icu_provider v2.2.0
46
47
  Compiling num-traits v0.2.19
47
- Compiling icu_properties_data v2.2.0
48
48
  Compiling icu_normalizer_data v2.2.0
49
+ Compiling icu_properties_data v2.2.0
49
50
  Compiling rustc-hash v2.1.3
50
51
  Compiling parking_lot_core v0.9.12
51
52
  Compiling icu_properties v2.2.0
@@ -60,37 +61,37 @@ $ node ./scripts/build_wasm.js
60
61
  Compiling percent-encoding v2.3.2
61
62
  Compiling tap v1.0.1
62
63
  Compiling form_urlencoded v1.2.2
63
- Compiling wyz v0.5.1
64
64
  Compiling idna v1.1.0
65
+ Compiling wyz v0.5.1
65
66
  Compiling anyhow v1.0.104
66
- Compiling funty v2.0.0
67
+ Compiling outref v0.5.2
67
68
  Compiling bytes v1.12.1
69
+ Compiling funty v2.0.0
68
70
  Compiling vsimd v0.8.0
69
71
  Compiling pin-project-lite v0.2.17
70
- Compiling outref v0.5.2
71
72
  Compiling uuid v1.24.0
72
- Compiling base64-simd v0.8.0
73
73
  Compiling tracing v0.1.44
74
74
  Compiling debugid v0.8.0
75
75
  Compiling bytes-str v0.2.8
76
+ Compiling base64-simd v0.8.0
76
77
  Compiling bitvec v1.1.1
77
78
  Compiling url v2.5.8
78
79
  Compiling triomphe v0.1.16
79
- Compiling new_debug_unreachable v1.0.6
80
80
  Compiling data-encoding v2.11.0
81
+ Compiling new_debug_unreachable v1.0.6
82
+ Compiling unicode-width v0.2.2
81
83
  Compiling if_chain v1.0.3
82
84
  Compiling unicode-id-start v1.4.0
83
- Compiling unicode-width v0.2.2
84
85
  Compiling hstr v4.0.0
85
86
  Compiling num-integer v0.1.46
86
87
  Compiling scoped-tls v1.0.1
87
88
  Compiling better_scoped_tls v1.0.1
88
- Compiling swc_atoms v10.0.0
89
89
  Compiling num-bigint v0.4.8
90
+ Compiling swc_atoms v10.0.0
90
91
  Compiling parking_lot v0.12.5
91
92
  Compiling swc_visit v2.0.2
92
- Compiling termcolor v1.4.1
93
93
  Compiling siphasher v0.3.11
94
+ Compiling termcolor v1.4.1
94
95
  Compiling swc_sourcemap v10.0.2
95
96
  Compiling bitflags v2.13.1
96
97
  Compiling siphasher v1.0.3
@@ -107,9 +108,9 @@ $ node ./scripts/build_wasm.js
107
108
  Compiling compact_str v0.7.1
108
109
  Compiling swc_common v26.0.0
109
110
  Compiling regex-syntax v0.8.11
111
+ Compiling swc_ecma_regexp_common v0.0.1
110
112
  Compiling swc_ecma_ast v29.0.0
111
113
  Compiling regex-automata v0.4.16
112
- Compiling swc_ecma_regexp_common v0.0.1
113
114
  Compiling typenum v1.20.1
114
115
  Compiling swc_ecma_regexp_ast v3.0.0
115
116
  Compiling crossbeam-utils v0.8.22
@@ -117,8 +118,8 @@ $ node ./scripts/build_wasm.js
117
118
  Compiling swc_ecma_visit v29.0.0
118
119
  Compiling swc_ecma_parser v45.1.1
119
120
  Compiling regex v1.13.1
120
- Compiling swc_ecma_regexp v0.15.0
121
121
  Compiling swc_ecma_compat_regexp v9.0.0
122
+ Compiling swc_ecma_regexp v0.15.0
122
123
  Compiling dashmap v6.2.1
123
124
  Compiling generic-array v0.14.7
124
125
  Compiling hashbrown v0.16.1
@@ -132,52 +133,52 @@ $ node ./scripts/build_wasm.js
132
133
  Compiling thiserror v1.0.69
133
134
  Compiling owo-colors v4.3.0
134
135
  Compiling semver v1.0.28
135
- Compiling fixedbitset v0.5.7
136
+ Compiling unicode-linebreak v0.1.5
136
137
  Compiling swc_config v6.0.0
137
138
  Compiling swc_ecma_utils v35.0.0
138
139
  Compiling swc_ecma_hooks v1.0.0
140
+ Compiling fixedbitset v0.5.7
139
141
  Compiling base64 v0.22.1
140
- Compiling unicode-linebreak v0.1.5
141
- Compiling textwrap v0.16.2
142
- Compiling swc_ecma_transforms_base v49.0.1
143
142
  Compiling petgraph v0.7.1
144
- Compiling swc_ecma_transformer v21.0.1
145
- Compiling swc_ecma_transforms_classes v49.0.0
146
- Compiling swc_ecma_compat_common v45.0.0
143
+ Compiling swc_ecma_transforms_base v49.0.1
144
+ Compiling textwrap v0.16.2
147
145
  Compiling bumpalo v3.20.3
148
146
  Compiling thread_local v1.1.10
149
147
  Compiling unicode-width v0.1.14
148
+ Compiling swc_ecma_transformer v21.0.1
149
+ Compiling swc_ecma_transforms_classes v49.0.0
150
150
  Compiling camino v1.2.4
151
151
  Compiling miette v7.6.0
152
- Compiling swc_allocator v5.0.0
152
+ Compiling swc_ecma_compat_common v45.0.0
153
153
  Compiling swc_ecma_compat_es2015 v55.0.0
154
154
  Compiling swc_ecma_compat_es2022 v53.0.0
155
155
  Compiling swc_ecma_transforms_optimization v52.0.0
156
+ Compiling swc_allocator v5.0.0
156
157
  Compiling sha1 v0.10.7
157
158
  Compiling chrono v0.4.45
158
- Compiling syn v1.0.109
159
159
  Compiling ascii v1.1.0
160
- Compiling log v0.4.33
160
+ Compiling syn v1.0.109
161
161
  Compiling lazy_static v1.5.0
162
- Compiling sharded-slab v0.1.7
162
+ Compiling log v0.4.33
163
163
  Compiling tracing-log v0.2.0
164
+ Compiling sharded-slab v0.1.7
164
165
  Compiling swc_ecma_codegen v32.0.0
165
166
  Compiling swc_ecma_compat_bugfixes v56.0.0
166
167
  Compiling browserslist-data v0.2.0
167
168
  Compiling swc_ecma_transforms_react v55.0.1
168
169
  Compiling swc_ecma_compat_es2020 v53.0.0
169
170
  Compiling swc_error_reporters v28.0.0
170
- Compiling swc_ecma_compat_es2019 v50.0.0
171
+ Compiling swc_ecma_compat_es2016 v50.0.0
172
+ Compiling swc_ecma_compat_es2018 v51.0.0
171
173
  Compiling swc_ecma_compat_es2017 v50.0.0
172
174
  Compiling swc_ecma_compat_es2021 v50.0.0
173
- Compiling swc_ecma_compat_es2018 v51.0.0
174
- Compiling swc_ecma_compat_es2016 v50.0.0
175
+ Compiling swc_ecma_compat_es2019 v50.0.0
175
176
  Compiling matchers v0.2.0
176
177
  Compiling itertools v0.15.0
177
178
  Compiling cargo-platform v0.1.9
178
179
  Compiling nom v8.0.0
179
- Compiling yansi v1.0.1
180
180
  Compiling diff v0.1.13
181
+ Compiling yansi v1.0.1
181
182
  Compiling nu-ansi-term v0.50.3
182
183
  Compiling pretty_assertions v1.4.1
183
184
  Compiling tracing-subscriber v0.3.23
@@ -188,10 +189,10 @@ $ node ./scripts/build_wasm.js
188
189
  Compiling swc_ecma_transforms_typescript v55.0.1
189
190
  Compiling swc_ecma_transforms_proposal v49.0.0
190
191
  Compiling par-iter v2.0.0
192
+ Compiling pathdiff v0.2.3
191
193
  Compiling difference v2.0.0
192
- Compiling radix_fmt v1.0.0
193
194
  Compiling ryu-js v1.0.3
194
- Compiling pathdiff v0.2.3
195
+ Compiling radix_fmt v1.0.0
195
196
  Compiling testing v27.0.0
196
197
  Compiling swc_ecma_minifier v61.0.4
197
198
  Compiling swc_ecma_transforms v62.0.0
@@ -199,14 +200,14 @@ $ node ./scripts/build_wasm.js
199
200
  Compiling swc_ecma_preset_env v63.0.0
200
201
  Compiling sha2 v0.10.9
201
202
  Compiling lru v0.18.4
203
+ Compiling foldhash v0.1.5
202
204
  Compiling fastrand v2.5.0
203
205
  Compiling hex v0.4.3
204
- Compiling foldhash v0.1.5
205
- Compiling path-clean v1.0.1
206
206
  Compiling precomputed-map v0.2.0
207
207
  Compiling unicode-segmentation v1.13.3
208
- Compiling convert_case v0.6.0
208
+ Compiling path-clean v1.0.1
209
209
  Compiling swc_ecma_loader v27.0.0
210
+ Compiling convert_case v0.6.0
210
211
  Compiling swc_ecma_testing v27.0.0
211
212
  Compiling tempfile v3.27.0
212
213
  Compiling swc_ecma_ext_transforms v35.0.0
@@ -220,20 +221,20 @@ $ node ./scripts/build_wasm.js
220
221
  Compiling swc_compiler_base v64.0.0
221
222
  Compiling swc v75.0.1
222
223
  Compiling ctor v0.1.26
223
- Compiling bitflags v1.3.2
224
224
  Compiling napi-sys v2.4.0
225
+ Compiling bitflags v1.3.2
225
226
  Compiling napi v2.10.4
226
227
  Compiling napi-derive v2.9.3
228
+ Compiling convert_case v0.11.0
227
229
  Compiling sha-1 v0.10.1
228
230
  Compiling sugar_path v1.2.1
229
231
  Compiling hybrid-array v0.4.13
230
- Compiling convert_case v0.11.0
231
232
  Compiling swc_plugins_shared v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugins_shared)
232
233
  Compiling crypto-common v0.2.2
233
234
  Compiling block-buffer v0.12.1
234
235
  Compiling const-oid v0.10.2
235
- Compiling napi-build v2.3.2
236
236
  Compiling digest v0.11.3
237
+ Compiling napi-build v2.3.2
237
238
  Compiling getrandom v0.4.3
238
239
  Compiling react-transform v0.0.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform)
239
240
  Compiling sha2 v0.11.0
@@ -243,12 +244,12 @@ $ node ./scripts/build_wasm.js
243
244
  Compiling swc_plugin_element_template v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_element_template)
244
245
  Compiling swc_plugin_list v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_list)
245
246
  Compiling swc_plugin_css_scope v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_css_scope)
247
+ Compiling swc_plugin_compat v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_compat)
248
+ Compiling swc_plugin_text v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_text)
249
+ Compiling swc_plugin_inject v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_inject)
246
250
  Compiling swc_plugin_shake v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_shake)
247
251
  Compiling swc_plugin_dynamic_import v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_dynamic_import)
248
- Compiling swc_plugin_text v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_text)
249
- Compiling swc_plugin_compat v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_compat)
250
252
  Compiling swc_plugin_worklet v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_worklet)
251
- Compiling swc_plugin_inject v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_inject)
252
253
  Compiling swc_plugin_background_only v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_background_only)
253
254
  Compiling version-compare v0.2.1
254
- Finished `release` profile [optimized] target(s) in 4m 55s
255
+ Finished `release` profile [optimized] target(s) in 5m 06s
@@ -393,7 +393,7 @@ describe('element template', () => {
393
393
  expect(result.elementTemplates?.some(template => template.compiledTemplate.type === 'list-item')).toBe(true);
394
394
  expect(result.code).toMatchInlineSnapshot(`
395
395
  "import { jsx as _jsx } from "react/jsx-runtime";
396
- import * as ReactLynxInternal from "@lynx-js/react/internal";
396
+ import * as ReactLynxInternal from "@lynx-js/react/element-template/internal";
397
397
  const _et_4f796f70cdd7_bundle = globDynamicComponentEntry;
398
398
  const _et_4f796f70cdd7 = \`\${_et_4f796f70cdd7_bundle}:\${"_et_4f796f70cdd7"}\`;
399
399
  const _et_b8da8bac988e_bundle = globDynamicComponentEntry;
@@ -0,0 +1,11 @@
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
+
5
+ // The `browser` entry of `@lynx-js/react/transform`: the wasm build only.
6
+ // `main.cjs` also requires the napi build (`../index.cjs`), which is not
7
+ // published, so a bundler targeting the browser could not resolve it.
8
+
9
+ /* eslint-disable n/no-unpublished-require */
10
+
11
+ module.exports = require('../dist/wasm.cjs').default;