@lynx-js/react 0.128.0 → 0.129.1

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 (334) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/components/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +3 -4
  4. package/refresh/.turbo/turbo-build.log +1 -1
  5. package/runtime/__test__/core/entry-re-eval.test.ts +161 -0
  6. package/runtime/__test__/core/hooks/useLynxGlobalEventListener.test.jsx +1 -1
  7. package/runtime/__test__/core/reload-scoped-dual-thread-communication.test.ts +129 -0
  8. package/runtime/__test__/core/thread-function-call.test.ts +1 -0
  9. package/runtime/__test__/element-template/fixtures/background/render/_shared.tsx +2 -0
  10. package/runtime/__test__/element-template/imports/no-legacy-imports.test.ts +7 -6
  11. package/runtime/__test__/element-template/internal/legacy-internal-guardrail.test.ts +1 -2
  12. package/runtime/__test__/element-template/native/index.test.ts +8 -0
  13. package/runtime/__test__/element-template/native/main-thread-api.test.ts +5 -2
  14. package/runtime/__test__/element-template/native/main-thread-ref-init-value.test.ts +100 -0
  15. package/runtime/__test__/element-template/native/mts-destroy.test.ts +83 -0
  16. package/runtime/__test__/element-template/native/reload-dual-thread-communication.test.ts +104 -0
  17. package/runtime/__test__/element-template/native/reload.test.ts +79 -1
  18. package/runtime/__test__/element-template/runtime/background/commit-hook.test.ts +104 -47
  19. package/runtime/__test__/element-template/runtime/background/main-thread-function/compiled-fixtures.test.tsx +7 -1
  20. package/runtime/__test__/element-template/runtime/background/re-eval-reload.test.ts +69 -0
  21. package/runtime/__test__/element-template/runtime/background/update-timing.test.ts +15 -0
  22. package/runtime/__test__/element-template/runtime/hydration/hydration-listener.test.ts +31 -5
  23. package/runtime/__test__/element-template/runtime/patch/element-template-patch.test.tsx +214 -10
  24. package/runtime/__test__/element-template/runtime/patch/update-timing.test.ts +4 -1
  25. package/runtime/__test__/element-template/runtime/render/render-direct-suspense.test.ts +4 -1
  26. package/runtime/__test__/element-template/runtime/render/render-direct.test.ts +4 -1
  27. package/runtime/__test__/element-template/runtime/render/render-main-thread.test.ts +101 -1
  28. package/runtime/__test__/element-template/runtime/render/render-transform.contract.test.ts +2 -0
  29. package/runtime/__test__/element-template/runtime/template/element-template-handle.test.ts +32 -0
  30. package/runtime/__test__/element-template/runtime/template/main-thread-dynamic-attr-state.test.ts +121 -26
  31. package/runtime/__test__/element-template/runtime/template/main-thread-function.test.ts +89 -2
  32. package/runtime/__test__/element-template/test-utils/debug/compiledFixtureModule.ts +5 -0
  33. package/runtime/__test__/element-template/test-utils/debug/envManager.ts +8 -5
  34. package/runtime/__test__/element-template/test-utils/mock/mockNativePapi.ts +35 -2
  35. package/runtime/__test__/guardrails/snapshot-containment.test.ts +45 -11
  36. package/runtime/__test__/shared/component-stack.test.ts +211 -0
  37. package/runtime/__test__/snapshot/debug/formatPatch.test.ts +0 -8
  38. package/runtime/__test__/snapshot/gesture/prepareGestureForCommit.test.js +1 -1
  39. package/runtime/__test__/snapshot/lifecycle/re-eval-reload.test.jsx +114 -0
  40. package/runtime/__test__/snapshot/lifecycle/reload-background-function.test.jsx +169 -0
  41. package/runtime/__test__/snapshot/lifecycle/reload-delayed-background.test.jsx +63 -0
  42. package/runtime/__test__/snapshot/lifecycle/reload-delayed-main-thread.test.jsx +103 -0
  43. package/runtime/__test__/snapshot/lifecycle.test.jsx +61 -1
  44. package/runtime/__test__/snapshot/lynx/lazy-effect-scheduling.test.jsx +105 -0
  45. package/runtime/__test__/snapshot/lynx/timing.test.jsx +3 -0
  46. package/runtime/__test__/snapshot/preact.test.jsx +0 -3
  47. package/runtime/__test__/snapshot/snapshotPatch.test.jsx +0 -33
  48. package/runtime/__test__/snapshot/ssr.test.jsx +2 -2
  49. package/runtime/__test__/snapshot/worklet/runOnBackground.test.js +6 -11
  50. package/runtime/__test__/snapshot/worklet/runOnMainThread.test.jsx +1 -1
  51. package/runtime/__test__/snapshot/worklet/workletRef.test.jsx +24 -1
  52. package/runtime/__test__/worklet-runtime/jsFunctionLifecycle.test.js +27 -1
  53. package/runtime/__test__/worklet-runtime/loadRuntime.test.js +68 -0
  54. package/runtime/__test__/worklet-runtime/mainThreadObject.test.js +46 -0
  55. package/runtime/__test__/worklet-runtime/runOnMainThread.test.js +3 -3
  56. package/runtime/__test__/worklet-runtime/workletRuntime.test.js +30 -0
  57. package/runtime/lazy/element-template-internal.js +0 -1
  58. package/runtime/lazy/internal.js +1 -1
  59. package/runtime/lazy/jsx-dev-runtime.js +1 -1
  60. package/runtime/lazy/jsx-runtime.js +1 -1
  61. package/runtime/lazy/legacy-react-runtime.js +1 -1
  62. package/runtime/lazy/react-lepus.js +1 -1
  63. package/runtime/lazy/react.js +1 -1
  64. package/runtime/lib/core/background-function/exec-map.d.ts +2 -0
  65. package/runtime/lib/core/background-function/exec-map.js +7 -0
  66. package/runtime/lib/core/background-function/exec-map.js.map +1 -1
  67. package/runtime/lib/core/background-function/run-on-background.js +15 -16
  68. package/runtime/lib/core/background-function/run-on-background.js.map +1 -1
  69. package/runtime/lib/core/capture-main-thread-object.js +2 -1
  70. package/runtime/lib/core/capture-main-thread-object.js.map +1 -1
  71. package/runtime/lib/core/card-lifetime.d.ts +5 -0
  72. package/runtime/lib/core/card-lifetime.js +17 -0
  73. package/runtime/lib/core/card-lifetime.js.map +1 -0
  74. package/runtime/lib/core/compat/legacy-react-runtime.js +1 -1
  75. package/runtime/lib/core/compat/legacy-react-runtime.js.map +1 -1
  76. package/runtime/lib/core/entry-reload.d.ts +7 -0
  77. package/runtime/lib/core/entry-reload.js +49 -0
  78. package/runtime/lib/core/entry-reload.js.map +1 -0
  79. package/runtime/lib/core/lynx/lazy-bundle.js +5 -2
  80. package/runtime/lib/core/lynx/lazy-bundle.js.map +1 -1
  81. package/runtime/lib/core/lynx-data-processors.d.ts +125 -1
  82. package/runtime/lib/core/lynx-data-processors.js +3 -0
  83. package/runtime/lib/core/lynx-data-processors.js.map +1 -1
  84. package/runtime/lib/core/main-thread-ref-id.js +4 -4
  85. package/runtime/lib/core/main-thread-ref-id.js.map +1 -1
  86. package/runtime/lib/core/reload-scoped-event.d.ts +5 -0
  87. package/runtime/lib/core/reload-scoped-event.js +26 -0
  88. package/runtime/lib/core/reload-scoped-event.js.map +1 -0
  89. package/runtime/lib/core/reload-version.js +4 -3
  90. package/runtime/lib/core/reload-version.js.map +1 -1
  91. package/runtime/lib/core/runtime-destroy.d.ts +2 -0
  92. package/runtime/lib/core/runtime-destroy.js +10 -1
  93. package/runtime/lib/core/runtime-destroy.js.map +1 -1
  94. package/runtime/lib/core/thread-function-call/main-thread.js +5 -4
  95. package/runtime/lib/core/thread-function-call/main-thread.js.map +1 -1
  96. package/runtime/lib/core/thread-function-call/return-value.js +6 -5
  97. package/runtime/lib/core/thread-function-call/return-value.js.map +1 -1
  98. package/runtime/lib/document.js +0 -5
  99. package/runtime/lib/document.js.map +1 -1
  100. package/runtime/lib/element-template/background/commit-hook.js +24 -22
  101. package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
  102. package/runtime/lib/element-template/background/hydration-listener.js +2 -6
  103. package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
  104. package/runtime/lib/element-template/client/root.d.ts +1 -1
  105. package/runtime/lib/element-template/client/root.js.map +1 -1
  106. package/runtime/lib/element-template/index.d.ts +2 -2
  107. package/runtime/lib/element-template/index.js.map +1 -1
  108. package/runtime/lib/element-template/internal.d.ts +1 -1
  109. package/runtime/lib/element-template/internal.js +0 -13
  110. package/runtime/lib/element-template/internal.js.map +1 -1
  111. package/runtime/lib/element-template/lynx/env.js.map +1 -1
  112. package/runtime/lib/element-template/main-thread-ref-init-value.d.ts +3 -0
  113. package/runtime/lib/element-template/main-thread-ref-init-value.js +38 -0
  114. package/runtime/lib/element-template/main-thread-ref-init-value.js.map +1 -0
  115. package/runtime/lib/element-template/native/flush.d.ts +1 -0
  116. package/runtime/lib/element-template/native/flush.js +9 -0
  117. package/runtime/lib/element-template/native/flush.js.map +1 -0
  118. package/runtime/lib/element-template/native/index.js +2 -0
  119. package/runtime/lib/element-template/native/index.js.map +1 -1
  120. package/runtime/lib/element-template/native/main-thread-api.js +3 -7
  121. package/runtime/lib/element-template/native/main-thread-api.js.map +1 -1
  122. package/runtime/lib/element-template/native/mts-destroy.js +10 -2
  123. package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
  124. package/runtime/lib/element-template/native/patch-listener.js +58 -54
  125. package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
  126. package/runtime/lib/element-template/native/reload-background.d.ts +1 -1
  127. package/runtime/lib/element-template/native/reload-background.js +12 -1
  128. package/runtime/lib/element-template/native/reload-background.js.map +1 -1
  129. package/runtime/lib/element-template/native/reload-main-thread.d.ts +6 -0
  130. package/runtime/lib/element-template/native/reload-main-thread.js +20 -3
  131. package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -1
  132. package/runtime/lib/element-template/protocol/lifecycle-constant.d.ts +2 -1
  133. package/runtime/lib/element-template/protocol/lifecycle-constant.js +1 -0
  134. package/runtime/lib/element-template/protocol/lifecycle-constant.js.map +1 -1
  135. package/runtime/lib/element-template/protocol/types.d.ts +0 -2
  136. package/runtime/lib/element-template/protocol/types.js.map +1 -1
  137. package/runtime/lib/element-template/runtime/page/root-instance.d.ts +0 -1
  138. package/runtime/lib/element-template/runtime/page/root-instance.js.map +1 -1
  139. package/runtime/lib/element-template/runtime/patch.js +4 -0
  140. package/runtime/lib/element-template/runtime/patch.js.map +1 -1
  141. package/runtime/lib/element-template/runtime/render/render-components.js +4 -4
  142. package/runtime/lib/element-template/runtime/render/render-components.js.map +1 -1
  143. package/runtime/lib/element-template/runtime/render/render-main-thread.js +2 -0
  144. package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
  145. package/runtime/lib/element-template/runtime/template/main-thread-background-function.js +8 -1
  146. package/runtime/lib/element-template/runtime/template/main-thread-background-function.js.map +1 -1
  147. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.d.ts +1 -0
  148. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js +41 -21
  149. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js.map +1 -1
  150. package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.d.ts +1 -1
  151. package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.js.map +1 -1
  152. package/runtime/lib/internal.d.ts +1 -1
  153. package/runtime/lib/internal.js +1 -1
  154. package/runtime/lib/internal.js.map +1 -1
  155. package/runtime/lib/lynx-api.d.ts +2 -125
  156. package/runtime/lib/lynx-api.js.map +1 -1
  157. package/runtime/lib/shared/component-stack.d.ts +0 -4
  158. package/runtime/lib/shared/component-stack.js +21 -5
  159. package/runtime/lib/shared/component-stack.js.map +1 -1
  160. package/runtime/lib/shared/index-map.d.ts +4 -1
  161. package/runtime/lib/shared/index-map.js +5 -2
  162. package/runtime/lib/shared/index-map.js.map +1 -1
  163. package/runtime/lib/snapshot/gesture/{processGestureBagkround.js → processGestureBackground.js} +1 -1
  164. package/runtime/lib/snapshot/gesture/processGestureBackground.js.map +1 -0
  165. package/runtime/lib/snapshot/lifecycle/destroy.js +6 -0
  166. package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -1
  167. package/runtime/lib/snapshot/lifecycle/event/firstScreenSync.d.ts +6 -2
  168. package/runtime/lib/snapshot/lifecycle/event/firstScreenSync.js +21 -18
  169. package/runtime/lib/snapshot/lifecycle/event/firstScreenSync.js.map +1 -1
  170. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.d.ts +0 -1
  171. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js +0 -5
  172. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js.map +1 -1
  173. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js +0 -10
  174. package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js.map +1 -1
  175. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js +56 -51
  176. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -1
  177. package/runtime/lib/snapshot/lifecycle/reload.d.ts +9 -2
  178. package/runtime/lib/snapshot/lifecycle/reload.js +29 -8
  179. package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
  180. package/runtime/lib/snapshot/list/list.js +3 -2
  181. package/runtime/lib/snapshot/list/list.js.map +1 -1
  182. package/runtime/lib/snapshot/list/listUpdateInfo.js +0 -30
  183. package/runtime/lib/snapshot/list/listUpdateInfo.js.map +1 -1
  184. package/runtime/lib/snapshot/lynx/calledByNative.js +14 -11
  185. package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -1
  186. package/runtime/lib/snapshot/renderToOpcodes/hydrate.js +0 -52
  187. package/runtime/lib/snapshot/renderToOpcodes/hydrate.js.map +1 -1
  188. package/runtime/lib/snapshot/renderToOpcodes/index.js +10 -10
  189. package/runtime/lib/snapshot/renderToOpcodes/index.js.map +1 -1
  190. package/runtime/lib/snapshot/renderToOpcodes/opcodes.js +0 -51
  191. package/runtime/lib/snapshot/renderToOpcodes/opcodes.js.map +1 -1
  192. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +1 -1
  193. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
  194. package/runtime/lib/snapshot/snapshot/list.js +2 -1
  195. package/runtime/lib/snapshot/snapshot/list.js.map +1 -1
  196. package/runtime/lib/snapshot/snapshot/snapshotInstanceManager.d.ts +4 -2
  197. package/runtime/lib/snapshot/snapshot/snapshotInstanceManager.js +11 -11
  198. package/runtime/lib/snapshot/snapshot/snapshotInstanceManager.js.map +1 -1
  199. package/runtime/lib/snapshot/worklet/call/runOnMainThread.d.ts +1 -0
  200. package/runtime/lib/snapshot/worklet/call/runOnMainThread.js +6 -1
  201. package/runtime/lib/snapshot/worklet/call/runOnMainThread.js.map +1 -1
  202. package/runtime/lib/snapshot/worklet/ctx.d.ts +1 -1
  203. package/runtime/lib/snapshot/worklet/ctx.js +6 -1
  204. package/runtime/lib/snapshot/worklet/ctx.js.map +1 -1
  205. package/runtime/lib/snapshot/worklet/ref/updateInitValue.js +6 -0
  206. package/runtime/lib/snapshot/worklet/ref/updateInitValue.js.map +1 -1
  207. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  208. package/runtime/lib/worklet-runtime/bindings/index.d.ts +1 -0
  209. package/runtime/lib/worklet-runtime/bindings/index.js +1 -0
  210. package/runtime/lib/worklet-runtime/bindings/index.js.map +1 -1
  211. package/runtime/lib/worklet-runtime/bindings/loadRuntime.d.ts +8 -0
  212. package/runtime/lib/worklet-runtime/bindings/loadRuntime.js +23 -0
  213. package/runtime/lib/worklet-runtime/bindings/loadRuntime.js.map +1 -0
  214. package/runtime/lib/worklet-runtime/delayRunOnBackground.js +3 -1
  215. package/runtime/lib/worklet-runtime/delayRunOnBackground.js.map +1 -1
  216. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.d.ts +2 -0
  217. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js +8 -1
  218. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +1 -1
  219. package/runtime/lib/worklet-runtime/listeners.js +2 -2
  220. package/runtime/lib/worklet-runtime/listeners.js.map +1 -1
  221. package/runtime/lib/worklet-runtime/mainThreadObject.js +3 -1
  222. package/runtime/lib/worklet-runtime/mainThreadObject.js.map +1 -1
  223. package/runtime/lib/worklet-runtime/runOnMainThread.js +4 -3
  224. package/runtime/lib/worklet-runtime/runOnMainThread.js.map +1 -1
  225. package/runtime/lib/worklet-runtime/workletRuntime.js +2 -0
  226. package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
  227. package/runtime/package.json +2 -3
  228. package/runtime/src/core/background-function/exec-map.ts +9 -0
  229. package/runtime/src/core/background-function/run-on-background.ts +14 -16
  230. package/runtime/src/core/capture-main-thread-object.ts +2 -1
  231. package/runtime/src/core/card-lifetime.ts +18 -0
  232. package/runtime/src/core/compat/legacy-react-runtime.ts +1 -1
  233. package/runtime/src/core/entry-reload.ts +63 -0
  234. package/runtime/src/core/lynx/lazy-bundle.ts +5 -2
  235. package/runtime/src/core/lynx-data-processors.ts +124 -1
  236. package/runtime/src/core/main-thread-ref-id.ts +5 -4
  237. package/runtime/src/core/reload-scoped-event.ts +35 -0
  238. package/runtime/src/core/reload-version.ts +5 -3
  239. package/runtime/src/core/runtime-destroy.ts +12 -1
  240. package/runtime/src/core/thread-function-call/main-thread.ts +4 -4
  241. package/runtime/src/core/thread-function-call/return-value.ts +6 -5
  242. package/runtime/src/document.ts +0 -6
  243. package/runtime/src/element-template/background/commit-hook.ts +32 -23
  244. package/runtime/src/element-template/background/hydration-listener.ts +2 -6
  245. package/runtime/src/element-template/client/root.ts +1 -3
  246. package/runtime/src/element-template/index.ts +2 -2
  247. package/runtime/src/element-template/internal.ts +0 -20
  248. package/runtime/src/element-template/lynx/env.ts +1 -1
  249. package/runtime/src/element-template/main-thread-ref-init-value.ts +44 -0
  250. package/runtime/src/element-template/native/flush.ts +10 -0
  251. package/runtime/src/element-template/native/index.ts +2 -0
  252. package/runtime/src/element-template/native/main-thread-api.ts +3 -6
  253. package/runtime/src/element-template/native/mts-destroy.ts +10 -2
  254. package/runtime/src/element-template/native/patch-listener.ts +62 -62
  255. package/runtime/src/element-template/native/reload-background.ts +13 -1
  256. package/runtime/src/element-template/native/reload-main-thread.ts +32 -3
  257. package/runtime/src/element-template/protocol/lifecycle-constant.ts +1 -0
  258. package/runtime/src/element-template/protocol/types.ts +0 -15
  259. package/runtime/src/element-template/runtime/page/root-instance.ts +0 -1
  260. package/runtime/src/element-template/runtime/patch.ts +5 -0
  261. package/runtime/src/element-template/runtime/render/render-components.ts +3 -3
  262. package/runtime/src/element-template/runtime/render/render-main-thread.ts +2 -0
  263. package/runtime/src/element-template/runtime/template/main-thread-background-function.ts +8 -1
  264. package/runtime/src/element-template/runtime/template/main-thread-dynamic-attr-state.ts +51 -21
  265. package/runtime/src/element-template/runtime/template/main-thread-ref-ctx.ts +2 -2
  266. package/runtime/src/element-template/types.d.ts +6 -0
  267. package/runtime/src/internal.ts +1 -1
  268. package/runtime/src/lynx-api.ts +2 -124
  269. package/runtime/src/shared/component-stack.ts +22 -5
  270. package/runtime/src/shared/index-map.ts +3 -2
  271. package/runtime/src/snapshot/lifecycle/destroy.ts +7 -0
  272. package/runtime/src/snapshot/lifecycle/event/firstScreenSync.ts +26 -19
  273. package/runtime/src/snapshot/lifecycle/patch/snapshotPatch.ts +0 -5
  274. package/runtime/src/snapshot/lifecycle/patch/snapshotPatchApply.ts +0 -10
  275. package/runtime/src/snapshot/lifecycle/patch/updateMainThread.ts +62 -58
  276. package/runtime/src/snapshot/lifecycle/reload.ts +47 -11
  277. package/runtime/src/snapshot/list/list.ts +9 -2
  278. package/runtime/src/snapshot/list/listUpdateInfo.ts +0 -52
  279. package/runtime/src/snapshot/lynx/calledByNative.ts +14 -13
  280. package/runtime/src/snapshot/renderToOpcodes/hydrate.ts +0 -58
  281. package/runtime/src/snapshot/renderToOpcodes/index.ts +8 -8
  282. package/runtime/src/snapshot/renderToOpcodes/opcodes.ts +0 -57
  283. package/runtime/src/snapshot/snapshot/backgroundSnapshot.ts +1 -1
  284. package/runtime/src/snapshot/snapshot/list.ts +5 -1
  285. package/runtime/src/snapshot/snapshot/snapshotInstanceManager.ts +19 -12
  286. package/runtime/src/snapshot/worklet/call/runOnMainThread.ts +10 -1
  287. package/runtime/src/snapshot/worklet/ctx.ts +10 -1
  288. package/runtime/src/snapshot/worklet/ref/updateInitValue.ts +6 -0
  289. package/runtime/src/worklet-runtime/README.md +33 -0
  290. package/runtime/src/worklet-runtime/bindings/index.ts +2 -0
  291. package/runtime/src/worklet-runtime/bindings/loadRuntime.ts +25 -0
  292. package/runtime/src/worklet-runtime/delayRunOnBackground.ts +3 -1
  293. package/runtime/src/worklet-runtime/jsFunctionLifecycle.ts +8 -1
  294. package/runtime/src/worklet-runtime/listeners.ts +4 -7
  295. package/runtime/src/worklet-runtime/mainThreadObject.ts +2 -1
  296. package/runtime/src/worklet-runtime/runOnMainThread.ts +4 -3
  297. package/runtime/src/worklet-runtime/workletRuntime.ts +2 -0
  298. package/runtime/types/types.d.ts +3 -1
  299. package/runtime/vitest.config.ts +0 -2
  300. package/testing-library/.turbo/turbo-build.log +7 -7
  301. package/testing-library/src/__tests__/act.test.jsx +0 -7
  302. package/testing-library/src/__tests__/alog.test.jsx +12 -54
  303. package/testing-library/src/__tests__/end-to-end.test.jsx +0 -7
  304. package/testing-library/src/__tests__/renderComponent.test.jsx +0 -14
  305. package/testing-library/src/__tests__/worklet.test.jsx +59 -5
  306. package/transform/.turbo/turbo-build$colon$wasm.log +63 -136
  307. package/transform/__test__/defines.spec.js +137 -0
  308. package/transform/__test__/object-methods.spec.js +79 -0
  309. package/transform/crates/swc_plugin_worklet/definition_imports.rs +97 -0
  310. package/transform/crates/swc_plugin_worklet/extract_ident.rs +99 -49
  311. package/transform/crates/swc_plugin_worklet/gen_stmt.rs +56 -48
  312. package/transform/crates/swc_plugin_worklet/lib.rs +400 -595
  313. package/transform/crates/swc_plugin_worklet/napi.rs +4 -6
  314. package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_2_js.js +6 -1
  315. package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_2_lepus.js +7 -1
  316. package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_js.js +9 -0
  317. package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_lepus.js +12 -1
  318. package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_preserve_main_thread_objects_in_class_js.js +1 -1
  319. package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_preserve_main_thread_objects_in_class_lepus.js +1 -1
  320. package/transform/dist/wasm.cjs +1 -1
  321. package/transform/index.d.ts +3 -1
  322. package/transform/package.json +0 -1
  323. package/transform/src/lib.rs +173 -12
  324. package/transform/swc-plugin-reactlynx/.turbo/turbo-build.log +105 -32
  325. package/transform/swc-plugin-reactlynx/src/lib.rs +1 -4
  326. package/transform/swc-plugin-reactlynx/swc_plugin_reactlynx.wasm +0 -0
  327. package/transform/swc-plugin-reactlynx-compat/.turbo/turbo-build.log +193 -194
  328. package/runtime/lib/snapshot/gesture/processGestureBagkround.js.map +0 -1
  329. package/runtime/lib/snapshot/worklet/hmr.d.ts +0 -1
  330. package/runtime/lib/snapshot/worklet/hmr.js +0 -28
  331. package/runtime/lib/snapshot/worklet/hmr.js.map +0 -1
  332. package/runtime/src/snapshot/worklet/hmr.ts +0 -34
  333. /package/runtime/lib/snapshot/gesture/{processGestureBagkround.d.ts → processGestureBackground.d.ts} +0 -0
  334. /package/runtime/src/snapshot/gesture/{processGestureBagkround.ts → processGestureBackground.ts} +0 -0
