@lynx-js/react 0.126.1 → 0.126.2
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 +22 -0
- package/components/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/refresh/.turbo/turbo-build.log +3 -3
- package/refresh/dist/index.js +1 -2
- package/refresh/package.json +1 -1
- 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/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/suspense-lazy.test.ts +52 -7
- 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/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/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/lazy.test.js +44 -9
- package/runtime/__test__/snapshot/lifecycle/reloadGc.test.jsx +66 -0
- package/runtime/__test__/snapshot/lynx/runtime-version.test.ts +140 -0
- package/runtime/__test__/snapshot/spread.test.jsx +22 -15
- package/runtime/__test__/snapshot/ssr.legacy-slot.test.jsx +168 -0
- package/runtime/__test__/snapshot/ssr.list.test.jsx +211 -0
- package/runtime/__test__/worklet-runtime/hydrate.test.js +92 -0
- package/runtime/__test__/worklet-runtime/runOnBackground.test.js +8 -6
- package/runtime/__test__/worklet-runtime/workletRuntime.test.js +3 -2
- package/runtime/lazy/element-template-import.js +0 -4
- package/runtime/lazy/element-template-internal.js +18 -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 +1 -3
- package/runtime/lazy/import.js +0 -4
- package/runtime/lazy/internal.js +15 -1
- package/runtime/lazy/target.js +0 -21
- package/runtime/lib/core/hooks/react.d.ts +2 -0
- package/runtime/lib/core/hooks/react.js +2 -0
- package/runtime/lib/core/hooks/react.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/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 +1 -1
- package/runtime/lib/element-template/index.js +1 -1
- package/runtime/lib/element-template/index.js.map +1 -1
- package/runtime/lib/element-template/internal.d.ts +4 -1
- package/runtime/lib/element-template/internal.js +6 -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/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.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 +3 -1
- package/runtime/lib/internal.js +5 -1
- package/runtime/lib/internal.js.map +1 -1
- package/runtime/lib/lynx-api.d.ts +15 -6
- package/runtime/lib/lynx-api.js +13 -4
- package/runtime/lib/lynx-api.js.map +1 -1
- 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/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/element.d.ts +2 -0
- package/runtime/lib/snapshot/lynx/element.js +2 -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/tsconfig.tsbuildinfo +1 -1
- package/runtime/lib/worklet-runtime/bindings/types.d.ts +1 -1
- package/runtime/lib/worklet-runtime/hydrate.js +1 -1
- package/runtime/lib/worklet-runtime/hydrate.js.map +1 -1
- package/runtime/lib/worklet-runtime/workletRuntime.js +5 -14
- package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
- package/runtime/src/core/hooks/react.ts +2 -0
- package/runtime/src/core/lynx/runtime-version.ts +62 -0
- 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 +1 -1
- package/runtime/src/element-template/internal.ts +12 -1
- package/runtime/src/element-template/native/index.ts +4 -0
- 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 +10 -1
- package/runtime/src/lynx-api.ts +15 -6
- 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/reload.ts +4 -0
- package/runtime/src/snapshot/lynx/calledByNative.ts +4 -0
- package/runtime/src/snapshot/lynx/element.ts +2 -0
- package/runtime/src/snapshot/renderToOpcodes/opcodes.ts +2 -1
- package/runtime/src/worklet-runtime/bindings/types.ts +1 -1
- package/runtime/src/worklet-runtime/hydrate.ts +1 -1
- package/runtime/src/worklet-runtime/workletRuntime.ts +5 -14
- package/runtime/types/types.d.ts +2 -0
- package/runtime/worklet-runtime/dev.js +4 -16
- 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 +2 -2
- 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/node_modules/.bin/rsbuild +19 -6
- package/testing-library/node_modules/.bin/rspeedy +17 -4
- package/testing-library/node_modules/.bin/rstest +19 -6
- package/testing-library/package.json +2 -2
- package/testing-library/src/__tests__/reload/reloadGc.test.jsx +64 -0
- package/testing-library/src/__tests__/reload/reloadTemplate.js +39 -0
- package/testing-library/types/entry.d.ts +2 -2
- package/transform/.turbo/turbo-build$colon$wasm.log +68 -56
- package/transform/__test__/fixture.spec.js +17 -20
- 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_plugins_shared/jsx_helpers.rs +8 -4
- package/transform/dist/wasm.cjs +1 -1
- package/transform/index.d.ts +7 -6
- package/transform/node_modules/.bin/esbuild +17 -4
- package/transform/node_modules/.bin/napi +17 -4
- 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 +310 -114
- 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 +10 -208
- 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/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/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 → runtime-marker.d.ts} +0 -0
- /package/runtime/lib/{runtime-backend-marker.d.ts → runtime-marker.d.ts} +0 -0
|
@@ -9938,12 +9938,14 @@ __webpack_require__.add({
|
|
|
9938
9938
|
if (!(index < values.length)) return {
|
|
9939
9939
|
done: true
|
|
9940
9940
|
};
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9941
|
+
else {
|
|
9942
|
+
var value = values[index];
|
|
9943
|
+
index += 1;
|
|
9944
|
+
return {
|
|
9945
|
+
done: false,
|
|
9946
|
+
value: value
|
|
9947
|
+
};
|
|
9948
|
+
}
|
|
9947
9949
|
}
|
|
9948
9950
|
};
|
|
9949
9951
|
return iter;
|
|
@@ -10040,13 +10042,15 @@ __webpack_require__.add({
|
|
|
10040
10042
|
},
|
|
10041
10043
|
decompressFromUint8Array: function(compressed) {
|
|
10042
10044
|
if (null == compressed) return LZString.decompress(compressed);
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10045
|
+
else {
|
|
10046
|
+
var buf = new Array(compressed.length / 2);
|
|
10047
|
+
for(var i = 0, TotalLen = buf.length; i < TotalLen; i++)buf[i] = 256 * compressed[2 * i] + compressed[2 * i + 1];
|
|
10048
|
+
var result = [];
|
|
10049
|
+
buf.forEach(function(c) {
|
|
10050
|
+
result.push(f(c));
|
|
10051
|
+
});
|
|
10052
|
+
return LZString.decompress(result.join(''));
|
|
10053
|
+
}
|
|
10050
10054
|
},
|
|
10051
10055
|
compressToEncodedURIComponent: function(input) {
|
|
10052
10056
|
if (null == input) return "";
|
|
@@ -10230,8 +10234,7 @@ __webpack_require__.add({
|
|
|
10230
10234
|
if (context_data_position == bitsPerChar - 1) {
|
|
10231
10235
|
context_data.push(getCharFromInt(context_data_val));
|
|
10232
10236
|
break;
|
|
10233
|
-
}
|
|
10234
|
-
context_data_position++;
|
|
10237
|
+
} else context_data_position++;
|
|
10235
10238
|
}
|
|
10236
10239
|
return context_data.join('');
|
|
10237
10240
|
},
|
|
@@ -10706,10 +10709,10 @@ __webpack_require__.add({
|
|
|
10706
10709
|
var _collections = __webpack_require__("../../../node_modules/.pnpm/pretty-format@27.5.1/node_modules/pretty-format/build/collections.js");
|
|
10707
10710
|
var global = function() {
|
|
10708
10711
|
if ("u" > typeof globalThis) return globalThis;
|
|
10709
|
-
if (void 0 !== global) return global;
|
|
10710
|
-
if ("u" > typeof self) return self;
|
|
10711
|
-
if ("u" > typeof window) return window;
|
|
10712
|
-
return Function('return this')();
|
|
10712
|
+
else if (void 0 !== global) return global;
|
|
10713
|
+
else if ("u" > typeof self) return self;
|
|
10714
|
+
else if ("u" > typeof window) return window;
|
|
10715
|
+
else return Function('return this')();
|
|
10713
10716
|
}();
|
|
10714
10717
|
var Symbol1 = global['jest-symbol-do-not-touch'] || global.Symbol;
|
|
10715
10718
|
const asymmetricMatcher = 'function' == typeof Symbol1 && Symbol1.for ? Symbol1.for('jest.asymmetricMatcher') : 0x1357a5;
|
|
@@ -11050,10 +11053,10 @@ __webpack_require__.add({
|
|
|
11050
11053
|
var _markup = __webpack_require__("../../../node_modules/.pnpm/pretty-format@27.5.1/node_modules/pretty-format/build/plugins/lib/markup.js");
|
|
11051
11054
|
var global = function() {
|
|
11052
11055
|
if ("u" > typeof globalThis) return globalThis;
|
|
11053
|
-
if (void 0 !== global) return global;
|
|
11054
|
-
if ("u" > typeof self) return self;
|
|
11055
|
-
if ("u" > typeof window) return window;
|
|
11056
|
-
return Function('return this')();
|
|
11056
|
+
else if (void 0 !== global) return global;
|
|
11057
|
+
else if ("u" > typeof self) return self;
|
|
11058
|
+
else if ("u" > typeof window) return window;
|
|
11059
|
+
else return Function('return this')();
|
|
11057
11060
|
}();
|
|
11058
11061
|
var Symbol1 = global['jest-symbol-do-not-touch'] || global.Symbol;
|
|
11059
11062
|
const testSymbol = 'function' == typeof Symbol1 && Symbol1.for ? Symbol1.for('react.test.json') : 0xea71357;
|
|
@@ -12380,10 +12383,10 @@ function getDocument() {
|
|
|
12380
12383
|
}
|
|
12381
12384
|
function getWindowFromNode(node) {
|
|
12382
12385
|
if (node.defaultView) return node.defaultView;
|
|
12383
|
-
if (node.ownerDocument && node.ownerDocument.defaultView) return node.ownerDocument.defaultView;
|
|
12384
|
-
if (node.window) return node.window;
|
|
12385
|
-
if (node.ownerDocument && null === node.ownerDocument.defaultView) throw new Error("It looks like the window object is not available for the provided node.");
|
|
12386
|
-
if (node.then instanceof Function) throw new Error("It looks like you passed a Promise object instead of a DOM node. Did you do something like `fireEvent.click(screen.findBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`, or await the findBy query `fireEvent.click(await screen.findBy...`?");
|
|
12386
|
+
else if (node.ownerDocument && node.ownerDocument.defaultView) return node.ownerDocument.defaultView;
|
|
12387
|
+
else if (node.window) return node.window;
|
|
12388
|
+
else if (node.ownerDocument && null === node.ownerDocument.defaultView) throw new Error("It looks like the window object is not available for the provided node.");
|
|
12389
|
+
else if (node.then instanceof Function) throw new Error("It looks like you passed a Promise object instead of a DOM node. Did you do something like `fireEvent.click(screen.findBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`, or await the findBy query `fireEvent.click(await screen.findBy...`?");
|
|
12387
12390
|
else if (Array.isArray(node)) throw new Error("It looks like you passed an Array instead of a DOM node. Did you do something like `fireEvent.click(screen.getAllBy...` when you meant to use a `getBy` query `fireEvent.click(screen.getBy...`?");
|
|
12388
12391
|
else if ('function' == typeof node.debug && 'function' == typeof node.logTestingPlaygroundURL) throw new Error("It looks like you passed a `screen` object. Did you do something like `fireEvent.click(screen, ...` when you meant to use a query, e.g. `fireEvent.click(screen.getBy..., `?");
|
|
12389
12392
|
else throw new Error("The given node is not an Element, the node type is: " + typeof node + ".");
|
|
@@ -12404,7 +12407,7 @@ const shouldHighlight = ()=>{
|
|
|
12404
12407
|
if (colorsJSON) colors = JSON.parse(colorsJSON);
|
|
12405
12408
|
} catch {}
|
|
12406
12409
|
if ('boolean' == typeof colors) return colors;
|
|
12407
|
-
return void 0 !== process.versions && void 0 !== process.versions.node;
|
|
12410
|
+
else return void 0 !== process.versions && void 0 !== process.versions.node;
|
|
12408
12411
|
};
|
|
12409
12412
|
const { DOMCollection: DOMCollection } = build.plugins;
|
|
12410
12413
|
const ELEMENT_NODE = 1;
|
|
@@ -12541,16 +12544,16 @@ function fuzzyMatches(textToMatch, node, matcher, normalizer) {
|
|
|
12541
12544
|
assertNotNullOrUndefined(matcher);
|
|
12542
12545
|
const normalizedText = normalizer(textToMatch);
|
|
12543
12546
|
if ('string' == typeof matcher || 'number' == typeof matcher) return normalizedText.toLowerCase().includes(matcher.toString().toLowerCase());
|
|
12544
|
-
if ('function' == typeof matcher) return matcher(normalizedText, node);
|
|
12545
|
-
return matchRegExp(matcher, normalizedText);
|
|
12547
|
+
else if ('function' == typeof matcher) return matcher(normalizedText, node);
|
|
12548
|
+
else return matchRegExp(matcher, normalizedText);
|
|
12546
12549
|
}
|
|
12547
12550
|
function matches(textToMatch, node, matcher, normalizer) {
|
|
12548
12551
|
if ('string' != typeof textToMatch) return false;
|
|
12549
12552
|
assertNotNullOrUndefined(matcher);
|
|
12550
12553
|
const normalizedText = normalizer(textToMatch);
|
|
12551
12554
|
if (matcher instanceof Function) return matcher(normalizedText, node);
|
|
12552
|
-
if (matcher instanceof RegExp) return matchRegExp(matcher, normalizedText);
|
|
12553
|
-
return normalizedText === String(matcher);
|
|
12555
|
+
else if (matcher instanceof RegExp) return matchRegExp(matcher, normalizedText);
|
|
12556
|
+
else return normalizedText === String(matcher);
|
|
12554
12557
|
}
|
|
12555
12558
|
function getDefaultNormalizer(_temp) {
|
|
12556
12559
|
let { trim = true, collapseWhitespace = true } = void 0 === _temp ? {} : _temp;
|
|
@@ -12617,8 +12620,8 @@ function buildElementRoleList(elementRolesMap) {
|
|
|
12617
12620
|
const shouldBeNonEmpty = -1 !== constraints.indexOf('set');
|
|
12618
12621
|
const hasExplicitValue = void 0 !== value;
|
|
12619
12622
|
if (hasExplicitValue) return "[" + attributeName + "=\"" + value + "\"]";
|
|
12620
|
-
if (shouldNotExist) return ":not([" + attributeName + "])";
|
|
12621
|
-
if (shouldBeNonEmpty) return "[" + attributeName + "]:not([" + attributeName + "=\"\"])";
|
|
12623
|
+
else if (shouldNotExist) return ":not([" + attributeName + "])";
|
|
12624
|
+
else if (shouldBeNonEmpty) return "[" + attributeName + "]:not([" + attributeName + "=\"\"])";
|
|
12622
12625
|
return "[" + attributeName + "]";
|
|
12623
12626
|
}).join('');
|
|
12624
12627
|
}
|
|
@@ -12921,7 +12924,7 @@ function waitFor(callback, _ref) {
|
|
|
12921
12924
|
}
|
|
12922
12925
|
function checkRealTimersCallback() {
|
|
12923
12926
|
if (!jestFakeTimersAreEnabled()) return checkCallback();
|
|
12924
|
-
{
|
|
12927
|
+
else {
|
|
12925
12928
|
const error = new Error("Changed from using real timers to fake timers while using waitFor. This is not allowed and will result in very strange behavior. Please ensure you're awaiting all async things your test is doing before changing to fake timers. For more info, please go to https://github.com/testing-library/dom-testing-library/issues/830");
|
|
12926
12929
|
if (!showOriginalStackTrace) copyStackTrace(error, stackTraceError);
|
|
12927
12930
|
return reject(error);
|
|
@@ -13137,9 +13140,8 @@ const getAllByLabelText = function(container, text) {
|
|
|
13137
13140
|
if (labels.length) {
|
|
13138
13141
|
const tagNames = labels.map((label)=>getTagNameOfElementAssociatedWithLabelViaFor(container, label)).filter((tagName)=>!!tagName);
|
|
13139
13142
|
if (tagNames.length) throw getConfig().getElementError(tagNames.map((tagName)=>"Found a label with the text of: " + text + ", however the element associated with this label (<" + tagName + " />) is non-labellable [https://html.spec.whatwg.org/multipage/forms.html#category-label]. If you really need to label a <" + tagName + " />, you can use aria-label or aria-labelledby instead.").join('\n\n'), container);
|
|
13140
|
-
throw getConfig().getElementError("Found a label with the text of: " + text + ", however no form control was found associated to that label. Make sure you're using the \"for\" attribute or \"aria-labelledby\" attribute correctly.", container);
|
|
13141
|
-
}
|
|
13142
|
-
throw getConfig().getElementError("Unable to find a label with the text of: " + text, container);
|
|
13143
|
+
else throw getConfig().getElementError("Found a label with the text of: " + text + ", however no form control was found associated to that label. Make sure you're using the \"for\" attribute or \"aria-labelledby\" attribute correctly.", container);
|
|
13144
|
+
} else throw getConfig().getElementError("Unable to find a label with the text of: " + text, container);
|
|
13143
13145
|
}
|
|
13144
13146
|
return els;
|
|
13145
13147
|
};
|
|
@@ -13211,7 +13213,7 @@ const queryAllByDisplayValue = function(container, value, _temp) {
|
|
|
13211
13213
|
});
|
|
13212
13214
|
return Array.from(container.querySelectorAll("input,textarea,select")).filter((node)=>{
|
|
13213
13215
|
if ('SELECT' !== node.tagName) return matcher(node.value, node, value, matchNormalizer);
|
|
13214
|
-
{
|
|
13216
|
+
else {
|
|
13215
13217
|
const selectedOptions = Array.from(node.options).filter((option)=>option.selected);
|
|
13216
13218
|
return selectedOptions.some((optionNode)=>matcher(getNodeText(optionNode), optionNode, value, matchNormalizer));
|
|
13217
13219
|
}
|
|
@@ -14282,10 +14284,9 @@ function getElement(elemOrNodesRef) {
|
|
|
14282
14284
|
if (elemOrNodesRef instanceof NodesRef) {
|
|
14283
14285
|
const { type, identifier } = elemOrNodesRef._nodeSelectToken;
|
|
14284
14286
|
return 0 === type ? document.querySelector(identifier) : __GetElementByUniqueId(Number(identifier));
|
|
14285
|
-
}
|
|
14286
|
-
if ('
|
|
14287
|
-
|
|
14288
|
-
throw new Error('Invalid element, got: ' + elemOrNodesRef.constructor?.name);
|
|
14287
|
+
} else if ('refAttr' in elemOrNodesRef) return document.querySelector(`[react-ref-${elemOrNodesRef.refAttr[0]}-${elemOrNodesRef.refAttr[1]}]`);
|
|
14288
|
+
else if (elemOrNodesRef?.constructor?.name === 'HTMLUnknownElement') return elemOrNodesRef;
|
|
14289
|
+
else throw new Error('Invalid element, got: ' + elemOrNodesRef.constructor?.name);
|
|
14289
14290
|
}
|
|
14290
14291
|
const fire_event_fireEvent = (elemOrNodesRef, ...args)=>{
|
|
14291
14292
|
const isMainThread = __MAIN_THREAD__;
|
|
@@ -14498,7 +14499,7 @@ function pure_render(ui, { queries, wrapper: WrapperComponent, enableMainThread
|
|
|
14498
14499
|
const { document: document1 } = lynxTestingEnv.env.window;
|
|
14499
14500
|
const container = lynxTestingEnv.mainThread.elementTree.root;
|
|
14500
14501
|
if ('function' == typeof document1.createRange) return document1.createRange().createContextualFragment(container.innerHTML);
|
|
14501
|
-
{
|
|
14502
|
+
else {
|
|
14502
14503
|
const template = document1.createElement('template');
|
|
14503
14504
|
template.innerHTML = container.innerHTML;
|
|
14504
14505
|
return template.content;
|
|
@@ -59,7 +59,7 @@ export interface RenderOptions<Q extends Queries = typeof queries> {
|
|
|
59
59
|
export type RenderResult<Q extends Queries = typeof queries> = {
|
|
60
60
|
container: LynxElement;
|
|
61
61
|
rerender: (ui: ComponentChild) => void;
|
|
62
|
-
unmount: () =>
|
|
62
|
+
unmount: () => void;
|
|
63
63
|
} & { [P in keyof Q]: BoundFunction<Q[P]> };
|
|
64
64
|
|
|
65
65
|
// @public
|
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# Resolve $0 through symlinks so basedir is the shim's real directory.
|
|
3
3
|
# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim.
|
|
4
|
+
#
|
|
5
|
+
# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed,
|
|
6
|
+
# uname, and printf go through `command -p`, which searches the system default
|
|
7
|
+
# path instead. A dependency's bin cannot stand in for one of them and take over
|
|
8
|
+
# the shim before it reaches its target. Directories come from `${link%/*}`,
|
|
9
|
+
# which needs no helper at all.
|
|
4
10
|
link="$0"
|
|
11
|
+
# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup
|
|
12
|
+
# and stands for a file in the current directory.
|
|
13
|
+
case "$link" in
|
|
14
|
+
*/*|*\\*) ;;
|
|
15
|
+
*) link="./$link" ;;
|
|
16
|
+
esac
|
|
5
17
|
hops=0
|
|
6
18
|
while [ -L "$link" ] && [ "$hops" -lt 40 ]; do
|
|
7
19
|
hops=$((hops+1))
|
|
8
|
-
target=$(readlink "$link")
|
|
20
|
+
target=$(command -p readlink "$link")
|
|
9
21
|
case "$target" in
|
|
10
22
|
/*) link="$target" ;;
|
|
11
|
-
*) link="$
|
|
23
|
+
*) link="${link%/*}/$target" ;;
|
|
12
24
|
esac
|
|
13
25
|
done
|
|
14
|
-
basedir=$(
|
|
26
|
+
basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g')
|
|
27
|
+
basedir="${basedir%/*}"
|
|
15
28
|
basedir_win="$basedir"
|
|
16
29
|
exe=""
|
|
17
30
|
msys=""
|
|
18
31
|
|
|
19
|
-
case `uname -a` in
|
|
32
|
+
case `command -p uname -a` in
|
|
20
33
|
*CYGWIN*|*MINGW*|*MSYS*)
|
|
21
34
|
if command -v cygpath > /dev/null 2>&1; then
|
|
22
35
|
basedir_win=`cygpath -w "$basedir"`
|
|
@@ -37,9 +50,9 @@ case `uname -a` in
|
|
|
37
50
|
esac
|
|
38
51
|
|
|
39
52
|
if [ -z "$NODE_PATH" ]; then
|
|
40
|
-
export NODE_PATH="/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rsbuild+core@2.2.
|
|
53
|
+
export NODE_PATH="/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rsbuild+core@2.2.9_core-js@3.50.0/node_modules/@rsbuild/core/node_modules:/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rsbuild+core@2.2.9_core-js@3.50.0/node_modules:/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/node_modules"
|
|
41
54
|
else
|
|
42
|
-
export NODE_PATH="/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rsbuild+core@2.2.
|
|
55
|
+
export NODE_PATH="/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rsbuild+core@2.2.9_core-js@3.50.0/node_modules/@rsbuild/core/node_modules:/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rsbuild+core@2.2.9_core-js@3.50.0/node_modules:/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
43
56
|
fi
|
|
44
57
|
if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then
|
|
45
58
|
exec "$basedir/node.exe" "$basedir_win/../@rsbuild/core/bin/rsbuild.js" "$@"
|
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# Resolve $0 through symlinks so basedir is the shim's real directory.
|
|
3
3
|
# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim.
|
|
4
|
+
#
|
|
5
|
+
# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed,
|
|
6
|
+
# uname, and printf go through `command -p`, which searches the system default
|
|
7
|
+
# path instead. A dependency's bin cannot stand in for one of them and take over
|
|
8
|
+
# the shim before it reaches its target. Directories come from `${link%/*}`,
|
|
9
|
+
# which needs no helper at all.
|
|
4
10
|
link="$0"
|
|
11
|
+
# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup
|
|
12
|
+
# and stands for a file in the current directory.
|
|
13
|
+
case "$link" in
|
|
14
|
+
*/*|*\\*) ;;
|
|
15
|
+
*) link="./$link" ;;
|
|
16
|
+
esac
|
|
5
17
|
hops=0
|
|
6
18
|
while [ -L "$link" ] && [ "$hops" -lt 40 ]; do
|
|
7
19
|
hops=$((hops+1))
|
|
8
|
-
target=$(readlink "$link")
|
|
20
|
+
target=$(command -p readlink "$link")
|
|
9
21
|
case "$target" in
|
|
10
22
|
/*) link="$target" ;;
|
|
11
|
-
*) link="$
|
|
23
|
+
*) link="${link%/*}/$target" ;;
|
|
12
24
|
esac
|
|
13
25
|
done
|
|
14
|
-
basedir=$(
|
|
26
|
+
basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g')
|
|
27
|
+
basedir="${basedir%/*}"
|
|
15
28
|
basedir_win="$basedir"
|
|
16
29
|
exe=""
|
|
17
30
|
msys=""
|
|
18
31
|
|
|
19
|
-
case `uname -a` in
|
|
32
|
+
case `command -p uname -a` in
|
|
20
33
|
*CYGWIN*|*MINGW*|*MSYS*)
|
|
21
34
|
if command -v cygpath > /dev/null 2>&1; then
|
|
22
35
|
basedir_win=`cygpath -w "$basedir"`
|
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# Resolve $0 through symlinks so basedir is the shim's real directory.
|
|
3
3
|
# Cap hops at the kernel's ELOOP limit so a cycle cannot hang the shim.
|
|
4
|
+
#
|
|
5
|
+
# A shim runs with node_modules/.bin at the front of PATH, so readlink, sed,
|
|
6
|
+
# uname, and printf go through `command -p`, which searches the system default
|
|
7
|
+
# path instead. A dependency's bin cannot stand in for one of them and take over
|
|
8
|
+
# the shim before it reaches its target. Directories come from `${link%/*}`,
|
|
9
|
+
# which needs no helper at all.
|
|
4
10
|
link="$0"
|
|
11
|
+
# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup
|
|
12
|
+
# and stands for a file in the current directory.
|
|
13
|
+
case "$link" in
|
|
14
|
+
*/*|*\\*) ;;
|
|
15
|
+
*) link="./$link" ;;
|
|
16
|
+
esac
|
|
5
17
|
hops=0
|
|
6
18
|
while [ -L "$link" ] && [ "$hops" -lt 40 ]; do
|
|
7
19
|
hops=$((hops+1))
|
|
8
|
-
target=$(readlink "$link")
|
|
20
|
+
target=$(command -p readlink "$link")
|
|
9
21
|
case "$target" in
|
|
10
22
|
/*) link="$target" ;;
|
|
11
|
-
*) link="$
|
|
23
|
+
*) link="${link%/*}/$target" ;;
|
|
12
24
|
esac
|
|
13
25
|
done
|
|
14
|
-
basedir=$(
|
|
26
|
+
basedir=$(command -p printf '%s\n' "$link" | command -p sed -e 's,\\,/,g')
|
|
27
|
+
basedir="${basedir%/*}"
|
|
15
28
|
basedir_win="$basedir"
|
|
16
29
|
exe=""
|
|
17
30
|
msys=""
|
|
18
31
|
|
|
19
|
-
case `uname -a` in
|
|
32
|
+
case `command -p uname -a` in
|
|
20
33
|
*CYGWIN*|*MINGW*|*MSYS*)
|
|
21
34
|
if command -v cygpath > /dev/null 2>&1; then
|
|
22
35
|
basedir_win=`cygpath -w "$basedir"`
|
|
@@ -37,9 +50,9 @@ case `uname -a` in
|
|
|
37
50
|
esac
|
|
38
51
|
|
|
39
52
|
if [ -z "$NODE_PATH" ]; then
|
|
40
|
-
export NODE_PATH="/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rstest+core@0.
|
|
53
|
+
export NODE_PATH="/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rstest+core@0.12.1_core-js@3.50.0_happy-dom@20.14.0_jsdom@30.0.1/node_modules/@rstest/core/node_modules:/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rstest+core@0.12.1_core-js@3.50.0_happy-dom@20.14.0_jsdom@30.0.1/node_modules:/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/node_modules"
|
|
41
54
|
else
|
|
42
|
-
export NODE_PATH="/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rstest+core@0.
|
|
55
|
+
export NODE_PATH="/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rstest+core@0.12.1_core-js@3.50.0_happy-dom@20.14.0_jsdom@30.0.1/node_modules/@rstest/core/node_modules:/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/@rstest+core@0.12.1_core-js@3.50.0_happy-dom@20.14.0_jsdom@30.0.1/node_modules:/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
43
56
|
fi
|
|
44
57
|
if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then
|
|
45
58
|
exec "$basedir/node.exe" "$basedir_win/../@rstest/core/bin/rstest.js" "$@"
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "rslib
|
|
8
|
-
"dev": "rslib
|
|
7
|
+
"build": "rslib",
|
|
8
|
+
"dev": "rslib --watch",
|
|
9
9
|
"rstest": "rstest",
|
|
10
10
|
"test": "npm run test:base && npm run test:3.1",
|
|
11
11
|
"test:3.1": "vitest --config vitest.3.1.config.ts",
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
|
|
5
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { useInitData } from '@lynx-js/react';
|
|
8
|
+
|
|
9
|
+
import { render } from '../..';
|
|
10
|
+
import { reloadTemplate } from './reloadTemplate.js';
|
|
11
|
+
import { resetFirstScreenSyncState } from '../../../../runtime/lib/snapshot/lifecycle/event/firstScreenSync.js';
|
|
12
|
+
|
|
13
|
+
function App() {
|
|
14
|
+
const { text = 'Hello' } = useInitData() ?? {};
|
|
15
|
+
return (
|
|
16
|
+
<view>
|
|
17
|
+
<text>{text}</text>
|
|
18
|
+
</view>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const mainThreadGlobals = () => lynxTestingEnv.mainThread.globalThis;
|
|
23
|
+
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
delete mainThreadGlobals().lepusng_gc;
|
|
26
|
+
mainThreadGlobals().__FIRST_SCREEN_SYNC_TIMING__ = 'immediately';
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('gc after the rendered tree is replaced', () => {
|
|
30
|
+
it('runs after reloadTemplate', () => {
|
|
31
|
+
const gc = vi.fn();
|
|
32
|
+
mainThreadGlobals().lepusng_gc = gc;
|
|
33
|
+
const ui = <App />;
|
|
34
|
+
const { container } = render(ui, { enableMainThread: true });
|
|
35
|
+
expect(gc).not.toHaveBeenCalled();
|
|
36
|
+
|
|
37
|
+
reloadTemplate(ui, { text: 'Enjoy' });
|
|
38
|
+
expect(gc).toHaveBeenCalledTimes(1);
|
|
39
|
+
expect(container.innerHTML).toBe('<view><text>Enjoy</text></view>');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('runs after an update before first-screen sync, not after one that follows it', () => {
|
|
43
|
+
const gc = vi.fn();
|
|
44
|
+
mainThreadGlobals().lepusng_gc = gc;
|
|
45
|
+
mainThreadGlobals().__FIRST_SCREEN_SYNC_TIMING__ = 'jsReady';
|
|
46
|
+
resetFirstScreenSyncState();
|
|
47
|
+
const { container } = render(<App />, { enableMainThread: true, enableBackgroundThread: false });
|
|
48
|
+
|
|
49
|
+
lynxTestingEnv.switchToMainThread();
|
|
50
|
+
globalThis.updatePage({ text: 'Enjoy' });
|
|
51
|
+
expect(gc).toHaveBeenCalledTimes(1);
|
|
52
|
+
expect(container.innerHTML).toBe('<view><text>Enjoy</text></view>');
|
|
53
|
+
|
|
54
|
+
globalThis.rLynxFirstScreenSyncReady();
|
|
55
|
+
globalThis.updatePage({ text: 'Again' });
|
|
56
|
+
expect(gc).toHaveBeenCalledTimes(1);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('is skipped when the engine does not expose it', () => {
|
|
60
|
+
const ui = <App />;
|
|
61
|
+
render(ui, { enableMainThread: true });
|
|
62
|
+
expect(() => reloadTemplate(ui, { text: 'Enjoy' })).not.toThrow();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
|
|
5
|
+
import { act } from 'preact/test-utils';
|
|
6
|
+
|
|
7
|
+
import { __root } from '../../../../runtime/lib/root.js';
|
|
8
|
+
import { flushDelayedLifecycleEvents } from '../../../../runtime/lib/snapshot/lynx/tt.js';
|
|
9
|
+
|
|
10
|
+
// What native does for `reloadTemplate`: the main thread re-renders and
|
|
11
|
+
// hydrates, then the background reloads and hydrates against the main
|
|
12
|
+
// thread's first-screen tree.
|
|
13
|
+
export function reloadTemplate(ui, data) {
|
|
14
|
+
lynxTestingEnv.switchToMainThread();
|
|
15
|
+
const lifecycleEvents = [];
|
|
16
|
+
const original = globalThis.__OnLifecycleEvent;
|
|
17
|
+
globalThis.__OnLifecycleEvent = (...args) => lifecycleEvents.push(args);
|
|
18
|
+
try {
|
|
19
|
+
globalThis.updatePage(data, { reloadTemplate: true });
|
|
20
|
+
} finally {
|
|
21
|
+
globalThis.__OnLifecycleEvent = original;
|
|
22
|
+
}
|
|
23
|
+
// The reload swaps in a fresh root; the environment reinstalls
|
|
24
|
+
// `globalThis.__root` on every thread switch.
|
|
25
|
+
globalThis.__root = __root;
|
|
26
|
+
lynxTestingEnv.mainThread.globalThis.__root = __root;
|
|
27
|
+
|
|
28
|
+
lynxTestingEnv.switchToBackgroundThread();
|
|
29
|
+
__root.__jsx = ui;
|
|
30
|
+
act(() => {
|
|
31
|
+
lynx.getApp().onAppReload(data);
|
|
32
|
+
});
|
|
33
|
+
act(() => {
|
|
34
|
+
for (const args of lifecycleEvents) {
|
|
35
|
+
lynx.getApp().OnLifecycleEvent(...args);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
flushDelayedLifecycleEvents();
|
|
39
|
+
}
|
|
@@ -142,7 +142,7 @@ export interface RenderOptions<Q extends Queries = typeof queries> {
|
|
|
142
142
|
export type RenderResult<Q extends Queries = typeof queries> = {
|
|
143
143
|
container: LynxElement;
|
|
144
144
|
rerender: (ui: React.ReactNode) => void;
|
|
145
|
-
unmount: () =>
|
|
145
|
+
unmount: () => void;
|
|
146
146
|
asFragment: () => DocumentFragment;
|
|
147
147
|
} & { [P in keyof Q]: BoundFunction<Q[P]> };
|
|
148
148
|
|
|
@@ -257,7 +257,7 @@ export interface RenderHookOptions<Props> {
|
|
|
257
257
|
* export * from '@lynx-js/react/testing-library'
|
|
258
258
|
*
|
|
259
259
|
* // override renderHook method
|
|
260
|
-
* export {
|
|
260
|
+
* export { customRenderHook as renderHook }
|
|
261
261
|
* ```
|
|
262
262
|
*/
|
|
263
263
|
wrapper?: React.JSXElementConstructor<{ children: React.ReactNode }> | undefined;
|