@lynx-js/react 0.127.0 → 0.128.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/components/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -14
- package/refresh/.turbo/turbo-build.log +1 -1
- package/runtime/__test__/element-template/internal/legacy-internal-guardrail.test.ts +1 -1
- package/runtime/__test__/element-template/runtime/background/event/compiled-fixtures.test.tsx +39 -48
- package/runtime/__test__/element-template/runtime/background/main-thread-function/compiled-fixtures.test.tsx +7 -9
- package/runtime/__test__/element-template/runtime/render/render-transform.contract.test.ts +6 -3
- package/runtime/__test__/element-template/test-utils/mock/globals.js +6 -0
- package/runtime/__test__/element-template/vitest.config.ts +4 -0
- package/runtime/__test__/worklet-runtime/initEntry.test.js +109 -0
- package/runtime/__test__/worklet-runtime/object-methods.test.js +2 -3
- package/runtime/lazy/element-template-internal.js +0 -1
- package/runtime/lazy/internal.js +0 -1
- package/runtime/lib/core/background-function/exec-map.js.map +1 -1
- package/runtime/lib/core/background-function/handle.js.map +1 -1
- package/runtime/lib/core/background-function/run-on-background.js.map +1 -1
- package/runtime/lib/core/capture-main-thread-object.js.map +1 -1
- package/runtime/lib/core/commit-context.js.map +1 -1
- package/runtime/lib/core/compat/legacy-react-runtime.js.map +1 -1
- package/runtime/lib/core/compat/lynxComponent.js.map +1 -1
- package/runtime/lib/core/component.js.map +1 -1
- package/runtime/lib/core/forceRootRender.js.map +1 -1
- package/runtime/lib/core/globalProps.js.map +1 -1
- package/runtime/lib/core/hooks/mainThread.js.map +1 -1
- package/runtime/lib/core/hooks/mainThreadImpl.js.map +1 -1
- package/runtime/lib/core/hooks/react.js.map +1 -1
- package/runtime/lib/core/hooks/useLynxGlobalEventListener.js.map +1 -1
- package/runtime/lib/core/initData.js.map +1 -1
- package/runtime/lib/core/lynx/dynamic-import.js.map +1 -1
- package/runtime/lib/core/lynx/lazy-bundle.js.map +1 -1
- package/runtime/lib/core/lynx/runtime-backend.js.map +1 -1
- package/runtime/lib/core/lynx/runtime-version.js.map +1 -1
- package/runtime/lib/core/lynx-data-processors.js.map +1 -1
- package/runtime/lib/core/lynx-page-data.js.map +1 -1
- package/runtime/lib/core/lynx-update-data.js.map +1 -1
- package/runtime/lib/core/main-thread-function.js.map +1 -1
- package/runtime/lib/core/main-thread-object-handle-registry.js.map +1 -1
- package/runtime/lib/core/main-thread-object.js +1 -4
- package/runtime/lib/core/main-thread-object.js.map +1 -1
- package/runtime/lib/core/main-thread-ref-id.js.map +1 -1
- package/runtime/lib/core/main-thread-ref-init-value.js.map +1 -1
- package/runtime/lib/core/main-thread-ref.js.map +1 -1
- package/runtime/lib/core/mts-capability.js.map +1 -1
- package/runtime/lib/core/performance.js.map +1 -1
- package/runtime/lib/core/ref.js.map +1 -1
- package/runtime/lib/core/reload-version.js.map +1 -1
- package/runtime/lib/core/runtime-destroy.js.map +1 -1
- package/runtime/lib/core/thread-function-call/main-thread.js.map +1 -1
- package/runtime/lib/core/thread-function-call/return-value.js.map +1 -1
- package/runtime/lib/document.js.map +1 -1
- package/runtime/lib/element-template/background/attr-slots.js.map +1 -1
- package/runtime/lib/element-template/background/commit-context.js.map +1 -1
- package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
- package/runtime/lib/element-template/background/destroy.js.map +1 -1
- package/runtime/lib/element-template/background/document.js.map +1 -1
- package/runtime/lib/element-template/background/hydrate.js.map +1 -1
- package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
- package/runtime/lib/element-template/background/instance.js.map +1 -1
- package/runtime/lib/element-template/background/manager.js.map +1 -1
- package/runtime/lib/element-template/background/page-root-hydrate.js.map +1 -1
- package/runtime/lib/element-template/background/render-scope.js.map +1 -1
- package/runtime/lib/element-template/client/root.js.map +1 -1
- package/runtime/lib/element-template/debug/alog.js.map +1 -1
- package/runtime/lib/element-template/debug/elementPAPICall.js.map +1 -1
- package/runtime/lib/element-template/debug/profile.js.map +1 -1
- package/runtime/lib/element-template/hydration-map.js.map +1 -1
- package/runtime/lib/element-template/index.js.map +1 -1
- package/runtime/lib/element-template/internal.d.ts +0 -1
- package/runtime/lib/element-template/internal.js +0 -1
- package/runtime/lib/element-template/internal.js.map +1 -1
- package/runtime/lib/element-template/jsx-dev-runtime/index.js.map +1 -1
- package/runtime/lib/element-template/jsx-runtime/index.js.map +1 -1
- package/runtime/lib/element-template/lynx/env.js.map +1 -1
- package/runtime/lib/element-template/lynx/performance.js.map +1 -1
- package/runtime/lib/element-template/native/callDestroyLifetimeFun.js.map +1 -1
- package/runtime/lib/element-template/native/index.js.map +1 -1
- package/runtime/lib/element-template/native/main-thread-api.js.map +1 -1
- package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
- package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
- package/runtime/lib/element-template/native/reload-background.js.map +1 -1
- package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -1
- package/runtime/lib/element-template/prop-adapters/event-value.js.map +1 -1
- package/runtime/lib/element-template/prop-adapters/event.js.map +1 -1
- package/runtime/lib/element-template/prop-adapters/ref.js.map +1 -1
- package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -1
- package/runtime/lib/element-template/protocol/lifecycle-constant.js.map +1 -1
- package/runtime/lib/element-template/protocol/opcodes.js.map +1 -1
- package/runtime/lib/element-template/protocol/page.js.map +1 -1
- package/runtime/lib/element-template/protocol/template-type.js.map +1 -1
- package/runtime/lib/element-template/protocol/types.js.map +1 -1
- package/runtime/lib/element-template/protocol/update-event.js.map +1 -1
- package/runtime/lib/element-template/runtime/list/list.js.map +1 -1
- package/runtime/lib/element-template/runtime/page/authored-page.js.map +1 -1
- package/runtime/lib/element-template/runtime/page/page.js.map +1 -1
- package/runtime/lib/element-template/runtime/page/root-instance.js.map +1 -1
- package/runtime/lib/element-template/runtime/patch.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/create-rendered-host.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/host.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/render-components.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/render-direct.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/attr-slot-plan.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/handle.js.map +1 -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.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-event-ctx.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-function.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/registry.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/typed-attributes.js.map +1 -1
- package/runtime/lib/element-template/runtime-marker.js.map +1 -1
- package/runtime/lib/index.js.map +1 -1
- package/runtime/lib/internal.d.ts +0 -1
- package/runtime/lib/internal.js +0 -1
- package/runtime/lib/internal.js.map +1 -1
- package/runtime/lib/lynx-api.js.map +1 -1
- package/runtime/lib/lynx.js.map +1 -1
- package/runtime/lib/root.js.map +1 -1
- package/runtime/lib/runtime-marker.js.map +1 -1
- package/runtime/lib/shared/attribute-name.js.map +1 -1
- package/runtime/lib/shared/component-stack.js.map +1 -1
- package/runtime/lib/shared/index-map.js.map +1 -1
- package/runtime/lib/shared/profile.js.map +1 -1
- package/runtime/lib/shared/render-constants.js.map +1 -1
- package/runtime/lib/snapshot/alog/elementPAPICall.js.map +1 -1
- package/runtime/lib/snapshot/alog/index.js.map +1 -1
- package/runtime/lib/snapshot/alog/render.js.map +1 -1
- package/runtime/lib/snapshot/compat/componentIs.js.map +1 -1
- package/runtime/lib/snapshot/debug/debug.js.map +1 -1
- package/runtime/lib/snapshot/debug/describeInvalidValue.js.map +1 -1
- package/runtime/lib/snapshot/debug/formatPatch.js.map +1 -1
- package/runtime/lib/snapshot/debug/printSnapshot.js.map +1 -1
- package/runtime/lib/snapshot/debug/profileHooks.js.map +1 -1
- package/runtime/lib/snapshot/debug/vnodeSource.js.map +1 -1
- package/runtime/lib/snapshot/gesture/processGesture.js.map +1 -1
- package/runtime/lib/snapshot/gesture/processGestureBagkround.js.map +1 -1
- package/runtime/lib/snapshot/gesture/types.js.map +1 -1
- package/runtime/lib/snapshot/index.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/constant.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/event/delayEvents.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/event/delayLifecycleEvents.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/event/firstScreenSync.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/isRendering.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/error.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/globalState.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/isMainThreadHydrating.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/nodesRefApply.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/ref/delay.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/render.js.map +1 -1
- package/runtime/lib/snapshot/list/list.js.map +1 -1
- package/runtime/lib/snapshot/list/listUpdateInfo.js.map +1 -1
- package/runtime/lib/snapshot/list/pendingListUpdates.js.map +1 -1
- package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -1
- package/runtime/lib/snapshot/lynx/children.js.map +1 -1
- package/runtime/lib/snapshot/lynx/element.js.map +1 -1
- package/runtime/lib/snapshot/lynx/env.js.map +1 -1
- package/runtime/lib/snapshot/lynx/injectLepusMethods.js.map +1 -1
- package/runtime/lib/snapshot/lynx/lazyBundleConstants.js.map +1 -1
- package/runtime/lib/snapshot/lynx/nodesRef.js.map +1 -1
- package/runtime/lib/snapshot/lynx/performance.js.map +1 -1
- package/runtime/lib/snapshot/lynx/portals.js.map +1 -1
- package/runtime/lib/snapshot/lynx/portalsPending.js.map +1 -1
- package/runtime/lib/snapshot/lynx/prepareLazyBundleMTS.js.map +1 -1
- package/runtime/lib/snapshot/lynx/runWithForce.js.map +1 -1
- package/runtime/lib/snapshot/lynx/suspense.js.map +1 -1
- package/runtime/lib/snapshot/lynx/tt.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/hydrate.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/index.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/opcodes.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/constants.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/definition.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/dynamicPartType.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/event.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/gesture.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/index.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/list.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/platformInfo.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/reconstructInstanceTree.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/ref.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/snapshot.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/snapshotCreatorMap.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/snapshotInstanceHydrationMap.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/snapshotInstanceManager.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/spread.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/types.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/utils.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/workletEvent.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/workletRef.js.map +1 -1
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.js.map +1 -1
- package/runtime/lib/snapshot/worklet/ctx.js.map +1 -1
- package/runtime/lib/snapshot/worklet/destroy.js.map +1 -1
- package/runtime/lib/snapshot/worklet/functionality.js.map +1 -1
- package/runtime/lib/snapshot/worklet/hmr.js.map +1 -1
- package/runtime/lib/snapshot/worklet/ref/updateInitValue.js.map +1 -1
- package/runtime/lib/tsconfig.tsbuildinfo +1 -1
- package/runtime/lib/utils.js.map +1 -1
- package/runtime/lib/worklet-runtime/api/animation/animation.js.map +1 -1
- package/runtime/lib/worklet-runtime/api/animation/effect.js.map +1 -1
- package/runtime/lib/worklet-runtime/api/element.js.map +1 -1
- package/runtime/lib/worklet-runtime/api/lepusQuerySelector.js.map +1 -1
- package/runtime/lib/worklet-runtime/api/lynxApi.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/bindings.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/events.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/index.d.ts +0 -1
- package/runtime/lib/worklet-runtime/bindings/index.js +0 -1
- package/runtime/lib/worklet-runtime/bindings/index.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/observers.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/types.js.map +1 -1
- package/runtime/lib/worklet-runtime/delayRunOnBackground.js.map +1 -1
- package/runtime/lib/worklet-runtime/delayWorkletEvent.js.map +1 -1
- package/runtime/lib/worklet-runtime/eomImpl.js.map +1 -1
- package/runtime/lib/worklet-runtime/eventPropagation.js.map +1 -1
- package/runtime/lib/worklet-runtime/global.js.map +1 -1
- package/runtime/lib/worklet-runtime/hydrate.js.map +1 -1
- package/runtime/lib/worklet-runtime/index.js +6 -0
- package/runtime/lib/worklet-runtime/index.js.map +1 -1
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +1 -1
- package/runtime/lib/worklet-runtime/listeners.js.map +1 -1
- package/runtime/lib/worklet-runtime/mainThreadObject.js.map +1 -1
- package/runtime/lib/worklet-runtime/runOnMainThread.js.map +1 -1
- package/runtime/lib/worklet-runtime/utils/mainThreadFlushLoopGuard.js.map +1 -1
- package/runtime/lib/worklet-runtime/utils/profile.js.map +1 -1
- package/runtime/lib/worklet-runtime/utils/version.js.map +1 -1
- package/runtime/lib/worklet-runtime/workletRef.js.map +1 -1
- package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
- package/runtime/src/core/main-thread-object.ts +1 -8
- package/runtime/src/element-template/internal.ts +0 -1
- package/runtime/src/internal.ts +0 -1
- package/runtime/src/worklet-runtime/bindings/index.ts +0 -1
- package/runtime/src/worklet-runtime/index.ts +7 -0
- package/runtime/tsconfig.json +2 -0
- package/runtime/vitest.config.ts +4 -0
- package/testing-library/.turbo/turbo-build.log +11 -11
- package/testing-library/dist/env/index.js +3 -15
- package/testing-library/dist/plugins/index.js +10 -0
- package/testing-library/dist/rstest-config.js +15 -0
- package/testing-library/dist/setupFiles/common/worklet-runtime-init.js +11 -0
- package/testing-library/rstest.config.ts +3 -0
- package/testing-library/src/__tests__/rstest-config.test.js +34 -1
- package/testing-library/src/__tests__/worklet.test.jsx +41 -32
- package/testing-library/src/plugins/vitest.ts +5 -1
- package/testing-library/src/rstest-config.ts +17 -1
- package/testing-library/src/setupFiles/common/worklet-runtime-init.js +22 -0
- package/transform/.turbo/turbo-build$colon$wasm.log +113 -123
- package/transform/__test__/defines.spec.js +80 -12
- package/transform/__test__/fixture.spec.js +166 -48
- package/transform/__test__/object-methods.spec.js +1 -3
- package/transform/crates/swc_plugin_worklet/gen_stmt.rs +26 -10
- package/transform/crates/swc_plugin_worklet/lib.rs +132 -148
- package/transform/crates/swc_plugin_worklet/napi.rs +10 -1
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_capture_env_lepus.js +4 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_expose_object_method_capture_channels_lepus.js +3 -5
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_ident_from_this_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_2_lepus.js +4 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_3_lepus.js +3 -5
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_4_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_lepus.js +4 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_not_capture_computed_object_method_key_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_not_capture_globals.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_not_capture_object_method_local_decls_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_not_capture_type_annotations.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_not_destructure_from_closure.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_not_extract_catch_clause_params.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_not_extract_idents_inside_of_ctx.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_not_transform_recursively.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_preserve_main_thread_objects_in_class_lepus.js +6 -6
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_skip_shared_identifiers_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_arrow_function.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_fn_decl_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_function_expr.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_in_class_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_in_class_property_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_in_class_static_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_in_class_static_property_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_js_fn_in_run_on_js_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_lepus.js +4 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_lepus_alias.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_lepus_general.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_lepus_general_mixed.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_multiple_worklets.js +3 -5
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_multiple_worklets_in_func.js +3 -5
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_object_methods_lepus.js +2 -4
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_ui_worklet_lepus.js +2 -4
- package/transform/dist/wasm.cjs +1 -1
- package/transform/index.d.ts +25 -1
- package/transform/src/lib.rs +193 -23
- package/transform/swc-plugin-reactlynx/.turbo/turbo-build.log +30 -31
- package/transform/swc-plugin-reactlynx/swc_plugin_reactlynx.wasm +0 -0
- package/transform/swc-plugin-reactlynx-compat/.turbo/turbo-build.log +195 -217
- package/runtime/lib/worklet-runtime/bindings/loadRuntime.d.ts +0 -8
- package/runtime/lib/worklet-runtime/bindings/loadRuntime.js +0 -23
- package/runtime/lib/worklet-runtime/bindings/loadRuntime.js.map +0 -1
- package/runtime/src/worklet-runtime/bindings/loadRuntime.ts +0 -25
- package/runtime/worklet-runtime/dev.js +0 -775
- package/runtime/worklet-runtime/main.js +0 -1
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_add_worklet_runtime_ident_with_inner_ident.js +0 -13
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_add_worklet_runtime_ident_with_outer_ident.js +0 -13
|
@@ -10,7 +10,9 @@ use gen_stmt::StmtGen;
|
|
|
10
10
|
use hash::WorkletHash;
|
|
11
11
|
use rustc_hash::FxHashSet;
|
|
12
12
|
use serde::Deserialize;
|
|
13
|
+
use std::cell::Cell;
|
|
13
14
|
use std::collections::HashSet;
|
|
15
|
+
use std::rc::Rc;
|
|
14
16
|
use std::vec;
|
|
15
17
|
use swc_core::common::util::take::Take;
|
|
16
18
|
use swc_core::common::{errors::HANDLER, Span, Spanned, DUMMY_SP};
|
|
@@ -18,7 +20,6 @@ use swc_core::ecma::ast::*;
|
|
|
18
20
|
use swc_core::ecma::utils::{prepend_stmts, private_ident};
|
|
19
21
|
use swc_core::ecma::visit::VisitMutWith;
|
|
20
22
|
use swc_core::ecma::visit::{noop_visit_mut_type, noop_visit_type, Visit, VisitMut, VisitWith};
|
|
21
|
-
use swc_core::quote;
|
|
22
23
|
use worklet_type::WorkletType;
|
|
23
24
|
|
|
24
25
|
use swc_plugins_shared::{
|
|
@@ -53,7 +54,7 @@ impl Default for WorkletVisitorConfig {
|
|
|
53
54
|
filename: "index.js".into(),
|
|
54
55
|
target: TransformTarget::LEPUS,
|
|
55
56
|
custom_global_ident_names: None,
|
|
56
|
-
runtime_pkg: "
|
|
57
|
+
runtime_pkg: "@lynx-js/react/internal".into(),
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
}
|
|
@@ -66,8 +67,9 @@ pub struct WorkletVisitor {
|
|
|
66
67
|
named_imports: HashSet<String>,
|
|
67
68
|
hasher: WorkletHash,
|
|
68
69
|
shared_identifiers: FxHashSet<Id>,
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
requires_main_thread_runtime: bool,
|
|
71
|
+
register_worklet: Ident,
|
|
72
|
+
main_thread_programmability: Option<Rc<Cell<bool>>>,
|
|
71
73
|
defines_collector: Option<DefinesCollector>,
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -121,7 +123,8 @@ impl VisitMut for WorkletVisitor {
|
|
|
121
123
|
&mut collector,
|
|
122
124
|
false,
|
|
123
125
|
&mut self.named_imports,
|
|
124
|
-
self.
|
|
126
|
+
&mut self.requires_main_thread_runtime,
|
|
127
|
+
&self.register_worklet,
|
|
125
128
|
collect_main_thread,
|
|
126
129
|
);
|
|
127
130
|
|
|
@@ -220,7 +223,8 @@ impl VisitMut for WorkletVisitor {
|
|
|
220
223
|
&mut collector,
|
|
221
224
|
true,
|
|
222
225
|
&mut self.named_imports,
|
|
223
|
-
self.
|
|
226
|
+
&mut self.requires_main_thread_runtime,
|
|
227
|
+
&self.register_worklet,
|
|
224
228
|
collect_main_thread,
|
|
225
229
|
);
|
|
226
230
|
|
|
@@ -355,7 +359,8 @@ impl VisitMut for WorkletVisitor {
|
|
|
355
359
|
&mut collector,
|
|
356
360
|
true,
|
|
357
361
|
&mut self.named_imports,
|
|
358
|
-
self.
|
|
362
|
+
&mut self.requires_main_thread_runtime,
|
|
363
|
+
&self.register_worklet,
|
|
359
364
|
collect_main_thread,
|
|
360
365
|
);
|
|
361
366
|
|
|
@@ -444,7 +449,8 @@ impl VisitMut for WorkletVisitor {
|
|
|
444
449
|
&mut collector,
|
|
445
450
|
false,
|
|
446
451
|
&mut self.named_imports,
|
|
447
|
-
self.
|
|
452
|
+
&mut self.requires_main_thread_runtime,
|
|
453
|
+
&self.register_worklet,
|
|
448
454
|
collect_main_thread,
|
|
449
455
|
);
|
|
450
456
|
|
|
@@ -530,7 +536,8 @@ impl VisitMut for WorkletVisitor {
|
|
|
530
536
|
&mut collector,
|
|
531
537
|
false,
|
|
532
538
|
&mut self.named_imports,
|
|
533
|
-
self.
|
|
539
|
+
&mut self.requires_main_thread_runtime,
|
|
540
|
+
&self.register_worklet,
|
|
534
541
|
collect_main_thread,
|
|
535
542
|
);
|
|
536
543
|
|
|
@@ -572,7 +579,8 @@ impl VisitMut for WorkletVisitor {
|
|
|
572
579
|
&mut collector,
|
|
573
580
|
false,
|
|
574
581
|
&mut self.named_imports,
|
|
575
|
-
self.
|
|
582
|
+
&mut self.requires_main_thread_runtime,
|
|
583
|
+
&self.register_worklet,
|
|
576
584
|
collect_main_thread,
|
|
577
585
|
);
|
|
578
586
|
|
|
@@ -659,7 +667,8 @@ impl VisitMut for WorkletVisitor {
|
|
|
659
667
|
&mut collector,
|
|
660
668
|
false,
|
|
661
669
|
&mut self.named_imports,
|
|
662
|
-
self.
|
|
670
|
+
&mut self.requires_main_thread_runtime,
|
|
671
|
+
&self.register_worklet,
|
|
663
672
|
collect_main_thread,
|
|
664
673
|
);
|
|
665
674
|
|
|
@@ -682,7 +691,7 @@ impl VisitMut for WorkletVisitor {
|
|
|
682
691
|
}
|
|
683
692
|
|
|
684
693
|
fn visit_mut_module(&mut self, n: &mut Module) {
|
|
685
|
-
// First process imports to detect shared-runtime modules
|
|
694
|
+
// First process imports to detect shared-runtime modules.
|
|
686
695
|
for item in &n.body {
|
|
687
696
|
if let ModuleItem::ModuleDecl(ModuleDecl::Import(import_decl)) = item {
|
|
688
697
|
if is_shared_runtime_import(import_decl) {
|
|
@@ -707,87 +716,89 @@ impl VisitMut for WorkletVisitor {
|
|
|
707
716
|
|
|
708
717
|
n.visit_mut_children_with(self);
|
|
709
718
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
quote!("const $loaded = loadWorkletRuntime(typeof globDynamicComponentEntry === 'undefined' ? undefined : globDynamicComponentEntry)" as Stmt, loaded = self.worklet_runtime_loaded_ident.clone()),
|
|
715
|
-
);
|
|
716
|
-
self.worklet_runtime_loaded = true;
|
|
719
|
+
if self.requires_main_thread_runtime {
|
|
720
|
+
if let Some(result) = &self.main_thread_programmability {
|
|
721
|
+
result.set(true);
|
|
722
|
+
}
|
|
717
723
|
}
|
|
718
724
|
|
|
719
725
|
let mut specifiers = self.named_imports.iter().collect::<Vec<_>>();
|
|
726
|
+
let mut prepended_items = vec![];
|
|
727
|
+
|
|
728
|
+
if self.requires_main_thread_runtime {
|
|
729
|
+
// The generated call and its import share an SWC binding, so hygiene
|
|
730
|
+
// keeps authored names and compiler-owned registrations independent.
|
|
731
|
+
prepended_items.push(self.registration_import());
|
|
732
|
+
}
|
|
720
733
|
|
|
721
734
|
if !specifiers.is_empty() {
|
|
722
735
|
// Sort to keep the output consistent
|
|
723
736
|
specifiers.sort();
|
|
724
737
|
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
.iter()
|
|
733
|
-
.map(|imported| {
|
|
734
|
-
ImportSpecifier::Named(ImportNamedSpecifier {
|
|
735
|
-
span: DUMMY_SP,
|
|
736
|
-
is_type_only: false,
|
|
737
|
-
local: Ident {
|
|
738
|
-
ctxt: Default::default(),
|
|
739
|
-
span: DUMMY_SP,
|
|
740
|
-
sym: format!("__{imported}").into(),
|
|
741
|
-
optional: false,
|
|
742
|
-
},
|
|
743
|
-
imported: Some(ModuleExportName::Ident(Ident {
|
|
744
|
-
ctxt: Default::default(),
|
|
745
|
-
span: DUMMY_SP,
|
|
746
|
-
sym: imported.as_str().into(),
|
|
747
|
-
optional: false,
|
|
748
|
-
})),
|
|
749
|
-
})
|
|
750
|
-
})
|
|
751
|
-
.collect::<Vec<_>>(),
|
|
752
|
-
src: Box::new(Str {
|
|
738
|
+
prepended_items.push(ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
|
|
739
|
+
span: DUMMY_SP,
|
|
740
|
+
phase: ImportPhase::Evaluation,
|
|
741
|
+
specifiers: specifiers
|
|
742
|
+
.iter()
|
|
743
|
+
.map(|imported| {
|
|
744
|
+
ImportSpecifier::Named(ImportNamedSpecifier {
|
|
753
745
|
span: DUMMY_SP,
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
746
|
+
is_type_only: false,
|
|
747
|
+
local: Ident {
|
|
748
|
+
ctxt: Default::default(),
|
|
749
|
+
span: DUMMY_SP,
|
|
750
|
+
sym: format!("__{imported}").into(),
|
|
751
|
+
optional: false,
|
|
752
|
+
},
|
|
753
|
+
imported: Some(ModuleExportName::Ident(Ident {
|
|
754
|
+
ctxt: Default::default(),
|
|
755
|
+
span: DUMMY_SP,
|
|
756
|
+
sym: imported.as_str().into(),
|
|
757
|
+
optional: false,
|
|
758
|
+
})),
|
|
759
|
+
})
|
|
760
|
+
})
|
|
761
|
+
.collect::<Vec<_>>(),
|
|
762
|
+
src: Box::new(Str {
|
|
763
|
+
span: DUMMY_SP,
|
|
764
|
+
raw: None,
|
|
765
|
+
value: self.cfg.runtime_pkg.clone().into(),
|
|
766
|
+
}),
|
|
767
|
+
type_only: Default::default(),
|
|
768
|
+
with: Default::default(),
|
|
769
|
+
})));
|
|
770
|
+
prepended_items.push(ModuleItem::Stmt(Stmt::Decl(Decl::Var(Box::new(VarDecl {
|
|
771
|
+
ctxt: Default::default(),
|
|
772
|
+
span: DUMMY_SP,
|
|
773
|
+
kind: VarDeclKind::Var,
|
|
774
|
+
declare: false,
|
|
775
|
+
decls: specifiers
|
|
776
|
+
.into_iter()
|
|
777
|
+
.map(|name| VarDeclarator {
|
|
762
778
|
span: DUMMY_SP,
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
.into_iter()
|
|
767
|
-
.map(|name| VarDeclarator {
|
|
779
|
+
name: Pat::Ident(
|
|
780
|
+
Ident {
|
|
781
|
+
ctxt: Default::default(),
|
|
768
782
|
span: DUMMY_SP,
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
]
|
|
789
|
-
.into_iter(),
|
|
790
|
-
);
|
|
783
|
+
sym: name.as_str().into(),
|
|
784
|
+
optional: false,
|
|
785
|
+
}
|
|
786
|
+
.into(),
|
|
787
|
+
),
|
|
788
|
+
init: Some(Box::new(Expr::Ident(Ident {
|
|
789
|
+
ctxt: Default::default(),
|
|
790
|
+
span: DUMMY_SP,
|
|
791
|
+
sym: format!("__{name}").into(),
|
|
792
|
+
optional: false,
|
|
793
|
+
}))),
|
|
794
|
+
definite: false,
|
|
795
|
+
})
|
|
796
|
+
.collect(),
|
|
797
|
+
})))));
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
if !prepended_items.is_empty() {
|
|
801
|
+
prepend_stmts(&mut n.body, prepended_items.into_iter());
|
|
791
802
|
}
|
|
792
803
|
// Add statements to insert at top level after processing all items
|
|
793
804
|
n.body.extend(
|
|
@@ -928,6 +939,11 @@ impl WorkletVisitor {
|
|
|
928
939
|
self
|
|
929
940
|
}
|
|
930
941
|
|
|
942
|
+
pub fn with_main_thread_programmability(mut self, result: Rc<Cell<bool>>) -> Self {
|
|
943
|
+
self.main_thread_programmability = Some(result);
|
|
944
|
+
self
|
|
945
|
+
}
|
|
946
|
+
|
|
931
947
|
pub fn new(mode: TransformMode, cfg: WorkletVisitorConfig) -> Self {
|
|
932
948
|
WorkletVisitor {
|
|
933
949
|
mode,
|
|
@@ -937,8 +953,9 @@ impl WorkletVisitor {
|
|
|
937
953
|
hasher: WorkletHash::new(),
|
|
938
954
|
named_imports: HashSet::default(),
|
|
939
955
|
shared_identifiers: FxHashSet::default(),
|
|
940
|
-
|
|
941
|
-
|
|
956
|
+
requires_main_thread_runtime: false,
|
|
957
|
+
register_worklet: private_ident!("__registerWorklet"),
|
|
958
|
+
main_thread_programmability: None,
|
|
942
959
|
defines_collector: None,
|
|
943
960
|
}
|
|
944
961
|
}
|
|
@@ -948,6 +965,36 @@ impl WorkletVisitor {
|
|
|
948
965
|
self
|
|
949
966
|
}
|
|
950
967
|
|
|
968
|
+
fn registration_import(&self) -> ModuleItem {
|
|
969
|
+
let runtime_pkg = self
|
|
970
|
+
.cfg
|
|
971
|
+
.runtime_pkg
|
|
972
|
+
.strip_suffix("/internal")
|
|
973
|
+
// A scoped package named `internal` is a package root, not an entry.
|
|
974
|
+
.filter(|pkg| !pkg.starts_with('@') || pkg.contains('/'))
|
|
975
|
+
.unwrap_or(&self.cfg.runtime_pkg);
|
|
976
|
+
ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
|
|
977
|
+
span: DUMMY_SP,
|
|
978
|
+
phase: ImportPhase::Evaluation,
|
|
979
|
+
specifiers: vec![ImportSpecifier::Named(ImportNamedSpecifier {
|
|
980
|
+
span: DUMMY_SP,
|
|
981
|
+
is_type_only: false,
|
|
982
|
+
local: self.register_worklet.clone(),
|
|
983
|
+
imported: Some(ModuleExportName::Ident(Ident::new_no_ctxt(
|
|
984
|
+
"registerWorklet".into(),
|
|
985
|
+
DUMMY_SP,
|
|
986
|
+
))),
|
|
987
|
+
})],
|
|
988
|
+
src: Box::new(Str {
|
|
989
|
+
span: DUMMY_SP,
|
|
990
|
+
raw: None,
|
|
991
|
+
value: format!("{runtime_pkg}/worklet-runtime/init").into(),
|
|
992
|
+
}),
|
|
993
|
+
type_only: false,
|
|
994
|
+
with: None,
|
|
995
|
+
}))
|
|
996
|
+
}
|
|
997
|
+
|
|
951
998
|
fn collect_worklet_define(
|
|
952
999
|
&mut self,
|
|
953
1000
|
hash: Option<String>,
|
|
@@ -961,15 +1008,11 @@ impl WorkletVisitor {
|
|
|
961
1008
|
collect_unmergeable_define(&self.defines_collector, DefineKind::Worklet, hash);
|
|
962
1009
|
return;
|
|
963
1010
|
}
|
|
964
|
-
let guard = quote!(
|
|
965
|
-
"const $loaded = loadWorkletRuntime(typeof globDynamicComponentEntry === 'undefined' ? undefined : globDynamicComponentEntry)" as Stmt,
|
|
966
|
-
loaded = self.worklet_runtime_loaded_ident.clone(),
|
|
967
|
-
);
|
|
968
1011
|
collect_define(
|
|
969
1012
|
&self.defines_collector,
|
|
970
1013
|
DefineKind::Worklet,
|
|
971
1014
|
hash,
|
|
972
|
-
vec![
|
|
1015
|
+
vec![self.registration_import(), ModuleItem::Stmt(stmt)],
|
|
973
1016
|
);
|
|
974
1017
|
}
|
|
975
1018
|
|
|
@@ -3272,63 +3315,4 @@ class App extends Component {
|
|
|
3272
3315
|
}
|
|
3273
3316
|
"#
|
|
3274
3317
|
);
|
|
3275
|
-
|
|
3276
|
-
test!(
|
|
3277
|
-
module,
|
|
3278
|
-
Syntax::Typescript(TsSyntax {
|
|
3279
|
-
..Default::default()
|
|
3280
|
-
}),
|
|
3281
|
-
|_| (
|
|
3282
|
-
resolver(Mark::new(), Mark::new(), true),
|
|
3283
|
-
visit_mut_pass(WorkletVisitor::new(
|
|
3284
|
-
TransformMode::Test,
|
|
3285
|
-
WorkletVisitorConfig {
|
|
3286
|
-
filename: "index.ts".into(),
|
|
3287
|
-
target: TransformTarget::LEPUS,
|
|
3288
|
-
custom_global_ident_names: None,
|
|
3289
|
-
runtime_pkg: "@lynx-js/react".into(),
|
|
3290
|
-
}
|
|
3291
|
-
)),
|
|
3292
|
-
hygiene()
|
|
3293
|
-
),
|
|
3294
|
-
should_add_worklet_runtime_ident_with_outer_ident,
|
|
3295
|
-
r#"
|
|
3296
|
-
const __workletRuntimeLoaded = false;
|
|
3297
|
-
console.log(__workletRuntimeLoaded);
|
|
3298
|
-
|
|
3299
|
-
function foo() {
|
|
3300
|
-
"main thread";
|
|
3301
|
-
return 1;
|
|
3302
|
-
}
|
|
3303
|
-
"#
|
|
3304
|
-
);
|
|
3305
|
-
|
|
3306
|
-
test!(
|
|
3307
|
-
module,
|
|
3308
|
-
Syntax::Typescript(TsSyntax {
|
|
3309
|
-
..Default::default()
|
|
3310
|
-
}),
|
|
3311
|
-
|_| (
|
|
3312
|
-
resolver(Mark::new(), Mark::new(), true),
|
|
3313
|
-
visit_mut_pass(WorkletVisitor::new(
|
|
3314
|
-
TransformMode::Test,
|
|
3315
|
-
WorkletVisitorConfig {
|
|
3316
|
-
filename: "index.ts".into(),
|
|
3317
|
-
target: TransformTarget::LEPUS,
|
|
3318
|
-
custom_global_ident_names: None,
|
|
3319
|
-
runtime_pkg: "@lynx-js/react".into(),
|
|
3320
|
-
}
|
|
3321
|
-
)),
|
|
3322
|
-
hygiene()
|
|
3323
|
-
),
|
|
3324
|
-
should_add_worklet_runtime_ident_with_inner_ident,
|
|
3325
|
-
r#"
|
|
3326
|
-
function foo() {
|
|
3327
|
-
"main thread";
|
|
3328
|
-
const __workletRuntimeLoaded = false;
|
|
3329
|
-
console.log(__workletRuntimeLoaded);
|
|
3330
|
-
return 1;
|
|
3331
|
-
}
|
|
3332
|
-
"#
|
|
3333
|
-
);
|
|
3334
3318
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
use napi_derive::napi;
|
|
2
|
+
use std::cell::Cell;
|
|
3
|
+
use std::rc::Rc;
|
|
2
4
|
|
|
3
5
|
use swc_core::ecma::ast::*;
|
|
4
6
|
use swc_core::ecma::visit::{noop_visit_mut_type, VisitMut};
|
|
@@ -23,6 +25,8 @@ pub struct WorkletVisitorConfig {
|
|
|
23
25
|
/// @internal
|
|
24
26
|
#[napi(ts_type = "'LEPUS' | 'JS' | 'MIXED'")]
|
|
25
27
|
pub target: TransformTarget,
|
|
28
|
+
/// Module providing worklet helpers. The init entry uses this path with a
|
|
29
|
+
/// trailing `/internal` removed, followed by `/worklet-runtime/init`.
|
|
26
30
|
pub runtime_pkg: String,
|
|
27
31
|
}
|
|
28
32
|
|
|
@@ -32,7 +36,7 @@ impl Default for WorkletVisitorConfig {
|
|
|
32
36
|
filename: "index.js".into(),
|
|
33
37
|
target: TransformTarget::LEPUS,
|
|
34
38
|
custom_global_ident_names: None,
|
|
35
|
-
runtime_pkg: "
|
|
39
|
+
runtime_pkg: "@lynx-js/react/internal".into(),
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
}
|
|
@@ -103,6 +107,11 @@ impl WorkletVisitor {
|
|
|
103
107
|
self
|
|
104
108
|
}
|
|
105
109
|
|
|
110
|
+
pub fn with_main_thread_programmability(mut self, result: Rc<Cell<bool>>) -> Self {
|
|
111
|
+
self.inner = self.inner.with_main_thread_programmability(result);
|
|
112
|
+
self
|
|
113
|
+
}
|
|
114
|
+
|
|
106
115
|
pub fn with_defines_collector(mut self, collector: DefinesCollector) -> Self {
|
|
107
116
|
self.inner.defines_collector = Some(collector);
|
|
108
117
|
self
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
2
|
+
import { captureMainThreadObject as __captureMainThreadObject } from "@lynx-js/react";
|
|
3
|
+
var captureMainThreadObject = __captureMainThreadObject;
|
|
3
4
|
let Y = {
|
|
4
5
|
_c: {
|
|
5
6
|
y1,
|
|
@@ -17,8 +18,7 @@ let Y = {
|
|
|
17
18
|
},
|
|
18
19
|
_wkltId: "a77b:test:1"
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a77b:test:1", function() {
|
|
21
|
+
__registerWorklet("main-thread", "a77b:test:1", function() {
|
|
22
22
|
const Y = lynxWorkletImpl._workletMap["a77b:test:1"].bind(this);
|
|
23
23
|
let { y1, y2, y3, y4, y5, props } = this["_c"];
|
|
24
24
|
"main thread";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var loadWorkletRuntime = __loadWorkletRuntime;
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
3
2
|
const callback = ()=>{};
|
|
4
3
|
const valueType = defineMainThreadObjectType({
|
|
5
4
|
type: '@test/capturing-value',
|
|
@@ -29,13 +28,12 @@ const valueType = defineMainThreadObjectType({
|
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
});
|
|
32
|
-
|
|
33
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a77b:test:1", function() {
|
|
31
|
+
__registerWorklet("main-thread", "a77b:test:1", function() {
|
|
34
32
|
let { _jsFn1 } = this["_jsFn"];
|
|
35
33
|
"main thread";
|
|
36
34
|
runOnBackground(_jsFn1)();
|
|
37
35
|
});
|
|
38
|
-
|
|
36
|
+
__registerWorklet("main-thread", "a77b:test:2", function(initialValue: number) {
|
|
39
37
|
let { _jsFn1 } = this["_jsFn"];
|
|
40
38
|
"main thread";
|
|
41
39
|
runOnBackground(_jsFn1)();
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var loadWorkletRuntime = __loadWorkletRuntime;
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
3
2
|
let onTapLepus = {
|
|
4
3
|
_wkltId: "a123:test:1",
|
|
5
4
|
...{
|
|
6
5
|
a: this.a
|
|
7
6
|
}
|
|
8
7
|
};
|
|
9
|
-
|
|
10
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a123:test:1", function(event: ReactLynx.Worklet.ITouchEvent) {
|
|
8
|
+
__registerWorklet("main-thread", "a123:test:1", function(event: ReactLynx.Worklet.ITouchEvent) {
|
|
11
9
|
const onTapLepus = lynxWorkletImpl._workletMap["a123:test:1"].bind(this);
|
|
12
10
|
"main thread";
|
|
13
11
|
let a = 1;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
2
|
+
import { captureMainThreadObject as __captureMainThreadObject } from "@lynx-js/react";
|
|
3
|
+
var captureMainThreadObject = __captureMainThreadObject;
|
|
3
4
|
let onTapLepus = {
|
|
4
5
|
_c: {
|
|
5
6
|
aaaa,
|
|
@@ -29,8 +30,7 @@ let onTapLepus = {
|
|
|
29
30
|
})(this.mmmm)
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
|
-
|
|
33
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a123:test:1", function() {
|
|
33
|
+
__registerWorklet("main-thread", "a123:test:1", function() {
|
|
34
34
|
const onTapLepus = lynxWorkletImpl._workletMap["a123:test:1"].bind(this);
|
|
35
35
|
let { aaaa, bbbb, eeee, ffff } = this["_c"];
|
|
36
36
|
"main thread";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var loadWorkletRuntime = __loadWorkletRuntime;
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
3
2
|
let enableScroll = {
|
|
4
3
|
_c: {
|
|
5
4
|
containerID,
|
|
@@ -12,8 +11,7 @@ let enableScroll = {
|
|
|
12
11
|
let makeVelocityIfRequired = {
|
|
13
12
|
_wkltId: "a123:test:2"
|
|
14
13
|
};
|
|
15
|
-
|
|
16
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a123:test:1", function(enable: boolean) {
|
|
14
|
+
__registerWorklet("main-thread", "a123:test:1", function(enable: boolean) {
|
|
17
15
|
const enableScroll = lynxWorkletImpl._workletMap["a123:test:1"].bind(this);
|
|
18
16
|
let { containerID, a, b, f } = this["_c"];
|
|
19
17
|
'main thread';
|
|
@@ -23,7 +21,7 @@ __workletRuntimeLoaded && registerWorkletInternal("main-thread", "a123:test:1",
|
|
|
23
21
|
e: f
|
|
24
22
|
}).e;
|
|
25
23
|
});
|
|
26
|
-
|
|
24
|
+
__registerWorklet("main-thread", "a123:test:2", function(nodeRef: MainThreadRef<Velocity>, velocity: boolean) {
|
|
27
25
|
const makeVelocityIfRequired = lynxWorkletImpl._workletMap["a123:test:2"].bind(this);
|
|
28
26
|
'main thread';
|
|
29
27
|
class Velocity implements Velocity {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var loadWorkletRuntime = __loadWorkletRuntime;
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
3
2
|
let enableScroll = {
|
|
4
3
|
_wkltId: "a123:test:1"
|
|
5
4
|
};
|
|
6
|
-
|
|
7
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a123:test:1", function(enable: boolean) {
|
|
5
|
+
__registerWorklet("main-thread", "a123:test:1", function(enable: boolean) {
|
|
8
6
|
const enableScroll = lynxWorkletImpl._workletMap["a123:test:1"].bind(this);
|
|
9
7
|
'main thread';
|
|
10
8
|
function x() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
2
|
+
import { captureMainThreadObject as __captureMainThreadObject } from "@lynx-js/react";
|
|
3
|
+
var captureMainThreadObject = __captureMainThreadObject;
|
|
3
4
|
let onTapLepus = {
|
|
4
5
|
_c: {
|
|
5
6
|
aaaa: captureMainThreadObject(aaaa) ?? {
|
|
@@ -23,8 +24,7 @@ let onTapLepus = {
|
|
|
23
24
|
},
|
|
24
25
|
_wkltId: "a123:test:1"
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a123:test:1", function() {
|
|
27
|
+
__registerWorklet("main-thread", "a123:test:1", function() {
|
|
28
28
|
const onTapLepus = lynxWorkletImpl._workletMap["a123:test:1"].bind(this);
|
|
29
29
|
let { aaaa, cccc, hhhh, llll, oooo, rrrr, uuuu } = this["_c"];
|
|
30
30
|
"main thread";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var loadWorkletRuntime = __loadWorkletRuntime;
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
3
2
|
const name = 'create';
|
|
4
3
|
const nestedName = 'read';
|
|
5
4
|
const valueType = defineMainThreadObjectType({
|
|
@@ -11,8 +10,7 @@ const valueType = defineMainThreadObjectType({
|
|
|
11
10
|
_wkltId: "a77b:test:1"
|
|
12
11
|
}
|
|
13
12
|
});
|
|
14
|
-
|
|
15
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a77b:test:1", function(initialValue) {
|
|
13
|
+
__registerWorklet("main-thread", "a77b:test:1", function(initialValue) {
|
|
16
14
|
let { nestedName } = this["_c"];
|
|
17
15
|
"main thread";
|
|
18
16
|
return {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var loadWorkletRuntime = __loadWorkletRuntime;
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
3
2
|
let Y = {
|
|
4
3
|
_wkltId: "a77b:test:1"
|
|
5
4
|
};
|
|
6
|
-
|
|
7
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a77b:test:1", function() {
|
|
5
|
+
__registerWorklet("main-thread", "a77b:test:1", function() {
|
|
8
6
|
const Y = lynxWorkletImpl._workletMap["a77b:test:1"].bind(this);
|
|
9
7
|
"main thread";
|
|
10
8
|
console.log(111);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var loadWorkletRuntime = __loadWorkletRuntime;
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
3
2
|
const valueType = defineMainThreadObjectType({
|
|
4
3
|
type: '@test/value',
|
|
5
4
|
create: {
|
|
6
5
|
_wkltId: "a77b:test:1"
|
|
7
6
|
}
|
|
8
7
|
});
|
|
9
|
-
|
|
10
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a77b:test:1", function(initialValue) {
|
|
8
|
+
__registerWorklet("main-thread", "a77b:test:1", function(initialValue) {
|
|
11
9
|
"main thread";
|
|
12
10
|
const state = {
|
|
13
11
|
value: initialValue
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var loadWorkletRuntime = __loadWorkletRuntime;
|
|
1
|
+
import { registerWorklet as __registerWorklet } from "@lynx-js/react/worklet-runtime/init";
|
|
3
2
|
let onTapLepus = {
|
|
4
3
|
_c: {
|
|
5
4
|
wv
|
|
6
5
|
},
|
|
7
6
|
_wkltId: "a123:test:1"
|
|
8
7
|
};
|
|
9
|
-
|
|
10
|
-
__workletRuntimeLoaded && registerWorkletInternal("main-thread", "a123:test:1", function(event: ReactLynx.Worklet.ITouchEvent) {
|
|
8
|
+
__registerWorklet("main-thread", "a123:test:1", function(event: ReactLynx.Worklet.ITouchEvent) {
|
|
11
9
|
const onTapLepus = lynxWorkletImpl._workletMap["a123:test:1"].bind(this);
|
|
12
10
|
let { wv } = this["_c"];
|
|
13
11
|
"main thread";
|