@lynx-js/react 0.129.3 → 0.129.4
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 +16 -0
- package/components/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/refresh/.turbo/turbo-build.log +3 -3
- package/refresh/dist/index.js +113 -20
- package/refresh/rslib.config.ts +13 -3
- package/refresh/src/index.ts +100 -0
- package/refresh/src/self.ts +38 -0
- package/runtime/__test__/{snapshot → core}/attribute-name.test.ts +1 -1
- package/runtime/__test__/core/background-function.test.ts +37 -0
- package/runtime/__test__/{shared → core}/component-stack.test.ts +4 -4
- package/runtime/__test__/core/ref.test.ts +218 -1
- package/runtime/__test__/core/sync-effect-flush.test.ts +58 -0
- package/runtime/__test__/element-template/debug/alog.test.ts +20 -12
- package/runtime/__test__/element-template/fixtures/background/hydrate/_shared.tsx +15 -34
- package/runtime/__test__/element-template/fixtures/background/hydrate/children.creates-missing-nodes-recursively/output.txt +2 -0
- package/runtime/__test__/element-template/fixtures/background/hydrate/children.iterates-existing-slots/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/background/hydrate/children.missing-attrs-element/output.txt +6 -1
- package/runtime/__test__/element-template/fixtures/background/hydrate/children.missing-slot-record-on-main/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/background/hydrate/{coverage.move-before-child → children.reconciles-raw-text-slots}/case.tsx +1 -1
- package/runtime/__test__/element-template/fixtures/background/hydrate/coverage.emit-create-raw-text/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/background/hydrate/coverage.emit-create-raw-text-non-text/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/background/hydrate/root-key-mismatch-reconciles/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/children.creates-and-inserts-new/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/children.inserts-before-existing-sibling/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/children.mixed-operations/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/children.non-string-raw-text-key-on-main/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/background/hydrate-compiled/complex-trees.deeply-nested-dynamic-content/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/background/instance/ops/emits-bundle-url-in-create-template/output.txt +1 -0
- package/runtime/__test__/element-template/fixtures/list/mts/index.tsx +185 -0
- package/runtime/__test__/element-template/fixtures/page/render-page/native-log.txt +1 -0
- package/runtime/__test__/element-template/fixtures/patch/detaches-node-when-moving-between-slots/case.tsx +2 -0
- package/runtime/__test__/element-template/fixtures/patch-compiled/applies-insert-before-with-reference/ops.txt +1 -0
- package/runtime/__test__/element-template/fixtures/patch-compiled/apply-hydration-ops/ops.txt +1 -0
- package/runtime/__test__/element-template/fixtures/render/child-siblings/papi.txt +10 -5
- package/runtime/__test__/element-template/fixtures/render/component/papi.txt +6 -3
- package/runtime/__test__/element-template/fixtures/render/component-slot-content/papi.txt +6 -3
- package/runtime/__test__/element-template/fixtures/render/css-scope-dynamic-bundle-url/papi.txt +2 -1
- package/runtime/__test__/element-template/fixtures/render/direct-native/appends-root-text-via-append-element/native-log.txt +1 -0
- package/runtime/__test__/element-template/fixtures/render/direct-native/creates-template-from-attrs-and-slot-text/native-log.txt +2 -0
- package/runtime/__test__/element-template/fixtures/render/direct-native/handles-multiple-template-children-in-the-same-slot/native-log.txt +3 -0
- package/runtime/__test__/element-template/fixtures/render/direct-native/handles-multiple-text-nodes-in-the-same-slot/native-log.txt +3 -0
- package/runtime/__test__/element-template/fixtures/render/direct-native/inserts-nested-templates-into-parent-slots/native-log.txt +3 -0
- package/runtime/__test__/element-template/fixtures/render/direct-native/keeps-slot-children-separated-and-ordered/native-log.txt +3 -0
- package/runtime/__test__/element-template/fixtures/render/direct-native/passes-bundle-url-to-native-create/native-log.txt +1 -0
- package/runtime/__test__/element-template/fixtures/render/mapped-view-children/papi.txt +14 -7
- package/runtime/__test__/element-template/fixtures/render/mixed-children/papi.txt +8 -4
- package/runtime/__test__/element-template/fixtures/render/multiple-text/papi.txt +38 -19
- package/runtime/__test__/element-template/fixtures/render/nested-templates/papi.txt +6 -3
- package/runtime/__test__/element-template/fixtures/render/react-example/papi.txt +6 -3
- package/runtime/__test__/element-template/fixtures/render/sparse-element-slot/papi.txt +6 -3
- package/runtime/__test__/element-template/fixtures/render/template-dedupe/papi.txt +10 -5
- package/runtime/__test__/element-template/lynx/performance.test.ts +1 -0
- package/runtime/__test__/element-template/native/callDestroyLifetimeFun.test.ts +1 -0
- package/runtime/__test__/element-template/native/mts-destroy.test.ts +10 -15
- package/runtime/__test__/element-template/native/reload.test.ts +4 -7
- package/runtime/__test__/element-template/runtime/background/adapter/background-adapter.et.test.tsx +0 -32
- package/runtime/__test__/element-template/runtime/background/commit-context.test.ts +0 -14
- package/runtime/__test__/element-template/runtime/background/commit-hook.test.ts +10 -0
- package/runtime/__test__/element-template/runtime/background/event/compiled-fixtures.test.tsx +22 -0
- package/runtime/__test__/element-template/runtime/background/hydrate.test.ts +197 -252
- package/runtime/__test__/element-template/runtime/background/instance.test.ts +277 -126
- package/runtime/__test__/element-template/runtime/background/passive-update-depth.test.tsx +496 -0
- package/runtime/__test__/element-template/runtime/background/render/preact.test.tsx +16 -22
- package/runtime/__test__/element-template/runtime/background/root-render.test.tsx +5 -3
- package/runtime/__test__/element-template/runtime/background/suspense.test.tsx +2 -0
- package/runtime/__test__/element-template/runtime/background/update/compiled-fixtures.test.tsx +1 -0
- package/runtime/__test__/element-template/runtime/background/update-timing.test.ts +1 -0
- package/runtime/__test__/element-template/runtime/hydration/hydration-listener.test.ts +3 -4
- package/runtime/__test__/element-template/runtime/list/list-mts-compiled.test.ts +525 -0
- package/runtime/__test__/element-template/runtime/page/compiled-fixtures.test.tsx +2 -0
- package/runtime/__test__/element-template/runtime/page/root-instance.test.ts +2 -14
- package/runtime/__test__/element-template/runtime/patch/element-template-patch.test.tsx +425 -1032
- package/runtime/__test__/element-template/runtime/patch/patch-listener-alog.test.ts +1 -0
- package/runtime/__test__/element-template/runtime/patch/update-timing.test.ts +1 -0
- package/runtime/__test__/element-template/runtime/prop-adapters/event.test.ts +0 -20
- package/runtime/__test__/element-template/runtime/prop-adapters/gesture.test.ts +2 -1
- package/runtime/__test__/element-template/runtime/prop-adapters/hydrate.test.ts +1 -0
- package/runtime/__test__/element-template/runtime/prop-adapters/ref.test.ts +65 -0
- package/runtime/__test__/element-template/runtime/prop-adapters/spread-mts-compiled.test.ts +12 -4
- package/runtime/__test__/element-template/runtime/render/render-components.test.jsx +2 -5
- package/runtime/__test__/element-template/runtime/render/render-direct-native.test.tsx +56 -121
- package/runtime/__test__/element-template/runtime/render/render-direct-suspense.test.ts +18 -17
- package/runtime/__test__/element-template/runtime/render/render-direct.test.ts +5 -4
- package/runtime/__test__/element-template/runtime/render/render-main-thread.contract.test.ts +2 -0
- package/runtime/__test__/element-template/runtime/render/render-main-thread.test.ts +1 -60
- package/runtime/__test__/element-template/runtime/render/render-transform.contract.test.ts +32 -89
- package/runtime/__test__/element-template/runtime/template/element-template-handle.test.ts +8 -6
- package/runtime/__test__/element-template/runtime/template/main-thread-dynamic-attr-state.test.ts +34 -6
- package/runtime/__test__/element-template/test-utils/debug/updateRunner.test.tsx +20 -12
- package/runtime/__test__/element-template/test-utils/debug/updateRunner.ts +2 -28
- package/runtime/__test__/element-template/test-utils/mock/mockNativePapi/templateTree.test.ts +14 -5
- package/runtime/__test__/element-template/test-utils/mock/mockNativePapi/templateTree.ts +1 -57
- package/runtime/__test__/element-template/test-utils/mock/mockNativePapi.ts +29 -13
- package/runtime/__test__/element-template/vitest.config.ts +1 -0
- package/runtime/__test__/guardrails/snapshot-containment.test.ts +98 -77
- package/runtime/__test__/snapshot/debug/passive-update-depth.test.jsx +549 -0
- package/runtime/__test__/snapshot/debug/react-hooks-profile.test.jsx +3 -3
- package/runtime/__test__/snapshot/lifecycle/reload-background-function.test.jsx +138 -1
- package/runtime/__test__/snapshot/lifecycle/reload-delayed-background.test.jsx +1 -1
- package/runtime/__test__/snapshot/lifecycle/transfer.mts.test.jsx +194 -0
- package/runtime/__test__/snapshot/lifecycle/transfer.test.jsx +210 -0
- package/runtime/__test__/snapshot/list.test.jsx +109 -0
- package/runtime/__test__/snapshot/lynxQueueMicrotask.test.jsx +2 -2
- package/runtime/__test__/snapshot/ref.test.jsx +124 -1
- package/runtime/__test__/snapshot/utils/envManager.ts +5 -0
- package/runtime/__test__/snapshot/utils/globals.js +1 -0
- package/runtime/__test__/worklet-runtime/delayWorkletEvent.test.js +22 -11
- package/runtime/__test__/worklet-runtime/hydrate.test.js +1 -0
- package/runtime/__test__/worklet-runtime/jsFunctionLifecycle.test.js +24 -16
- package/runtime/__test__/worklet-runtime/runOnBackground.test.js +188 -0
- package/runtime/__test__/worklet-runtime/workletRef.test.js +16 -0
- package/runtime/__test__/worklet-runtime/workletRuntime.test.js +53 -1
- package/runtime/lazy/internal.js +1 -0
- package/runtime/lib/core/attribute-name.js.map +1 -0
- package/runtime/lib/core/background-function/run-on-background.js +7 -7
- package/runtime/lib/core/background-function/run-on-background.js.map +1 -1
- package/runtime/lib/{shared → core}/component-stack.js +1 -1
- package/runtime/lib/core/component-stack.js.map +1 -0
- package/runtime/lib/core/deep-equal.d.ts +1 -0
- package/runtime/lib/core/deep-equal.js +31 -0
- package/runtime/lib/core/deep-equal.js.map +1 -0
- package/runtime/lib/core/hooks/mainThreadImpl.js +1 -1
- package/runtime/lib/core/hooks/mainThreadImpl.js.map +1 -1
- package/runtime/lib/core/lynx-page-data.js +1 -1
- package/runtime/lib/core/lynx-page-data.js.map +1 -1
- package/runtime/lib/core/mts-capability.js +1 -1
- package/runtime/lib/core/mts-capability.js.map +1 -1
- package/runtime/lib/core/performance.js +2 -1
- package/runtime/lib/core/performance.js.map +1 -1
- package/runtime/lib/core/ref.d.ts +1 -2
- package/runtime/lib/core/ref.js +60 -9
- package/runtime/lib/core/ref.js.map +1 -1
- package/runtime/lib/core/sync-effect-flush.d.ts +9 -0
- package/runtime/lib/core/sync-effect-flush.js +31 -0
- package/runtime/lib/core/sync-effect-flush.js.map +1 -0
- package/runtime/lib/core/thread-function-call/main-thread.js +1 -1
- package/runtime/lib/core/thread-function-call/main-thread.js.map +1 -1
- package/runtime/lib/element-template/background/attr-slots.d.ts +1 -0
- package/runtime/lib/element-template/background/attr-slots.js.map +1 -1
- package/runtime/lib/element-template/background/commit-hook.js +1 -1
- package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
- package/runtime/lib/element-template/background/destroy.js +1 -1
- package/runtime/lib/element-template/background/destroy.js.map +1 -1
- package/runtime/lib/element-template/background/hydrate.js +173 -85
- package/runtime/lib/element-template/background/hydrate.js.map +1 -1
- package/runtime/lib/element-template/background/instance.d.ts +7 -10
- package/runtime/lib/element-template/background/instance.js +65 -58
- package/runtime/lib/element-template/background/instance.js.map +1 -1
- package/runtime/lib/element-template/background/render-scope.js +2 -1
- package/runtime/lib/element-template/background/render-scope.js.map +1 -1
- package/runtime/lib/element-template/debug/alog.d.ts +1 -10
- package/runtime/lib/element-template/debug/alog.js +1 -16
- package/runtime/lib/element-template/debug/alog.js.map +1 -1
- package/runtime/lib/element-template/debug/profile.js +1 -1
- package/runtime/lib/element-template/debug/profile.js.map +1 -1
- package/runtime/lib/element-template/native/index.js +2 -2
- package/runtime/lib/element-template/native/index.js.map +1 -1
- package/runtime/lib/element-template/native/patch-listener.js +4 -8
- package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
- package/runtime/lib/element-template/native/reload-main-thread.js +0 -4
- package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -1
- package/runtime/lib/element-template/prop-adapters/ref.d.ts +2 -1
- package/runtime/lib/element-template/prop-adapters/ref.js +4 -4
- package/runtime/lib/element-template/prop-adapters/ref.js.map +1 -1
- package/runtime/lib/element-template/prop-adapters/spread.js +1 -1
- package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -1
- package/runtime/lib/element-template/protocol/opcodes.d.ts +0 -2
- package/runtime/lib/element-template/protocol/opcodes.js +0 -2
- package/runtime/lib/element-template/protocol/opcodes.js.map +1 -1
- package/runtime/lib/element-template/protocol/types.d.ts +8 -30
- package/runtime/lib/element-template/protocol/types.js.map +1 -1
- package/runtime/lib/element-template/runtime/list/list.d.ts +14 -54
- package/runtime/lib/element-template/runtime/list/list.js +82 -546
- package/runtime/lib/element-template/runtime/list/list.js.map +1 -1
- package/runtime/lib/element-template/runtime/list/platform-info.d.ts +2 -0
- package/runtime/lib/element-template/runtime/list/platform-info.js +26 -0
- package/runtime/lib/element-template/runtime/list/platform-info.js.map +1 -0
- package/runtime/lib/element-template/runtime/patch.js +42 -119
- package/runtime/lib/element-template/runtime/patch.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/create-rendered-host.d.ts +1 -1
- package/runtime/lib/element-template/runtime/render/create-rendered-host.js +24 -21
- package/runtime/lib/element-template/runtime/render/create-rendered-host.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/render-components.d.ts +1 -1
- package/runtime/lib/element-template/runtime/render/render-components.js +3 -6
- package/runtime/lib/element-template/runtime/render/render-components.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/render-direct.js +21 -20
- package/runtime/lib/element-template/runtime/render/render-direct.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/render-main-thread.js +0 -13
- package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/attr-slot-plan.js +8 -0
- package/runtime/lib/element-template/runtime/template/attr-slot-plan.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/handle.d.ts +3 -3
- package/runtime/lib/element-template/runtime/template/handle.js +2 -2
- package/runtime/lib/element-template/runtime/template/handle.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-background-function.js +1 -6
- package/runtime/lib/element-template/runtime/template/main-thread-background-function.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.d.ts +2 -1
- package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js +44 -28
- package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/typed-attributes.d.ts +2 -0
- package/runtime/lib/element-template/runtime/template/typed-attributes.js +8 -1
- package/runtime/lib/element-template/runtime/template/typed-attributes.js.map +1 -1
- package/runtime/lib/internal.d.ts +1 -0
- package/runtime/lib/internal.js +1 -0
- package/runtime/lib/internal.js.map +1 -1
- package/runtime/lib/lynx-api.js +6 -1
- package/runtime/lib/lynx-api.js.map +1 -1
- package/runtime/lib/lynx.js +4 -4
- package/runtime/lib/lynx.js.map +1 -1
- package/runtime/lib/root.d.ts +5 -1
- package/runtime/lib/root.js +12 -1
- package/runtime/lib/root.js.map +1 -1
- package/runtime/lib/shared/microtask.d.ts +1 -0
- package/runtime/lib/shared/microtask.js +28 -0
- package/runtime/lib/shared/microtask.js.map +1 -0
- package/runtime/lib/shared/utils.d.ts +8 -0
- package/runtime/lib/shared/utils.js +27 -0
- package/runtime/lib/shared/utils.js.map +1 -0
- package/runtime/lib/{worklet-runtime/utils → shared}/version.d.ts +1 -0
- package/runtime/lib/{worklet-runtime/utils → shared}/version.js +4 -2
- package/runtime/lib/shared/version.js.map +1 -0
- package/runtime/lib/snapshot/alog/render.js +1 -1
- package/runtime/lib/snapshot/alog/render.js.map +1 -1
- package/runtime/lib/snapshot/debug/profileHooks.js +1 -1
- package/runtime/lib/snapshot/debug/profileHooks.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/destroy.js +2 -2
- package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/isRendering.js +2 -1
- package/runtime/lib/snapshot/lifecycle/isRendering.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/commit.d.ts +7 -2
- package/runtime/lib/snapshot/lifecycle/patch/commit.js +11 -6
- package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.d.ts +5 -0
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/ref/delay.d.ts +1 -1
- package/runtime/lib/snapshot/lifecycle/ref/delay.js +2 -2
- package/runtime/lib/snapshot/lifecycle/ref/delay.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/reload.js +1 -1
- package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
- package/runtime/lib/snapshot/list/list.js +12 -3
- package/runtime/lib/snapshot/list/list.js.map +1 -1
- package/runtime/lib/snapshot/lynx/tt.d.ts +3 -1
- package/runtime/lib/snapshot/lynx/tt.js +7 -3
- package/runtime/lib/snapshot/lynx/tt.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/hydrate.js +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/hydrate.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +1 -1
- package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/platformInfo.js +1 -1
- package/runtime/lib/snapshot/snapshot/platformInfo.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/ref.d.ts +1 -0
- package/runtime/lib/snapshot/snapshot/ref.js +2 -2
- package/runtime/lib/snapshot/snapshot/ref.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/snapshot.js +1 -1
- package/runtime/lib/snapshot/snapshot/snapshot.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/spread.js +3 -2
- package/runtime/lib/snapshot/snapshot/spread.js.map +1 -1
- package/runtime/lib/snapshot/transfer.d.ts +15 -0
- package/runtime/lib/snapshot/transfer.js +343 -0
- package/runtime/lib/snapshot/transfer.js.map +1 -0
- package/runtime/lib/snapshot/worklet/functionality.js +1 -1
- package/runtime/lib/snapshot/worklet/functionality.js.map +1 -1
- package/runtime/lib/tsconfig.tsbuildinfo +1 -1
- package/runtime/lib/worklet-runtime/api/element.js +1 -1
- package/runtime/lib/worklet-runtime/api/element.js.map +1 -1
- package/runtime/lib/worklet-runtime/api/lynxApi.js +1 -1
- package/runtime/lib/worklet-runtime/api/lynxApi.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/bindings.d.ts +3 -2
- package/runtime/lib/worklet-runtime/bindings/bindings.js +11 -1
- package/runtime/lib/worklet-runtime/bindings/bindings.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/observers.js +9 -1
- package/runtime/lib/worklet-runtime/bindings/observers.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/types.d.ts +1 -0
- package/runtime/lib/worklet-runtime/bindings/types.js.map +1 -1
- package/runtime/lib/worklet-runtime/delayWorkletEvent.d.ts +2 -4
- package/runtime/lib/worklet-runtime/delayWorkletEvent.js +42 -44
- package/runtime/lib/worklet-runtime/delayWorkletEvent.js.map +1 -1
- package/runtime/lib/worklet-runtime/global.d.ts +1 -2
- package/runtime/lib/worklet-runtime/global.js.map +1 -1
- package/runtime/lib/worklet-runtime/hydrate.js +2 -32
- package/runtime/lib/worklet-runtime/hydrate.js.map +1 -1
- package/runtime/lib/worklet-runtime/run-on-background/index.d.ts +28 -0
- package/runtime/lib/worklet-runtime/run-on-background/index.js +103 -0
- package/runtime/lib/worklet-runtime/run-on-background/index.js.map +1 -0
- package/runtime/lib/worklet-runtime/{jsFunctionLifecycle.d.ts → run-on-background/lifecycle.d.ts} +2 -2
- package/runtime/lib/worklet-runtime/{jsFunctionLifecycle.js → run-on-background/lifecycle.js} +12 -9
- package/runtime/lib/worklet-runtime/run-on-background/lifecycle.js.map +1 -0
- package/runtime/lib/worklet-runtime/workletRef.js +51 -54
- package/runtime/lib/worklet-runtime/workletRef.js.map +1 -1
- package/runtime/lib/worklet-runtime/workletRuntime.js +5 -6
- package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
- package/runtime/src/core/background-function/run-on-background.ts +7 -7
- package/runtime/src/{shared → core}/component-stack.ts +1 -1
- package/runtime/src/core/deep-equal.ts +33 -0
- package/runtime/src/core/hooks/mainThreadImpl.ts +1 -1
- package/runtime/src/core/lynx-page-data.ts +1 -1
- package/runtime/src/core/mts-capability.ts +1 -1
- package/runtime/src/core/performance.ts +2 -1
- package/runtime/src/core/ref.ts +92 -15
- package/runtime/src/core/sync-effect-flush.ts +30 -0
- package/runtime/src/core/thread-function-call/main-thread.ts +1 -1
- package/runtime/src/element-template/background/attr-slots.ts +2 -2
- package/runtime/src/element-template/background/commit-hook.ts +1 -1
- package/runtime/src/element-template/background/destroy.ts +1 -1
- package/runtime/src/element-template/background/hydrate.ts +229 -119
- package/runtime/src/element-template/background/instance.ts +82 -82
- package/runtime/src/element-template/background/render-scope.ts +2 -1
- package/runtime/src/element-template/debug/alog.ts +2 -30
- package/runtime/src/element-template/debug/profile.ts +1 -1
- package/runtime/src/element-template/native/index.ts +2 -2
- package/runtime/src/element-template/native/patch-listener.ts +6 -7
- package/runtime/src/element-template/native/reload-main-thread.ts +0 -4
- package/runtime/src/element-template/prop-adapters/ref.ts +12 -5
- package/runtime/src/element-template/prop-adapters/spread.ts +1 -1
- package/runtime/src/element-template/protocol/opcodes.ts +0 -2
- package/runtime/src/element-template/protocol/types.ts +10 -38
- package/runtime/src/element-template/runtime/list/list.ts +115 -744
- package/runtime/src/element-template/runtime/list/platform-info.ts +31 -0
- package/runtime/src/element-template/runtime/patch.ts +59 -163
- package/runtime/src/element-template/runtime/render/create-rendered-host.ts +27 -31
- package/runtime/src/element-template/runtime/render/render-components.ts +2 -5
- package/runtime/src/element-template/runtime/render/render-direct.ts +19 -18
- package/runtime/src/element-template/runtime/render/render-main-thread.ts +0 -14
- package/runtime/src/element-template/runtime/template/attr-slot-plan.ts +9 -0
- package/runtime/src/element-template/runtime/template/handle.ts +3 -2
- package/runtime/src/element-template/runtime/template/main-thread-background-function.ts +1 -6
- package/runtime/src/element-template/runtime/template/main-thread-dynamic-attr-state.ts +44 -30
- package/runtime/src/element-template/runtime/template/typed-attributes.ts +17 -1
- package/runtime/src/element-template/types.d.ts +6 -22
- package/runtime/src/internal.ts +2 -0
- package/runtime/src/lynx-api.ts +6 -1
- package/runtime/src/lynx.ts +4 -4
- package/runtime/src/root.ts +17 -1
- package/runtime/src/shared/microtask.ts +26 -0
- package/runtime/src/shared/utils.ts +37 -0
- package/runtime/src/{worklet-runtime/utils → shared}/version.ts +6 -4
- package/runtime/src/snapshot/alog/render.ts +1 -1
- package/runtime/src/snapshot/debug/profileHooks.ts +1 -1
- package/runtime/src/snapshot/lifecycle/destroy.ts +2 -2
- package/runtime/src/snapshot/lifecycle/isRendering.ts +2 -1
- package/runtime/src/snapshot/lifecycle/patch/commit.ts +28 -7
- package/runtime/src/snapshot/lifecycle/patch/updateMainThread.ts +1 -1
- package/runtime/src/snapshot/lifecycle/ref/delay.ts +5 -2
- package/runtime/src/snapshot/lifecycle/reload.ts +1 -1
- package/runtime/src/snapshot/list/list.ts +12 -3
- package/runtime/src/snapshot/lynx/tt.ts +8 -3
- package/runtime/src/snapshot/renderToOpcodes/hydrate.ts +1 -1
- package/runtime/src/snapshot/snapshot/backgroundSnapshot.ts +1 -1
- package/runtime/src/snapshot/snapshot/platformInfo.ts +1 -1
- package/runtime/src/snapshot/snapshot/ref.ts +7 -4
- package/runtime/src/snapshot/snapshot/snapshot.ts +1 -1
- package/runtime/src/snapshot/snapshot/spread.ts +3 -2
- package/runtime/src/snapshot/transfer.ts +379 -0
- package/runtime/src/snapshot/worklet/functionality.ts +1 -1
- package/runtime/src/worklet-runtime/api/element.ts +1 -1
- package/runtime/src/worklet-runtime/api/lynxApi.ts +1 -1
- package/runtime/src/worklet-runtime/bindings/bindings.ts +12 -0
- package/runtime/src/worklet-runtime/bindings/observers.ts +9 -1
- package/runtime/src/worklet-runtime/bindings/types.ts +1 -0
- package/runtime/src/worklet-runtime/delayWorkletEvent.ts +49 -54
- package/runtime/src/worklet-runtime/global.ts +1 -2
- package/runtime/src/worklet-runtime/hydrate.ts +2 -35
- package/runtime/src/worklet-runtime/run-on-background/index.ts +145 -0
- package/runtime/src/worklet-runtime/{jsFunctionLifecycle.ts → run-on-background/lifecycle.ts} +11 -9
- package/runtime/src/worklet-runtime/workletRef.ts +63 -62
- package/runtime/src/worklet-runtime/workletRuntime.ts +10 -10
- package/testing-library/.turbo/turbo-build.log +10 -10
- package/testing-library/dist/pure.js +7 -4
- package/testing-library/dist/setupFiles/common/runtime-setup.js +3 -1
- package/testing-library/dist/setupFiles/inner/rstest.js +1 -1
- package/testing-library/dist/setupFiles/inner/vitest.js +1 -1
- package/testing-library/src/__tests__/list.test.jsx +52 -0
- package/testing-library/src/__tests__/worklet.test.jsx +81 -0
- package/testing-library/src/pure.jsx +5 -2
- package/testing-library/src/setupFiles/common/runtime-setup.js +2 -0
- package/transform/.turbo/turbo-build$colon$wasm.log +64 -64
- package/transform/crates/swc_plugin_element_template/tests/element_template.rs +19 -45
- package/transform/crates/swc_plugin_element_template/tests/element_template_contract.rs +0 -19
- package/transform/rspack-napi/tsconfig.tsbuildinfo +1 -1
- package/transform/swc-plugin-reactlynx/.turbo/turbo-build.log +85 -85
- package/transform/swc-plugin-reactlynx-compat/.turbo/turbo-build.log +213 -192
- package/runtime/__test__/element-template/fixtures/background/hydrate/coverage.move-before-child/output.txt +0 -10
- package/runtime/__test__/element-template/fixtures/background/hydrate/coverage.raw-text-key-branches/case.tsx +0 -5
- package/runtime/__test__/element-template/fixtures/background/instance/ops/supports-silent-insert-before/case.ts +0 -11
- package/runtime/__test__/element-template/fixtures/background/instance/ops/supports-silent-insert-before/output.txt +0 -1
- package/runtime/__test__/element-template/fixtures/background/instance/ops/treats-nullish-attrs-as-empty-object/case.ts +0 -23
- package/runtime/__test__/element-template/fixtures/background/instance/ops/treats-nullish-attrs-as-empty-object/output.txt +0 -6
- package/runtime/__test__/element-template/runtime/page/authored-page.test.ts +0 -35
- package/runtime/__test__/element-template/runtime/patch/update-fixture-helper.test.tsx +0 -40
- package/runtime/__test__/snapshot/lynx-data-processors.test.ts +0 -3
- package/runtime/lib/shared/attribute-name.js.map +0 -1
- package/runtime/lib/shared/component-stack.js.map +0 -1
- package/runtime/lib/snapshot/alog/index.d.ts +0 -1
- package/runtime/lib/snapshot/alog/index.js +0 -8
- package/runtime/lib/snapshot/alog/index.js.map +0 -1
- package/runtime/lib/utils.d.ts +0 -19
- package/runtime/lib/utils.js +0 -119
- package/runtime/lib/utils.js.map +0 -1
- package/runtime/lib/worklet-runtime/delayRunOnBackground.d.ts +0 -13
- package/runtime/lib/worklet-runtime/delayRunOnBackground.js +0 -29
- package/runtime/lib/worklet-runtime/delayRunOnBackground.js.map +0 -1
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +0 -1
- package/runtime/lib/worklet-runtime/utils/version.js.map +0 -1
- package/runtime/src/snapshot/alog/index.ts +0 -8
- package/runtime/src/utils.ts +0 -134
- package/runtime/src/worklet-runtime/delayRunOnBackground.ts +0 -53
- /package/runtime/__test__/element-template/fixtures/background/hydrate/{coverage.raw-text-key-branches → children.reconciles-raw-text-slots}/output.txt +0 -0
- /package/runtime/lib/{shared → core}/attribute-name.d.ts +0 -0
- /package/runtime/lib/{shared → core}/attribute-name.js +0 -0
- /package/runtime/lib/{shared → core}/component-stack.d.ts +0 -0
- /package/runtime/src/{shared → core}/attribute-name.ts +0 -0
|
@@ -89,6 +89,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
89
89
|
null,
|
|
90
90
|
[],
|
|
91
91
|
[],
|
|
92
|
+
null,
|
|
92
93
|
ElementTemplateUpdateOps.insertNode,
|
|
93
94
|
0,
|
|
94
95
|
0,
|
|
@@ -217,7 +218,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
217
218
|
expect(globalCommitContext.ops).toEqual([ElementTemplateUpdateOps.setAttribute, -10, 0, 'changed']);
|
|
218
219
|
});
|
|
219
220
|
|
|
220
|
-
it('emits exact list create
|
|
221
|
+
it('emits exact list create with logical child slots and ref candidates', () => {
|
|
221
222
|
const list = new BackgroundListElementTemplateInstance();
|
|
222
223
|
const item = new BackgroundElementTemplateInstance('_et_list_item');
|
|
223
224
|
list.setAttribute('attributes', { id: 'feed' });
|
|
@@ -231,16 +232,22 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
231
232
|
list.instanceId,
|
|
232
233
|
'list',
|
|
233
234
|
{ id: 'feed' },
|
|
235
|
+
[[item.instanceId]],
|
|
234
236
|
null,
|
|
237
|
+
ElementTemplateUpdateOps.updateTypedListItem,
|
|
238
|
+
list.instanceId,
|
|
235
239
|
{
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
subtreeHandleIds: [],
|
|
241
|
-
}],
|
|
240
|
+
__etHandleRef: item.instanceId,
|
|
241
|
+
type: '_et_list_item',
|
|
242
|
+
platformInfo: null,
|
|
243
|
+
subtreeHandleIds: [],
|
|
242
244
|
},
|
|
243
245
|
]);
|
|
246
|
+
|
|
247
|
+
globalCommitContext.ops = [];
|
|
248
|
+
list.emitCreate();
|
|
249
|
+
|
|
250
|
+
expect(globalCommitContext.ops).toEqual([]);
|
|
244
251
|
});
|
|
245
252
|
|
|
246
253
|
it('owns empty attributes in the generic typed attribute slot', () => {
|
|
@@ -351,7 +358,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
351
358
|
]);
|
|
352
359
|
});
|
|
353
360
|
|
|
354
|
-
it('emits logical list insertions
|
|
361
|
+
it('emits logical list insertions through the shared child slot commands', () => {
|
|
355
362
|
const list = new BackgroundListElementTemplateInstance();
|
|
356
363
|
const oldListId = list.instanceId;
|
|
357
364
|
backgroundElementTemplateInstanceManager.updateId(oldListId, -10);
|
|
@@ -376,15 +383,13 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
376
383
|
null,
|
|
377
384
|
[],
|
|
378
385
|
[],
|
|
379
|
-
|
|
386
|
+
{ __listItemPlatformInfo: { 'item-key': 'b' } },
|
|
387
|
+
ElementTemplateUpdateOps.insertNode,
|
|
380
388
|
-10,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
type: '_et_item_b',
|
|
384
|
-
platformInfo: { 'item-key': 'b' },
|
|
385
|
-
subtreeHandleIds: [],
|
|
386
|
-
},
|
|
389
|
+
0,
|
|
390
|
+
second.instanceId,
|
|
387
391
|
-11,
|
|
392
|
+
null,
|
|
388
393
|
]);
|
|
389
394
|
});
|
|
390
395
|
|
|
@@ -411,9 +416,183 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
411
416
|
__etHandleRef: -11,
|
|
412
417
|
type: '_et_item_a',
|
|
413
418
|
platformInfo: { 'item-key': 'a', 'estimated-height': 42 },
|
|
414
|
-
subtreeHandleIds:
|
|
419
|
+
subtreeHandleIds: null,
|
|
420
|
+
},
|
|
421
|
+
]);
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
it('filters list item metadata in background create commands without changing ordinary attributes', () => {
|
|
425
|
+
const platformInfo = {
|
|
426
|
+
'reuse-identifier': '',
|
|
427
|
+
'full-span': false,
|
|
428
|
+
'item-key': 'a',
|
|
429
|
+
'sticky-top': false,
|
|
430
|
+
'sticky-bottom': true,
|
|
431
|
+
'estimated-height': 0,
|
|
432
|
+
'estimated-height-px': null,
|
|
433
|
+
'estimated-main-axis-size-px': undefined,
|
|
434
|
+
recyclable: false,
|
|
435
|
+
};
|
|
436
|
+
const attributes = {
|
|
437
|
+
id: 'row',
|
|
438
|
+
className: 'row-before',
|
|
439
|
+
style: { height: 64 },
|
|
440
|
+
};
|
|
441
|
+
const handleTap = vi.fn();
|
|
442
|
+
const metadata = {
|
|
443
|
+
...platformInfo,
|
|
444
|
+
...attributes,
|
|
445
|
+
bindtap: handleTap,
|
|
446
|
+
__spread: true,
|
|
447
|
+
itemKey: 'camel-case',
|
|
448
|
+
};
|
|
449
|
+
const originalMetadata = { ...metadata };
|
|
450
|
+
const item = new BackgroundElementTemplateInstance('_et_item_a', [attributes]);
|
|
451
|
+
|
|
452
|
+
item.setAttribute('__listItemPlatformInfo', metadata);
|
|
453
|
+
|
|
454
|
+
expect(item.getListItemPlatformInfo()).toStrictEqual(platformInfo);
|
|
455
|
+
expect(item.getListItemPlatformInfo()).not.toBe(metadata);
|
|
456
|
+
expect(metadata).toStrictEqual(originalMetadata);
|
|
457
|
+
markElementTemplateHydrated();
|
|
458
|
+
globalCommitContext.ops = [];
|
|
459
|
+
|
|
460
|
+
item.emitCreate();
|
|
461
|
+
|
|
462
|
+
expect(globalCommitContext.ops).toStrictEqual([
|
|
463
|
+
ElementTemplateUpdateOps.createTemplate,
|
|
464
|
+
item.instanceId,
|
|
465
|
+
'_et_item_a',
|
|
466
|
+
null,
|
|
467
|
+
[attributes],
|
|
468
|
+
[],
|
|
469
|
+
{ __listItemPlatformInfo: platformInfo },
|
|
470
|
+
]);
|
|
471
|
+
expect(item.attributeSlots[0]).toBe(attributes);
|
|
472
|
+
expect(handleTap).not.toHaveBeenCalled();
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
it('ignores inherited platform info and does not rename ordinary metadata keys', () => {
|
|
476
|
+
const metadata = Object.assign(
|
|
477
|
+
Object.create({ 'item-key': 'inherited', 'reuse-identifier': 'inherited' }) as Record<string, unknown>,
|
|
478
|
+
{ 'estimated-height': 42, itemKey: 'camel-case', className: 'row' },
|
|
479
|
+
);
|
|
480
|
+
const item = new BackgroundElementTemplateInstance('_et_item_a');
|
|
481
|
+
|
|
482
|
+
item.setAttribute('__listItemPlatformInfo', metadata);
|
|
483
|
+
|
|
484
|
+
expect(item.getListItemPlatformInfo()).toEqual({ 'estimated-height': 42 });
|
|
485
|
+
expect(Object.hasOwn(metadata, 'item-key')).toBe(false);
|
|
486
|
+
expect(metadata['item-key']).toBe('inherited');
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
it('ignores ordinary prop changes but emits filtered list item platform info updates', () => {
|
|
490
|
+
const list = new BackgroundListElementTemplateInstance();
|
|
491
|
+
backgroundElementTemplateInstanceManager.updateId(list.instanceId, -10);
|
|
492
|
+
list.markMaterializedByHydration();
|
|
493
|
+
const metadata = {
|
|
494
|
+
'item-key': 'a',
|
|
495
|
+
'estimated-height': 42,
|
|
496
|
+
className: 'row-before',
|
|
497
|
+
style: { height: 64 },
|
|
498
|
+
bindtap: vi.fn(),
|
|
499
|
+
};
|
|
500
|
+
const item = new BackgroundElementTemplateInstance('_et_item_a');
|
|
501
|
+
item.setAttribute('__listItemPlatformInfo', metadata);
|
|
502
|
+
list.appendChild(item);
|
|
503
|
+
backgroundElementTemplateInstanceManager.updateId(item.instanceId, -11);
|
|
504
|
+
item.markMaterializedByHydration();
|
|
505
|
+
markElementTemplateHydrated();
|
|
506
|
+
globalCommitContext.ops = [];
|
|
507
|
+
const changedProps = {
|
|
508
|
+
...metadata,
|
|
509
|
+
id: 'next-row',
|
|
510
|
+
className: 'row-after',
|
|
511
|
+
style: { height: 80 },
|
|
512
|
+
bindtap: vi.fn(),
|
|
513
|
+
__spread: true,
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
item.setAttribute('__listItemPlatformInfo', changedProps);
|
|
517
|
+
|
|
518
|
+
expect(item.getListItemPlatformInfo()).toEqual({ 'item-key': 'a', 'estimated-height': 42 });
|
|
519
|
+
expect(globalCommitContext.ops).toEqual([]);
|
|
520
|
+
|
|
521
|
+
item.setAttribute('__listItemPlatformInfo', { ...changedProps, 'estimated-height': 84 });
|
|
522
|
+
|
|
523
|
+
expect(globalCommitContext.ops).toEqual([
|
|
524
|
+
ElementTemplateUpdateOps.updateTypedListItem,
|
|
525
|
+
-10,
|
|
526
|
+
{
|
|
527
|
+
__etHandleRef: -11,
|
|
528
|
+
type: '_et_item_a',
|
|
529
|
+
platformInfo: { 'item-key': 'a', 'estimated-height': 84 },
|
|
530
|
+
subtreeHandleIds: null,
|
|
531
|
+
},
|
|
532
|
+
]);
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
it('copies list item metadata before comparing a reused input object', () => {
|
|
536
|
+
const list = new BackgroundListElementTemplateInstance();
|
|
537
|
+
backgroundElementTemplateInstanceManager.updateId(list.instanceId, -10);
|
|
538
|
+
list.markMaterializedByHydration();
|
|
539
|
+
const metadata = { 'item-key': 'a', className: 'row' };
|
|
540
|
+
const item = new BackgroundElementTemplateInstance('_et_item_a');
|
|
541
|
+
item.setAttribute('__listItemPlatformInfo', metadata);
|
|
542
|
+
list.appendChild(item);
|
|
543
|
+
backgroundElementTemplateInstanceManager.updateId(item.instanceId, -11);
|
|
544
|
+
item.markMaterializedByHydration();
|
|
545
|
+
markElementTemplateHydrated();
|
|
546
|
+
globalCommitContext.ops = [];
|
|
547
|
+
|
|
548
|
+
metadata['item-key'] = 'b';
|
|
549
|
+
|
|
550
|
+
expect(item.getListItemPlatformInfo()).toEqual({ 'item-key': 'a' });
|
|
551
|
+
|
|
552
|
+
item.setAttribute('__listItemPlatformInfo', metadata);
|
|
553
|
+
|
|
554
|
+
expect(globalCommitContext.ops).toEqual([
|
|
555
|
+
ElementTemplateUpdateOps.updateTypedListItem,
|
|
556
|
+
-10,
|
|
557
|
+
{
|
|
558
|
+
__etHandleRef: -11,
|
|
559
|
+
type: '_et_item_a',
|
|
560
|
+
platformInfo: { 'item-key': 'b' },
|
|
561
|
+
subtreeHandleIds: null,
|
|
562
|
+
},
|
|
563
|
+
]);
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
it.each([null, undefined, {}, { className: 'row' }])('clears list item platform info once when set to %s', value => {
|
|
567
|
+
const list = new BackgroundListElementTemplateInstance();
|
|
568
|
+
backgroundElementTemplateInstanceManager.updateId(list.instanceId, -10);
|
|
569
|
+
list.markMaterializedByHydration();
|
|
570
|
+
const item = new BackgroundElementTemplateInstance('_et_item_a');
|
|
571
|
+
item.setAttribute('__listItemPlatformInfo', { 'item-key': 'a' });
|
|
572
|
+
list.appendChild(item);
|
|
573
|
+
backgroundElementTemplateInstanceManager.updateId(item.instanceId, -11);
|
|
574
|
+
item.markMaterializedByHydration();
|
|
575
|
+
markElementTemplateHydrated();
|
|
576
|
+
globalCommitContext.ops = [];
|
|
577
|
+
|
|
578
|
+
item.setAttribute('__listItemPlatformInfo', value);
|
|
579
|
+
|
|
580
|
+
expect(globalCommitContext.ops).toEqual([
|
|
581
|
+
ElementTemplateUpdateOps.updateTypedListItem,
|
|
582
|
+
-10,
|
|
583
|
+
{
|
|
584
|
+
__etHandleRef: -11,
|
|
585
|
+
type: '_et_item_a',
|
|
586
|
+
platformInfo: {},
|
|
587
|
+
subtreeHandleIds: null,
|
|
415
588
|
},
|
|
416
589
|
]);
|
|
590
|
+
|
|
591
|
+
globalCommitContext.ops = [];
|
|
592
|
+
|
|
593
|
+
item.setAttribute('__listItemPlatformInfo', value);
|
|
594
|
+
|
|
595
|
+
expect(globalCommitContext.ops).toEqual([]);
|
|
417
596
|
});
|
|
418
597
|
|
|
419
598
|
it('does not refresh list membership when adding a subtree without MTRefs', () => {
|
|
@@ -438,6 +617,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
438
617
|
null,
|
|
439
618
|
[],
|
|
440
619
|
[],
|
|
620
|
+
null,
|
|
441
621
|
ElementTemplateUpdateOps.insertNode,
|
|
442
622
|
-11,
|
|
443
623
|
0,
|
|
@@ -514,8 +694,9 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
514
694
|
flushPendingRefs();
|
|
515
695
|
|
|
516
696
|
expect(globalCommitContext.ops).toEqual([
|
|
517
|
-
ElementTemplateUpdateOps.
|
|
697
|
+
ElementTemplateUpdateOps.removeNode,
|
|
518
698
|
-10,
|
|
699
|
+
0,
|
|
519
700
|
-11,
|
|
520
701
|
[-11],
|
|
521
702
|
]);
|
|
@@ -559,19 +740,17 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
559
740
|
newList.appendChild(item);
|
|
560
741
|
|
|
561
742
|
expect(globalCommitContext.ops).toEqual([
|
|
562
|
-
ElementTemplateUpdateOps.
|
|
743
|
+
ElementTemplateUpdateOps.removeNode,
|
|
563
744
|
-10,
|
|
745
|
+
0,
|
|
564
746
|
-11,
|
|
565
747
|
[],
|
|
566
|
-
ElementTemplateUpdateOps.
|
|
748
|
+
ElementTemplateUpdateOps.insertNode,
|
|
567
749
|
-20,
|
|
568
|
-
{
|
|
569
|
-
__etHandleRef: -11,
|
|
570
|
-
type: '_et_item_a',
|
|
571
|
-
platformInfo: { 'item-key': 'a' },
|
|
572
|
-
subtreeHandleIds: [],
|
|
573
|
-
},
|
|
574
750
|
0,
|
|
751
|
+
-11,
|
|
752
|
+
0,
|
|
753
|
+
null,
|
|
575
754
|
]);
|
|
576
755
|
});
|
|
577
756
|
|
|
@@ -605,7 +784,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
605
784
|
{
|
|
606
785
|
__etHandleRef: item.instanceId,
|
|
607
786
|
type: '_et_item',
|
|
608
|
-
platformInfo:
|
|
787
|
+
platformInfo: null,
|
|
609
788
|
subtreeHandleIds: [child.instanceId],
|
|
610
789
|
},
|
|
611
790
|
]);
|
|
@@ -637,13 +816,13 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
637
816
|
{
|
|
638
817
|
__etHandleRef: item.instanceId,
|
|
639
818
|
type: '_et_item',
|
|
640
|
-
platformInfo:
|
|
819
|
+
platformInfo: null,
|
|
641
820
|
subtreeHandleIds: [],
|
|
642
821
|
},
|
|
643
822
|
]);
|
|
644
823
|
});
|
|
645
824
|
|
|
646
|
-
it('emits
|
|
825
|
+
it('emits structural and platform info updates for list mutations during one render', () => {
|
|
647
826
|
const list = new BackgroundListElementTemplateInstance();
|
|
648
827
|
backgroundElementTemplateInstanceManager.updateId(list.instanceId, -10);
|
|
649
828
|
list.markMaterializedByHydration();
|
|
@@ -670,17 +849,16 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
670
849
|
null,
|
|
671
850
|
[],
|
|
672
851
|
[],
|
|
673
|
-
|
|
852
|
+
null,
|
|
853
|
+
ElementTemplateUpdateOps.insertNode,
|
|
674
854
|
-10,
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
type: '_et_item_c',
|
|
678
|
-
platformInfo: {},
|
|
679
|
-
subtreeHandleIds: [],
|
|
680
|
-
},
|
|
855
|
+
0,
|
|
856
|
+
third.instanceId,
|
|
681
857
|
-12,
|
|
682
|
-
|
|
858
|
+
null,
|
|
859
|
+
ElementTemplateUpdateOps.removeNode,
|
|
683
860
|
-10,
|
|
861
|
+
0,
|
|
684
862
|
-11,
|
|
685
863
|
[-11],
|
|
686
864
|
ElementTemplateUpdateOps.updateTypedListItem,
|
|
@@ -689,7 +867,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
689
867
|
__etHandleRef: -12,
|
|
690
868
|
type: '_et_item_b',
|
|
691
869
|
platformInfo: { 'item-key': 'b', 'full-span': true },
|
|
692
|
-
subtreeHandleIds:
|
|
870
|
+
subtreeHandleIds: null,
|
|
693
871
|
},
|
|
694
872
|
]);
|
|
695
873
|
});
|
|
@@ -784,17 +962,6 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
784
962
|
expect(parent.lastChild).toBe(child);
|
|
785
963
|
});
|
|
786
964
|
|
|
787
|
-
it('supports silent append on regular parents', () => {
|
|
788
|
-
const parent = new BackgroundElementTemplateInstance('view');
|
|
789
|
-
const child = new BackgroundElementTemplateInstance('text');
|
|
790
|
-
globalCommitContext.ops = [];
|
|
791
|
-
|
|
792
|
-
parent.insertBefore(child, null, true);
|
|
793
|
-
|
|
794
|
-
expect(parent.firstChild).toBe(child);
|
|
795
|
-
expect(globalCommitContext.ops).toEqual([]);
|
|
796
|
-
});
|
|
797
|
-
|
|
798
965
|
it('emits create with initialized attrs before inserting a post-hydration template', () => {
|
|
799
966
|
const parent = new BackgroundElementTemplateInstance('view');
|
|
800
967
|
parent.emitCreate();
|
|
@@ -816,6 +983,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
816
983
|
null,
|
|
817
984
|
['logo.png'],
|
|
818
985
|
[],
|
|
986
|
+
null,
|
|
819
987
|
3,
|
|
820
988
|
parent.instanceId,
|
|
821
989
|
0,
|
|
@@ -846,6 +1014,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
846
1014
|
null,
|
|
847
1015
|
[`${child.instanceId}-0`],
|
|
848
1016
|
[],
|
|
1017
|
+
null,
|
|
849
1018
|
3,
|
|
850
1019
|
parent.instanceId,
|
|
851
1020
|
0,
|
|
@@ -870,7 +1039,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
870
1039
|
child.appendChild(ordinaryDescendant);
|
|
871
1040
|
parent.appendChild(child);
|
|
872
1041
|
|
|
873
|
-
expect(globalCommitContext.ops[
|
|
1042
|
+
expect(globalCommitContext.ops[14]).toBe(ElementTemplateUpdateOps.insertNode);
|
|
874
1043
|
expect(globalCommitContext.ops.at(-1)).toEqual([child.instanceId]);
|
|
875
1044
|
});
|
|
876
1045
|
|
|
@@ -957,32 +1126,14 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
957
1126
|
expect(parent.childNodes).toEqual([owner, anchor]);
|
|
958
1127
|
expect(owner.firstChild).toBe(nested);
|
|
959
1128
|
expect(nested.firstChild).toBe(leaf);
|
|
960
|
-
expect(globalCommitContext.ops).toEqual(
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
parent.instanceId,
|
|
969
|
-
{
|
|
970
|
-
__etHandleRef: owner.instanceId,
|
|
971
|
-
type: '_et_owner',
|
|
972
|
-
platformInfo: {},
|
|
973
|
-
subtreeHandleIds: [leaf.instanceId],
|
|
974
|
-
},
|
|
975
|
-
anchor.instanceId,
|
|
976
|
-
]
|
|
977
|
-
: [
|
|
978
|
-
ElementTemplateUpdateOps.insertNode,
|
|
979
|
-
parent.instanceId,
|
|
980
|
-
0,
|
|
981
|
-
owner.instanceId,
|
|
982
|
-
anchor.instanceId,
|
|
983
|
-
[leaf.instanceId],
|
|
984
|
-
],
|
|
985
|
-
);
|
|
1129
|
+
expect(globalCommitContext.ops).toEqual([
|
|
1130
|
+
ElementTemplateUpdateOps.insertNode,
|
|
1131
|
+
parent.instanceId,
|
|
1132
|
+
0,
|
|
1133
|
+
owner.instanceId,
|
|
1134
|
+
anchor.instanceId,
|
|
1135
|
+
parentKind === 'list' ? null : [leaf.instanceId],
|
|
1136
|
+
]);
|
|
986
1137
|
});
|
|
987
1138
|
|
|
988
1139
|
it('creates new descendants once when moving their materialized owner', () => {
|
|
@@ -1017,12 +1168,14 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1017
1168
|
null,
|
|
1018
1169
|
[`${leaf.instanceId}-0`],
|
|
1019
1170
|
[],
|
|
1171
|
+
null,
|
|
1020
1172
|
ElementTemplateUpdateOps.createTemplate,
|
|
1021
1173
|
nested.instanceId,
|
|
1022
1174
|
'_et_nested',
|
|
1023
1175
|
null,
|
|
1024
1176
|
[],
|
|
1025
1177
|
[[leaf.instanceId]],
|
|
1178
|
+
null,
|
|
1026
1179
|
ElementTemplateUpdateOps.insertNode,
|
|
1027
1180
|
owner.instanceId,
|
|
1028
1181
|
0,
|
|
@@ -1067,12 +1220,14 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1067
1220
|
null,
|
|
1068
1221
|
['nested'],
|
|
1069
1222
|
[],
|
|
1223
|
+
null,
|
|
1070
1224
|
1,
|
|
1071
1225
|
owner.instanceId,
|
|
1072
1226
|
'view',
|
|
1073
1227
|
null,
|
|
1074
1228
|
[],
|
|
1075
1229
|
[[nested.instanceId]],
|
|
1230
|
+
null,
|
|
1076
1231
|
3,
|
|
1077
1232
|
parent.instanceId,
|
|
1078
1233
|
0,
|
|
@@ -1096,14 +1251,14 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1096
1251
|
|
|
1097
1252
|
parent.appendChild(child);
|
|
1098
1253
|
|
|
1099
|
-
const serializedSlots = globalCommitContext.ops[
|
|
1100
|
-
expect(globalCommitContext.ops[
|
|
1101
|
-
expect(globalCommitContext.ops[
|
|
1254
|
+
const serializedSlots = globalCommitContext.ops[12] as unknown[];
|
|
1255
|
+
expect(globalCommitContext.ops[7]).toBe(1);
|
|
1256
|
+
expect(globalCommitContext.ops[8]).toBe(child.instanceId);
|
|
1102
1257
|
expect(serializedSlots).toHaveLength(2);
|
|
1103
1258
|
expect(0 in serializedSlots).toBe(false);
|
|
1104
1259
|
expect(1 in serializedSlots).toBe(true);
|
|
1105
1260
|
expect(serializedSlots[1]).toEqual([grandchild.instanceId]);
|
|
1106
|
-
expect(globalCommitContext.ops.slice(
|
|
1261
|
+
expect(globalCommitContext.ops.slice(14)).toEqual([
|
|
1107
1262
|
3,
|
|
1108
1263
|
parent.instanceId,
|
|
1109
1264
|
0,
|
|
@@ -1135,31 +1290,34 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1135
1290
|
null,
|
|
1136
1291
|
[],
|
|
1137
1292
|
[],
|
|
1293
|
+
null,
|
|
1138
1294
|
ElementTemplateUpdateOps.createTemplate,
|
|
1139
1295
|
item.instanceId,
|
|
1140
1296
|
'_et_item',
|
|
1141
1297
|
null,
|
|
1142
1298
|
[],
|
|
1143
1299
|
[[nested.instanceId]],
|
|
1300
|
+
null,
|
|
1144
1301
|
ElementTemplateUpdateOps.createTypedElement,
|
|
1145
1302
|
list.instanceId,
|
|
1146
1303
|
'list',
|
|
1147
1304
|
null,
|
|
1305
|
+
[[item.instanceId]],
|
|
1148
1306
|
null,
|
|
1307
|
+
ElementTemplateUpdateOps.updateTypedListItem,
|
|
1308
|
+
list.instanceId,
|
|
1149
1309
|
{
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
subtreeHandleIds: [],
|
|
1155
|
-
}],
|
|
1310
|
+
__etHandleRef: item.instanceId,
|
|
1311
|
+
type: '_et_item',
|
|
1312
|
+
platformInfo: null,
|
|
1313
|
+
subtreeHandleIds: [],
|
|
1156
1314
|
},
|
|
1157
1315
|
ElementTemplateUpdateOps.insertNode,
|
|
1158
1316
|
parent.instanceId,
|
|
1159
1317
|
0,
|
|
1160
1318
|
list.instanceId,
|
|
1161
1319
|
0,
|
|
1162
|
-
|
|
1320
|
+
[list.instanceId],
|
|
1163
1321
|
]);
|
|
1164
1322
|
});
|
|
1165
1323
|
|
|
@@ -1270,6 +1428,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1270
1428
|
null,
|
|
1271
1429
|
[],
|
|
1272
1430
|
[],
|
|
1431
|
+
null,
|
|
1273
1432
|
ElementTemplateUpdateOps.insertNode,
|
|
1274
1433
|
parent.instanceId,
|
|
1275
1434
|
1,
|
|
@@ -1302,6 +1461,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1302
1461
|
null,
|
|
1303
1462
|
[],
|
|
1304
1463
|
[],
|
|
1464
|
+
null,
|
|
1305
1465
|
ElementTemplateUpdateOps.insertNode,
|
|
1306
1466
|
parent.instanceId,
|
|
1307
1467
|
1,
|
|
@@ -1385,12 +1545,14 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1385
1545
|
null,
|
|
1386
1546
|
['inside'],
|
|
1387
1547
|
[],
|
|
1548
|
+
null,
|
|
1388
1549
|
ElementTemplateUpdateOps.createTemplate,
|
|
1389
1550
|
child.instanceId,
|
|
1390
1551
|
'view',
|
|
1391
1552
|
null,
|
|
1392
1553
|
[],
|
|
1393
1554
|
[[grandchild.instanceId]],
|
|
1555
|
+
null,
|
|
1394
1556
|
ElementTemplateUpdateOps.insertNode,
|
|
1395
1557
|
parent.instanceId,
|
|
1396
1558
|
0,
|
|
@@ -1425,12 +1587,14 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1425
1587
|
null,
|
|
1426
1588
|
['inside'],
|
|
1427
1589
|
[],
|
|
1590
|
+
null,
|
|
1428
1591
|
ElementTemplateUpdateOps.createTemplate,
|
|
1429
1592
|
-2,
|
|
1430
1593
|
'view',
|
|
1431
1594
|
null,
|
|
1432
1595
|
[],
|
|
1433
1596
|
[[-3]],
|
|
1597
|
+
null,
|
|
1434
1598
|
ElementTemplateUpdateOps.insertNode,
|
|
1435
1599
|
parent.instanceId,
|
|
1436
1600
|
0,
|
|
@@ -1747,20 +1911,20 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1747
1911
|
const child = new BackgroundElementTemplateInstance('text');
|
|
1748
1912
|
parent.appendChild(child);
|
|
1749
1913
|
|
|
1750
|
-
|
|
1914
|
+
markElementTemplateHydrated();
|
|
1915
|
+
parent.markMaterializedByHydration();
|
|
1916
|
+
child.markMaterializedByHydration();
|
|
1917
|
+
|
|
1751
1918
|
parent.removeChild(child, true);
|
|
1752
1919
|
|
|
1753
1920
|
expect(parent.childSlots[0]).toBeUndefined();
|
|
1921
|
+
expect(child.parent).toBeNull();
|
|
1754
1922
|
expect(globalCommitContext.ops).toEqual([]);
|
|
1755
1923
|
expect([...globalCommitContext.nonPayload.removedSubtreesAwaitingTeardown]).toEqual([]);
|
|
1924
|
+
expect(backgroundElementTemplateInstanceManager.get(child.instanceId)).toBe(child);
|
|
1756
1925
|
});
|
|
1757
1926
|
});
|
|
1758
1927
|
|
|
1759
|
-
it('should be registered with manager upon creation', () => {
|
|
1760
|
-
const instance = new BackgroundElementTemplateInstance('view');
|
|
1761
|
-
expect(backgroundElementTemplateInstanceManager.get(instance.instanceId)).toBe(instance);
|
|
1762
|
-
});
|
|
1763
|
-
|
|
1764
1928
|
it('should tear down correctly', () => {
|
|
1765
1929
|
const parent = new BackgroundElementTemplateInstance('view');
|
|
1766
1930
|
const child = new BackgroundElementTemplateInstance('text');
|
|
@@ -1802,7 +1966,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1802
1966
|
expect(ref.current).toBeNull();
|
|
1803
1967
|
});
|
|
1804
1968
|
|
|
1805
|
-
it('reports
|
|
1969
|
+
it('reports errors for compiled and List emitCreate with illegal handleId 0 in dev', () => {
|
|
1806
1970
|
const lynxObj = globalThis.lynx as typeof lynx & { reportError?: (error: Error) => void };
|
|
1807
1971
|
const oldReportError = lynxObj.reportError;
|
|
1808
1972
|
const reportErrorSpy = vi.fn();
|
|
@@ -1814,6 +1978,16 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1814
1978
|
|
|
1815
1979
|
expect(reportErrorSpy).toHaveBeenCalledTimes(1);
|
|
1816
1980
|
|
|
1981
|
+
const list = new BackgroundListElementTemplateInstance();
|
|
1982
|
+
list.appendChild(new BackgroundElementTemplateInstance('_et_list_item'));
|
|
1983
|
+
list.instanceId = 0;
|
|
1984
|
+
globalCommitContext.ops = [];
|
|
1985
|
+
|
|
1986
|
+
list.emitCreate();
|
|
1987
|
+
|
|
1988
|
+
expect(reportErrorSpy).toHaveBeenCalledTimes(2);
|
|
1989
|
+
expect(globalCommitContext.ops).toEqual([]);
|
|
1990
|
+
|
|
1817
1991
|
lynxObj.reportError = oldReportError;
|
|
1818
1992
|
});
|
|
1819
1993
|
|
|
@@ -1843,6 +2017,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
1843
2017
|
null,
|
|
1844
2018
|
[null],
|
|
1845
2019
|
[],
|
|
2020
|
+
null,
|
|
1846
2021
|
]);
|
|
1847
2022
|
});
|
|
1848
2023
|
|
|
@@ -2181,6 +2356,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
2181
2356
|
null,
|
|
2182
2357
|
[],
|
|
2183
2358
|
[],
|
|
2359
|
+
null,
|
|
2184
2360
|
]);
|
|
2185
2361
|
});
|
|
2186
2362
|
|
|
@@ -2198,6 +2374,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
2198
2374
|
null,
|
|
2199
2375
|
[],
|
|
2200
2376
|
[],
|
|
2377
|
+
null,
|
|
2201
2378
|
]);
|
|
2202
2379
|
});
|
|
2203
2380
|
|
|
@@ -2232,6 +2409,7 @@ describe('BackgroundElementTemplateInstance', () => {
|
|
|
2232
2409
|
null,
|
|
2233
2410
|
['deferred'],
|
|
2234
2411
|
[],
|
|
2412
|
+
null,
|
|
2235
2413
|
3,
|
|
2236
2414
|
parent.instanceId,
|
|
2237
2415
|
0,
|
|
@@ -2341,14 +2519,6 @@ describe('BackgroundElementTemplateInstance Shadow State', () => {
|
|
|
2341
2519
|
expect(instance.attributeSlots).toEqual(slots);
|
|
2342
2520
|
});
|
|
2343
2521
|
|
|
2344
|
-
it('should update attributeSlots when setAttribute("attributeSlots", ...) is called', () => {
|
|
2345
|
-
const instance = new BackgroundElementTemplateInstance('view');
|
|
2346
|
-
const slots = [{ id: 'a' }, { class: 'foo' }] as const;
|
|
2347
|
-
instance.setAttribute('attributeSlots', [...slots]);
|
|
2348
|
-
|
|
2349
|
-
expect(instance.attributeSlots).toEqual(slots);
|
|
2350
|
-
});
|
|
2351
|
-
|
|
2352
2522
|
it.each([false, true])('does not serialize attributes before materialization (hydrated=%s)', (isHydrated) => {
|
|
2353
2523
|
const instance = new BackgroundElementTemplateInstance('view', [{ id: 'before' }]);
|
|
2354
2524
|
if (isHydrated) {
|
|
@@ -2377,6 +2547,7 @@ describe('BackgroundElementTemplateInstance Shadow State', () => {
|
|
|
2377
2547
|
null,
|
|
2378
2548
|
nextSlots,
|
|
2379
2549
|
[],
|
|
2550
|
+
null,
|
|
2380
2551
|
ElementTemplateUpdateOps.insertNode,
|
|
2381
2552
|
root.instanceId,
|
|
2382
2553
|
0,
|
|
@@ -2525,6 +2696,7 @@ describe('BackgroundElementTemplateInstance Shadow State', () => {
|
|
|
2525
2696
|
null,
|
|
2526
2697
|
[eventValue],
|
|
2527
2698
|
[],
|
|
2699
|
+
null,
|
|
2528
2700
|
]);
|
|
2529
2701
|
});
|
|
2530
2702
|
|
|
@@ -2653,6 +2825,7 @@ describe('BackgroundElementTemplateInstance Shadow State', () => {
|
|
|
2653
2825
|
null,
|
|
2654
2826
|
[preparedSpread],
|
|
2655
2827
|
[],
|
|
2828
|
+
null,
|
|
2656
2829
|
]);
|
|
2657
2830
|
});
|
|
2658
2831
|
|
|
@@ -2696,36 +2869,14 @@ describe('BackgroundElementTemplateInstance slot-index children', () => {
|
|
|
2696
2869
|
expect(root.childSlots[1]).toEqual([text]);
|
|
2697
2870
|
});
|
|
2698
2871
|
|
|
2699
|
-
it('should
|
|
2700
|
-
const root = new BackgroundElementTemplateInstance('element-template-view');
|
|
2701
|
-
const text = createTextNode('late');
|
|
2702
|
-
|
|
2703
|
-
text.__slotIndex = 2;
|
|
2704
|
-
root.appendChild(text);
|
|
2705
|
-
|
|
2706
|
-
expect(root.childSlots[2]).toEqual([text]);
|
|
2707
|
-
});
|
|
2708
|
-
|
|
2709
|
-
it('should move slot children to the new slot index when partId changes', () => {
|
|
2710
|
-
const root = new BackgroundElementTemplateInstance('element-template-view');
|
|
2711
|
-
const text = createTextNode('move');
|
|
2712
|
-
|
|
2713
|
-
text.__slotIndex = 0;
|
|
2714
|
-
root.appendChild(text);
|
|
2715
|
-
text.__slotIndex = 3;
|
|
2716
|
-
|
|
2717
|
-
expect(root.childSlots[0]).toBeUndefined();
|
|
2718
|
-
expect(root.childSlots[3]).toEqual([text]);
|
|
2719
|
-
});
|
|
2720
|
-
|
|
2721
|
-
it('should detach a moved child from the old slot shadow state when silent reparenting', () => {
|
|
2872
|
+
it('should detach a moved child from the old slot shadow state when reparenting', () => {
|
|
2722
2873
|
const root = new BackgroundElementTemplateInstance('element-template-view');
|
|
2723
2874
|
const text = createTextNode('move');
|
|
2724
2875
|
|
|
2725
2876
|
root.appendChild(text);
|
|
2726
2877
|
|
|
2727
2878
|
text.__slotIndex = 1;
|
|
2728
|
-
root.insertBefore(text, null
|
|
2879
|
+
root.insertBefore(text, null);
|
|
2729
2880
|
|
|
2730
2881
|
expect(root.childSlots[0]).toBeUndefined();
|
|
2731
2882
|
expect(root.childSlots[1]).toEqual([text]);
|
|
@@ -2739,7 +2890,7 @@ describe('BackgroundElementTemplateInstance slot-index children', () => {
|
|
|
2739
2890
|
|
|
2740
2891
|
rootA.appendChild(text);
|
|
2741
2892
|
|
|
2742
|
-
rootB.insertBefore(text, null
|
|
2893
|
+
rootB.insertBefore(text, null);
|
|
2743
2894
|
|
|
2744
2895
|
expect(rootA.childSlots).toEqual([]);
|
|
2745
2896
|
expect(rootB.firstChild).toBe(text);
|