@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.
- package/CHANGELOG.md +34 -0
- package/components/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/refresh/.turbo/turbo-build.log +1 -1
- package/runtime/__test__/core/entry-re-eval.test.ts +161 -0
- package/runtime/__test__/core/hooks/useLynxGlobalEventListener.test.jsx +1 -1
- package/runtime/__test__/core/reload-scoped-dual-thread-communication.test.ts +129 -0
- package/runtime/__test__/core/thread-function-call.test.ts +1 -0
- package/runtime/__test__/element-template/fixtures/background/render/_shared.tsx +2 -0
- package/runtime/__test__/element-template/imports/no-legacy-imports.test.ts +7 -6
- package/runtime/__test__/element-template/internal/legacy-internal-guardrail.test.ts +1 -2
- package/runtime/__test__/element-template/native/index.test.ts +8 -0
- package/runtime/__test__/element-template/native/main-thread-api.test.ts +5 -2
- package/runtime/__test__/element-template/native/main-thread-ref-init-value.test.ts +100 -0
- package/runtime/__test__/element-template/native/mts-destroy.test.ts +83 -0
- package/runtime/__test__/element-template/native/reload-dual-thread-communication.test.ts +104 -0
- package/runtime/__test__/element-template/native/reload.test.ts +79 -1
- package/runtime/__test__/element-template/runtime/background/commit-hook.test.ts +104 -47
- package/runtime/__test__/element-template/runtime/background/main-thread-function/compiled-fixtures.test.tsx +7 -1
- package/runtime/__test__/element-template/runtime/background/re-eval-reload.test.ts +69 -0
- package/runtime/__test__/element-template/runtime/background/update-timing.test.ts +15 -0
- package/runtime/__test__/element-template/runtime/hydration/hydration-listener.test.ts +31 -5
- package/runtime/__test__/element-template/runtime/patch/element-template-patch.test.tsx +214 -10
- package/runtime/__test__/element-template/runtime/patch/update-timing.test.ts +4 -1
- package/runtime/__test__/element-template/runtime/render/render-direct-suspense.test.ts +4 -1
- package/runtime/__test__/element-template/runtime/render/render-direct.test.ts +4 -1
- package/runtime/__test__/element-template/runtime/render/render-main-thread.test.ts +101 -1
- package/runtime/__test__/element-template/runtime/render/render-transform.contract.test.ts +2 -0
- package/runtime/__test__/element-template/runtime/template/element-template-handle.test.ts +32 -0
- package/runtime/__test__/element-template/runtime/template/main-thread-dynamic-attr-state.test.ts +121 -26
- package/runtime/__test__/element-template/runtime/template/main-thread-function.test.ts +89 -2
- package/runtime/__test__/element-template/test-utils/debug/compiledFixtureModule.ts +5 -0
- package/runtime/__test__/element-template/test-utils/debug/envManager.ts +8 -5
- package/runtime/__test__/element-template/test-utils/mock/mockNativePapi.ts +35 -2
- package/runtime/__test__/guardrails/snapshot-containment.test.ts +45 -11
- package/runtime/__test__/shared/component-stack.test.ts +211 -0
- package/runtime/__test__/snapshot/debug/formatPatch.test.ts +0 -8
- package/runtime/__test__/snapshot/gesture/prepareGestureForCommit.test.js +1 -1
- package/runtime/__test__/snapshot/lifecycle/re-eval-reload.test.jsx +114 -0
- package/runtime/__test__/snapshot/lifecycle/reload-background-function.test.jsx +169 -0
- package/runtime/__test__/snapshot/lifecycle/reload-delayed-background.test.jsx +63 -0
- package/runtime/__test__/snapshot/lifecycle/reload-delayed-main-thread.test.jsx +103 -0
- package/runtime/__test__/snapshot/lifecycle.test.jsx +61 -1
- package/runtime/__test__/snapshot/lynx/lazy-effect-scheduling.test.jsx +105 -0
- package/runtime/__test__/snapshot/lynx/timing.test.jsx +3 -0
- package/runtime/__test__/snapshot/preact.test.jsx +0 -3
- package/runtime/__test__/snapshot/snapshotPatch.test.jsx +0 -33
- package/runtime/__test__/snapshot/ssr.test.jsx +2 -2
- package/runtime/__test__/snapshot/worklet/runOnBackground.test.js +6 -11
- package/runtime/__test__/snapshot/worklet/runOnMainThread.test.jsx +1 -1
- package/runtime/__test__/snapshot/worklet/workletRef.test.jsx +24 -1
- package/runtime/__test__/worklet-runtime/jsFunctionLifecycle.test.js +27 -1
- package/runtime/__test__/worklet-runtime/loadRuntime.test.js +68 -0
- package/runtime/__test__/worklet-runtime/mainThreadObject.test.js +46 -0
- package/runtime/__test__/worklet-runtime/runOnMainThread.test.js +3 -3
- package/runtime/__test__/worklet-runtime/workletRuntime.test.js +30 -0
- package/runtime/lazy/element-template-internal.js +0 -1
- package/runtime/lazy/internal.js +1 -1
- package/runtime/lazy/jsx-dev-runtime.js +1 -1
- package/runtime/lazy/jsx-runtime.js +1 -1
- package/runtime/lazy/legacy-react-runtime.js +1 -1
- package/runtime/lazy/react-lepus.js +1 -1
- package/runtime/lazy/react.js +1 -1
- package/runtime/lib/core/background-function/exec-map.d.ts +2 -0
- package/runtime/lib/core/background-function/exec-map.js +7 -0
- package/runtime/lib/core/background-function/exec-map.js.map +1 -1
- package/runtime/lib/core/background-function/run-on-background.js +15 -16
- package/runtime/lib/core/background-function/run-on-background.js.map +1 -1
- package/runtime/lib/core/capture-main-thread-object.js +2 -1
- package/runtime/lib/core/capture-main-thread-object.js.map +1 -1
- package/runtime/lib/core/card-lifetime.d.ts +5 -0
- package/runtime/lib/core/card-lifetime.js +17 -0
- package/runtime/lib/core/card-lifetime.js.map +1 -0
- package/runtime/lib/core/compat/legacy-react-runtime.js +1 -1
- package/runtime/lib/core/compat/legacy-react-runtime.js.map +1 -1
- package/runtime/lib/core/entry-reload.d.ts +7 -0
- package/runtime/lib/core/entry-reload.js +49 -0
- package/runtime/lib/core/entry-reload.js.map +1 -0
- package/runtime/lib/core/lynx/lazy-bundle.js +5 -2
- package/runtime/lib/core/lynx/lazy-bundle.js.map +1 -1
- package/runtime/lib/core/lynx-data-processors.d.ts +125 -1
- package/runtime/lib/core/lynx-data-processors.js +3 -0
- package/runtime/lib/core/lynx-data-processors.js.map +1 -1
- package/runtime/lib/core/main-thread-ref-id.js +4 -4
- package/runtime/lib/core/main-thread-ref-id.js.map +1 -1
- package/runtime/lib/core/reload-scoped-event.d.ts +5 -0
- package/runtime/lib/core/reload-scoped-event.js +26 -0
- package/runtime/lib/core/reload-scoped-event.js.map +1 -0
- package/runtime/lib/core/reload-version.js +4 -3
- package/runtime/lib/core/reload-version.js.map +1 -1
- package/runtime/lib/core/runtime-destroy.d.ts +2 -0
- package/runtime/lib/core/runtime-destroy.js +10 -1
- package/runtime/lib/core/runtime-destroy.js.map +1 -1
- package/runtime/lib/core/thread-function-call/main-thread.js +5 -4
- package/runtime/lib/core/thread-function-call/main-thread.js.map +1 -1
- package/runtime/lib/core/thread-function-call/return-value.js +6 -5
- package/runtime/lib/core/thread-function-call/return-value.js.map +1 -1
- package/runtime/lib/document.js +0 -5
- package/runtime/lib/document.js.map +1 -1
- package/runtime/lib/element-template/background/commit-hook.js +24 -22
- package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
- package/runtime/lib/element-template/background/hydration-listener.js +2 -6
- package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
- package/runtime/lib/element-template/client/root.d.ts +1 -1
- package/runtime/lib/element-template/client/root.js.map +1 -1
- package/runtime/lib/element-template/index.d.ts +2 -2
- package/runtime/lib/element-template/index.js.map +1 -1
- package/runtime/lib/element-template/internal.d.ts +1 -1
- package/runtime/lib/element-template/internal.js +0 -13
- package/runtime/lib/element-template/internal.js.map +1 -1
- package/runtime/lib/element-template/lynx/env.js.map +1 -1
- package/runtime/lib/element-template/main-thread-ref-init-value.d.ts +3 -0
- package/runtime/lib/element-template/main-thread-ref-init-value.js +38 -0
- package/runtime/lib/element-template/main-thread-ref-init-value.js.map +1 -0
- package/runtime/lib/element-template/native/flush.d.ts +1 -0
- package/runtime/lib/element-template/native/flush.js +9 -0
- package/runtime/lib/element-template/native/flush.js.map +1 -0
- package/runtime/lib/element-template/native/index.js +2 -0
- package/runtime/lib/element-template/native/index.js.map +1 -1
- package/runtime/lib/element-template/native/main-thread-api.js +3 -7
- package/runtime/lib/element-template/native/main-thread-api.js.map +1 -1
- package/runtime/lib/element-template/native/mts-destroy.js +10 -2
- package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
- package/runtime/lib/element-template/native/patch-listener.js +58 -54
- package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
- package/runtime/lib/element-template/native/reload-background.d.ts +1 -1
- package/runtime/lib/element-template/native/reload-background.js +12 -1
- package/runtime/lib/element-template/native/reload-background.js.map +1 -1
- package/runtime/lib/element-template/native/reload-main-thread.d.ts +6 -0
- package/runtime/lib/element-template/native/reload-main-thread.js +20 -3
- package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -1
- package/runtime/lib/element-template/protocol/lifecycle-constant.d.ts +2 -1
- package/runtime/lib/element-template/protocol/lifecycle-constant.js +1 -0
- package/runtime/lib/element-template/protocol/lifecycle-constant.js.map +1 -1
- package/runtime/lib/element-template/protocol/types.d.ts +0 -2
- package/runtime/lib/element-template/protocol/types.js.map +1 -1
- package/runtime/lib/element-template/runtime/page/root-instance.d.ts +0 -1
- package/runtime/lib/element-template/runtime/page/root-instance.js.map +1 -1
- package/runtime/lib/element-template/runtime/patch.js +4 -0
- package/runtime/lib/element-template/runtime/patch.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/render-components.js +4 -4
- package/runtime/lib/element-template/runtime/render/render-components.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/render-main-thread.js +2 -0
- package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-background-function.js +8 -1
- package/runtime/lib/element-template/runtime/template/main-thread-background-function.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.d.ts +1 -0
- package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js +41 -21
- package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.d.ts +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.js.map +1 -1
- package/runtime/lib/internal.d.ts +1 -1
- package/runtime/lib/internal.js +1 -1
- package/runtime/lib/internal.js.map +1 -1
- package/runtime/lib/lynx-api.d.ts +2 -125
- package/runtime/lib/lynx-api.js.map +1 -1
- package/runtime/lib/shared/component-stack.d.ts +0 -4
- package/runtime/lib/shared/component-stack.js +21 -5
- package/runtime/lib/shared/component-stack.js.map +1 -1
- package/runtime/lib/shared/index-map.d.ts +4 -1
- package/runtime/lib/shared/index-map.js +5 -2
- package/runtime/lib/shared/index-map.js.map +1 -1
- package/runtime/lib/snapshot/gesture/{processGestureBagkround.js → processGestureBackground.js} +1 -1
- package/runtime/lib/snapshot/gesture/processGestureBackground.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/destroy.js +6 -0
- package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/event/firstScreenSync.d.ts +6 -2
- package/runtime/lib/snapshot/lifecycle/event/firstScreenSync.js +21 -18
- package/runtime/lib/snapshot/lifecycle/event/firstScreenSync.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.d.ts +0 -1
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js +0 -5
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js +0 -10
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js +56 -51
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/reload.d.ts +9 -2
- package/runtime/lib/snapshot/lifecycle/reload.js +29 -8
- package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
- package/runtime/lib/snapshot/list/list.js +3 -2
- package/runtime/lib/snapshot/list/list.js.map +1 -1
- package/runtime/lib/snapshot/list/listUpdateInfo.js +0 -30
- package/runtime/lib/snapshot/list/listUpdateInfo.js.map +1 -1
- package/runtime/lib/snapshot/lynx/calledByNative.js +14 -11
- package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/hydrate.js +0 -52
- package/runtime/lib/snapshot/renderToOpcodes/hydrate.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/index.js +10 -10
- package/runtime/lib/snapshot/renderToOpcodes/index.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/opcodes.js +0 -51
- package/runtime/lib/snapshot/renderToOpcodes/opcodes.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +1 -1
- package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/list.js +2 -1
- package/runtime/lib/snapshot/snapshot/list.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/snapshotInstanceManager.d.ts +4 -2
- package/runtime/lib/snapshot/snapshot/snapshotInstanceManager.js +11 -11
- package/runtime/lib/snapshot/snapshot/snapshotInstanceManager.js.map +1 -1
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.d.ts +1 -0
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.js +6 -1
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.js.map +1 -1
- package/runtime/lib/snapshot/worklet/ctx.d.ts +1 -1
- package/runtime/lib/snapshot/worklet/ctx.js +6 -1
- package/runtime/lib/snapshot/worklet/ctx.js.map +1 -1
- package/runtime/lib/snapshot/worklet/ref/updateInitValue.js +6 -0
- package/runtime/lib/snapshot/worklet/ref/updateInitValue.js.map +1 -1
- package/runtime/lib/tsconfig.tsbuildinfo +1 -1
- package/runtime/lib/worklet-runtime/bindings/index.d.ts +1 -0
- package/runtime/lib/worklet-runtime/bindings/index.js +1 -0
- package/runtime/lib/worklet-runtime/bindings/index.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/loadRuntime.d.ts +8 -0
- package/runtime/lib/worklet-runtime/bindings/loadRuntime.js +23 -0
- package/runtime/lib/worklet-runtime/bindings/loadRuntime.js.map +1 -0
- package/runtime/lib/worklet-runtime/delayRunOnBackground.js +3 -1
- package/runtime/lib/worklet-runtime/delayRunOnBackground.js.map +1 -1
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.d.ts +2 -0
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js +8 -1
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +1 -1
- package/runtime/lib/worklet-runtime/listeners.js +2 -2
- package/runtime/lib/worklet-runtime/listeners.js.map +1 -1
- package/runtime/lib/worklet-runtime/mainThreadObject.js +3 -1
- package/runtime/lib/worklet-runtime/mainThreadObject.js.map +1 -1
- package/runtime/lib/worklet-runtime/runOnMainThread.js +4 -3
- package/runtime/lib/worklet-runtime/runOnMainThread.js.map +1 -1
- package/runtime/lib/worklet-runtime/workletRuntime.js +2 -0
- package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
- package/runtime/package.json +2 -3
- package/runtime/src/core/background-function/exec-map.ts +9 -0
- package/runtime/src/core/background-function/run-on-background.ts +14 -16
- package/runtime/src/core/capture-main-thread-object.ts +2 -1
- package/runtime/src/core/card-lifetime.ts +18 -0
- package/runtime/src/core/compat/legacy-react-runtime.ts +1 -1
- package/runtime/src/core/entry-reload.ts +63 -0
- package/runtime/src/core/lynx/lazy-bundle.ts +5 -2
- package/runtime/src/core/lynx-data-processors.ts +124 -1
- package/runtime/src/core/main-thread-ref-id.ts +5 -4
- package/runtime/src/core/reload-scoped-event.ts +35 -0
- package/runtime/src/core/reload-version.ts +5 -3
- package/runtime/src/core/runtime-destroy.ts +12 -1
- package/runtime/src/core/thread-function-call/main-thread.ts +4 -4
- package/runtime/src/core/thread-function-call/return-value.ts +6 -5
- package/runtime/src/document.ts +0 -6
- package/runtime/src/element-template/background/commit-hook.ts +32 -23
- package/runtime/src/element-template/background/hydration-listener.ts +2 -6
- package/runtime/src/element-template/client/root.ts +1 -3
- package/runtime/src/element-template/index.ts +2 -2
- package/runtime/src/element-template/internal.ts +0 -20
- package/runtime/src/element-template/lynx/env.ts +1 -1
- package/runtime/src/element-template/main-thread-ref-init-value.ts +44 -0
- package/runtime/src/element-template/native/flush.ts +10 -0
- package/runtime/src/element-template/native/index.ts +2 -0
- package/runtime/src/element-template/native/main-thread-api.ts +3 -6
- package/runtime/src/element-template/native/mts-destroy.ts +10 -2
- package/runtime/src/element-template/native/patch-listener.ts +62 -62
- package/runtime/src/element-template/native/reload-background.ts +13 -1
- package/runtime/src/element-template/native/reload-main-thread.ts +32 -3
- package/runtime/src/element-template/protocol/lifecycle-constant.ts +1 -0
- package/runtime/src/element-template/protocol/types.ts +0 -15
- package/runtime/src/element-template/runtime/page/root-instance.ts +0 -1
- package/runtime/src/element-template/runtime/patch.ts +5 -0
- package/runtime/src/element-template/runtime/render/render-components.ts +3 -3
- package/runtime/src/element-template/runtime/render/render-main-thread.ts +2 -0
- package/runtime/src/element-template/runtime/template/main-thread-background-function.ts +8 -1
- package/runtime/src/element-template/runtime/template/main-thread-dynamic-attr-state.ts +51 -21
- package/runtime/src/element-template/runtime/template/main-thread-ref-ctx.ts +2 -2
- package/runtime/src/element-template/types.d.ts +6 -0
- package/runtime/src/internal.ts +1 -1
- package/runtime/src/lynx-api.ts +2 -124
- package/runtime/src/shared/component-stack.ts +22 -5
- package/runtime/src/shared/index-map.ts +3 -2
- package/runtime/src/snapshot/lifecycle/destroy.ts +7 -0
- package/runtime/src/snapshot/lifecycle/event/firstScreenSync.ts +26 -19
- package/runtime/src/snapshot/lifecycle/patch/snapshotPatch.ts +0 -5
- package/runtime/src/snapshot/lifecycle/patch/snapshotPatchApply.ts +0 -10
- package/runtime/src/snapshot/lifecycle/patch/updateMainThread.ts +62 -58
- package/runtime/src/snapshot/lifecycle/reload.ts +47 -11
- package/runtime/src/snapshot/list/list.ts +9 -2
- package/runtime/src/snapshot/list/listUpdateInfo.ts +0 -52
- package/runtime/src/snapshot/lynx/calledByNative.ts +14 -13
- package/runtime/src/snapshot/renderToOpcodes/hydrate.ts +0 -58
- package/runtime/src/snapshot/renderToOpcodes/index.ts +8 -8
- package/runtime/src/snapshot/renderToOpcodes/opcodes.ts +0 -57
- package/runtime/src/snapshot/snapshot/backgroundSnapshot.ts +1 -1
- package/runtime/src/snapshot/snapshot/list.ts +5 -1
- package/runtime/src/snapshot/snapshot/snapshotInstanceManager.ts +19 -12
- package/runtime/src/snapshot/worklet/call/runOnMainThread.ts +10 -1
- package/runtime/src/snapshot/worklet/ctx.ts +10 -1
- package/runtime/src/snapshot/worklet/ref/updateInitValue.ts +6 -0
- package/runtime/src/worklet-runtime/README.md +33 -0
- package/runtime/src/worklet-runtime/bindings/index.ts +2 -0
- package/runtime/src/worklet-runtime/bindings/loadRuntime.ts +25 -0
- package/runtime/src/worklet-runtime/delayRunOnBackground.ts +3 -1
- package/runtime/src/worklet-runtime/jsFunctionLifecycle.ts +8 -1
- package/runtime/src/worklet-runtime/listeners.ts +4 -7
- package/runtime/src/worklet-runtime/mainThreadObject.ts +2 -1
- package/runtime/src/worklet-runtime/runOnMainThread.ts +4 -3
- package/runtime/src/worklet-runtime/workletRuntime.ts +2 -0
- package/runtime/types/types.d.ts +3 -1
- package/runtime/vitest.config.ts +0 -2
- package/testing-library/.turbo/turbo-build.log +7 -7
- package/testing-library/src/__tests__/act.test.jsx +0 -7
- package/testing-library/src/__tests__/alog.test.jsx +12 -54
- package/testing-library/src/__tests__/end-to-end.test.jsx +0 -7
- package/testing-library/src/__tests__/renderComponent.test.jsx +0 -14
- package/testing-library/src/__tests__/worklet.test.jsx +59 -5
- package/transform/.turbo/turbo-build$colon$wasm.log +63 -136
- package/transform/__test__/defines.spec.js +137 -0
- package/transform/__test__/object-methods.spec.js +79 -0
- package/transform/crates/swc_plugin_worklet/definition_imports.rs +97 -0
- package/transform/crates/swc_plugin_worklet/extract_ident.rs +99 -49
- package/transform/crates/swc_plugin_worklet/gen_stmt.rs +56 -48
- package/transform/crates/swc_plugin_worklet/lib.rs +400 -595
- package/transform/crates/swc_plugin_worklet/napi.rs +4 -6
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_2_js.js +6 -1
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_2_lepus.js +7 -1
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_js.js +9 -0
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_lepus.js +12 -1
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_preserve_main_thread_objects_in_class_js.js +1 -1
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_preserve_main_thread_objects_in_class_lepus.js +1 -1
- package/transform/dist/wasm.cjs +1 -1
- package/transform/index.d.ts +3 -1
- package/transform/package.json +0 -1
- package/transform/src/lib.rs +173 -12
- package/transform/swc-plugin-reactlynx/.turbo/turbo-build.log +105 -32
- package/transform/swc-plugin-reactlynx/src/lib.rs +1 -4
- package/transform/swc-plugin-reactlynx/swc_plugin_reactlynx.wasm +0 -0
- package/transform/swc-plugin-reactlynx-compat/.turbo/turbo-build.log +193 -194
- package/runtime/lib/snapshot/gesture/processGestureBagkround.js.map +0 -1
- package/runtime/lib/snapshot/worklet/hmr.d.ts +0 -1
- package/runtime/lib/snapshot/worklet/hmr.js +0 -28
- package/runtime/lib/snapshot/worklet/hmr.js.map +0 -1
- package/runtime/src/snapshot/worklet/hmr.ts +0 -34
- /package/runtime/lib/snapshot/gesture/{processGestureBagkround.d.ts → processGestureBackground.d.ts} +0 -0
- /package/runtime/src/snapshot/gesture/{processGestureBagkround.ts → processGestureBackground.ts} +0 -0
|
@@ -1,89 +1,16 @@
|
|
|
1
1
|
$ node ./scripts/build_wasm.js
|
|
2
2
|
Blocking waiting for file lock on package cache
|
|
3
3
|
Blocking waiting for file lock on package cache
|
|
4
|
-
Blocking waiting for file lock on package cache
|
|
5
4
|
Downloading crates ...
|
|
6
|
-
Downloaded bitflags v1.3.2
|
|
7
|
-
Downloaded block-buffer v0.12.1
|
|
8
|
-
Downloaded arrayvec v0.7.8
|
|
9
|
-
Downloaded browserslist-rs v0.20.0
|
|
10
|
-
Downloaded napi-sys v2.4.0
|
|
11
|
-
Downloaded crypto-common v0.2.2
|
|
12
|
-
Downloaded ctor v0.1.26
|
|
13
5
|
Downloaded napi-build v2.3.2
|
|
14
|
-
Downloaded path-clean v1.0.1
|
|
15
|
-
Downloaded pathdiff v0.2.3
|
|
16
|
-
Downloaded radix_fmt v1.0.0
|
|
17
6
|
Downloaded convert_case v0.6.0
|
|
18
|
-
Downloaded
|
|
19
|
-
Downloaded
|
|
20
|
-
Downloaded
|
|
21
|
-
Downloaded
|
|
22
|
-
Downloaded lru v0.18.4
|
|
23
|
-
Downloaded precomputed-map v0.2.0
|
|
24
|
-
Downloaded preset_env_base v9.0.0
|
|
25
|
-
Downloaded browserslist-data v0.2.0
|
|
26
|
-
Downloaded const-oid v0.10.2
|
|
27
|
-
Downloaded cpufeatures v0.3.0
|
|
28
|
-
Downloaded crossbeam-utils v0.8.22
|
|
29
|
-
Downloaded dashmap v6.2.1
|
|
30
|
-
Downloaded digest v0.11.3
|
|
31
|
-
Downloaded getrandom v0.3.4
|
|
32
|
-
Downloaded globset v0.4.19
|
|
33
|
-
Downloaded iana-time-zone v0.1.65
|
|
7
|
+
Downloaded napi-sys v2.4.0
|
|
8
|
+
Downloaded ctor v0.1.26
|
|
9
|
+
Downloaded bitflags v1.3.2
|
|
10
|
+
Downloaded napi-derive-backend v1.0.40
|
|
34
11
|
Downloaded napi v2.10.4
|
|
35
12
|
Downloaded napi-derive v2.9.3
|
|
36
|
-
Downloaded napi-derive-backend v1.0.40
|
|
37
|
-
Downloaded sha1 v0.10.7
|
|
38
|
-
Downloaded sha2 v0.11.0
|
|
39
|
-
Downloaded st-map v0.2.4
|
|
40
|
-
Downloaded static-map-macro v0.3.4
|
|
41
|
-
Downloaded chrono v0.4.45
|
|
42
|
-
Downloaded hashbrown v0.16.1
|
|
43
|
-
Downloaded itertools v0.15.0
|
|
44
|
-
Downloaded jsonc-parser v0.26.3
|
|
45
|
-
Downloaded nom v8.0.0
|
|
46
|
-
Downloaded par-iter v2.0.0
|
|
47
|
-
Downloaded ryu-js v1.0.3
|
|
48
|
-
Downloaded bstr v1.13.0
|
|
49
|
-
Downloaded regress v0.11.1
|
|
50
|
-
Downloaded swc_compiler_base v64.0.0
|
|
51
|
-
Downloaded swc_ecma_regexp_ast v3.0.0
|
|
52
|
-
Downloaded swc_ecma_regexp_visit v0.15.0
|
|
53
|
-
Downloaded petgraph v0.7.1
|
|
54
|
-
Downloaded swc v75.0.1
|
|
55
|
-
Downloaded swc_config v6.0.0
|
|
56
|
-
Downloaded swc_config_macro v1.0.1
|
|
57
|
-
Downloaded swc_ecma_compat_common v45.0.0
|
|
58
|
-
Downloaded swc_ecma_compat_es2017 v50.0.0
|
|
59
|
-
Downloaded swc_ecma_compat_es2018 v51.0.0
|
|
60
|
-
Downloaded swc_ecma_compat_es2019 v50.0.0
|
|
61
|
-
Downloaded swc_ecma_compat_es2020 v53.0.0
|
|
62
|
-
Downloaded swc_ecma_compat_es2021 v50.0.0
|
|
63
|
-
Downloaded swc_ecma_compat_regexp v9.0.0
|
|
64
|
-
Downloaded swc_ecma_loader v27.0.0
|
|
65
|
-
Downloaded swc_ecma_preset_env v63.0.0
|
|
66
|
-
Downloaded swc_ecma_regexp_common v0.0.1
|
|
67
|
-
Downloaded swc_ecma_transformer v21.0.1
|
|
68
|
-
Downloaded swc_ecma_compat_bugfixes v56.0.0
|
|
69
|
-
Downloaded swc_ecma_compat_es2015 v55.0.0
|
|
70
|
-
Downloaded swc_ecma_compat_es2016 v50.0.0
|
|
71
|
-
Downloaded swc_ecma_hooks v1.0.0
|
|
72
|
-
Downloaded swc_ecma_regexp v0.15.0
|
|
73
|
-
Downloaded swc_ecma_minifier v61.0.4
|
|
74
|
-
Downloaded swc_ecma_transforms v62.0.0
|
|
75
|
-
Downloaded swc_ecma_transforms_macros v1.0.1
|
|
76
|
-
Downloaded swc_ecma_compat_es2022 v53.0.0
|
|
77
|
-
Downloaded swc_ecma_transforms_optimization v52.0.0
|
|
78
|
-
Downloaded swc_ecma_transforms_proposal v49.0.0
|
|
79
|
-
Downloaded swc_ecma_transforms_react v55.0.1
|
|
80
|
-
Downloaded swc_ecma_ext_transforms v35.0.0
|
|
81
|
-
Downloaded swc_ecma_transforms_classes v49.0.0
|
|
82
|
-
Downloaded swc_ecma_transforms_compat v57.0.1
|
|
83
|
-
Downloaded swc_ecma_transforms_typescript v55.0.1
|
|
84
|
-
Downloaded swc_node_comments v27.0.0
|
|
85
13
|
Downloaded version-compare v0.2.1
|
|
86
|
-
Blocking waiting for file lock on package cache
|
|
87
14
|
Blocking waiting for file lock on build directory
|
|
88
15
|
Compiling cfg-if v1.0.4
|
|
89
16
|
Compiling serde_core v1.0.229
|
|
@@ -106,11 +33,11 @@ $ node ./scripts/build_wasm.js
|
|
|
106
33
|
Compiling itoa v1.0.18
|
|
107
34
|
Compiling serde_json v1.0.151
|
|
108
35
|
Compiling tinystr v0.8.3
|
|
109
|
-
Compiling writeable v0.6.3
|
|
110
36
|
Compiling litemap v0.8.2
|
|
37
|
+
Compiling writeable v0.6.3
|
|
111
38
|
Compiling potential_utf v0.1.5
|
|
112
|
-
Compiling icu_locale_core v2.2.0
|
|
113
39
|
Compiling zerotrie v0.2.4
|
|
40
|
+
Compiling icu_locale_core v2.2.0
|
|
114
41
|
Compiling utf8_iter v1.0.4
|
|
115
42
|
Compiling icu_collections v2.2.0
|
|
116
43
|
Compiling indexmap v2.14.0
|
|
@@ -120,99 +47,99 @@ $ node ./scripts/build_wasm.js
|
|
|
120
47
|
Compiling icu_properties_data v2.2.0
|
|
121
48
|
Compiling rustc-hash v2.1.3
|
|
122
49
|
Compiling parking_lot_core v0.9.12
|
|
123
|
-
Compiling icu_properties v2.2.0
|
|
124
50
|
Compiling icu_normalizer v2.2.0
|
|
125
|
-
Compiling
|
|
51
|
+
Compiling icu_properties v2.2.0
|
|
126
52
|
Compiling either v1.17.0
|
|
127
53
|
Compiling scopeguard v1.2.0
|
|
128
|
-
Compiling radium v0.7.0
|
|
129
54
|
Compiling lock_api v0.4.14
|
|
130
|
-
Compiling
|
|
55
|
+
Compiling radium v0.7.0
|
|
56
|
+
Compiling hashbrown v0.14.5
|
|
131
57
|
Compiling tracing-core v0.1.36
|
|
132
|
-
Compiling
|
|
58
|
+
Compiling idna_adapter v1.2.2
|
|
133
59
|
Compiling tap v1.0.1
|
|
60
|
+
Compiling percent-encoding v2.3.2
|
|
61
|
+
Compiling idna v1.1.0
|
|
134
62
|
Compiling wyz v0.5.1
|
|
135
63
|
Compiling form_urlencoded v1.2.2
|
|
136
|
-
Compiling idna v1.1.0
|
|
137
64
|
Compiling anyhow v1.0.104
|
|
138
|
-
Compiling pin-project-lite v0.2.17
|
|
139
65
|
Compiling bytes v1.12.1
|
|
140
|
-
Compiling
|
|
66
|
+
Compiling pin-project-lite v0.2.17
|
|
141
67
|
Compiling uuid v1.24.0
|
|
142
68
|
Compiling outref v0.5.2
|
|
143
69
|
Compiling vsimd v0.8.0
|
|
70
|
+
Compiling funty v2.0.0
|
|
71
|
+
Compiling base64-simd v0.8.0
|
|
144
72
|
Compiling bytes-str v0.2.8
|
|
145
|
-
Compiling bitvec v1.1.1
|
|
146
73
|
Compiling debugid v0.8.0
|
|
147
|
-
Compiling base64-simd v0.8.0
|
|
148
74
|
Compiling url v2.5.8
|
|
149
75
|
Compiling tracing v0.1.44
|
|
76
|
+
Compiling bitvec v1.1.1
|
|
150
77
|
Compiling triomphe v0.1.16
|
|
151
78
|
Compiling unicode-width v0.2.2
|
|
152
|
-
Compiling if_chain v1.0.3
|
|
153
|
-
Compiling data-encoding v2.11.0
|
|
154
79
|
Compiling new_debug_unreachable v1.0.6
|
|
80
|
+
Compiling data-encoding v2.11.0
|
|
155
81
|
Compiling unicode-id-start v1.4.0
|
|
82
|
+
Compiling if_chain v1.0.3
|
|
156
83
|
Compiling hstr v4.0.0
|
|
157
84
|
Compiling num-integer v0.1.46
|
|
158
85
|
Compiling scoped-tls v1.0.1
|
|
159
86
|
Compiling better_scoped_tls v1.0.1
|
|
160
|
-
Compiling num-bigint v0.4.8
|
|
161
87
|
Compiling swc_atoms v10.0.0
|
|
88
|
+
Compiling num-bigint v0.4.8
|
|
162
89
|
Compiling parking_lot v0.12.5
|
|
163
|
-
Compiling swc_sourcemap v10.0.2
|
|
164
90
|
Compiling swc_visit v2.0.2
|
|
165
|
-
Compiling siphasher v0.3.11
|
|
166
91
|
Compiling termcolor v1.4.1
|
|
92
|
+
Compiling swc_sourcemap v10.0.2
|
|
93
|
+
Compiling siphasher v0.3.11
|
|
167
94
|
Compiling bitflags v2.13.1
|
|
168
95
|
Compiling siphasher v1.0.3
|
|
96
|
+
Compiling phf_shared v0.11.3
|
|
169
97
|
Compiling libc v0.2.189
|
|
170
98
|
Compiling dragonbox_ecma v0.1.12
|
|
171
|
-
Compiling phf_shared v0.11.3
|
|
172
99
|
Compiling par-core v2.0.0
|
|
173
|
-
Compiling num_cpus v1.17.0
|
|
174
100
|
Compiling phf v0.11.3
|
|
101
|
+
Compiling num_cpus v1.17.0
|
|
175
102
|
Compiling castaway v0.2.4
|
|
176
103
|
Compiling ryu v1.0.23
|
|
177
104
|
Compiling static_assertions v1.1.0
|
|
178
105
|
Compiling aho-corasick v1.1.4
|
|
179
|
-
Compiling swc_common v26.0.0
|
|
180
106
|
Compiling compact_str v0.7.1
|
|
107
|
+
Compiling swc_common v26.0.0
|
|
181
108
|
Compiling regex-syntax v0.8.11
|
|
182
109
|
Compiling swc_ecma_ast v29.0.0
|
|
183
110
|
Compiling regex-automata v0.4.16
|
|
184
111
|
Compiling typenum v1.20.1
|
|
185
112
|
Compiling swc_ecma_regexp_common v0.0.1
|
|
186
|
-
Compiling crossbeam-utils v0.8.22
|
|
187
113
|
Compiling swc_ecma_regexp_ast v3.0.0
|
|
114
|
+
Compiling crossbeam-utils v0.8.22
|
|
188
115
|
Compiling swc_ecma_regexp_visit v0.15.0
|
|
189
|
-
Compiling dashmap v6.2.1
|
|
190
|
-
Compiling swc_ecma_compat_regexp v9.0.0
|
|
191
116
|
Compiling swc_ecma_regexp v0.15.0
|
|
117
|
+
Compiling swc_ecma_compat_regexp v9.0.0
|
|
192
118
|
Compiling swc_ecma_visit v29.0.0
|
|
193
119
|
Compiling swc_ecma_parser v45.1.1
|
|
194
120
|
Compiling regex v1.13.1
|
|
121
|
+
Compiling dashmap v6.2.1
|
|
195
122
|
Compiling generic-array v0.14.7
|
|
196
|
-
Compiling hashbrown v0.16.1
|
|
197
123
|
Compiling bstr v1.13.0
|
|
198
|
-
Compiling
|
|
124
|
+
Compiling hashbrown v0.16.1
|
|
199
125
|
Compiling regress v0.11.1
|
|
200
|
-
Compiling
|
|
126
|
+
Compiling globset v0.4.19
|
|
201
127
|
Compiling crypto-common v0.1.7
|
|
128
|
+
Compiling block-buffer v0.10.4
|
|
129
|
+
Compiling swc_config v6.0.0
|
|
202
130
|
Compiling digest v0.10.7
|
|
203
131
|
Compiling arrayvec v0.7.8
|
|
204
132
|
Compiling thiserror v1.0.69
|
|
205
133
|
Compiling owo-colors v4.3.0
|
|
206
134
|
Compiling semver v1.0.28
|
|
207
|
-
Compiling fixedbitset v0.5.7
|
|
208
135
|
Compiling unicode-linebreak v0.1.5
|
|
136
|
+
Compiling fixedbitset v0.5.7
|
|
209
137
|
Compiling base64 v0.22.1
|
|
210
|
-
Compiling textwrap v0.16.2
|
|
211
|
-
Compiling swc_config v6.0.0
|
|
212
138
|
Compiling petgraph v0.7.1
|
|
213
|
-
Compiling
|
|
139
|
+
Compiling textwrap v0.16.2
|
|
214
140
|
Compiling swc_ecma_utils v35.0.0
|
|
215
141
|
Compiling swc_ecma_hooks v1.0.0
|
|
142
|
+
Compiling bumpalo v3.20.3
|
|
216
143
|
Compiling thread_local v1.1.10
|
|
217
144
|
Compiling unicode-width v0.1.14
|
|
218
145
|
Compiling miette v7.6.0
|
|
@@ -221,36 +148,36 @@ $ node ./scripts/build_wasm.js
|
|
|
221
148
|
Compiling swc_allocator v5.0.0
|
|
222
149
|
Compiling sha1 v0.10.7
|
|
223
150
|
Compiling chrono v0.4.45
|
|
224
|
-
Compiling lazy_static v1.5.0
|
|
225
|
-
Compiling log v0.4.33
|
|
226
151
|
Compiling syn v1.0.109
|
|
152
|
+
Compiling lazy_static v1.5.0
|
|
227
153
|
Compiling ascii v1.1.0
|
|
228
|
-
Compiling
|
|
154
|
+
Compiling log v0.4.33
|
|
155
|
+
Compiling tracing-log v0.2.0
|
|
156
|
+
Compiling browserslist-data v0.2.0
|
|
229
157
|
Compiling swc_ecma_transformer v21.0.1
|
|
230
158
|
Compiling swc_ecma_transforms_classes v49.0.0
|
|
231
159
|
Compiling swc_ecma_compat_common v45.0.0
|
|
232
160
|
Compiling swc_ecma_compat_es2015 v55.0.0
|
|
233
161
|
Compiling swc_ecma_compat_es2022 v53.0.0
|
|
234
162
|
Compiling swc_ecma_transforms_optimization v52.0.0
|
|
235
|
-
Compiling swc_ecma_compat_es2020 v53.0.0
|
|
236
|
-
Compiling swc_ecma_compat_es2019 v50.0.0
|
|
237
163
|
Compiling swc_ecma_compat_bugfixes v56.0.0
|
|
164
|
+
Compiling swc_ecma_compat_es2020 v53.0.0
|
|
165
|
+
Compiling swc_ecma_compat_es2017 v50.0.0
|
|
238
166
|
Compiling swc_ecma_compat_es2021 v50.0.0
|
|
239
|
-
Compiling swc_ecma_compat_es2018 v51.0.0
|
|
240
167
|
Compiling swc_ecma_compat_es2016 v50.0.0
|
|
241
|
-
Compiling
|
|
242
|
-
Compiling
|
|
168
|
+
Compiling swc_ecma_compat_es2018 v51.0.0
|
|
169
|
+
Compiling swc_ecma_compat_es2019 v50.0.0
|
|
243
170
|
Compiling swc_ecma_transforms_react v55.0.1
|
|
244
|
-
Compiling
|
|
171
|
+
Compiling swc_ecma_codegen v32.0.0
|
|
245
172
|
Compiling sharded-slab v0.1.7
|
|
246
173
|
Compiling swc_error_reporters v28.0.0
|
|
247
174
|
Compiling matchers v0.2.0
|
|
248
175
|
Compiling itertools v0.15.0
|
|
249
176
|
Compiling cargo-platform v0.1.9
|
|
250
177
|
Compiling nom v8.0.0
|
|
251
|
-
Compiling diff v0.1.13
|
|
252
178
|
Compiling nu-ansi-term v0.50.3
|
|
253
179
|
Compiling yansi v1.0.1
|
|
180
|
+
Compiling diff v0.1.13
|
|
254
181
|
Compiling pretty_assertions v1.4.1
|
|
255
182
|
Compiling tracing-subscriber v0.3.23
|
|
256
183
|
Compiling st-map v0.2.4
|
|
@@ -260,67 +187,67 @@ $ node ./scripts/build_wasm.js
|
|
|
260
187
|
Compiling swc_ecma_transforms_compat v57.0.1
|
|
261
188
|
Compiling swc_ecma_transforms_proposal v49.0.0
|
|
262
189
|
Compiling par-iter v2.0.0
|
|
190
|
+
Compiling difference v2.0.0
|
|
263
191
|
Compiling ryu-js v1.0.3
|
|
264
192
|
Compiling pathdiff v0.2.3
|
|
265
|
-
Compiling difference v2.0.0
|
|
266
193
|
Compiling radix_fmt v1.0.0
|
|
267
|
-
Compiling testing v27.0.0
|
|
268
|
-
Compiling swc_ecma_minifier v61.0.4
|
|
269
194
|
Compiling swc_ecma_transforms v62.0.0
|
|
195
|
+
Compiling testing v27.0.0
|
|
270
196
|
Compiling preset_env_base v9.0.0
|
|
271
197
|
Compiling swc_ecma_preset_env v63.0.0
|
|
198
|
+
Compiling swc_ecma_minifier v61.0.4
|
|
272
199
|
Compiling sha2 v0.10.9
|
|
273
200
|
Compiling lru v0.18.4
|
|
274
|
-
Compiling
|
|
275
|
-
Compiling fastrand v2.5.0
|
|
201
|
+
Compiling precomputed-map v0.2.0
|
|
276
202
|
Compiling hex v0.4.3
|
|
203
|
+
Compiling foldhash v0.1.5
|
|
277
204
|
Compiling unicode-segmentation v1.13.3
|
|
278
205
|
Compiling path-clean v1.0.1
|
|
279
|
-
Compiling
|
|
206
|
+
Compiling fastrand v2.5.0
|
|
207
|
+
Compiling tempfile v3.27.0
|
|
280
208
|
Compiling swc_ecma_loader v27.0.0
|
|
281
209
|
Compiling convert_case v0.6.0
|
|
282
210
|
Compiling swc_ecma_testing v27.0.0
|
|
283
|
-
Compiling tempfile v3.27.0
|
|
284
211
|
Compiling swc_ecma_ext_transforms v35.0.0
|
|
285
212
|
Compiling swc_node_comments v27.0.0
|
|
286
213
|
Compiling swc_transform_common v20.0.0
|
|
287
214
|
Compiling jsonc-parser v0.26.3
|
|
288
|
-
Compiling swc_core v77.1.2
|
|
289
215
|
Compiling ansi_term v0.12.1
|
|
216
|
+
Compiling swc_core v77.1.2
|
|
290
217
|
Compiling swc_ecma_transforms_testing v53.0.0
|
|
291
218
|
Compiling napi-derive-backend v1.0.40
|
|
292
219
|
Compiling swc_compiler_base v64.0.0
|
|
293
220
|
Compiling swc v75.0.1
|
|
294
221
|
Compiling ctor v0.1.26
|
|
295
|
-
Compiling napi-sys v2.4.0
|
|
296
222
|
Compiling bitflags v1.3.2
|
|
223
|
+
Compiling napi-sys v2.4.0
|
|
297
224
|
Compiling napi v2.10.4
|
|
298
225
|
Compiling napi-derive v2.9.3
|
|
299
226
|
Compiling convert_case v0.11.0
|
|
300
227
|
Compiling sha-1 v0.10.1
|
|
301
228
|
Compiling sugar_path v1.2.1
|
|
302
|
-
Compiling hybrid-array v0.4.13
|
|
303
229
|
Compiling swc_plugins_shared v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugins_shared)
|
|
304
|
-
Compiling
|
|
230
|
+
Compiling hybrid-array v0.4.13
|
|
305
231
|
Compiling crypto-common v0.2.2
|
|
232
|
+
Compiling block-buffer v0.12.1
|
|
306
233
|
Compiling const-oid v0.10.2
|
|
307
|
-
Compiling napi-build v2.3.2
|
|
308
234
|
Compiling digest v0.11.3
|
|
309
|
-
Compiling
|
|
310
|
-
Compiling react-transform v0.0.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform)
|
|
235
|
+
Compiling napi-build v2.3.2
|
|
311
236
|
Compiling getrandom v0.4.3
|
|
237
|
+
Compiling react-transform v0.0.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform)
|
|
238
|
+
Compiling sha2 v0.11.0
|
|
312
239
|
Compiling swc_plugin_snapshot v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_snapshot)
|
|
313
240
|
Compiling swc_plugin_define_dce v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_define_dce)
|
|
314
241
|
Compiling swc_plugin_directive_dce v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_directive_dce)
|
|
315
242
|
Compiling swc_plugin_element_template v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_element_template)
|
|
316
243
|
Compiling swc_plugin_list v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_list)
|
|
317
|
-
Compiling
|
|
244
|
+
Compiling swc_plugin_inject v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_inject)
|
|
245
|
+
Compiling swc_plugin_compat v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_compat)
|
|
318
246
|
Compiling swc_plugin_dynamic_import v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_dynamic_import)
|
|
319
247
|
Compiling swc_plugin_shake v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_shake)
|
|
320
|
-
Compiling swc_plugin_text v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_text)
|
|
321
248
|
Compiling swc_plugin_worklet v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_worklet)
|
|
322
|
-
Compiling
|
|
323
|
-
Compiling
|
|
249
|
+
Compiling swc_plugin_text v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_text)
|
|
250
|
+
Compiling swc_plugin_css_scope v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_css_scope)
|
|
324
251
|
Compiling swc_plugin_background_only v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_background_only)
|
|
325
252
|
Compiling version-compare v0.2.1
|
|
326
|
-
Finished `release` profile [optimized] target(s) in 6m
|
|
253
|
+
Finished `release` profile [optimized] target(s) in 6m 28s
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
|
|
5
7
|
import { describe, expect, it } from 'vitest';
|
|
6
8
|
|
|
7
9
|
import { transformReactLynx } from '../main.js';
|
|
@@ -175,6 +177,21 @@ describe('collected defines', () => {
|
|
|
175
177
|
expect(result.code).not.toContain('__CreateView');
|
|
176
178
|
});
|
|
177
179
|
|
|
180
|
+
it.each(['development', 'production'])(
|
|
181
|
+
'keeps worklet implementations in main-thread definitions in %s builds',
|
|
182
|
+
async mode => {
|
|
183
|
+
const result = await transformReactLynx(source, options('JS', { mode }));
|
|
184
|
+
|
|
185
|
+
expect(result.errors).toEqual([]);
|
|
186
|
+
expect(result.code).not.toContain('registerWorkletOnBackground');
|
|
187
|
+
expect(result.code).not.toContain('console.info');
|
|
188
|
+
expect(result.code).toContain('_wkltId');
|
|
189
|
+
expect(result.definesForWorklet).toHaveLength(1);
|
|
190
|
+
expect(result.definesForWorklet[0].code).toContain('__registerWorklet');
|
|
191
|
+
expect(result.definesForWorklet[0].code).toContain('console.info');
|
|
192
|
+
},
|
|
193
|
+
);
|
|
194
|
+
|
|
178
195
|
it('collects the same definitions the main-thread transform would emit', async () => {
|
|
179
196
|
const fromBackground = await transformReactLynx(
|
|
180
197
|
source,
|
|
@@ -273,6 +290,111 @@ function legacy(target, extra = {}) {
|
|
|
273
290
|
});
|
|
274
291
|
}
|
|
275
292
|
|
|
293
|
+
describe('worklet definition imports', () => {
|
|
294
|
+
const source = `
|
|
295
|
+
import { runOnBackground, useState } from '@lynx-js/react';
|
|
296
|
+
export function Repro() {
|
|
297
|
+
const [count, setCount] = useState(0);
|
|
298
|
+
const onTap = () => {
|
|
299
|
+
'main thread';
|
|
300
|
+
runOnBackground(() => {
|
|
301
|
+
'background only';
|
|
302
|
+
setCount(value => value + 1);
|
|
303
|
+
})();
|
|
304
|
+
};
|
|
305
|
+
return <view main-thread:bindtap={onTap}>{count}</view>;
|
|
306
|
+
}
|
|
307
|
+
`;
|
|
308
|
+
|
|
309
|
+
it.each(['test', 'development'])(
|
|
310
|
+
'carries the runOnBackground import without unrelated component imports in %s mode',
|
|
311
|
+
async (mode) => {
|
|
312
|
+
const background = await transformReactLynx(source, options('JS', { mode }));
|
|
313
|
+
const mainThread = await transformReactLynx(source, options('LEPUS', { mode }));
|
|
314
|
+
expect(background.errors).toEqual([]);
|
|
315
|
+
expect(background.definesForWorklet).toEqual(mainThread.definesForWorklet);
|
|
316
|
+
const [definition] = background.definesForWorklet;
|
|
317
|
+
const dependency = definition.imports.find(item => item.imported === 'runOnBackground');
|
|
318
|
+
expect(dependency).toEqual({ source: '@lynx-js/react', imported: 'runOnBackground', local: dependency.local });
|
|
319
|
+
expect(definition.code).toContain(`${dependency.local}(_jsFn1)()`);
|
|
320
|
+
expect(definition.imports.some(item => item.imported === 'useState')).toBe(false);
|
|
321
|
+
},
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
it('resolves Windows relative imports in the Wasm transform', async () => {
|
|
325
|
+
const result = await transformReactLynx(
|
|
326
|
+
source.replace('\'@lynx-js/react\'', '\'./bridge.js\''),
|
|
327
|
+
options('JS', { filename: 'C:\\project\\src\\Repro.jsx' }),
|
|
328
|
+
);
|
|
329
|
+
expect(result.errors).toEqual([]);
|
|
330
|
+
expect(result.definesForWorklet[0].imports).toContainEqual(
|
|
331
|
+
expect.objectContaining({ source: 'C:/project/src/./bridge.js', imported: 'runOnBackground' }),
|
|
332
|
+
);
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it('resolves relative imports from the owning module directory', async () => {
|
|
336
|
+
const filename = path.resolve('src/components/Repro.jsx');
|
|
337
|
+
const result = await transformReactLynx(
|
|
338
|
+
source.replace('\'@lynx-js/react\'', '\'./bridge.js\''),
|
|
339
|
+
options('JS', { filename }),
|
|
340
|
+
);
|
|
341
|
+
expect(result.errors).toEqual([]);
|
|
342
|
+
expect(result.definesForWorklet[0].imports).toContainEqual(expect.objectContaining({
|
|
343
|
+
source: `${path.dirname(filename)}/./bridge.js`.replaceAll('\\', '/'),
|
|
344
|
+
imported: 'runOnBackground',
|
|
345
|
+
}));
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
it('does not import bindings captured through the worklet context', async () => {
|
|
349
|
+
const result = await transformReactLynx(
|
|
350
|
+
`
|
|
351
|
+
import { value } from './values.js';
|
|
352
|
+
function worklet() { 'main thread'; return value; }
|
|
353
|
+
`,
|
|
354
|
+
options('JS'),
|
|
355
|
+
);
|
|
356
|
+
expect(result.errors).toEqual([]);
|
|
357
|
+
expect(result.definesForWorklet[0].imports).toHaveLength(1);
|
|
358
|
+
expect(result.definesForWorklet[0].code).toContain('this["_c"]');
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
it('preserves default, namespace and aliased imports and shorthand keys', async () => {
|
|
362
|
+
const opts = options('JS');
|
|
363
|
+
opts.worklet.customGlobalIdentNames = ['call', 'api', 'named'];
|
|
364
|
+
const result = await transformReactLynx(
|
|
365
|
+
`
|
|
366
|
+
import call, * as api from './bridge.js';
|
|
367
|
+
import { original as named } from './other.js';
|
|
368
|
+
function worklet() { 'main thread'; return [call(), api.value, { named }]; }
|
|
369
|
+
`,
|
|
370
|
+
opts,
|
|
371
|
+
);
|
|
372
|
+
expect(result.errors).toEqual([]);
|
|
373
|
+
const [definition] = result.definesForWorklet;
|
|
374
|
+
expect(definition.imports).toEqual(expect.arrayContaining([
|
|
375
|
+
{ source: './bridge.js', imported: 'default', local: 'call' },
|
|
376
|
+
{ source: './bridge.js', imported: '*', local: 'api', namespace: true },
|
|
377
|
+
{ source: './other.js', imported: 'original', local: 'named' },
|
|
378
|
+
]));
|
|
379
|
+
expect(definition.code).toContain('named');
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
it('does not carry an import shadowed by a worklet parameter', async () => {
|
|
383
|
+
const result = await transformReactLynx(
|
|
384
|
+
`
|
|
385
|
+
import { runOnBackground } from './bridge.js';
|
|
386
|
+
function worklet(runOnBackground) {
|
|
387
|
+
'main thread';
|
|
388
|
+
runOnBackground(() => {})();
|
|
389
|
+
}
|
|
390
|
+
`,
|
|
391
|
+
options('JS'),
|
|
392
|
+
);
|
|
393
|
+
expect(result.errors).toEqual([]);
|
|
394
|
+
expect(result.definesForWorklet[0].imports).toHaveLength(1);
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
|
|
276
398
|
describe('legacy slot codegen', () => {
|
|
277
399
|
it('collects the definitions its frozen codegen emits', async () => {
|
|
278
400
|
const { definesForSnapshot, definesForWorklet } = await transformReactLynx(
|
|
@@ -332,6 +454,21 @@ describe('legacy slot codegen', () => {
|
|
|
332
454
|
`);
|
|
333
455
|
});
|
|
334
456
|
|
|
457
|
+
it.each(['development', 'production'])(
|
|
458
|
+
'keeps worklet implementations in main-thread definitions in %s builds',
|
|
459
|
+
async mode => {
|
|
460
|
+
const result = await transformReactLynx(source, { ...legacy('JS'), mode });
|
|
461
|
+
|
|
462
|
+
expect(result.errors).toEqual([]);
|
|
463
|
+
expect(result.code).not.toContain('registerWorkletOnBackground');
|
|
464
|
+
expect(result.code).not.toContain('console.info');
|
|
465
|
+
expect(result.code).toContain('_wkltId');
|
|
466
|
+
expect(result.definesForWorklet).toHaveLength(1);
|
|
467
|
+
expect(result.definesForWorklet[0].code).toContain('__registerWorklet');
|
|
468
|
+
expect(result.definesForWorklet[0].code).toContain('console.info');
|
|
469
|
+
},
|
|
470
|
+
);
|
|
471
|
+
|
|
335
472
|
it('collects the same definitions the main-thread transform would emit', async () => {
|
|
336
473
|
const fromBackground = await transformReactLynx(source, legacy('JS'));
|
|
337
474
|
const fromMainThread = await transformReactLynx(source, legacy('LEPUS'));
|
|
@@ -79,4 +79,83 @@ describe('object method captures', () => {
|
|
|
79
79
|
expect(Object.getOwnPropertyDescriptor(valueType, 'create').get.call(other)._jsFn._jsFn1)
|
|
80
80
|
.toBe(other.callback);
|
|
81
81
|
});
|
|
82
|
+
|
|
83
|
+
it('preserves nullish bases and guards when narrowing optional member captures', async () => {
|
|
84
|
+
const result = await transformReactLynx(
|
|
85
|
+
`
|
|
86
|
+
export function create(enabled, handlers) {
|
|
87
|
+
return () => {
|
|
88
|
+
'main thread';
|
|
89
|
+
if (enabled && handlers?.start) handlers.start();
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function createNested(enabled, handlers) {
|
|
94
|
+
return () => {
|
|
95
|
+
'main thread';
|
|
96
|
+
if (enabled && handlers?.nested?.start) handlers.nested.start();
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
`,
|
|
100
|
+
options('LEPUS'),
|
|
101
|
+
);
|
|
102
|
+
const functions = new Map();
|
|
103
|
+
const { create, createNested } = new Function(
|
|
104
|
+
'__registerWorklet',
|
|
105
|
+
'__captureMainThreadObject',
|
|
106
|
+
`${result.code.replace(/^import .*;$/gm, '').replace(/^export /gm, '')}\nreturn { create, createNested };`,
|
|
107
|
+
)(
|
|
108
|
+
(_type, id, fn) => functions.set(id, fn),
|
|
109
|
+
() => undefined,
|
|
110
|
+
);
|
|
111
|
+
const invoke = worklet => functions.get(worklet._wkltId).call(worklet);
|
|
112
|
+
|
|
113
|
+
const withNullDisabled = create(false, null);
|
|
114
|
+
expect(withNullDisabled._c.handlers).toBeNull();
|
|
115
|
+
expect(() => invoke(withNullDisabled)).not.toThrow();
|
|
116
|
+
|
|
117
|
+
const withUndefinedDisabled = create(false, undefined);
|
|
118
|
+
expect(withUndefinedDisabled._c.handlers).toBeUndefined();
|
|
119
|
+
expect(() => invoke(withUndefinedDisabled)).not.toThrow();
|
|
120
|
+
|
|
121
|
+
const withNullEnabled = create(true, null);
|
|
122
|
+
expect(withNullEnabled._c.handlers).toBeNull();
|
|
123
|
+
expect(() => invoke(withNullEnabled)).not.toThrow();
|
|
124
|
+
|
|
125
|
+
const withUndefinedEnabled = create(true, undefined);
|
|
126
|
+
expect(withUndefinedEnabled._c.handlers).toBeUndefined();
|
|
127
|
+
expect(() => invoke(withUndefinedEnabled)).not.toThrow();
|
|
128
|
+
|
|
129
|
+
let started = 0;
|
|
130
|
+
const handlers = {
|
|
131
|
+
start() {
|
|
132
|
+
started += 1;
|
|
133
|
+
},
|
|
134
|
+
extra: 'unreferenced',
|
|
135
|
+
};
|
|
136
|
+
const withHandlersDisabled = create(false, handlers);
|
|
137
|
+
expect(withHandlersDisabled._c.handlers).toEqual({ start: handlers.start });
|
|
138
|
+
expect('extra' in withHandlersDisabled._c.handlers).toBe(false);
|
|
139
|
+
invoke(withHandlersDisabled);
|
|
140
|
+
expect(started).toBe(0);
|
|
141
|
+
|
|
142
|
+
const withHandlersEnabled = create(true, handlers);
|
|
143
|
+
invoke(withHandlersEnabled);
|
|
144
|
+
expect(started).toBe(1);
|
|
145
|
+
|
|
146
|
+
const withNestedNull = createNested(true, { nested: null, extra: 1 });
|
|
147
|
+
expect(withNestedNull._c.handlers).toEqual({ nested: null });
|
|
148
|
+
expect(() => invoke(withNestedNull)).not.toThrow();
|
|
149
|
+
|
|
150
|
+
const withNestedUndefined = createNested(true, { nested: undefined, extra: 1 });
|
|
151
|
+
expect(withNestedUndefined._c.handlers).toEqual({ nested: undefined });
|
|
152
|
+
expect(() => invoke(withNestedUndefined)).not.toThrow();
|
|
153
|
+
|
|
154
|
+
const withNestedHandlers = createNested(true, { nested: handlers, extra: 1 });
|
|
155
|
+
expect(withNestedHandlers._c.handlers).toEqual({
|
|
156
|
+
nested: { start: handlers.start },
|
|
157
|
+
});
|
|
158
|
+
invoke(withNestedHandlers);
|
|
159
|
+
expect(started).toBe(2);
|
|
160
|
+
});
|
|
82
161
|
});
|