@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
package/runtime/lib/lynx-api.js
CHANGED
|
@@ -20,6 +20,8 @@ import { flushDelayedLifecycleEvents } from './snapshot/lynx/tt.js';
|
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
22
|
* @public
|
|
23
|
+
*
|
|
24
|
+
* @group Functions
|
|
23
25
|
*/
|
|
24
26
|
export const root = {
|
|
25
27
|
render: (jsx) => {
|
|
@@ -72,6 +74,8 @@ export const root = {
|
|
|
72
74
|
* ```
|
|
73
75
|
*
|
|
74
76
|
* @public
|
|
77
|
+
*
|
|
78
|
+
* @group Functions
|
|
75
79
|
*/
|
|
76
80
|
export function markFirstScreenSyncReady() {
|
|
77
81
|
if (__FIRST_SCREEN_SYNC_TIMING__ !== 'manual') {
|
|
@@ -115,6 +119,8 @@ const _InitData = /* @__PURE__ */ factory({
|
|
|
115
119
|
* ```
|
|
116
120
|
*
|
|
117
121
|
* @public
|
|
122
|
+
*
|
|
123
|
+
* @function
|
|
118
124
|
*/
|
|
119
125
|
// @ts-expect-error make preact and react types work
|
|
120
126
|
export const InitDataProvider = /* @__PURE__ */ _InitData.Provider();
|
|
@@ -123,6 +129,8 @@ export const InitDataProvider = /* @__PURE__ */ _InitData.Provider();
|
|
|
123
129
|
* This should be used with {@link InitDataProvider}
|
|
124
130
|
* @group Components
|
|
125
131
|
* @public
|
|
132
|
+
*
|
|
133
|
+
* @function
|
|
126
134
|
*/
|
|
127
135
|
// @ts-expect-error make preact and react types work
|
|
128
136
|
export const InitDataConsumer = /* @__PURE__ */ _InitData.Consumer();
|
|
@@ -140,7 +148,10 @@ export const InitDataConsumer = /* @__PURE__ */ _InitData.Consumer();
|
|
|
140
148
|
* }
|
|
141
149
|
* ```
|
|
142
150
|
*
|
|
151
|
+
* @function
|
|
143
152
|
* @public
|
|
153
|
+
*
|
|
154
|
+
* @group Hooks
|
|
144
155
|
*/
|
|
145
156
|
export const useInitData = /* @__PURE__ */ _InitData.use();
|
|
146
157
|
/**
|
|
@@ -154,7 +165,10 @@ export const useInitData = /* @__PURE__ */ _InitData.use();
|
|
|
154
165
|
* })
|
|
155
166
|
* }
|
|
156
167
|
* ```
|
|
168
|
+
* @function
|
|
157
169
|
* @public
|
|
170
|
+
*
|
|
171
|
+
* @group Hooks
|
|
158
172
|
*/
|
|
159
173
|
export const useInitDataChanged = /* @__PURE__ */ _InitData.useChanged();
|
|
160
174
|
const _GlobalProps = /* @__PURE__ */ createGlobalProps({
|
|
@@ -164,12 +178,15 @@ const _GlobalProps = /* @__PURE__ */ createGlobalProps({
|
|
|
164
178
|
useLynxGlobalEventListener,
|
|
165
179
|
});
|
|
166
180
|
/**
|
|
167
|
-
* The {@link https://react.dev/reference/react/createContext#provider | Provider} Component that provide `lynx.__globalProps
|
|
168
|
-
*
|
|
181
|
+
* The {@link https://react.dev/reference/react/createContext#provider | Provider} Component that provide `lynx.__globalProps`.
|
|
182
|
+
* Only needed with `globalPropsMode: 'event'`; in the default `'reactive'` mode it renders its children directly
|
|
183
|
+
* and updates come from a full re-render.
|
|
169
184
|
* @group Components
|
|
170
185
|
*
|
|
171
186
|
* @example
|
|
172
187
|
*
|
|
188
|
+
* With `globalPropsMode: 'event'`:
|
|
189
|
+
*
|
|
173
190
|
* ```ts
|
|
174
191
|
* import { root } from "@lynx-js/react"
|
|
175
192
|
*
|
|
@@ -188,20 +205,26 @@ const _GlobalProps = /* @__PURE__ */ createGlobalProps({
|
|
|
188
205
|
* ```
|
|
189
206
|
*
|
|
190
207
|
* @public
|
|
208
|
+
*
|
|
209
|
+
* @function
|
|
191
210
|
*/
|
|
192
211
|
// @ts-expect-error make preact and react types work
|
|
193
212
|
export const GlobalPropsProvider = /* @__PURE__ */ _GlobalProps.Provider();
|
|
194
213
|
/**
|
|
195
214
|
* The {@link https://react.dev/reference/react/createContext#consumer | Consumer} Component that provide `lynx.__globalProps`.
|
|
196
|
-
*
|
|
215
|
+
* Only needed with `globalPropsMode: 'event'`, together with {@link GlobalPropsProvider}; in the default `'reactive'` mode
|
|
216
|
+
* it calls `children` with `lynx.__globalProps` directly and updates come from a full re-render.
|
|
197
217
|
* @group Components
|
|
198
218
|
* @public
|
|
219
|
+
*
|
|
220
|
+
* @function
|
|
199
221
|
*/
|
|
200
222
|
// @ts-expect-error make preact and react types work
|
|
201
223
|
export const GlobalPropsConsumer = /* @__PURE__ */ _GlobalProps.Consumer();
|
|
202
224
|
/**
|
|
203
225
|
* A React Hooks for you to get `lynx.__globalProps`.
|
|
204
|
-
*
|
|
226
|
+
* With `globalPropsMode: 'event'`, the component re-renders when `lynx.__globalProps` changes;
|
|
227
|
+
* in the default `'reactive'` mode, updates arrive through a full re-render.
|
|
205
228
|
*
|
|
206
229
|
* @example
|
|
207
230
|
*
|
|
@@ -213,7 +236,10 @@ export const GlobalPropsConsumer = /* @__PURE__ */ _GlobalProps.Consumer();
|
|
|
213
236
|
* }
|
|
214
237
|
* ```
|
|
215
238
|
*
|
|
239
|
+
* @function
|
|
216
240
|
* @public
|
|
241
|
+
*
|
|
242
|
+
* @group Hooks
|
|
217
243
|
*/
|
|
218
244
|
export const useGlobalProps = /* @__PURE__ */ _GlobalProps.use();
|
|
219
245
|
/**
|
|
@@ -228,7 +254,10 @@ export const useGlobalProps = /* @__PURE__ */ _GlobalProps.use();
|
|
|
228
254
|
* })
|
|
229
255
|
* }
|
|
230
256
|
* ```
|
|
257
|
+
* @function
|
|
231
258
|
* @public
|
|
259
|
+
*
|
|
260
|
+
* @group Hooks
|
|
232
261
|
*/
|
|
233
262
|
export const useGlobalPropsChanged = /* @__PURE__ */ _GlobalProps
|
|
234
263
|
.useChanged();
|
|
@@ -237,4 +266,5 @@ export { useLynxGlobalEventListener } from './core/hooks/useLynxGlobalEventListe
|
|
|
237
266
|
export { runOnBackground } from './core/background-function/run-on-background.js';
|
|
238
267
|
export { runOnMainThread } from './snapshot/worklet/call/runOnMainThread.js';
|
|
239
268
|
export { MainThreadRef, useMainThreadRef } from './core/main-thread-ref.js';
|
|
269
|
+
export { defineMainThreadObjectType, useMainThreadObject } from './core/main-thread-object.js';
|
|
240
270
|
//# sourceMappingURL=lynx-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lynx-api.js","sourceRoot":"","sources":["../src/lynx-api.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"lynx-api.js","sourceRoot":"","sources":["../src/lynx-api.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,iBA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ACb,QAAQ;IACR,aAAa;IACb,0BAA0B;CAC3B,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,oDAAoD;AACpD,MAAM,CAAC,MAAM,mBAAmB,GAA6C,eAAe,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;AAErH;;;;;;;;GAQG;AACH,oDAAoD;AACpD,MAAM,CAAC,MAAM,mBAAmB,GAA0B,eAAe,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;AAElG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;AAEpF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAoD,eAAe,CAAC,YAAY;KAC/G,UAAU,EAAE,CAAC;AAuBhB,OAAO,EAAE,mBAAmB,EAAE,CAAC;AA+O/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/runtime/lib/lynx.js
CHANGED
|
@@ -59,7 +59,7 @@ if (typeof __ALOG__ !== 'undefined' && __ALOG__) {
|
|
|
59
59
|
if (typeof __ALOG_ELEMENT_API__ !== 'undefined' && __ALOG_ELEMENT_API__) {
|
|
60
60
|
initElementPAPICallAlog();
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
function initBackgroundRuntime() {
|
|
63
63
|
// Trick Preact and TypeScript to accept our custom document adapter.
|
|
64
64
|
options.document = document;
|
|
65
65
|
options.requestAnimationFrame = lynxQueueMicrotask;
|
|
@@ -78,5 +78,8 @@ if (typeof __BACKGROUND__ !== 'undefined' && __BACKGROUND__) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
+
if (typeof __BACKGROUND__ !== 'undefined' && __BACKGROUND__) {
|
|
82
|
+
initBackgroundRuntime();
|
|
83
|
+
}
|
|
81
84
|
setupLynxEnv();
|
|
82
85
|
//# sourceMappingURL=lynx.js.map
|
package/runtime/lib/lynx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lynx.js","sourceRoot":"","sources":["../src/lynx.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,4DAA4D;AAC5D,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,aA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QAAQ,EAAE,CAAC;AACb,CAAC;AACD,IAAI,OAAO,oBAAoB,KAAK,WAAW,IAAI,oBAAoB,EAAE,CAAC;IACxE,uBAAuB,EAAE,CAAC;AAC5B,CAAC;AAED,SAAS,qBAAqB;IAC5B,qEAAqE;IACrE,OAAO,CAAC,QAAQ,GAAG,QAA+B,CAAC;IACnD,OAAO,CAAC,qBAAqB,GAAG,kBAAkB,CAAC;IACnD,uBAAuB,EAAE,CAAC;IAC1B,QAAQ,EAAE,CAAC;IACX,2BAA2B,EAAE,CAAC;IAE9B,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,EAAE,CAAC,CAAA,CAAC;SACrC,CAAC;QACJ,iBAAiB,EAAE,CAAC;QACpB,aAAa,EAAE,CAAC;QAChB,IAAI,OAAO,IAAI,WAAW,EAAE,CAAC;YAC3B,oBAAoB,EAAE,CAAC;QACzB,CAAC;QACD,IAAI,WAAW,EAAE,CAAC;YAChB,eAAe,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;AACH,CAAC;AAED,IAAI,OAAO,cAAc,KAAK,WAAW,IAAI,cAAc,EAAE,CAAC;IAC5D,qBAAqB,EAAE,CAAC;AAC1B,CAAC;AAED,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
// Side-effect entry that registers this bundle's runtime markers (backend,
|
|
5
|
+
// version, ...) on load. Imported once by the runtime entry so later-loaded
|
|
6
|
+
// lazy bundles register their own markers too.
|
|
7
|
+
import { RUNTIME_BACKEND_SNAPSHOT, registerRuntimeBackend } from './core/lynx/runtime-backend.js';
|
|
8
|
+
import { registerRuntimeVersion } from './core/lynx/runtime-version.js';
|
|
9
|
+
registerRuntimeBackend(RUNTIME_BACKEND_SNAPSHOT);
|
|
10
|
+
// An older `react-webpack-plugin` may not stamp `__RUNTIME_VERSION__`. Guard
|
|
11
|
+
// with `typeof` so referencing it does not throw when the define is missing.
|
|
12
|
+
registerRuntimeVersion(typeof __RUNTIME_VERSION__ === 'undefined' ? undefined : __RUNTIME_VERSION__);
|
|
13
|
+
//# sourceMappingURL=runtime-marker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-marker.js","sourceRoot":"","sources":["../src/runtime-marker.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,2EAA2E;AAC3E,4EAA4E;AAC5E,+CAA+C;AAE/C,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,sBAAsB,CAAC,wBAAwB,CAAC,CAAC;AACjD,6EAA6E;AAC7E,6EAA6E;AAC7E,sBAAsB,CACpB,OAAO,mBAAmB,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAC7E,CAAC"}
|
|
@@ -131,7 +131,11 @@ export function setupComponentStack() {
|
|
|
131
131
|
oldRoot(vnode, parent);
|
|
132
132
|
};
|
|
133
133
|
options.vnode = (vnode) => {
|
|
134
|
-
|
|
134
|
+
// Scheduled component updates clone the vnode before entering its render scope.
|
|
135
|
+
// Preserve the original owner when Preact invokes this hook for that clone.
|
|
136
|
+
if (vnode._owner === undefined) {
|
|
137
|
+
vnode._owner = ownerStack.length > 0 ? ownerStack[ownerStack.length - 1] : null;
|
|
138
|
+
}
|
|
135
139
|
if (oldVNode)
|
|
136
140
|
oldVNode(vnode);
|
|
137
141
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-stack.js","sourceRoot":"","sources":["../../src/shared/component-stack.ts"],"names":[],"mappings":"AAA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CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACnF,CAAC;QACD,IAAI,QAAQ;YAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,CAAC;IAEF,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE;QACxB,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QAED,IAAI,SAAS;YAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
import { Component, options } from 'preact';
|
|
5
5
|
import { BITS, COMMIT, COMPONENT, COMPONENT_DIRTY, DIFF, DIFF2, DIFFED, HOOKS, LIST, NEXT_STATE, NEXT_VALUE, RENDER, VALUE, VNODE, } from '../../shared/render-constants.js';
|
|
6
|
-
import { getDisplayName
|
|
6
|
+
import { getDisplayName } from '../../utils.js';
|
|
7
7
|
import { globalPatchOptions } from '../lifecycle/patch/commit.js';
|
|
8
8
|
import { __globalSnapshotPatch } from '../lifecycle/patch/snapshotPatch.js';
|
|
9
9
|
const format = (val) => {
|
|
@@ -63,8 +63,10 @@ export function initProfileHook() {
|
|
|
63
63
|
{
|
|
64
64
|
const sFlowID = Symbol('FLOW_ID');
|
|
65
65
|
if (typeof __BACKGROUND__ !== 'undefined' && __BACKGROUND__) {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
67
|
+
const oldSetState = Component.prototype.setState;
|
|
68
|
+
Component.prototype.setState = function (state, callback) {
|
|
69
|
+
oldSetState?.call(this, state, callback);
|
|
68
70
|
if (this[BITS] & COMPONENT_DIRTY) {
|
|
69
71
|
const type = this[VNODE].type;
|
|
70
72
|
const isClassComponent = typeof type === 'function' && ('prototype' in type)
|
|
@@ -76,9 +78,13 @@ export function initProfileHook() {
|
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
|
-
}
|
|
81
|
+
};
|
|
80
82
|
}
|
|
81
|
-
|
|
83
|
+
// These hot callbacks have fixed signatures; avoid collecting and spreading
|
|
84
|
+
// an argument array for every host and component visited.
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
86
|
+
const oldDiff2 = options[DIFF2];
|
|
87
|
+
options[DIFF2] = (vnode, oldVNode) => {
|
|
82
88
|
// We only add profiling trace for Component
|
|
83
89
|
if (typeof vnode.type === 'function') {
|
|
84
90
|
const profileOptions = {};
|
|
@@ -96,9 +102,11 @@ export function initProfileHook() {
|
|
|
96
102
|
}
|
|
97
103
|
profileStart(`ReactLynx::diff::${ /* #__INLINE__ */getDisplayName(vnode.type)}`, profileOptions);
|
|
98
104
|
}
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
105
|
+
oldDiff2?.(vnode, oldVNode);
|
|
106
|
+
};
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
108
|
+
const oldDiffed = options[DIFFED];
|
|
109
|
+
options[DIFFED] = vnode => {
|
|
102
110
|
if (typeof __BACKGROUND__ !== 'undefined' && __BACKGROUND__) {
|
|
103
111
|
const hooks = vnode[COMPONENT]?.[HOOKS];
|
|
104
112
|
const hookList = hooks?.[LIST];
|
|
@@ -139,10 +147,12 @@ export function initProfileHook() {
|
|
|
139
147
|
if (typeof vnode.type === 'function') {
|
|
140
148
|
profileEnd(); // for options[DIFF2]
|
|
141
149
|
}
|
|
142
|
-
|
|
143
|
-
}
|
|
150
|
+
oldDiffed?.(vnode);
|
|
151
|
+
};
|
|
144
152
|
if (typeof __BACKGROUND__ !== 'undefined' && __BACKGROUND__) {
|
|
145
|
-
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
154
|
+
const oldCommit = options[COMMIT];
|
|
155
|
+
options[COMMIT] = (vnode, commitQueue) => {
|
|
146
156
|
profileStart('ReactLynx::commit', {
|
|
147
157
|
...globalPatchOptions.flowIds
|
|
148
158
|
? {
|
|
@@ -151,13 +161,15 @@ export function initProfileHook() {
|
|
|
151
161
|
}
|
|
152
162
|
: {},
|
|
153
163
|
});
|
|
154
|
-
|
|
164
|
+
oldCommit?.(vnode, commitQueue);
|
|
155
165
|
profileEnd();
|
|
156
|
-
}
|
|
166
|
+
};
|
|
157
167
|
}
|
|
158
168
|
}
|
|
159
169
|
// Profile the user-provided `render`.
|
|
160
|
-
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
171
|
+
const oldRender = options[RENDER];
|
|
172
|
+
options[RENDER] = (vnode) => {
|
|
161
173
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
162
174
|
const originalRender = vnode[COMPONENT].render;
|
|
163
175
|
vnode[COMPONENT].render = function render(props, state, context) {
|
|
@@ -170,17 +182,21 @@ export function initProfileHook() {
|
|
|
170
182
|
vnode[COMPONENT].render = originalRender;
|
|
171
183
|
}
|
|
172
184
|
};
|
|
173
|
-
|
|
174
|
-
}
|
|
185
|
+
oldRender?.(vnode);
|
|
186
|
+
};
|
|
175
187
|
if (typeof __BACKGROUND__ !== 'undefined' && __BACKGROUND__) {
|
|
176
188
|
const sPatchLength = Symbol('PATCH_LENGTH');
|
|
177
|
-
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
190
|
+
const oldDiff = options[DIFF];
|
|
191
|
+
options[DIFF] = (vnode) => {
|
|
178
192
|
if (typeof vnode.type === 'function' && __globalSnapshotPatch) {
|
|
179
193
|
vnode[sPatchLength] = __globalSnapshotPatch.length;
|
|
180
194
|
}
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
195
|
+
oldDiff?.(vnode);
|
|
196
|
+
};
|
|
197
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
198
|
+
const oldPatchDiffed = options[DIFFED];
|
|
199
|
+
options[DIFFED] = (vnode) => {
|
|
184
200
|
if (typeof vnode.type === 'function') {
|
|
185
201
|
const patchLength = vnode[sPatchLength];
|
|
186
202
|
delete vnode[sPatchLength];
|
|
@@ -193,8 +209,8 @@ export function initProfileHook() {
|
|
|
193
209
|
});
|
|
194
210
|
}
|
|
195
211
|
}
|
|
196
|
-
|
|
197
|
-
}
|
|
212
|
+
oldPatchDiffed?.(vnode);
|
|
213
|
+
};
|
|
198
214
|
}
|
|
199
215
|
}
|
|
200
216
|
//# sourceMappingURL=profileHooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profileHooks.js","sourceRoot":"","sources":["../../../src/snapshot/debug/profileHooks.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAK5C,OAAO,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,eAAe,EACf,IAAI,EACJ,KAAK,EACL,MAAM,EACN,KAAK,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,KAAK,EACL,KAAK,GACN,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"profileHooks.js","sourceRoot":"","sources":["../../../src/snapshot/debug/profileHooks.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAK5C,OAAO,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,eAAe,EACf,IAAI,EACJ,KAAK,EACL,MAAM,EACN,KAAK,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,KA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
|
4
|
+
commitId: number;
|
|
5
|
+
isHydration: boolean;
|
|
6
|
+
parent?: number;
|
|
7
|
+
child?: number;
|
|
8
|
+
/** Missing main-thread contexts: 1 for parent, 2 for child, 3 for both. */
|
|
9
|
+
missingNode?: 1 | 2 | 3;
|
|
10
|
+
}
|
|
2
11
|
export interface CtxNotFoundData {
|
|
3
12
|
id: number;
|
|
13
|
+
options: CtxNotFoundOptions;
|
|
4
14
|
}
|
|
5
|
-
export declare function sendCtxNotFoundEventToBackground(id: number): void;
|
|
15
|
+
export declare function sendCtxNotFoundEventToBackground(id: number, options: CtxNotFoundOptions): void;
|
|
6
16
|
export declare function reportCtxNotFound(data: CtxNotFoundData): void;
|
|
7
17
|
export declare function addCtxNotFoundEventListener(): void;
|
|
8
18
|
export declare function removeCtxNotFoundEventListener(): void;
|
|
@@ -2,35 +2,43 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
import { backgroundSnapshotInstanceManager } from '../../snapshot/backgroundSnapshot.js';
|
|
5
|
-
import { snapshotManager } from '../../snapshot/definition.js';
|
|
6
5
|
export const ctxNotFoundType = 'Lynx.Error.CtxNotFound';
|
|
7
6
|
const errorMsg = 'snapshotPatchApply failed: ctx not found';
|
|
8
7
|
let ctxNotFoundEventListener = null;
|
|
9
|
-
export function sendCtxNotFoundEventToBackground(id) {
|
|
10
|
-
/* v8 ignore next 3 */
|
|
8
|
+
export function sendCtxNotFoundEventToBackground(id, options) {
|
|
11
9
|
if (!lynx.getJSContext) {
|
|
12
10
|
throw new Error(errorMsg);
|
|
13
11
|
}
|
|
14
12
|
lynx.getJSContext().dispatchEvent({
|
|
15
13
|
type: ctxNotFoundType,
|
|
16
|
-
data: {
|
|
17
|
-
id,
|
|
18
|
-
},
|
|
14
|
+
data: { id, options },
|
|
19
15
|
});
|
|
20
16
|
}
|
|
21
17
|
export function reportCtxNotFound(data) {
|
|
22
|
-
const id = data
|
|
18
|
+
const { id, options } = data;
|
|
23
19
|
const instance = backgroundSnapshotInstanceManager.values.get(id);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
const snapshotType = instance?.__snapshot_def ? instance.type ?? 'null' : 'null';
|
|
21
|
+
const { operation, commitId, isHydration, child, missingNode } = options;
|
|
22
|
+
const parent = options.parent ?? instance?.parentNode?.__id;
|
|
23
|
+
let parentInfo = 'parent: null';
|
|
24
|
+
if (parent !== undefined) {
|
|
25
|
+
const parentInstance = backgroundSnapshotInstanceManager.values.get(parent);
|
|
26
|
+
const parentType = parentInstance?.__snapshot_def ? parentInstance.type ?? 'null' : 'null';
|
|
27
|
+
const missingInfo = missingNode === undefined
|
|
28
|
+
? ''
|
|
29
|
+
: `, missing: ${missingNode === 1 || missingNode === 3}`;
|
|
30
|
+
parentInfo = `parent: { id: ${parent}, snapshot type: '${parentType}'${missingInfo} }`;
|
|
32
31
|
}
|
|
33
|
-
let
|
|
32
|
+
let ctxInfo = parentInfo;
|
|
33
|
+
if (child !== undefined) {
|
|
34
|
+
const childInstance = backgroundSnapshotInstanceManager.values.get(child);
|
|
35
|
+
const childType = childInstance?.__snapshot_def ? childInstance.type ?? 'null' : 'null';
|
|
36
|
+
const missingInfo = missingNode === undefined
|
|
37
|
+
? ''
|
|
38
|
+
: `, missing: ${missingNode === 2 || missingNode === 3}`;
|
|
39
|
+
ctxInfo = `${parentInfo}, child: { id: ${child}, snapshot type: '${childType}'${missingInfo} }`;
|
|
40
|
+
}
|
|
41
|
+
let message = `${errorMsg}, snapshot type: '${snapshotType}', ${ctxInfo}, operation: '${operation}', commitId: ${commitId}, isHydration: ${isHydration}`;
|
|
34
42
|
if (__DEV__) {
|
|
35
43
|
message += '. You can set environment variable `REACT_ALOG=true` and restart your dev server for troubleshooting.';
|
|
36
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../src/snapshot/lifecycle/patch/error.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../src/snapshot/lifecycle/patch/error.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAEzF,MAAM,CAAC,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAE5D,IAAI,wBAAwB,GAA6C,IAAI,CAAC;AAiB9E,MAAM,UAAU,gCAAgC,CAAC,EAAU,EAAE,OAA2B;IACtF,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,CAAC,YAAY,EAAE,CAAC,aAAa,CAAC;QAChC,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE;KACtB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAqB;IACrD,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC7B,MAAM,QAAQ,GAAG,iCAAiC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClE,MAAM,YAAY,GAAG,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACjF,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IACzE,MAAM,MAAM,GAAG,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EAAE,CAAC;QACZ,OAAO,IAAI,uGAAuG,CAAC;IACrH,CAAC;IACD,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,wBAAwB,GAAG,CAAC,CAAC,EAAE,EAAE;QAC/B,iBAAiB,CAAC,CAAC,CAAC,IAAuB,CAAC,CAAC;IAC/C,CAAC,CAAC;IACF,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC,gBAAgB,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAC;AACtF,CAAC;AAED,MAAM,UAAU,8BAA8B;IAC5C,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;IAC5C,IAAI,WAAW,IAAI,wBAAwB,EAAE,CAAC;QAC5C,WAAW,CAAC,mBAAmB,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAC;QAC3E,wBAAwB,GAAG,IAAI,CAAC;IAClC,CAAC;AACH,CAAC"}
|
|
@@ -4,4 +4,4 @@ import type { SnapshotPatch } from './snapshotPatch.js';
|
|
|
4
4
|
* This is the counterpart to the patch generation in the background thread.
|
|
5
5
|
* Each operation in the patch is processed sequentially to update the DOM.
|
|
6
6
|
*/
|
|
7
|
-
export declare function snapshotPatchApply(snapshotPatch: SnapshotPatch): void;
|
|
7
|
+
export declare function snapshotPatchApply(snapshotPatch: SnapshotPatch, commitId: number, isHydration: boolean): void;
|
|
@@ -20,7 +20,7 @@ import { SnapshotInstance, snapshotCreatorMap, snapshotInstanceManager } from '.
|
|
|
20
20
|
* This is the counterpart to the patch generation in the background thread.
|
|
21
21
|
* Each operation in the patch is processed sequentially to update the DOM.
|
|
22
22
|
*/
|
|
23
|
-
export function snapshotPatchApply(snapshotPatch) {
|
|
23
|
+
export function snapshotPatchApply(snapshotPatch, commitId, isHydration) {
|
|
24
24
|
const length = snapshotPatch.length;
|
|
25
25
|
for (let i = 0; i < length; ++i) {
|
|
26
26
|
switch (snapshotPatch[i]) {
|
|
@@ -39,7 +39,14 @@ export function snapshotPatchApply(snapshotPatch) {
|
|
|
39
39
|
const child = snapshotInstanceManager.values.get(childId);
|
|
40
40
|
const existingNode = snapshotInstanceManager.values.get(beforeId);
|
|
41
41
|
if (!parent || !child) {
|
|
42
|
-
sendCtxNotFoundEventToBackground(parent ? childId : parentId
|
|
42
|
+
sendCtxNotFoundEventToBackground(parent ? childId : parentId, {
|
|
43
|
+
operation: 'InsertBefore',
|
|
44
|
+
commitId,
|
|
45
|
+
isHydration,
|
|
46
|
+
parent: parentId,
|
|
47
|
+
child: childId,
|
|
48
|
+
missingNode: parent ? 2 : (child ? 1 : 3),
|
|
49
|
+
});
|
|
43
50
|
}
|
|
44
51
|
else {
|
|
45
52
|
child.__slotIndex = __slotIndex;
|
|
@@ -53,7 +60,14 @@ export function snapshotPatchApply(snapshotPatch) {
|
|
|
53
60
|
const parent = snapshotInstanceManager.values.get(parentId);
|
|
54
61
|
const child = snapshotInstanceManager.values.get(childId);
|
|
55
62
|
if (!parent || !child) {
|
|
56
|
-
sendCtxNotFoundEventToBackground(parent ? childId : parentId
|
|
63
|
+
sendCtxNotFoundEventToBackground(parent ? childId : parentId, {
|
|
64
|
+
operation: 'RemoveChild',
|
|
65
|
+
commitId,
|
|
66
|
+
isHydration,
|
|
67
|
+
parent: parentId,
|
|
68
|
+
child: childId,
|
|
69
|
+
missingNode: parent ? 2 : (child ? 1 : 3),
|
|
70
|
+
});
|
|
57
71
|
}
|
|
58
72
|
else {
|
|
59
73
|
parent.removeChild(child);
|
|
@@ -69,7 +83,11 @@ export function snapshotPatchApply(snapshotPatch) {
|
|
|
69
83
|
applyNodesRefInsertBefore(identifier, child, beforeId);
|
|
70
84
|
}
|
|
71
85
|
else {
|
|
72
|
-
sendCtxNotFoundEventToBackground(childId
|
|
86
|
+
sendCtxNotFoundEventToBackground(childId, {
|
|
87
|
+
operation: 'nodesRefInsertBefore',
|
|
88
|
+
commitId,
|
|
89
|
+
isHydration,
|
|
90
|
+
});
|
|
73
91
|
}
|
|
74
92
|
break;
|
|
75
93
|
}
|
|
@@ -81,7 +99,11 @@ export function snapshotPatchApply(snapshotPatch) {
|
|
|
81
99
|
applyNodesRefRemoveChild(identifier, child);
|
|
82
100
|
}
|
|
83
101
|
else {
|
|
84
|
-
sendCtxNotFoundEventToBackground(childId
|
|
102
|
+
sendCtxNotFoundEventToBackground(childId, {
|
|
103
|
+
operation: 'nodesRefRemoveChild',
|
|
104
|
+
commitId,
|
|
105
|
+
isHydration,
|
|
106
|
+
});
|
|
85
107
|
}
|
|
86
108
|
break;
|
|
87
109
|
}
|
|
@@ -94,7 +116,7 @@ export function snapshotPatchApply(snapshotPatch) {
|
|
|
94
116
|
si.setAttribute(dynamicPartIndex, value);
|
|
95
117
|
}
|
|
96
118
|
else {
|
|
97
|
-
sendCtxNotFoundEventToBackground(id);
|
|
119
|
+
sendCtxNotFoundEventToBackground(id, { operation: 'SetAttribute', commitId, isHydration });
|
|
98
120
|
}
|
|
99
121
|
break;
|
|
100
122
|
}
|
|
@@ -106,7 +128,7 @@ export function snapshotPatchApply(snapshotPatch) {
|
|
|
106
128
|
si.setAttribute('values', values);
|
|
107
129
|
}
|
|
108
130
|
else {
|
|
109
|
-
sendCtxNotFoundEventToBackground(id);
|
|
131
|
+
sendCtxNotFoundEventToBackground(id, { operation: 'SetAttributes', commitId, isHydration });
|
|
110
132
|
}
|
|
111
133
|
break;
|
|
112
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshotPatchApply.js","sourceRoot":"","sources":["../../../../src/snapshot/lifecycle/patch/snapshotPatchApply.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D;;;;;;;;;GASG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;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CAAC,CACxE,CAAC;wBACJ,CAAC;wBAAC,OAAO,CAAC,EAAE,CAAC;4BACX,OAAO,CAAC,IAAI,CAAC,wDAAwD,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;wBACpF,CAAC;oBACH,CAAC;gBACH,CAAC;gBACD,MAAM;YACR,CAAC;YACC,qDAAqD;YACrD,mBAAmB;YACnB,mBAAmB;YACnB,+CAA+C;YAC/C,gDAAgD;YAChD,6EAA6E;YAC7E,gDAAgD;YAChD,MAAM;YACN,WAAW;YACX,IAAI;QACR,CAAC;IACH,CAAC;AACH,CAAC;AAED,qBAAqB;AACrB;;GAEG;AACH,SAAS,QAAQ,CAAI,IAAY;IAC/B,IAAI,OAAO,EAAE,CAAC;QACZ,2EAA2E;QAC3E,qEAAqE;QACrE,oEAAoE;QACpE,sDAAsD;QACtD,OAAO,IAAI,CAAC,UAAU,IAAI,KAAK,CAAM,CAAC;IACxC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;AAC1E,CAAC;AACD,oBAAoB"}
|
|
@@ -46,10 +46,10 @@ function updateMainThread({ data, patchOptions }) {
|
|
|
46
46
|
setMainThreadHydrating(true);
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
for (const { snapshotPatch } of patchList) {
|
|
49
|
+
for (const { snapshotPatch, id } of patchList) {
|
|
50
50
|
__pendingListUpdates.clearAttachedLists();
|
|
51
51
|
if (snapshotPatch) {
|
|
52
|
-
snapshotPatchApply(snapshotPatch);
|
|
52
|
+
snapshotPatchApply(snapshotPatch, id, patchOptions.isHydration === true);
|
|
53
53
|
}
|
|
54
54
|
__pendingListUpdates.flush();
|
|
55
55
|
// console.debug('********** Lepus updatePatch:');
|