@lynx-js/react 0.126.1 → 0.127.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 +40 -0
- package/components/tsconfig.tsbuildinfo +1 -1
- package/docs/directives.md +90 -0
- package/docs/global-events.md +50 -0
- package/docs/import-attributes.md +43 -0
- package/docs/macros.md +285 -0
- package/package.json +4 -3
- package/refresh/.turbo/turbo-build.log +4 -4
- package/refresh/dist/index.js +27 -8
- package/refresh/package.json +2 -2
- package/runtime/__test__/core/main-thread-object.test.js +149 -0
- package/runtime/__test__/element-template/debug/profile-installation.test.tsx +97 -1
- package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/children.non-string-raw-text-key-on-main/output.txt +1 -1
- package/runtime/__test__/element-template/fixtures/background/main-thread-function/run-on-main-thread/index.tsx +26 -3
- package/runtime/__test__/element-template/fixtures/render/child-siblings/index.js.txt +15 -11
- package/runtime/__test__/element-template/fixtures/render/component/index.js.txt +8 -7
- package/runtime/__test__/element-template/fixtures/render/component-slot-content/index.js.txt +14 -10
- package/runtime/__test__/element-template/fixtures/render/css-scope-dynamic-bundle-url/index.js.txt +4 -3
- package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/_shared.ts +2 -9
- package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/appends-root-text-via-append-element/case.ts +2 -4
- package/runtime/__test__/element-template/fixtures/render/direct-native/creates-template-from-attrs-and-slot-text/case.ts +20 -0
- package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/handles-multiple-template-children-in-the-same-slot/case.ts +3 -16
- package/runtime/__test__/element-template/fixtures/render/direct-native/handles-multiple-text-nodes-in-the-same-slot/case.ts +18 -0
- package/runtime/__test__/element-template/fixtures/render/direct-native/inserts-nested-templates-into-parent-slots/case.ts +20 -0
- package/runtime/__test__/element-template/fixtures/render/direct-native/keeps-slot-children-separated-and-ordered/case.ts +18 -0
- package/runtime/__test__/element-template/fixtures/render/direct-native/passes-bundle-url-to-native-create/case.ts +15 -0
- package/runtime/__test__/element-template/fixtures/render/mapped-view-children/index.js.txt +12 -11
- package/runtime/__test__/element-template/fixtures/render/mixed-children/index.js.txt +8 -7
- package/runtime/__test__/element-template/fixtures/render/multiple-text/index.js.txt +15 -13
- package/runtime/__test__/element-template/fixtures/render/nested-templates/index.js.txt +9 -7
- package/runtime/__test__/element-template/fixtures/render/react-example/index.js.txt +17 -20
- package/runtime/__test__/element-template/fixtures/render/sparse-element-slot/index.js.txt +13 -10
- package/runtime/__test__/element-template/fixtures/render/template-dedupe/index.js.txt +14 -11
- package/runtime/__test__/element-template/imports/main-thread-object-api.test.ts +10 -0
- package/runtime/__test__/element-template/imports/suspense-lazy.test.ts +52 -7
- package/runtime/__test__/element-template/internal/legacy-internal-guardrail.test.ts +3 -0
- package/runtime/__test__/element-template/native/reload.test.ts +10 -26
- package/runtime/__test__/element-template/runtime/background/component-stack.test.tsx +76 -0
- package/runtime/__test__/element-template/runtime/background/hydrate.test.ts +87 -43
- package/runtime/__test__/element-template/runtime/background/instance.test.ts +14 -0
- package/runtime/__test__/element-template/runtime/background/main-thread-function/compiled-fixtures.test.tsx +4 -0
- package/runtime/__test__/element-template/runtime/render/compact-host-debug.test.ts +57 -0
- package/runtime/__test__/element-template/runtime/render/compact-host.test.ts +199 -0
- package/runtime/__test__/element-template/runtime/render/render-components.test.jsx +292 -0
- package/runtime/__test__/element-template/runtime/render/{render-opcodes-into-element-template.et.test.tsx → render-direct-native.test.tsx} +50 -314
- package/runtime/__test__/element-template/runtime/render/render-direct-suspense.test.ts +378 -0
- package/runtime/__test__/element-template/runtime/render/render-direct.test.ts +491 -0
- package/runtime/__test__/element-template/runtime/render/render-main-thread.contract.test.ts +2 -28
- package/runtime/__test__/element-template/runtime/render/render-main-thread.test.ts +21 -35
- package/runtime/__test__/element-template/runtime/render/render-transform.contract.test.ts +6 -5
- package/runtime/__test__/element-template/test-utils/debug/renderFixtureRunner.ts +4 -4
- package/runtime/__test__/element-template/vitest.config.ts +2 -1
- package/runtime/__test__/snapshot/ctxNotFound.test.ts +271 -0
- package/runtime/__test__/snapshot/debug/main-thread-children-with-same-key.test.ts +28 -0
- package/runtime/__test__/snapshot/debug/profile.test.jsx +108 -3
- package/runtime/__test__/snapshot/event.test.jsx +7 -7
- package/runtime/__test__/snapshot/lazy.test.js +114 -7
- package/runtime/__test__/snapshot/lifecycle/reloadGc.test.jsx +66 -0
- package/runtime/__test__/snapshot/lynx/portals.test.jsx +75 -37
- package/runtime/__test__/snapshot/lynx/runtime-version.test.ts +140 -0
- package/runtime/__test__/snapshot/snapshotPatch.test.jsx +59 -47
- package/runtime/__test__/snapshot/spread.test.jsx +32 -25
- package/runtime/__test__/snapshot/ssr.legacy-slot.test.jsx +168 -0
- package/runtime/__test__/snapshot/ssr.list.test.jsx +211 -0
- package/runtime/__test__/snapshot/worklet/main-thread-object.test.jsx +306 -0
- package/runtime/__test__/snapshot/worklet/workletRef.test.jsx +1 -0
- package/runtime/__test__/worklet-runtime/hydrate.test.js +92 -0
- package/runtime/__test__/worklet-runtime/mainThreadObject.test.js +182 -0
- package/runtime/__test__/worklet-runtime/object-methods.test.js +60 -0
- package/runtime/__test__/worklet-runtime/runOnBackground.test.js +8 -6
- package/runtime/__test__/worklet-runtime/workletRef.test.js +362 -2
- package/runtime/__test__/worklet-runtime/workletRuntime.test.js +249 -3
- package/runtime/lazy/compat.js +2 -0
- package/runtime/lazy/element-template-import.js +0 -4
- package/runtime/lazy/element-template-internal.js +19 -8
- package/runtime/lazy/element-template-jsx-dev-runtime.js +1 -8
- package/runtime/lazy/element-template-jsx-runtime.js +1 -3
- package/runtime/lazy/element-template.js +3 -3
- package/runtime/lazy/import.js +0 -4
- package/runtime/lazy/internal.js +17 -1
- package/runtime/lazy/react.js +2 -0
- package/runtime/lazy/target.js +0 -21
- package/runtime/lib/core/background-function/run-on-background.d.ts +16 -0
- package/runtime/lib/core/background-function/run-on-background.js +16 -0
- package/runtime/lib/core/background-function/run-on-background.js.map +1 -1
- package/runtime/lib/core/capture-main-thread-object.js +16 -0
- package/runtime/lib/core/capture-main-thread-object.js.map +1 -0
- package/runtime/lib/core/globalProps.d.ts +2 -0
- package/runtime/lib/core/globalProps.js.map +1 -1
- package/runtime/lib/core/hooks/react.d.ts +6 -0
- package/runtime/lib/core/hooks/react.js +6 -0
- package/runtime/lib/core/hooks/react.js.map +1 -1
- package/runtime/lib/core/hooks/useLynxGlobalEventListener.d.ts +2 -0
- package/runtime/lib/core/hooks/useLynxGlobalEventListener.js +2 -0
- package/runtime/lib/core/hooks/useLynxGlobalEventListener.js.map +1 -1
- package/runtime/lib/core/initData.d.ts +2 -0
- package/runtime/lib/core/initData.js +2 -0
- package/runtime/lib/core/initData.js.map +1 -1
- package/runtime/lib/core/lynx/runtime-version.d.ts +16 -0
- package/runtime/lib/core/lynx/runtime-version.js +51 -0
- package/runtime/lib/core/lynx/runtime-version.js.map +1 -0
- package/runtime/lib/core/main-thread-object-handle-registry.d.ts +3 -0
- package/runtime/lib/core/main-thread-object-handle-registry.js +17 -0
- package/runtime/lib/core/main-thread-object-handle-registry.js.map +1 -0
- package/runtime/lib/core/main-thread-object.d.ts +77 -0
- package/runtime/lib/core/main-thread-object.js +261 -0
- package/runtime/lib/core/main-thread-object.js.map +1 -0
- package/runtime/lib/core/main-thread-ref-id.js +14 -0
- package/runtime/lib/core/main-thread-ref-id.js.map +1 -0
- package/runtime/lib/core/main-thread-ref-init-value.d.ts +1 -1
- package/runtime/lib/core/main-thread-ref-init-value.js +4 -2
- package/runtime/lib/core/main-thread-ref-init-value.js.map +1 -1
- package/runtime/lib/core/main-thread-ref.d.ts +4 -0
- package/runtime/lib/core/main-thread-ref.js +5 -8
- package/runtime/lib/core/main-thread-ref.js.map +1 -1
- package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
- package/runtime/lib/element-template/background/document.d.ts +1 -1
- package/runtime/lib/element-template/background/document.js +1 -1
- package/runtime/lib/element-template/background/document.js.map +1 -1
- package/runtime/lib/element-template/background/hydrate.js +51 -19
- package/runtime/lib/element-template/background/hydrate.js.map +1 -1
- package/runtime/lib/element-template/background/instance.js +5 -6
- package/runtime/lib/element-template/background/instance.js.map +1 -1
- package/runtime/lib/element-template/debug/profile.js +38 -22
- package/runtime/lib/element-template/debug/profile.js.map +1 -1
- package/runtime/lib/element-template/index.d.ts +3 -1
- package/runtime/lib/element-template/index.js +2 -1
- package/runtime/lib/element-template/index.js.map +1 -1
- package/runtime/lib/element-template/internal.d.ts +5 -1
- package/runtime/lib/element-template/internal.js +7 -1
- package/runtime/lib/element-template/internal.js.map +1 -1
- package/runtime/lib/element-template/native/index.js +4 -0
- package/runtime/lib/element-template/native/index.js.map +1 -1
- package/runtime/lib/element-template/protocol/types.d.ts +1 -1
- package/runtime/lib/element-template/runtime/list/list.d.ts +1 -0
- package/runtime/lib/element-template/runtime/list/list.js +3 -0
- package/runtime/lib/element-template/runtime/list/list.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/create-rendered-host.d.ts +7 -0
- package/runtime/lib/element-template/runtime/render/create-rendered-host.js +65 -0
- package/runtime/lib/element-template/runtime/render/create-rendered-host.js.map +1 -0
- package/runtime/lib/element-template/runtime/render/host.d.ts +18 -0
- package/runtime/lib/element-template/runtime/render/host.js +25 -0
- package/runtime/lib/element-template/runtime/render/host.js.map +1 -0
- package/runtime/lib/element-template/runtime/render/render-components.d.ts +6 -0
- package/runtime/lib/element-template/runtime/render/render-components.js +190 -0
- package/runtime/lib/element-template/runtime/render/render-components.js.map +1 -0
- package/runtime/lib/element-template/runtime/render/{render-opcodes.d.ts → render-direct.d.ts} +3 -1
- package/runtime/lib/element-template/runtime/render/render-direct.js +194 -0
- package/runtime/lib/element-template/runtime/render/render-direct.js.map +1 -0
- package/runtime/lib/element-template/runtime/render/render-main-thread.js +10 -9
- package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/handle.d.ts +2 -1
- package/runtime/lib/element-template/runtime/template/handle.js +12 -4
- package/runtime/lib/element-template/runtime/template/handle.js.map +1 -1
- package/runtime/lib/element-template/runtime-marker.d.ts +1 -0
- package/runtime/lib/element-template/runtime-marker.js +13 -0
- package/runtime/lib/element-template/runtime-marker.js.map +1 -0
- package/runtime/lib/index.d.ts +1 -1
- package/runtime/lib/index.js +1 -1
- package/runtime/lib/index.js.map +1 -1
- package/runtime/lib/internal.d.ts +4 -1
- package/runtime/lib/internal.js +6 -1
- package/runtime/lib/internal.js.map +1 -1
- package/runtime/lib/lynx-api.d.ts +49 -6
- package/runtime/lib/lynx-api.js +34 -4
- package/runtime/lib/lynx-api.js.map +1 -1
- package/runtime/lib/lynx.js +4 -1
- package/runtime/lib/lynx.js.map +1 -1
- package/runtime/lib/runtime-marker.d.ts +1 -0
- package/runtime/lib/runtime-marker.js +13 -0
- package/runtime/lib/runtime-marker.js.map +1 -0
- package/runtime/lib/shared/component-stack.js +5 -1
- package/runtime/lib/shared/component-stack.js.map +1 -1
- package/runtime/lib/snapshot/debug/profileHooks.js +38 -22
- package/runtime/lib/snapshot/debug/profileHooks.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/error.d.ts +11 -1
- package/runtime/lib/snapshot/lifecycle/patch/error.js +24 -16
- package/runtime/lib/snapshot/lifecycle/patch/error.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.d.ts +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js +29 -7
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js +2 -2
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/reload.js +3 -0
- package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
- package/runtime/lib/snapshot/lynx/calledByNative.js +3 -0
- package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -1
- package/runtime/lib/snapshot/lynx/children.d.ts +2 -0
- package/runtime/lib/snapshot/lynx/children.js.map +1 -1
- package/runtime/lib/snapshot/lynx/element.d.ts +10 -0
- package/runtime/lib/snapshot/lynx/element.js +6 -0
- package/runtime/lib/snapshot/lynx/element.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/opcodes.js +2 -1
- package/runtime/lib/snapshot/renderToOpcodes/opcodes.js.map +1 -1
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.d.ts +2 -0
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.js +2 -0
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.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/worklet-runtime/bindings/bindings.d.ts +3 -3
- package/runtime/lib/worklet-runtime/bindings/bindings.js +9 -1
- package/runtime/lib/worklet-runtime/bindings/bindings.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/types.d.ts +3 -6
- package/runtime/lib/worklet-runtime/bindings/types.js.map +1 -1
- package/runtime/lib/worklet-runtime/hydrate.js +27 -8
- package/runtime/lib/worklet-runtime/hydrate.js.map +1 -1
- package/runtime/lib/worklet-runtime/mainThreadObject.d.ts +8 -0
- package/runtime/lib/worklet-runtime/mainThreadObject.js +67 -0
- package/runtime/lib/worklet-runtime/mainThreadObject.js.map +1 -0
- package/runtime/lib/worklet-runtime/workletRef.d.ts +11 -7
- package/runtime/lib/worklet-runtime/workletRef.js +72 -9
- package/runtime/lib/worklet-runtime/workletRef.js.map +1 -1
- package/runtime/lib/worklet-runtime/workletRuntime.js +69 -19
- package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
- package/runtime/package.json +2 -3
- package/runtime/src/core/background-function/run-on-background.ts +16 -0
- package/runtime/src/core/capture-main-thread-object.ts +17 -0
- package/runtime/src/core/globalProps.ts +2 -0
- package/runtime/src/core/hooks/react.ts +6 -0
- package/runtime/src/core/hooks/useLynxGlobalEventListener.ts +2 -0
- package/runtime/src/core/initData.ts +2 -0
- package/runtime/src/core/lynx/runtime-version.ts +62 -0
- package/runtime/src/core/main-thread-object-handle-registry.ts +25 -0
- package/runtime/src/core/main-thread-object.ts +387 -0
- package/runtime/src/core/main-thread-ref-id.ts +16 -0
- package/runtime/src/core/main-thread-ref-init-value.ts +12 -4
- package/runtime/src/core/main-thread-ref.ts +7 -8
- package/runtime/src/element-template/background/commit-hook.ts +1 -1
- package/runtime/src/element-template/background/document.ts +3 -3
- package/runtime/src/element-template/background/hydrate.ts +61 -29
- package/runtime/src/element-template/background/instance.ts +5 -6
- package/runtime/src/element-template/debug/profile.ts +48 -36
- package/runtime/src/element-template/index.ts +7 -1
- package/runtime/src/element-template/internal.ts +14 -1
- package/runtime/src/element-template/native/index.ts +4 -0
- package/runtime/src/element-template/protocol/types.ts +1 -1
- package/runtime/src/element-template/runtime/list/list.ts +4 -0
- package/runtime/src/element-template/runtime/render/create-rendered-host.ts +126 -0
- package/runtime/src/element-template/runtime/render/host.ts +51 -0
- package/runtime/src/element-template/runtime/render/render-components.ts +255 -0
- package/runtime/src/element-template/runtime/render/render-direct.ts +275 -0
- package/runtime/src/element-template/runtime/render/render-main-thread.ts +10 -9
- package/runtime/src/element-template/runtime/template/handle.ts +17 -7
- package/runtime/src/element-template/runtime-marker.ts +17 -0
- package/runtime/src/index.ts +1 -1
- package/runtime/src/internal.ts +11 -1
- package/runtime/src/lynx-api.ts +53 -6
- package/runtime/src/lynx.ts +5 -1
- package/runtime/src/runtime-marker.ts +17 -0
- package/runtime/src/shared/component-stack.ts +5 -1
- package/runtime/src/snapshot/debug/profileHooks.ts +52 -40
- package/runtime/src/snapshot/lifecycle/patch/error.ts +36 -19
- package/runtime/src/snapshot/lifecycle/patch/snapshotPatchApply.ts +29 -7
- package/runtime/src/snapshot/lifecycle/patch/updateMainThread.ts +2 -2
- package/runtime/src/snapshot/lifecycle/reload.ts +4 -0
- package/runtime/src/snapshot/lynx/calledByNative.ts +4 -0
- package/runtime/src/snapshot/lynx/children.ts +2 -0
- package/runtime/src/snapshot/lynx/element.ts +10 -0
- package/runtime/src/snapshot/renderToOpcodes/opcodes.ts +2 -1
- package/runtime/src/snapshot/worklet/call/runOnMainThread.ts +2 -0
- package/runtime/src/snapshot/worklet/ref/updateInitValue.ts +1 -1
- package/runtime/src/worklet-runtime/bindings/bindings.ts +17 -2
- package/runtime/src/worklet-runtime/bindings/types.ts +7 -11
- package/runtime/src/worklet-runtime/hydrate.ts +44 -11
- package/runtime/src/worklet-runtime/mainThreadObject.ts +117 -0
- package/runtime/src/worklet-runtime/workletRef.ts +120 -19
- package/runtime/src/worklet-runtime/workletRuntime.ts +84 -21
- package/runtime/types/types.d.ts +2 -0
- package/runtime/worklet-runtime/dev.js +155 -30
- package/runtime/worklet-runtime/main.js +1 -1
- package/testing-library/.turbo/turbo-build.log +12 -12
- package/testing-library/dist/env/index.js +2 -2
- package/testing-library/dist/index.d.ts +167 -4
- package/testing-library/dist/plugins/index.js +1 -1
- package/testing-library/dist/pure.js +45 -44
- package/testing-library/etc/react-lynx-testing-library.api.md +1 -1
- package/testing-library/package.json +4 -3
- package/testing-library/src/__tests__/lynx.test.jsx +1 -1
- package/testing-library/src/__tests__/reload/reloadGc.test.jsx +64 -0
- package/testing-library/src/__tests__/reload/reloadTemplate.js +39 -0
- package/testing-library/src/__tests__/worklet.test.jsx +46 -1
- package/testing-library/tsconfig.docs.json +9 -0
- package/testing-library/typedoc.json +22 -0
- package/testing-library/types/entry.d.ts +2 -2
- package/transform/.turbo/turbo-build$colon$wasm.log +151 -67
- package/transform/__test__/fixture.spec.js +89 -50
- package/transform/__test__/object-methods.spec.js +84 -0
- package/transform/__test__/text.spec.js +75 -0
- package/transform/crates/swc_plugin_compat/lib.rs +4 -3
- package/transform/crates/swc_plugin_compat/napi.rs +4 -3
- package/transform/crates/swc_plugin_define_dce/napi.rs +1 -1
- package/transform/crates/swc_plugin_dynamic_import/lib.rs +105 -3
- package/transform/crates/swc_plugin_dynamic_import/tests/__swc_snapshots__/lib.rs/should_suffix_webpack_chunk_name.js +5 -0
- package/transform/crates/swc_plugin_element_template/host_lowering.rs +111 -0
- package/transform/crates/swc_plugin_element_template/lib.rs +41 -5
- package/transform/crates/swc_plugin_element_template/lowering.rs +39 -7
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_generate_attribute_slots_for_dynamic_attributes.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_background_conditional_attributes.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_boolean_and_number_attributes.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_complex_text_structure.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_dataset_attributes.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_deeply_nested_user_components.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_dynamic_class_attributes.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_events_lepus.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_id_attributes.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_inline_styles.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_interpolated_text_with_siblings_lepus.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_mixed_content.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_nested_structure_and_dynamic_content.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_refs_lepus.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_sibling_user_components.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_spread_attributes.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_handle_user_component.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_isolate_arrays_with_child_slot_placeholder.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_keep_code_and_template_attribute_slots_in_sync_for_spread.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_output_element_template_simple_lepus.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_output_template_with_static_attributes.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_verify_template_structure_complex.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/__combined_snapshots__/should_verify_text_attribute_and_child_text_slots.snap +1 -1
- package/transform/crates/swc_plugin_element_template/tests/element_template.rs +70 -66
- package/transform/crates/swc_plugin_element_template/tests/element_template_contract.rs +94 -8
- package/transform/crates/swc_plugin_shake/lib.rs +1 -1
- package/transform/crates/swc_plugin_shake/napi.rs +1 -1
- package/transform/crates/swc_plugin_text/lib.rs +57 -16
- package/transform/crates/swc_plugin_text/tests/__swc_snapshots__/lib.rs/should_keep_children_for_dynamic_or_multiple_text.js +13 -0
- package/transform/crates/swc_plugin_text/tests/__swc_snapshots__/lib.rs/should_transform_string_expressions_to_text_attr.js +13 -0
- package/transform/crates/swc_plugin_worklet/decl_collect.rs +10 -0
- package/transform/crates/swc_plugin_worklet/extract_ident.rs +14 -0
- package/transform/crates/swc_plugin_worklet/gen_stmt.rs +202 -3
- package/transform/crates/swc_plugin_worklet/lib.rs +468 -3
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_capture_env_js.js +8 -1
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_capture_env_lepus.js +10 -5
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_expose_object_method_capture_channels_js.js +27 -0
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_expose_object_method_capture_channels_lepus.js +45 -0
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_2_js.js +16 -14
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_2_lepus.js +16 -16
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_js.js +7 -5
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_lepus.js +7 -7
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_not_capture_computed_object_method_key_lepus.js +24 -0
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_not_capture_object_method_local_decls_lepus.js +16 -0
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_preserve_main_thread_objects_in_class_js.js +42 -0
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_preserve_main_thread_objects_in_class_lepus.js +58 -0
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_js.js +3 -1
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_lepus.js +3 -3
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_object_methods_js.js +9 -0
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_object_methods_lepus.js +16 -0
- package/transform/crates/swc_plugins_shared/jsx_helpers.rs +8 -4
- package/transform/dist/wasm.cjs +1 -1
- package/transform/index.d.ts +7 -6
- package/transform/rspack-napi/tsconfig.tsbuildinfo +1 -1
- package/transform/src/swc_plugin_extract_str/mod.rs +1 -1
- package/transform/swc-plugin-reactlynx/.turbo/turbo-build.log +63 -270
- package/transform/swc-plugin-reactlynx/index.d.ts +2 -2
- package/transform/swc-plugin-reactlynx/swc_plugin_reactlynx.wasm +0 -0
- package/transform/swc-plugin-reactlynx-compat/.turbo/turbo-build.log +306 -170
- package/transform/swc-plugin-reactlynx-compat/index.d.ts +3 -3
- package/transform/swc-plugin-reactlynx-compat/swc_plugin_reactlynx_compat.wasm +0 -0
- package/transform/vitest.config.ts +5 -1
- package/types/react.docs.d.ts +130 -11
- package/runtime/__test__/element-template/fixtures/render/opcodes-into-element-template/creates-template-from-attrs-and-slot-text/case.ts +0 -39
- package/runtime/__test__/element-template/fixtures/render/opcodes-into-element-template/handles-multiple-text-nodes-in-the-same-slot/case.ts +0 -29
- package/runtime/__test__/element-template/fixtures/render/opcodes-into-element-template/inserts-nested-templates-into-parent-slots/case.ts +0 -42
- package/runtime/__test__/element-template/fixtures/render/opcodes-into-element-template/keeps-slot-children-separated-and-ordered/case.ts +0 -31
- package/runtime/__test__/element-template/fixtures/render/opcodes-into-element-template/passes-bundle-url-to-native-create/case.ts +0 -20
- package/runtime/__test__/element-template/runtime/render/render-to-opcodes.et.test.jsx +0 -522
- package/runtime/lib/element-template/runtime/render/render-opcodes.js +0 -216
- package/runtime/lib/element-template/runtime/render/render-opcodes.js.map +0 -1
- package/runtime/lib/element-template/runtime/render/render-to-opcodes.d.ts +0 -16
- package/runtime/lib/element-template/runtime/render/render-to-opcodes.js +0 -324
- package/runtime/lib/element-template/runtime/render/render-to-opcodes.js.map +0 -1
- package/runtime/lib/element-template/runtime-backend-marker.js +0 -6
- package/runtime/lib/element-template/runtime-backend-marker.js.map +0 -1
- package/runtime/lib/runtime-backend-marker.js +0 -6
- package/runtime/lib/runtime-backend-marker.js.map +0 -1
- package/runtime/src/element-template/runtime/render/render-opcodes.ts +0 -313
- package/runtime/src/element-template/runtime/render/render-to-opcodes.ts +0 -411
- package/runtime/src/element-template/runtime-backend-marker.ts +0 -7
- package/runtime/src/runtime-backend-marker.ts +0 -7
- package/testing-library/node_modules/.bin/rsbuild +0 -55
- package/testing-library/node_modules/.bin/rspeedy +0 -55
- package/testing-library/node_modules/.bin/rstest +0 -55
- package/transform/node_modules/.bin/esbuild +0 -46
- package/transform/node_modules/.bin/napi +0 -55
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/appends-root-text-via-append-element/native-log.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/appends-root-text-via-append-element/output.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/creates-template-from-attrs-and-slot-text/native-log.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/creates-template-from-attrs-and-slot-text/output.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/handles-multiple-template-children-in-the-same-slot/native-log.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/handles-multiple-template-children-in-the-same-slot/output.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/handles-multiple-text-nodes-in-the-same-slot/native-log.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/handles-multiple-text-nodes-in-the-same-slot/output.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/inserts-nested-templates-into-parent-slots/native-log.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/inserts-nested-templates-into-parent-slots/output.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/keeps-slot-children-separated-and-ordered/native-log.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/keeps-slot-children-separated-and-ordered/output.txt +0 -0
- /package/runtime/__test__/element-template/fixtures/render/{opcodes-into-element-template → direct-native}/passes-bundle-url-to-native-create/native-log.txt +0 -0
- /package/runtime/lib/{element-template/runtime-backend-marker.d.ts → core/capture-main-thread-object.d.ts} +0 -0
- /package/runtime/lib/{runtime-backend-marker.d.ts → core/main-thread-ref-id.d.ts} +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes how a serializable initialization payload becomes a stable object
|
|
3
|
+
* in the main-thread runtime.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface MainThreadObjectTypeDefinition<I, O extends object> {
|
|
8
|
+
/** A globally unique and stable type key. */
|
|
9
|
+
readonly type: string;
|
|
10
|
+
/**
|
|
11
|
+
* Create the realized main-thread object.
|
|
12
|
+
*
|
|
13
|
+
* This must be a capture-free Main Thread Function. Imports used by the
|
|
14
|
+
* function must come from shared-runtime modules.
|
|
15
|
+
*/
|
|
16
|
+
readonly create: (initialValue: I) => O;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* An immutable MainThreadObject type token with source-handle inspection.
|
|
20
|
+
*
|
|
21
|
+
* The factory function belongs to the input definition and is not exposed
|
|
22
|
+
* by the returned token. In the background runtime they compile to opaque
|
|
23
|
+
* Main Thread Function descriptors rather than bundling their implementation.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export interface MainThreadObjectType<I, O extends object> {
|
|
28
|
+
/** A globally unique and stable type key. */
|
|
29
|
+
readonly type: string;
|
|
30
|
+
/**
|
|
31
|
+
* Narrow a value to a source-runtime handle of this exact type.
|
|
32
|
+
*
|
|
33
|
+
* This does not create or access the realized main-thread object.
|
|
34
|
+
*/
|
|
35
|
+
readonly downcast: (value: unknown) => MainThreadObjectHandle<I, O> | undefined;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An opaque source-runtime handle for an object realized on the main thread.
|
|
39
|
+
*
|
|
40
|
+
* A handle has logical identity and is serializable, but it is not the target
|
|
41
|
+
* object or an RPC stub. Capturing it in a main-thread function resolves it to
|
|
42
|
+
* the corresponding local target object. Development builds may wrap the
|
|
43
|
+
* background handle in a throwing guard solely to diagnose invalid access;
|
|
44
|
+
* that guard never forwards operations between runtimes.
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
export declare abstract class MainThreadObjectHandle<I, O extends object> {
|
|
49
|
+
/**
|
|
50
|
+
* The payload used to create the realized object.
|
|
51
|
+
*
|
|
52
|
+
* Readonly is a TypeScript contract; the value is not frozen at runtime.
|
|
53
|
+
*/
|
|
54
|
+
get creationPayload(): Readonly<I>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Define a main-thread object type for use by a library-provided hook.
|
|
58
|
+
*
|
|
59
|
+
* @param definition - Stable type key and target-object factory function.
|
|
60
|
+
* @returns An immutable object type definition.
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export declare function defineMainThreadObjectType<I, O extends object>(definition: MainThreadObjectTypeDefinition<I, O>): MainThreadObjectType<I, O>;
|
|
64
|
+
/**
|
|
65
|
+
* Create a stable handle that resolves to an object of the supplied type in
|
|
66
|
+
* main-thread functions.
|
|
67
|
+
*
|
|
68
|
+
* This primitive is intended for library hooks. The returned target type is
|
|
69
|
+
* only callable in a main-thread function; it must not be used from the
|
|
70
|
+
* background runtime.
|
|
71
|
+
*
|
|
72
|
+
* @param objectType - Definition used to realize the target object.
|
|
73
|
+
* @param initialValue - JSON-serializable initialization payload.
|
|
74
|
+
* @returns The main-thread-only target type.
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
export declare function useMainThreadObject<I, O extends object>(objectType: MainThreadObjectType<I, O>, initialValue: I): O;
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// Copyright 2026 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
import { WorkletEvents, loadWorkletRuntime, registerMainThreadObjectType, } from '@lynx-js/react/worklet-runtime/bindings';
|
|
5
|
+
import { useMemo } from './hooks/react.js';
|
|
6
|
+
import { getMainThreadObjectHandleType, registerMainThreadObjectHandle } from './main-thread-object-handle-registry.js';
|
|
7
|
+
import { allocateMainThreadRefId } from './main-thread-ref-id.js';
|
|
8
|
+
import { addMainThreadRefInitValue } from './main-thread-ref-init-value.js';
|
|
9
|
+
const mainThreadObjectTypeDefinitions = new WeakMap();
|
|
10
|
+
/**
|
|
11
|
+
* An opaque source-runtime handle for an object realized on the main thread.
|
|
12
|
+
*
|
|
13
|
+
* A handle has logical identity and is serializable, but it is not the target
|
|
14
|
+
* object or an RPC stub. Capturing it in a main-thread function resolves it to
|
|
15
|
+
* the corresponding local target object. Development builds may wrap the
|
|
16
|
+
* background handle in a throwing guard solely to diagnose invalid access;
|
|
17
|
+
* that guard never forwards operations between runtimes.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export class MainThreadObjectHandle {
|
|
22
|
+
/** @internal */
|
|
23
|
+
_wvid;
|
|
24
|
+
/** @internal */
|
|
25
|
+
_initValue;
|
|
26
|
+
/** @internal */
|
|
27
|
+
_type;
|
|
28
|
+
/** @internal */
|
|
29
|
+
_releaseObserver;
|
|
30
|
+
/** @internal */
|
|
31
|
+
constructor(initialValue, type) {
|
|
32
|
+
if (__DEV__ && __JS__) {
|
|
33
|
+
assertSerializableMainThreadObjectPayload(initialValue, type);
|
|
34
|
+
}
|
|
35
|
+
this._wvid = allocateMainThreadRefId();
|
|
36
|
+
this._initValue = initialValue;
|
|
37
|
+
this._type = type;
|
|
38
|
+
registerMainThreadObjectHandle(this, type);
|
|
39
|
+
if (__JS__) {
|
|
40
|
+
addMainThreadRefInitValue(this._wvid, initialValue, type);
|
|
41
|
+
const id = this._wvid;
|
|
42
|
+
this._releaseObserver = lynx.getNativeApp().createJSObjectDestructionObserver?.(() => {
|
|
43
|
+
lynx.getCoreContext?.().dispatchEvent({
|
|
44
|
+
type: WorkletEvents.releaseWorkletRef,
|
|
45
|
+
data: { id },
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The payload used to create the realized object.
|
|
52
|
+
*
|
|
53
|
+
* Readonly is a TypeScript contract; the value is not frozen at runtime.
|
|
54
|
+
*/
|
|
55
|
+
get creationPayload() {
|
|
56
|
+
return this._initValue;
|
|
57
|
+
}
|
|
58
|
+
/** @internal */
|
|
59
|
+
toJSON() {
|
|
60
|
+
return {
|
|
61
|
+
_wvid: this._wvid,
|
|
62
|
+
_initValue: this._initValue,
|
|
63
|
+
_type: this._type,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
class MainThreadObjectHandleImpl extends MainThreadObjectHandle {
|
|
68
|
+
constructor(initialValue, type) {
|
|
69
|
+
super(initialValue, type);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Define a main-thread object type for use by a library-provided hook.
|
|
74
|
+
*
|
|
75
|
+
* @param definition - Stable type key and target-object factory function.
|
|
76
|
+
* @returns An immutable object type definition.
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export function defineMainThreadObjectType(definition) {
|
|
80
|
+
// Read accessor-backed fields once so validation and deferred registration
|
|
81
|
+
// operate on the same definition values.
|
|
82
|
+
const { type, create } = definition;
|
|
83
|
+
if (typeof type !== 'string' || type.length === 0) {
|
|
84
|
+
throw new Error('MainThreadObject type must be a non-empty string.');
|
|
85
|
+
}
|
|
86
|
+
if (type === 'main-thread') {
|
|
87
|
+
throw new Error('MainThreadObject type "main-thread" is reserved for MainThreadRef.');
|
|
88
|
+
}
|
|
89
|
+
if (!isMainThreadLifecycleFunction(create)) {
|
|
90
|
+
throw new Error(`MainThreadObject type "${type}" must provide a create Main Thread Function.`);
|
|
91
|
+
}
|
|
92
|
+
if (__DEV__) {
|
|
93
|
+
assertCaptureFreeLifecycleFunction(type, 'create', create);
|
|
94
|
+
}
|
|
95
|
+
// Keep the validated fields independent from the caller-owned definition.
|
|
96
|
+
// Registration may be deferred until the first main-thread hook use, so a
|
|
97
|
+
// later mutation of `definition` must not change the type or factory that is
|
|
98
|
+
// registered for this token.
|
|
99
|
+
const validatedDefinition = Object.freeze({
|
|
100
|
+
type,
|
|
101
|
+
create,
|
|
102
|
+
});
|
|
103
|
+
const objectType = Object.freeze({
|
|
104
|
+
type,
|
|
105
|
+
downcast(value) {
|
|
106
|
+
return getMainThreadObjectHandleType(value) === type
|
|
107
|
+
? value
|
|
108
|
+
: undefined;
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
mainThreadObjectTypeDefinitions.set(objectType, validatedDefinition);
|
|
112
|
+
registerMainThreadObjectDefinition(validatedDefinition);
|
|
113
|
+
return objectType;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Create a stable handle that resolves to an object of the supplied type in
|
|
117
|
+
* main-thread functions.
|
|
118
|
+
*
|
|
119
|
+
* This primitive is intended for library hooks. The returned target type is
|
|
120
|
+
* only callable in a main-thread function; it must not be used from the
|
|
121
|
+
* background runtime.
|
|
122
|
+
*
|
|
123
|
+
* @param objectType - Definition used to realize the target object.
|
|
124
|
+
* @param initialValue - JSON-serializable initialization payload.
|
|
125
|
+
* @returns The main-thread-only target type.
|
|
126
|
+
* @public
|
|
127
|
+
*/
|
|
128
|
+
export function useMainThreadObject(objectType, initialValue) {
|
|
129
|
+
return useMemo(() => {
|
|
130
|
+
const definition = mainThreadObjectTypeDefinitions.get(objectType);
|
|
131
|
+
if (definition === undefined) {
|
|
132
|
+
throw new Error(`Invalid MainThreadObject type token for "${objectType.type}". Create it with defineMainThreadObjectType().`);
|
|
133
|
+
}
|
|
134
|
+
// A library module normally registers its type while the MTS bundle is
|
|
135
|
+
// evaluated. Register again at the first hook use so runtimes that retain
|
|
136
|
+
// the module but reset their per-page worklet registry remain correct.
|
|
137
|
+
// The registry treats an equivalent duplicate as an idempotent lookup.
|
|
138
|
+
registerMainThreadObjectDefinition(definition);
|
|
139
|
+
const handle = new MainThreadObjectHandleImpl(initialValue, objectType.type);
|
|
140
|
+
return guardBackgroundMainThreadObjectAccess(handle, objectType.type);
|
|
141
|
+
}, []);
|
|
142
|
+
}
|
|
143
|
+
function registerMainThreadObjectDefinition(definition) {
|
|
144
|
+
if (__JS__) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const schema = globalThis
|
|
148
|
+
.globDynamicComponentEntry;
|
|
149
|
+
loadWorkletRuntime(schema);
|
|
150
|
+
registerMainThreadObjectType(definition.type, definition.create);
|
|
151
|
+
}
|
|
152
|
+
function isMainThreadLifecycleFunction(value) {
|
|
153
|
+
return typeof value === 'function'
|
|
154
|
+
|| (typeof value === 'object' && value !== null
|
|
155
|
+
&& typeof value._wkltId === 'string');
|
|
156
|
+
}
|
|
157
|
+
function assertCaptureFreeLifecycleFunction(type, name, value) {
|
|
158
|
+
if (typeof value === 'function') {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const descriptors = Object.getOwnPropertyDescriptors(value);
|
|
162
|
+
const hasCaptures = Reflect.ownKeys(descriptors).some(key => {
|
|
163
|
+
if (typeof key !== 'string') {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
if (key === '_wkltId' || key === '_workletType' || key === '_lepusWorkletHash') {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
if (key === '_c') {
|
|
170
|
+
const descriptor = descriptors[key];
|
|
171
|
+
const closure = 'value' in descriptor ? descriptor.value : undefined;
|
|
172
|
+
return !('value' in descriptor)
|
|
173
|
+
|| (closure !== undefined
|
|
174
|
+
&& (typeof closure !== 'object' || closure === null
|
|
175
|
+
|| Reflect.ownKeys(closure).length !== 0));
|
|
176
|
+
}
|
|
177
|
+
return true;
|
|
178
|
+
});
|
|
179
|
+
if (hasCaptures) {
|
|
180
|
+
throw new Error(`MainThreadObject ${name} function for "${type}" must not capture values. Import dependencies from a shared-runtime module instead.`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function guardBackgroundMainThreadObjectAccess(handle, type) {
|
|
184
|
+
if (!__DEV__ || !__JS__) {
|
|
185
|
+
return handle;
|
|
186
|
+
}
|
|
187
|
+
// This development-only guard never forwards a call to the main thread. It
|
|
188
|
+
// only turns an otherwise opaque "method is not a function" failure into a
|
|
189
|
+
// diagnostic. Production handles remain plain serializable objects.
|
|
190
|
+
const guardedHandle = new Proxy(handle, {
|
|
191
|
+
get(target, property, receiver) {
|
|
192
|
+
if (property in target) {
|
|
193
|
+
return Reflect.get(target, property, receiver);
|
|
194
|
+
}
|
|
195
|
+
if (typeof property === 'symbol'
|
|
196
|
+
|| property === 'then'
|
|
197
|
+
|| property === '$$typeof') {
|
|
198
|
+
return undefined;
|
|
199
|
+
}
|
|
200
|
+
throw new Error(`MainThreadObject handle for "${type}" cannot access "${String(property)}" in the background runtime. Use the object only inside a main-thread function.`);
|
|
201
|
+
},
|
|
202
|
+
set(target, property, value, receiver) {
|
|
203
|
+
if (property in target) {
|
|
204
|
+
return Reflect.set(target, property, value, receiver);
|
|
205
|
+
}
|
|
206
|
+
throw new Error(`MainThreadObject handle for "${type}" cannot set "${String(property)}" in the background runtime. Use the object only inside a main-thread function.`);
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
registerMainThreadObjectHandle(guardedHandle, type);
|
|
210
|
+
return guardedHandle;
|
|
211
|
+
}
|
|
212
|
+
function assertSerializableMainThreadObjectPayload(value, type) {
|
|
213
|
+
const invalidPath = findNonSerializablePath(value, '$', new Set());
|
|
214
|
+
if (invalidPath !== undefined) {
|
|
215
|
+
throw new Error(`MainThreadObject initial value for "${type}" must be JSON-serializable; invalid value at ${invalidPath}.`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function findNonSerializablePath(value, path, ancestors) {
|
|
219
|
+
if (value === undefined
|
|
220
|
+
|| typeof value === 'function'
|
|
221
|
+
|| typeof value === 'symbol'
|
|
222
|
+
|| typeof value === 'bigint'
|
|
223
|
+
|| (typeof value === 'number' && !Number.isFinite(value))) {
|
|
224
|
+
return path;
|
|
225
|
+
}
|
|
226
|
+
if (value === null || typeof value !== 'object') {
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
|
229
|
+
if (ancestors.has(value)) {
|
|
230
|
+
return path;
|
|
231
|
+
}
|
|
232
|
+
const prototype = Object.getPrototypeOf(value);
|
|
233
|
+
if (!Array.isArray(value) && prototype !== Object.prototype && prototype !== null) {
|
|
234
|
+
return path;
|
|
235
|
+
}
|
|
236
|
+
ancestors.add(value);
|
|
237
|
+
if (Array.isArray(value)) {
|
|
238
|
+
for (let index = 0; index < value.length; index++) {
|
|
239
|
+
if (!Object.prototype.hasOwnProperty.call(value, index)) {
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
const invalidPath = findNonSerializablePath(value[index], `${path}.${index}`, ancestors);
|
|
243
|
+
if (invalidPath !== undefined) {
|
|
244
|
+
ancestors.delete(value);
|
|
245
|
+
return invalidPath;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
for (const [key, item] of Object.entries(value)) {
|
|
251
|
+
const invalidPath = findNonSerializablePath(item, `${path}.${key}`, ancestors);
|
|
252
|
+
if (invalidPath !== undefined) {
|
|
253
|
+
ancestors.delete(value);
|
|
254
|
+
return invalidPath;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
ancestors.delete(value);
|
|
259
|
+
return undefined;
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=main-thread-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-thread-object.js","sourceRoot":"","sources":["../../src/core/main-thread-object.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,4BAA4B,G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I,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;gBACxD,SAAS;YACX,CAAC;YACD,MAAM,WAAW,GAAG,uBAAuB,CACzC,KAAK,CAAC,KAAK,CAAC,EACZ,GAAG,IAAI,IAAI,KAAK,EAAE,EAClB,SAAS,CACV,CAAC;YACF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC9B,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACxB,OAAO,WAAW,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAChD,MAAM,WAAW,GAAG,uBAAuB,CAAC,IAAI,EAAE,GAAG,IAAI,IAAI,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;YAC/E,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC9B,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACxB,OAAO,WAAW,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC;IACD,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxB,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2026 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
let lastIdBG = 0;
|
|
5
|
+
let lastIdMT = 0;
|
|
6
|
+
/** @internal */
|
|
7
|
+
export function allocateMainThreadRefId() {
|
|
8
|
+
return __JS__ ? ++lastIdBG : --lastIdMT;
|
|
9
|
+
}
|
|
10
|
+
/** @internal */
|
|
11
|
+
export function clearMainThreadRefIdsForTesting() {
|
|
12
|
+
lastIdBG = lastIdMT = 0;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=main-thread-ref-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-thread-ref-id.js","sourceRoot":"","sources":["../../src/core/main-thread-ref-id.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,IAAI,QAAQ,GAAG,CAAC,CAAC;AAEjB,gBAAgB;AAChB,MAAM,UAAU,uBAAuB;IACrC,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC;AAC1C,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,+BAA+B;IAC7C,QAAQ,GAAG,QAAQ,GAAG,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -6,11 +6,13 @@ let mainThreadRefInitValuePatch = [];
|
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
export function addMainThreadRefInitValue(id, value) {
|
|
9
|
+
export function addMainThreadRefInitValue(id, value, type) {
|
|
10
10
|
if (!isMtsEnabled()) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
mainThreadRefInitValuePatch.push(
|
|
13
|
+
mainThreadRefInitValuePatch.push(type === undefined
|
|
14
|
+
? [id, value]
|
|
15
|
+
: [id, value, type]);
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main-thread-ref-init-value.js","sourceRoot":"","sources":["../../src/core/main-thread-ref-init-value.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;
|
|
1
|
+
{"version":3,"file":"main-thread-ref-init-value.js","sourceRoot":"","sources":["../../src/core/main-thread-ref-init-value.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAI1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,IAAI,2BAA2B,GAAgC,EAAE,CAAC;AAElE;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,EAAU,EACV,KAAc,EACd,IAAa;IAEb,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IAED,2BAA2B,CAAC,IAAI,CAC9B,IAAI,KAAK,SAAS;QAChB,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC;QACb,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CACtB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,+BAA+B;IAC7C,MAAM,KAAK,GAAG,2BAA2B,CAAC;IAC1C,2BAA2B,GAAG,EAAE,CAAC;IACjC,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -8,6 +8,8 @@ export declare function isMainThreadRef(value: unknown): value is WorkletRefImpl
|
|
|
8
8
|
* The data saved in `current` property of the `MainThreadRef` can be read and written in
|
|
9
9
|
* multiple main thread functions.
|
|
10
10
|
* @public
|
|
11
|
+
*
|
|
12
|
+
* @group Types
|
|
11
13
|
*/
|
|
12
14
|
export declare class MainThreadRef<T> {
|
|
13
15
|
constructor(initValue: T);
|
|
@@ -51,6 +53,8 @@ export declare class MainThreadRef<T> {
|
|
|
51
53
|
* ```
|
|
52
54
|
*
|
|
53
55
|
* @public
|
|
56
|
+
*
|
|
57
|
+
* @group Hooks
|
|
54
58
|
*/
|
|
55
59
|
export declare function useMainThreadRef<T>(initValue: T): MainThreadRef<T>;
|
|
56
60
|
/**
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { useMemo } from './hooks/react.js';
|
|
2
|
+
import { allocateMainThreadRefId, clearMainThreadRefIdsForTesting } from './main-thread-ref-id.js';
|
|
2
3
|
import { addMainThreadRefInitValue } from './main-thread-ref-init-value.js';
|
|
3
4
|
import { WorkletEvents } from '../worklet-runtime/bindings/events.js';
|
|
4
|
-
// Split into two variables for testing purposes.
|
|
5
|
-
let lastIdBG = 0;
|
|
6
|
-
let lastIdMT = 0;
|
|
7
5
|
export function clearMainThreadRefLastIdForTesting() {
|
|
8
|
-
|
|
6
|
+
clearMainThreadRefIdsForTesting();
|
|
9
7
|
}
|
|
10
8
|
export function isMainThreadRef(value) {
|
|
11
9
|
return typeof value === 'object'
|
|
@@ -18,6 +16,8 @@ export function isMainThreadRef(value) {
|
|
|
18
16
|
* The data saved in `current` property of the `MainThreadRef` can be read and written in
|
|
19
17
|
* multiple main thread functions.
|
|
20
18
|
* @public
|
|
19
|
+
*
|
|
20
|
+
* @group Types
|
|
21
21
|
*/
|
|
22
22
|
export class MainThreadRef {
|
|
23
23
|
/**
|
|
@@ -39,8 +39,8 @@ export class MainThreadRef {
|
|
|
39
39
|
constructor(initValue) {
|
|
40
40
|
this._initValue = initValue;
|
|
41
41
|
this._type = 'main-thread';
|
|
42
|
+
this._wvid = allocateMainThreadRefId();
|
|
42
43
|
if (__JS__) {
|
|
43
|
-
this._wvid = ++lastIdBG;
|
|
44
44
|
addMainThreadRefInitValue(this._wvid, initValue);
|
|
45
45
|
const id = this._wvid;
|
|
46
46
|
this._lifecycleObserver = lynx.getNativeApp().createJSObjectDestructionObserver?.(() => {
|
|
@@ -52,9 +52,6 @@ export class MainThreadRef {
|
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
else {
|
|
56
|
-
this._wvid = --lastIdMT;
|
|
57
|
-
}
|
|
58
55
|
}
|
|
59
56
|
get current() {
|
|
60
57
|
if (__JS__ && __DEV__) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main-thread-ref.js","sourceRoot":"","sources":["../../src/core/main-thread-ref.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,
|
|
1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C;YACL,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,IAAI,OAAO;QACT,IAAI,MAAM,IAAI,OAAO,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;QAC1G,CAAC;QACD,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;YACzB,sBAAsB;YACtB,MAAM,IAAI,KAAK,CAAC,2FAA2F,CAAC,CAAC;QAC/G,CAAC;QACD,OAAO,SAAc,CAAC;IACxB,CAAC;IAED,IAAI,OAAO,CAAC,CAAI;QACd,IAAI,MAAM,IAAI,OAAO,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;QAC1G,CAAC;QACD,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,2FAA2F,CAAC,CAAC;QAC/G,CAAC;IACH,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF;AA6HD,MAAM,UAAU,gBAAgB,CAAI,SAAa;IAC/C,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,OAAO,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit-hook.js","sourceRoot":"","sources":["../../../src/element-template/background/commit-hook.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,0CAA0C,GAC3C,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"commit-hook.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cAAc,EAAE,EAAE,CAAC;YACvD,2EAA2E;YAC3E,2EAA2E;YAC3E,gBAAgB,EAAE,CAAC;QACrB,CAAC;aAAM,IAAI,cAAc,IAAI,WAAW,EAAE,CAAC;YACzC,MAAM,2BAA2B,GAAG,+BAA+B,EAAE,CAAC;YACtE,IACE,mBAAmB,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC;mBAC/B,CAAC,aAAa,CAAC,mBAAmB,CAAC,YAAY,CAAC;mBAChD,cAAc,EAAE;mBAChB,0BAA0B,CAAC,MAAM,GAAG,CAAC;mBACrC,2BAA2B,CAAC,MAAM,GAAG,CAAC,EACzC,CAAC;gBACD,iCAAiC,CAAC,2BAA2B,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;QAED,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,4CAA4C;IAC1D,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO;IACT,CAAC;IACD,SAAS,GAAG,KAAK,CAAC;IAClB,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC;QACjC,cAAc,GAAG,SAAS,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;AACH,CAAC"}
|
|
@@ -2,6 +2,6 @@ import { BackgroundElementTemplateInstance } from './instance.js';
|
|
|
2
2
|
export interface BackgroundElementTemplateDocument {
|
|
3
3
|
createElement(type: string): BackgroundElementTemplateInstance;
|
|
4
4
|
createElementNS(ns: string, type: string): BackgroundElementTemplateInstance;
|
|
5
|
-
createTextNode(text: string): BackgroundElementTemplateInstance;
|
|
5
|
+
createTextNode(text: string | number): BackgroundElementTemplateInstance;
|
|
6
6
|
}
|
|
7
7
|
export declare function setupBackgroundElementTemplateDocument(): BackgroundElementTemplateDocument;
|
|
@@ -18,7 +18,7 @@ export function setupBackgroundElementTemplateDocument() {
|
|
|
18
18
|
return new BackgroundElementTemplateInstance(type);
|
|
19
19
|
},
|
|
20
20
|
createTextNode(text) {
|
|
21
|
-
return new BackgroundElementTemplateInstance(BUILTIN_RAW_TEXT_TEMPLATE_KEY, [text]);
|
|
21
|
+
return new BackgroundElementTemplateInstance(BUILTIN_RAW_TEXT_TEMPLATE_KEY, [String(text)]);
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
options.document = doc;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../src/element-template/background/document.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,qCAAqC,GACtC,MAAM,eAAe,CAAC;AAQvB,MAAM,UAAU,sCAAsC;IACpD,MAAM,GAAG,GAAG;QACV,aAAa,CAAC,IAAY;YACxB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;gBACpB,OAAO,IAAI,qCAAqC,EAAE,CAAC;YACrD,CAAC;YACD,OAAO,IAAI,iCAAiC,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;QACD,eAAe,CAAC,GAAW,EAAE,IAAY;YACvC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;gBACpB,OAAO,IAAI,qCAAqC,EAAE,CAAC;YACrD,CAAC;YACD,OAAO,IAAI,iCAAiC,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;QACD,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../src/element-template/background/document.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,qCAAqC,GACtC,MAAM,eAAe,CAAC;AAQvB,MAAM,UAAU,sCAAsC;IACpD,MAAM,GAAG,GAAG;QACV,aAAa,CAAC,IAAY;YACxB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;gBACpB,OAAO,IAAI,qCAAqC,EAAE,CAAC;YACrD,CAAC;YACD,OAAO,IAAI,iCAAiC,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;QACD,eAAe,CAAC,GAAW,EAAE,IAAY;YACvC,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;gBACpB,OAAO,IAAI,qCAAqC,EAAE,CAAC;YACrD,CAAC;YACD,OAAO,IAAI,iCAAiC,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;QACD,cAAc,CAAC,IAAqB;YAClC,OAAO,IAAI,iCAAiC,CAAC,6BAA6B,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9F,CAAC;KACF,CAAC;IAEF,OAAO,CAAC,QAAQ,GAAG,GAA0B,CAAC;IAE9C,OAAO,GAAG,CAAC;AACb,CAAC"}
|