@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
package/transform/index.d.ts
CHANGED
|
@@ -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
|
|
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 {
|
package/transform/package.json
CHANGED
package/transform/src/lib.rs
CHANGED
|
@@ -305,7 +305,7 @@ pub struct Define {
|
|
|
305
305
|
pub unmergeable: Option<bool>,
|
|
306
306
|
/// @internal
|
|
307
307
|
pub runtime_requirements: Option<TransformRuntimeRequirements>,
|
|
308
|
-
///
|
|
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
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
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:
|
|
420
|
+
source: source.clone(),
|
|
402
421
|
imported,
|
|
403
|
-
local
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
};
|
|
Binary file
|