@@ -804,7 +804,7 @@ export interface Define {
804
804
  unmergeable?: boolean
805
805
  /** @internal Compiler requirements of the extracted registration. */
806
806
  runtimeRequirements?: TransformRuntimeRequirements
807
- /** @internal Compiler-owned named imports required by this definition. */
807
+ /** @internal Imports required by this definition. */
808
808
  imports?: DefineImport[]
809
809
  }
810
810
  /** @internal */
@@ -815,6 +815,8 @@ export interface DefineImport {
815
815
  imported: string
816
816
  /** @internal */
817
817
  local: string
818
+ /** @internal */
819
+ namespace?: boolean
818
820
  }
819
821
  /** @internal */
820
822
  export interface ElementTemplateAsset {
@@ -20,7 +20,6 @@
20
20
  "files": [
21
21
  "index.d.ts",
22
22
  "main.js",
23
- "main.cjs",
24
23
  "cjs",
25
24
  "dist",
26
25
  "!dist/*.node"
@@ -305,7 +305,7 @@ pub struct Define {
305
305
  pub unmergeable: Option<bool>,
306
306
  /// @internal
307
307
  pub runtime_requirements: Option<TransformRuntimeRequirements>,
308
- /// Compiler-owned imports needed when this definition moves to another module.
308
+ /// Imports needed when this definition moves to another module.
309
309
  /// @internal
310
310
  pub imports: Option<Vec<DefineImport>>,
311
311
  }
@@ -319,6 +319,8 @@ pub struct DefineImport {
319
319
  pub imported: String,
320
320
  /// @internal
321
321
  pub local: String,
322
+ /// @internal
323
+ pub namespace: Option<bool>,
322
324
  }
323
325
 
324
326
  #[napi(object)]
@@ -365,6 +367,7 @@ fn print_define(
365
367
  items: Vec<ModuleItem>,
366
368
  top_level_mark: Mark,
367
369
  comments: &SingleThreadedComments,
370
+ filename: &str,
368
371
  ) -> Result<(String, Vec<DefineImport>), String> {
369
372
  let mut module = match Program::Module(Module {
370
373
  span: DUMMY_SP,
@@ -384,23 +387,40 @@ fn print_define(
384
387
 
385
388
  // Print imports and statements through the same hygiene pass before
386
389
  // separating them. The consumer must not guess bindings from generated code.
390
+ let filename = filename.replace('\\', "/");
387
391
  let mut imports = vec![];
388
392
  let mut statements = vec![];
389
393
  for item in module.body {
390
394
  if let ModuleItem::ModuleDecl(ModuleDecl::Import(import)) = item {
395
+ let mut source = import.src.value.to_string_lossy().into_owned();
396
+ // std::path's absolute-path checks are unsupported on wasm.
397
+ if source == "." || source == ".." || source.starts_with("./") || source.starts_with("../") {
398
+ if let Some((directory, _)) = filename.rsplit_once('/') {
399
+ source = format!("{directory}/{source}");
400
+ if !source.starts_with('/') && source.as_bytes().get(1) != Some(&b':') {
401
+ source = format!("./{source}");
402
+ }
403
+ }
404
+ }
391
405
  for specifier in import.specifiers {
392
- let ImportSpecifier::Named(named) = specifier else {
393
- return Err("definition dependency must be a named import".into());
394
- };
395
- let imported = match named.imported {
396
- Some(ModuleExportName::Ident(ident)) => ident.sym.to_string(),
397
- Some(ModuleExportName::Str(value)) => value.value.to_string_lossy().into_owned(),
398
- None => named.local.sym.to_string(),
406
+ let local = specifier.local().sym.to_string();
407
+ let namespace = matches!(specifier, ImportSpecifier::Namespace(_)).then_some(true);
408
+ let imported = match specifier {
409
+ ImportSpecifier::Default(_) => "default".into(),
410
+ ImportSpecifier::Namespace(_) => "*".into(),
411
+ ImportSpecifier::Named(named) => match named.imported {
412
+ Some(ModuleExportName::Ident(ident)) => ident.sym.to_string(),
413
+ Some(ModuleExportName::Str(value)) => value.value.to_string_lossy().into_owned(),
414
+ None => named.local.sym.to_string(),
415
+ },
416
+ #[allow(unreachable_patterns)]
417
+ _ => return Err("unknown definition import specifier".into()),
399
418
  };
400
419
  imports.push(DefineImport {
401
- source: import.src.value.to_string_lossy().into_owned(),
420
+ source: source.clone(),
402
421
  imported,
403
- local: named.local.sym.to_string(),
422
+ local,
423
+ namespace,
404
424
  });
405
425
  }
406
426
  } else {
@@ -873,7 +893,7 @@ fn transform_react_lynx_inner(
873
893
  }
874
894
  Either::B(config) => {
875
895
  let visitor =
876
- WorkletVisitor::new(options.mode.unwrap_or(TransformMode::Production), config)
896
+ WorkletVisitor::new(config)
877
897
  .with_content_hash(content_hash);
878
898
  let visitor =
879
899
  visitor
@@ -1004,7 +1024,7 @@ fn transform_react_lynx_inner(
1004
1024
  let mut defines_for_worklet: Vec<Define> = vec![];
1005
1025
  helpers::HELPERS.set(&helpers::Helpers::new(false), || {
1006
1026
  for define in defines_collector.borrow().iter() {
1007
- let (code, imports) = match print_define(&c, define.items.clone(), top_level_mark, &comments) {
1027
+ let (code, imports) = match print_define(&c, define.items.clone(), top_level_mark, &comments, &options.filename) {
1008
1028
  Ok(printed) => printed,
1009
1029
  Err(err) => {
1010
1030
  define_errors.push(esbuild::PartialMessage {
@@ -1225,6 +1245,147 @@ mod wasm {
1225
1245
  mod tests {
1226
1246
  use super::*;
1227
1247
 
1248
+ fn worklet_definition(source: &str, filename: &str) -> Define {
1249
+ let result = transform_react_lynx_inner(
1250
+ source.into(),
1251
+ TransformNodiffOptions {
1252
+ filename: filename.into(),
1253
+ worklet: Either::B(WorkletVisitorConfig {
1254
+ target: swc_plugins_shared::target_napi::TransformTarget::JS,
1255
+ custom_global_ident_names: Some(vec!["call".into(), "api".into(), "named".into()]),
1256
+ ..Default::default()
1257
+ }),
1258
+ css_scope: Either::A(false),
1259
+ ..Default::default()
1260
+ },
1261
+ );
1262
+ assert!(result.errors.is_empty(), "{:?}", result.errors);
1263
+ let mut definitions = result.defines_for_worklet.unwrap();
1264
+ assert_eq!(definitions.len(), 1);
1265
+ definitions.remove(0)
1266
+ }
1267
+
1268
+ #[test]
1269
+ fn should_collect_business_imports_for_background_only_worklets() {
1270
+ let definition = worklet_definition(
1271
+ r#"
1272
+ import { runOnBackground, useState } from '@lynx-js/react';
1273
+ export const handler = () => {
1274
+ 'main thread';
1275
+ runOnBackground(() => {})();
1276
+ };
1277
+ "#,
1278
+ "test.js",
1279
+ );
1280
+ let imports = definition.imports.unwrap();
1281
+ let dependency = imports
1282
+ .iter()
1283
+ .find(|item| item.imported == "runOnBackground")
1284
+ .unwrap();
1285
+ assert_eq!(dependency.source, "@lynx-js/react");
1286
+ assert!(definition
1287
+ .code
1288
+ .contains(&format!("{}(_jsFn1)()", dependency.local)));
1289
+ assert!(!imports.iter().any(|item| item.imported == "useState"));
1290
+ assert_eq!(imports.len(), 2);
1291
+ }
1292
+
1293
+ #[test]
1294
+ fn should_preserve_import_forms_and_rebase_relative_definition_dependencies() {
1295
+ for (filename, expected) in [
1296
+ ("/project/src/test.js", "/project/src/./bridge.js"),
1297
+ ("C:\\project\\src\\test.js", "C:/project/src/./bridge.js"),
1298
+ ("src/test.js", "./src/./bridge.js"),
1299
+ ("test.js", "./bridge.js"),
1300
+ ] {
1301
+ let definition = worklet_definition(
1302
+ r#"
1303
+ import call, * as api from './bridge.js';
1304
+ import { original as named } from './bridge.js';
1305
+ export const handler = () => {
1306
+ 'main thread';
1307
+ return [call(), api.value, { named }];
1308
+ };
1309
+ "#,
1310
+ filename,
1311
+ );
1312
+ let imports = definition.imports.unwrap();
1313
+ let default = imports
1314
+ .iter()
1315
+ .find(|item| item.imported == "default")
1316
+ .unwrap();
1317
+ assert_eq!(default.source, expected);
1318
+ assert_eq!(default.local, "call");
1319
+ assert_eq!(default.namespace, None);
1320
+ let namespace = imports
1321
+ .iter()
1322
+ .find(|item| item.namespace == Some(true))
1323
+ .unwrap();
1324
+ assert_eq!(namespace.imported, "*");
1325
+ assert_eq!(namespace.source, expected);
1326
+ let named = imports
1327
+ .iter()
1328
+ .find(|item| item.imported == "original")
1329
+ .unwrap();
1330
+ assert_eq!(named.source, expected);
1331
+ assert!(definition.code.contains(&named.local));
1332
+ }
1333
+ }
1334
+
1335
+ #[test]
1336
+ fn should_rebase_only_relative_definition_imports() {
1337
+ for (source, expected) in [
1338
+ (".", "/project/src/."),
1339
+ ("..", "/project/src/.."),
1340
+ ("./bridge.js", "/project/src/./bridge.js"),
1341
+ ("../bridge.js", "/project/src/../bridge.js"),
1342
+ (".hidden/x", ".hidden/x"),
1343
+ ("..hidden/x", "..hidden/x"),
1344
+ ("bridge", "bridge"),
1345
+ ] {
1346
+ let definition = worklet_definition(
1347
+ &format!(
1348
+ "import call from '{source}'; export const handler = () => {{ 'main thread'; return call(); }};"
1349
+ ),
1350
+ "/project/src/test.js",
1351
+ );
1352
+ let imports = definition.imports.unwrap();
1353
+ let dependency = imports
1354
+ .iter()
1355
+ .find(|item| item.imported == "default")
1356
+ .unwrap();
1357
+ assert_eq!(dependency.source, expected);
1358
+ }
1359
+ }
1360
+
1361
+ #[test]
1362
+ fn should_exclude_captured_and_shadowed_imports_from_worklet_dependencies() {
1363
+ for source in [
1364
+ "import { value } from './values.js'; export const handler = () => { 'main thread'; return value; };",
1365
+ "import { runOnBackground } from './bridge.js'; export const handler = (runOnBackground) => { 'main thread'; runOnBackground(() => {})(); };",
1366
+ ] {
1367
+ let definition = worklet_definition(source, "test.js");
1368
+ let imports = definition.imports.unwrap();
1369
+ assert_eq!(imports.len(), 1);
1370
+ assert_eq!(imports[0].imported, "registerWorklet");
1371
+ }
1372
+ }
1373
+
1374
+ #[test]
1375
+ fn should_preserve_string_named_definition_imports() {
1376
+ let definition = worklet_definition(
1377
+ "import { 'string-name' as call } from 'bridge'; export const handler = () => { 'main thread'; return call(); };",
1378
+ "test.js",
1379
+ );
1380
+ let imports = definition.imports.unwrap();
1381
+ let dependency = imports
1382
+ .iter()
1383
+ .find(|item| item.imported == "string-name")
1384
+ .unwrap();
1385
+ assert_eq!(dependency.source, "bridge");
1386
+ assert!(definition.code.contains(&format!("{}()", dependency.local)));
1387
+ }
1388
+
1228
1389
  #[test]
1229
1390
  fn test_syntax_serialize_and_deserialize() {
1230
1391
  use serde_json::json;
@@ -2,6 +2,79 @@ $ node ./build.js
2
2
  Blocking waiting for file lock on package cache
3
3
  Blocking waiting for file lock on package cache
4
4
  Blocking waiting for file lock on package cache
5
+ Downloading crates ...
6
+ Downloaded crossbeam-utils v0.8.22
7
+ Downloaded digest v0.11.3
8
+ Downloaded crypto-common v0.2.2
9
+ Downloaded cpufeatures v0.3.0
10
+ Downloaded fixedbitset v0.5.7
11
+ Downloaded foldhash v0.1.5
12
+ Downloaded globset v0.4.19
13
+ Downloaded pathdiff v0.2.3
14
+ Downloaded arrayvec v0.7.8
15
+ Downloaded block-buffer v0.12.1
16
+ Downloaded browserslist-rs v0.20.0
17
+ Downloaded dashmap v6.2.1
18
+ Downloaded foldhash v0.2.0
19
+ Downloaded hybrid-array v0.4.13
20
+ Downloaded iana-time-zone v0.1.65
21
+ Downloaded lru v0.18.4
22
+ Downloaded path-clean v1.0.1
23
+ Downloaded const-oid v0.10.2
24
+ Downloaded getrandom v0.3.4
25
+ Downloaded jsonc-parser v0.26.3
26
+ Downloaded precomputed-map v0.2.0
27
+ Downloaded preset_env_base v9.0.0
28
+ Downloaded itertools v0.15.0
29
+ Downloaded hashbrown v0.16.1
30
+ Downloaded nom v8.0.0
31
+ Downloaded par-iter v2.0.0
32
+ Downloaded chrono v0.4.45
33
+ Downloaded bstr v1.13.0
34
+ Downloaded radix_fmt v1.0.0
35
+ Downloaded browserslist-data v0.2.0
36
+ Downloaded petgraph v0.7.1
37
+ Downloaded regress v0.11.1
38
+ Downloaded swc_config v6.0.0
39
+ Downloaded swc_config_macro v1.0.1
40
+ Downloaded swc_ecma_compat_common v45.0.0
41
+ Downloaded ryu-js v1.0.3
42
+ Downloaded sha1 v0.10.7
43
+ Downloaded sha2 v0.11.0
44
+ Downloaded st-map v0.2.4
45
+ Downloaded static-map-macro v0.3.4
46
+ Downloaded swc v75.0.1
47
+ Downloaded swc_compiler_base v64.0.0
48
+ Downloaded swc_ecma_compat_bugfixes v56.0.0
49
+ Downloaded swc_ecma_compat_es2015 v55.0.0
50
+ Downloaded swc_ecma_compat_es2016 v50.0.0
51
+ Downloaded swc_ecma_compat_es2017 v50.0.0
52
+ Downloaded swc_ecma_compat_es2018 v51.0.0
53
+ Downloaded swc_ecma_compat_es2020 v53.0.0
54
+ Downloaded swc_ecma_compat_es2021 v50.0.0
55
+ Downloaded swc_ecma_compat_es2022 v53.0.0
56
+ Downloaded swc_ecma_compat_regexp v9.0.0
57
+ Downloaded swc_ecma_ext_transforms v35.0.0
58
+ Downloaded swc_ecma_hooks v1.0.0
59
+ Downloaded swc_ecma_loader v27.0.0
60
+ Downloaded swc_ecma_regexp v0.15.0
61
+ Downloaded swc_ecma_regexp_ast v3.0.0
62
+ Downloaded swc_ecma_regexp_common v0.0.1
63
+ Downloaded swc_ecma_regexp_visit v0.15.0
64
+ Downloaded swc_ecma_transforms v62.0.0
65
+ Downloaded swc_node_comments v27.0.0
66
+ Downloaded swc_ecma_minifier v61.0.4
67
+ Downloaded swc_ecma_preset_env v63.0.0
68
+ Downloaded swc_ecma_transformer v21.0.1
69
+ Downloaded swc_ecma_transforms_macros v1.0.1
70
+ Downloaded swc_ecma_transforms_optimization v52.0.0
71
+ Downloaded swc_ecma_transforms_react v55.0.1
72
+ Downloaded swc_ecma_transforms_typescript v55.0.1
73
+ Downloaded swc_ecma_compat_es2019 v50.0.0
74
+ Downloaded swc_ecma_transforms_proposal v49.0.0
75
+ Downloaded swc_ecma_transforms_classes v49.0.0
76
+ Downloaded swc_ecma_transforms_compat v57.0.1
77
+ Blocking waiting for file lock on package cache
5
78
  Blocking waiting for file lock on build directory
6
79
  Compiling foldhash v0.2.0
7
80
  Compiling zerovec v0.11.6
@@ -10,8 +83,8 @@ $ node ./build.js
10
83
  Compiling hashbrown v0.17.1
11
84
  Compiling either v1.17.0
12
85
  Compiling swc_visit v2.0.2
13
- Compiling aho-corasick v1.1.4
14
86
  Compiling hashbrown v0.14.5
87
+ Compiling aho-corasick v1.1.4
15
88
  Compiling indexmap v2.14.0
16
89
  Compiling tinystr v0.8.3
17
90
  Compiling potential_utf v0.1.5
@@ -21,39 +94,39 @@ $ node ./build.js
21
94
  Compiling hstr v4.0.0
22
95
  Compiling icu_provider v2.2.0
23
96
  Compiling swc_atoms v10.0.0
24
- Compiling icu_properties v2.2.0
25
- Compiling icu_normalizer v2.2.0
26
97
  Compiling regex-automata v0.4.16
27
- Compiling swc_ecma_regexp_common v0.0.1
98
+ Compiling icu_normalizer v2.2.0
99
+ Compiling icu_properties v2.2.0
28
100
  Compiling typenum v1.20.1
101
+ Compiling swc_ecma_regexp_common v0.0.1
29
102
  Compiling crossbeam-utils v0.8.22
30
103
  Compiling idna_adapter v1.2.2
31
104
  Compiling idna v1.1.0
32
105
  Compiling dashmap v6.2.1
33
- Compiling generic-array v0.14.7
34
106
  Compiling url v2.5.8
35
- Compiling hashbrown v0.16.1
107
+ Compiling generic-array v0.14.7
36
108
  Compiling swc_sourcemap v10.0.2
109
+ Compiling regex v1.13.1
110
+ Compiling hashbrown v0.16.1
37
111
  Compiling bstr v1.13.0
38
112
  Compiling regress v0.11.1
39
- Compiling regex v1.13.1
40
113
  Compiling swc_common v26.0.0
41
114
  Compiling swc_ecma_ast v29.0.0
42
115
  Compiling swc_ecma_regexp_ast v3.0.0
43
116
  Compiling swc_ecma_regexp_visit v0.15.0
44
- Compiling swc_ecma_regexp v0.15.0
45
- Compiling swc_ecma_compat_regexp v9.0.0
46
117
  Compiling globset v0.4.19
47
- Compiling crypto-common v0.1.7
48
118
  Compiling block-buffer v0.10.4
119
+ Compiling swc_ecma_compat_regexp v9.0.0
120
+ Compiling swc_ecma_regexp v0.15.0
121
+ Compiling crypto-common v0.1.7
49
122
  Compiling swc_config_macro v1.0.1
123
+ Compiling swc_config v6.0.0
50
124
  Compiling digest v0.10.7
51
125
  Compiling arrayvec v0.7.8
52
- Compiling swc_config v6.0.0
53
126
  Compiling swc_ecma_transforms_macros v1.0.1
54
127
  Compiling fixedbitset v0.5.7
55
- Compiling zmij v1.0.23
56
128
  Compiling petgraph v0.7.1
129
+ Compiling zmij v1.0.23
57
130
  Compiling swc_allocator v5.0.0
58
131
  Compiling sha1 v0.10.7
59
132
  Compiling chrono v0.4.45
@@ -63,11 +136,11 @@ $ node ./build.js
63
136
  Compiling itertools v0.15.0
64
137
  Compiling nom v8.0.0
65
138
  Compiling static-map-macro v0.3.4
66
- Compiling precomputed-map v0.2.0
67
139
  Compiling foldhash v0.1.5
140
+ Compiling precomputed-map v0.2.0
141
+ Compiling tracing-subscriber v0.3.23
68
142
  Compiling swc_ecma_visit v29.0.0
69
143
  Compiling swc_ecma_parser v45.1.1
70
- Compiling tracing-subscriber v0.3.23
71
144
  Compiling browserslist-rs v0.20.0
72
145
  Compiling swc_ecma_preset_env v63.0.0
73
146
  Compiling st-map v0.2.4
@@ -78,61 +151,61 @@ $ node ./build.js
78
151
  Compiling pathdiff v0.2.3
79
152
  Compiling testing v27.0.0
80
153
  Compiling preset_env_base v9.0.0
154
+ Compiling sha2 v0.10.9
155
+ Compiling lru v0.18.4
156
+ Compiling path-clean v1.0.1
157
+ Compiling swc_ecma_loader v27.0.0
158
+ Compiling swc_ecma_testing v27.0.0
81
159
  Compiling swc_ecma_utils v35.0.0
82
160
  Compiling swc_ecma_hooks v1.0.0
83
161
  Compiling swc_ecma_transforms_base v49.0.1
84
162
  Compiling swc_ecma_codegen v32.0.0
85
163
  Compiling swc_ecma_transformer v21.0.1
86
164
  Compiling swc_ecma_transforms_classes v49.0.0
87
- Compiling swc_ecma_transforms_optimization v52.0.0
88
165
  Compiling swc_ecma_compat_common v45.0.0
89
166
  Compiling swc_ecma_compat_es2015 v55.0.0
90
167
  Compiling swc_ecma_compat_es2022 v53.0.0
168
+ Compiling swc_ecma_transforms_optimization v52.0.0
91
169
  Compiling swc_ecma_compat_bugfixes v56.0.0
92
170
  Compiling swc_ecma_compat_es2020 v53.0.0
93
- Compiling swc_ecma_compat_es2018 v51.0.0
94
171
  Compiling swc_ecma_compat_es2019 v50.0.0
95
- Compiling swc_ecma_compat_es2016 v50.0.0
96
172
  Compiling swc_ecma_compat_es2021 v50.0.0
173
+ Compiling swc_ecma_compat_es2016 v50.0.0
97
174
  Compiling swc_ecma_compat_es2017 v50.0.0
175
+ Compiling swc_ecma_compat_es2018 v51.0.0
98
176
  Compiling swc_ecma_transforms_react v55.0.1
99
177
  Compiling swc_ecma_transforms_compat v57.0.1
100
178
  Compiling swc_ecma_transforms_typescript v55.0.1
101
179
  Compiling swc_ecma_transforms_proposal v49.0.0
102
- Compiling swc_ecma_minifier v61.0.4
103
180
  Compiling swc_ecma_transforms v62.0.0
104
- Compiling sha2 v0.10.9
105
- Compiling lru v0.18.4
106
- Compiling path-clean v1.0.1
107
- Compiling swc_compiler_base v64.0.0
108
- Compiling swc_ecma_testing v27.0.0
109
- Compiling swc_ecma_loader v27.0.0
181
+ Compiling swc_ecma_minifier v61.0.4
110
182
  Compiling swc_ecma_ext_transforms v35.0.0
111
183
  Compiling swc_node_comments v27.0.0
112
184
  Compiling swc_transform_common v20.0.0
113
185
  Compiling jsonc-parser v0.26.3
114
186
  Compiling swc_core v77.1.2
115
- Compiling swc v75.0.1
116
187
  Compiling swc_ecma_transforms_testing v53.0.0
188
+ Compiling swc_compiler_base v64.0.0
189
+ Compiling swc v75.0.1
117
190
  Compiling swc_plugin_proxy v30.0.0
118
191
  Compiling sha-1 v0.10.1
119
192
  Compiling hybrid-array v0.4.13
120
- Compiling crypto-common v0.2.2
121
193
  Compiling block-buffer v0.12.1
122
- Compiling const-oid v0.10.2
194
+ Compiling crypto-common v0.2.2
123
195
  Compiling swc_plugins_shared v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugins_shared)
196
+ Compiling const-oid v0.10.2
124
197
  Compiling digest v0.11.3
125
198
  Compiling sha2 v0.11.0
126
199
  Compiling swc_plugin_define_dce v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_define_dce)
127
200
  Compiling swc_plugin_directive_dce v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_directive_dce)
128
201
  Compiling swc_plugin_element_template v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_element_template)
129
- Compiling swc_plugin_list v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_list)
130
202
  Compiling swc_plugin_shake v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_shake)
131
- Compiling swc_plugin_worklet v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_worklet)
132
- Compiling swc_plugin_inject v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_inject)
133
203
  Compiling swc_plugin_dynamic_import v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_dynamic_import)
134
- Compiling swc_plugin_snapshot v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_snapshot)
135
204
  Compiling swc_plugin_text v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_text)
205
+ Compiling swc_plugin_worklet v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_worklet)
206
+ Compiling swc_plugin_inject v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_inject)
207
+ Compiling swc_plugin_list v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_list)
136
208
  Compiling swc_plugin_css_scope v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_css_scope)
209
+ Compiling swc_plugin_snapshot v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_snapshot)
137
210
  Compiling swc_plugin_reactlynx v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/swc-plugin-reactlynx)
138
- Finished `release` profile [optimized] target(s) in 4m 17s
211
+ Finished `release` profile [optimized] target(s) in 4m 16s
@@ -303,10 +303,7 @@ pub fn process_transform(program: Program, metadata: TransformPluginProgramMetad
303
303
  config,
304
304
  ),
305
305
  Either::B(config) => Optional::new(
306
- visit_mut_pass(
307
- WorkletVisitor::new(options.mode.unwrap_or(TransformMode::Production), config)
308
- .with_content_hash(content_hash),
309
- ),
306
+ visit_mut_pass(WorkletVisitor::new(config).with_content_hash(content_hash)),
310
307
  true,
311
308
  ),
312
309
  };