@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
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
$ node ./scripts/build_wasm.js
|
|
2
2
|
Blocking waiting for file lock on package cache
|
|
3
|
+
Blocking waiting for file lock on package cache
|
|
3
4
|
Downloading crates ...
|
|
4
|
-
Downloaded
|
|
5
|
-
Downloaded napi-build v2.3.2
|
|
5
|
+
Downloaded futures-core v0.3.33
|
|
6
6
|
Downloaded convert_case v0.6.0
|
|
7
|
+
Downloaded futures-task v0.3.33
|
|
8
|
+
Downloaded bitflags v1.3.2
|
|
7
9
|
Downloaded ctor v0.1.26
|
|
8
|
-
Downloaded napi-
|
|
9
|
-
Downloaded napi v2.10.4
|
|
10
|
+
Downloaded napi-build v2.3.2
|
|
10
11
|
Downloaded napi-sys v2.4.0
|
|
12
|
+
Downloaded futures-util v0.3.33
|
|
13
|
+
Downloaded napi-derive v2.9.3
|
|
11
14
|
Downloaded napi-derive-backend v1.0.40
|
|
15
|
+
Downloaded napi v2.10.4
|
|
16
|
+
Downloaded js-sys v0.3.103
|
|
17
|
+
Downloaded slab v0.4.12
|
|
18
|
+
Downloaded syn v1.0.109
|
|
12
19
|
Downloaded version-compare v0.2.1
|
|
20
|
+
Downloaded wasm-bindgen-macro v0.2.126
|
|
21
|
+
Downloaded wasm-bindgen-macro-support v0.2.126
|
|
22
|
+
Downloaded wasm-bindgen-shared v0.2.126
|
|
23
|
+
Downloaded wasm-bindgen v0.2.126
|
|
24
|
+
Blocking waiting for file lock on package cache
|
|
13
25
|
Blocking waiting for file lock on build directory
|
|
14
26
|
Compiling cfg-if v1.0.4
|
|
15
27
|
Compiling serde_core v1.0.229
|
|
@@ -19,8 +31,8 @@ $ node ./scripts/build_wasm.js
|
|
|
19
31
|
Compiling stable_deref_trait v1.2.1
|
|
20
32
|
Compiling memchr v2.8.3
|
|
21
33
|
Compiling zerofrom v0.1.8
|
|
22
|
-
Compiling equivalent v1.0.2
|
|
23
34
|
Compiling foldhash v0.2.0
|
|
35
|
+
Compiling equivalent v1.0.2
|
|
24
36
|
Compiling yoke v0.8.3
|
|
25
37
|
Compiling hashbrown v0.17.1
|
|
26
38
|
Compiling zerovec v0.11.6
|
|
@@ -31,12 +43,12 @@ $ node ./scripts/build_wasm.js
|
|
|
31
43
|
Compiling zmij v1.0.23
|
|
32
44
|
Compiling itoa v1.0.18
|
|
33
45
|
Compiling serde_json v1.0.151
|
|
46
|
+
Compiling litemap v0.8.2
|
|
34
47
|
Compiling tinystr v0.8.3
|
|
35
48
|
Compiling writeable v0.6.3
|
|
36
|
-
Compiling litemap v0.8.2
|
|
37
49
|
Compiling potential_utf v0.1.5
|
|
38
|
-
Compiling zerotrie v0.2.4
|
|
39
50
|
Compiling icu_locale_core v2.2.0
|
|
51
|
+
Compiling zerotrie v0.2.4
|
|
40
52
|
Compiling utf8_iter v1.0.4
|
|
41
53
|
Compiling icu_collections v2.2.0
|
|
42
54
|
Compiling indexmap v2.14.0
|
|
@@ -46,136 +58,136 @@ $ node ./scripts/build_wasm.js
|
|
|
46
58
|
Compiling icu_properties_data v2.2.0
|
|
47
59
|
Compiling rustc-hash v2.1.3
|
|
48
60
|
Compiling parking_lot_core v0.9.12
|
|
49
|
-
Compiling icu_normalizer v2.2.0
|
|
50
61
|
Compiling icu_properties v2.2.0
|
|
62
|
+
Compiling icu_normalizer v2.2.0
|
|
63
|
+
Compiling hashbrown v0.14.5
|
|
51
64
|
Compiling either v1.17.0
|
|
52
65
|
Compiling scopeguard v1.2.0
|
|
53
66
|
Compiling radium v0.7.0
|
|
54
67
|
Compiling lock_api v0.4.14
|
|
55
|
-
Compiling
|
|
68
|
+
Compiling idna_adapter v1.2.2
|
|
56
69
|
Compiling tracing-core v0.1.36
|
|
57
70
|
Compiling percent-encoding v2.3.2
|
|
58
|
-
Compiling idna_adapter v1.2.2
|
|
59
71
|
Compiling tap v1.0.1
|
|
60
|
-
Compiling wyz v0.5.1
|
|
61
72
|
Compiling idna v1.1.0
|
|
73
|
+
Compiling wyz v0.5.1
|
|
62
74
|
Compiling form_urlencoded v1.2.2
|
|
63
75
|
Compiling anyhow v1.0.104
|
|
64
|
-
Compiling
|
|
76
|
+
Compiling pin-project-lite v0.2.17
|
|
65
77
|
Compiling outref v0.5.2
|
|
66
78
|
Compiling funty v2.0.0
|
|
67
79
|
Compiling uuid v1.24.0
|
|
68
80
|
Compiling bytes v1.12.1
|
|
69
|
-
Compiling
|
|
70
|
-
Compiling tracing v0.1.44
|
|
71
|
-
Compiling bitvec v1.1.1
|
|
72
|
-
Compiling bytes-str v0.2.8
|
|
81
|
+
Compiling vsimd v0.8.0
|
|
73
82
|
Compiling base64-simd v0.8.0
|
|
83
|
+
Compiling bytes-str v0.2.8
|
|
84
|
+
Compiling bitvec v1.1.1
|
|
74
85
|
Compiling debugid v0.8.0
|
|
75
86
|
Compiling url v2.5.8
|
|
87
|
+
Compiling tracing v0.1.44
|
|
76
88
|
Compiling triomphe v0.1.16
|
|
77
89
|
Compiling unicode-id-start v1.4.0
|
|
78
|
-
Compiling
|
|
90
|
+
Compiling if_chain v1.0.3
|
|
79
91
|
Compiling unicode-width v0.2.2
|
|
80
92
|
Compiling data-encoding v2.11.0
|
|
81
|
-
Compiling
|
|
93
|
+
Compiling new_debug_unreachable v1.0.6
|
|
82
94
|
Compiling hstr v4.0.0
|
|
83
95
|
Compiling num-integer v0.1.46
|
|
84
96
|
Compiling scoped-tls v1.0.1
|
|
85
97
|
Compiling better_scoped_tls v1.0.1
|
|
98
|
+
Compiling num-bigint v0.4.8
|
|
86
99
|
Compiling swc_atoms v10.0.0
|
|
87
100
|
Compiling parking_lot v0.12.5
|
|
88
|
-
Compiling num-bigint v0.4.8
|
|
89
|
-
Compiling swc_sourcemap v10.0.2
|
|
90
101
|
Compiling swc_visit v2.0.2
|
|
102
|
+
Compiling swc_sourcemap v10.0.2
|
|
91
103
|
Compiling termcolor v1.4.1
|
|
92
104
|
Compiling siphasher v0.3.11
|
|
93
105
|
Compiling bitflags v2.13.1
|
|
94
106
|
Compiling siphasher v1.0.3
|
|
95
107
|
Compiling phf_shared v0.11.3
|
|
108
|
+
Compiling phf v0.11.3
|
|
96
109
|
Compiling libc v0.2.189
|
|
97
110
|
Compiling dragonbox_ecma v0.1.12
|
|
98
|
-
Compiling phf v0.11.3
|
|
99
111
|
Compiling par-core v2.0.0
|
|
100
112
|
Compiling num_cpus v1.17.0
|
|
101
113
|
Compiling castaway v0.2.4
|
|
102
114
|
Compiling ryu v1.0.23
|
|
103
115
|
Compiling static_assertions v1.1.0
|
|
104
|
-
Compiling swc_common v26.0.0
|
|
105
116
|
Compiling compact_str v0.7.1
|
|
106
117
|
Compiling aho-corasick v1.1.4
|
|
118
|
+
Compiling swc_common v26.0.0
|
|
107
119
|
Compiling regex-syntax v0.8.11
|
|
108
120
|
Compiling swc_ecma_ast v29.0.0
|
|
109
121
|
Compiling regex-automata v0.4.16
|
|
110
|
-
Compiling swc_ecma_regexp_common v0.0.1
|
|
111
122
|
Compiling typenum v1.20.1
|
|
123
|
+
Compiling swc_ecma_regexp_common v0.0.1
|
|
112
124
|
Compiling swc_ecma_regexp_ast v3.0.0
|
|
113
125
|
Compiling crossbeam-utils v0.8.22
|
|
114
126
|
Compiling swc_ecma_regexp_visit v0.15.0
|
|
115
127
|
Compiling dashmap v6.2.1
|
|
116
128
|
Compiling swc_ecma_regexp v0.15.0
|
|
117
|
-
Compiling swc_ecma_compat_regexp v9.0.0
|
|
118
129
|
Compiling swc_ecma_visit v29.0.0
|
|
119
130
|
Compiling swc_ecma_parser v45.1.1
|
|
120
131
|
Compiling regex v1.13.1
|
|
132
|
+
Compiling swc_ecma_compat_regexp v9.0.0
|
|
121
133
|
Compiling generic-array v0.14.7
|
|
122
134
|
Compiling bstr v1.13.0
|
|
123
135
|
Compiling hashbrown v0.16.1
|
|
124
136
|
Compiling regress v0.11.1
|
|
125
137
|
Compiling globset v0.4.19
|
|
126
|
-
Compiling crypto-common v0.1.7
|
|
127
138
|
Compiling block-buffer v0.10.4
|
|
139
|
+
Compiling crypto-common v0.1.7
|
|
128
140
|
Compiling swc_config v6.0.0
|
|
129
141
|
Compiling digest v0.10.7
|
|
130
142
|
Compiling arrayvec v0.7.8
|
|
131
143
|
Compiling thiserror v1.0.69
|
|
132
144
|
Compiling owo-colors v4.3.0
|
|
133
145
|
Compiling semver v1.0.28
|
|
134
|
-
Compiling unicode-linebreak v0.1.5
|
|
135
146
|
Compiling base64 v0.22.1
|
|
136
147
|
Compiling fixedbitset v0.5.7
|
|
137
|
-
Compiling petgraph v0.7.1
|
|
138
|
-
Compiling textwrap v0.16.2
|
|
139
148
|
Compiling swc_ecma_utils v35.0.0
|
|
140
149
|
Compiling swc_ecma_hooks v1.0.0
|
|
141
150
|
Compiling swc_ecma_transforms_base v49.0.1
|
|
151
|
+
Compiling unicode-linebreak v0.1.5
|
|
152
|
+
Compiling textwrap v0.16.2
|
|
153
|
+
Compiling petgraph v0.7.1
|
|
142
154
|
Compiling swc_ecma_transformer v21.0.1
|
|
143
155
|
Compiling swc_ecma_transforms_classes v49.0.0
|
|
144
156
|
Compiling swc_ecma_compat_common v45.0.0
|
|
145
157
|
Compiling bumpalo v3.20.3
|
|
146
158
|
Compiling thread_local v1.1.10
|
|
147
159
|
Compiling unicode-width v0.1.14
|
|
148
|
-
Compiling miette v7.6.0
|
|
149
160
|
Compiling camino v1.2.4
|
|
150
161
|
Compiling swc_allocator v5.0.0
|
|
151
162
|
Compiling swc_ecma_compat_es2015 v55.0.0
|
|
152
163
|
Compiling swc_ecma_compat_es2022 v53.0.0
|
|
164
|
+
Compiling miette v7.6.0
|
|
153
165
|
Compiling swc_ecma_transforms_optimization v52.0.0
|
|
154
166
|
Compiling sha1 v0.10.7
|
|
155
167
|
Compiling chrono v0.4.45
|
|
156
|
-
Compiling
|
|
168
|
+
Compiling syn v1.0.109
|
|
157
169
|
Compiling log v0.4.33
|
|
170
|
+
Compiling lazy_static v1.5.0
|
|
158
171
|
Compiling ascii v1.1.0
|
|
159
|
-
Compiling syn v1.0.109
|
|
160
172
|
Compiling swc_ecma_codegen v32.0.0
|
|
161
|
-
Compiling tracing-log v0.2.0
|
|
162
173
|
Compiling sharded-slab v0.1.7
|
|
163
|
-
Compiling
|
|
174
|
+
Compiling tracing-log v0.2.0
|
|
164
175
|
Compiling browserslist-data v0.2.0
|
|
176
|
+
Compiling swc_ecma_compat_bugfixes v56.0.0
|
|
165
177
|
Compiling swc_ecma_transforms_react v55.0.1
|
|
166
|
-
Compiling swc_ecma_compat_es2020 v53.0.0
|
|
167
178
|
Compiling swc_error_reporters v28.0.0
|
|
179
|
+
Compiling swc_ecma_compat_es2020 v53.0.0
|
|
180
|
+
Compiling swc_ecma_compat_es2016 v50.0.0
|
|
181
|
+
Compiling swc_ecma_compat_es2021 v50.0.0
|
|
168
182
|
Compiling swc_ecma_compat_es2017 v50.0.0
|
|
169
|
-
Compiling swc_ecma_compat_es2019 v50.0.0
|
|
170
183
|
Compiling swc_ecma_compat_es2018 v51.0.0
|
|
171
|
-
Compiling
|
|
172
|
-
Compiling swc_ecma_compat_es2016 v50.0.0
|
|
184
|
+
Compiling swc_ecma_compat_es2019 v50.0.0
|
|
173
185
|
Compiling matchers v0.2.0
|
|
174
186
|
Compiling itertools v0.15.0
|
|
175
187
|
Compiling cargo-platform v0.1.9
|
|
176
188
|
Compiling nom v8.0.0
|
|
177
|
-
Compiling yansi v1.0.1
|
|
178
189
|
Compiling diff v0.1.13
|
|
190
|
+
Compiling yansi v1.0.1
|
|
179
191
|
Compiling nu-ansi-term v0.50.3
|
|
180
192
|
Compiling tracing-subscriber v0.3.23
|
|
181
193
|
Compiling pretty_assertions v1.4.1
|
|
@@ -186,10 +198,10 @@ $ node ./scripts/build_wasm.js
|
|
|
186
198
|
Compiling swc_ecma_transforms_typescript v55.0.1
|
|
187
199
|
Compiling swc_ecma_transforms_proposal v49.0.0
|
|
188
200
|
Compiling par-iter v2.0.0
|
|
201
|
+
Compiling pathdiff v0.2.3
|
|
202
|
+
Compiling ryu-js v1.0.3
|
|
189
203
|
Compiling difference v2.0.0
|
|
190
204
|
Compiling radix_fmt v1.0.0
|
|
191
|
-
Compiling ryu-js v1.0.3
|
|
192
|
-
Compiling pathdiff v0.2.3
|
|
193
205
|
Compiling testing v27.0.0
|
|
194
206
|
Compiling swc_ecma_transforms v62.0.0
|
|
195
207
|
Compiling preset_env_base v9.0.0
|
|
@@ -197,29 +209,29 @@ $ node ./scripts/build_wasm.js
|
|
|
197
209
|
Compiling swc_ecma_preset_env v63.0.0
|
|
198
210
|
Compiling sha2 v0.10.9
|
|
199
211
|
Compiling lru v0.18.4
|
|
200
|
-
Compiling
|
|
212
|
+
Compiling path-clean v1.0.1
|
|
201
213
|
Compiling precomputed-map v0.2.0
|
|
214
|
+
Compiling hex v0.4.3
|
|
202
215
|
Compiling fastrand v2.5.0
|
|
216
|
+
Compiling unicode-segmentation v1.13.3
|
|
203
217
|
Compiling foldhash v0.1.5
|
|
204
|
-
Compiling
|
|
205
|
-
Compiling
|
|
218
|
+
Compiling convert_case v0.6.0
|
|
219
|
+
Compiling tempfile v3.27.0
|
|
206
220
|
Compiling swc_ecma_testing v27.0.0
|
|
207
221
|
Compiling swc_ecma_loader v27.0.0
|
|
208
|
-
Compiling tempfile v3.27.0
|
|
209
|
-
Compiling convert_case v0.6.0
|
|
210
222
|
Compiling swc_ecma_ext_transforms v35.0.0
|
|
211
223
|
Compiling swc_node_comments v27.0.0
|
|
212
224
|
Compiling swc_transform_common v20.0.0
|
|
213
225
|
Compiling jsonc-parser v0.26.3
|
|
214
|
-
Compiling ansi_term v0.12.1
|
|
215
226
|
Compiling swc_core v77.1.2
|
|
227
|
+
Compiling ansi_term v0.12.1
|
|
216
228
|
Compiling swc_ecma_transforms_testing v53.0.0
|
|
217
229
|
Compiling napi-derive-backend v1.0.40
|
|
218
230
|
Compiling swc_compiler_base v64.0.0
|
|
219
231
|
Compiling swc v75.0.1
|
|
220
232
|
Compiling ctor v0.1.26
|
|
221
|
-
Compiling bitflags v1.3.2
|
|
222
233
|
Compiling napi-sys v2.4.0
|
|
234
|
+
Compiling bitflags v1.3.2
|
|
223
235
|
Compiling napi v2.10.4
|
|
224
236
|
Compiling napi-derive v2.9.3
|
|
225
237
|
Compiling sha-1 v0.10.1
|
|
@@ -227,26 +239,26 @@ $ node ./scripts/build_wasm.js
|
|
|
227
239
|
Compiling sugar_path v1.2.1
|
|
228
240
|
Compiling swc_plugins_shared v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugins_shared)
|
|
229
241
|
Compiling hybrid-array v0.4.13
|
|
230
|
-
Compiling block-buffer v0.12.1
|
|
231
242
|
Compiling crypto-common v0.2.2
|
|
243
|
+
Compiling block-buffer v0.12.1
|
|
232
244
|
Compiling const-oid v0.10.2
|
|
233
245
|
Compiling napi-build v2.3.2
|
|
234
|
-
Compiling react-transform v0.0.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform)
|
|
235
|
-
Compiling getrandom v0.4.3
|
|
236
|
-
Compiling swc_plugin_snapshot v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_snapshot)
|
|
237
246
|
Compiling digest v0.11.3
|
|
247
|
+
Compiling getrandom v0.4.3
|
|
238
248
|
Compiling sha2 v0.11.0
|
|
249
|
+
Compiling react-transform v0.0.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform)
|
|
250
|
+
Compiling swc_plugin_snapshot v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_snapshot)
|
|
239
251
|
Compiling swc_plugin_define_dce v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_define_dce)
|
|
240
252
|
Compiling swc_plugin_directive_dce v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_directive_dce)
|
|
241
|
-
Compiling swc_plugin_list v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_list)
|
|
242
253
|
Compiling swc_plugin_element_template v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_element_template)
|
|
243
|
-
Compiling
|
|
244
|
-
Compiling swc_plugin_css_scope v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_css_scope)
|
|
245
|
-
Compiling swc_plugin_shake v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_shake)
|
|
254
|
+
Compiling swc_plugin_list v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_list)
|
|
246
255
|
Compiling swc_plugin_worklet v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_worklet)
|
|
256
|
+
Compiling swc_plugin_inject v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_inject)
|
|
247
257
|
Compiling swc_plugin_dynamic_import v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_dynamic_import)
|
|
248
258
|
Compiling swc_plugin_text v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_text)
|
|
249
259
|
Compiling swc_plugin_compat v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_compat)
|
|
260
|
+
Compiling swc_plugin_shake v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_shake)
|
|
261
|
+
Compiling swc_plugin_css_scope v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_css_scope)
|
|
250
262
|
Compiling swc_plugin_background_only v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_background_only)
|
|
251
263
|
Compiling version-compare v0.2.1
|
|
252
|
-
Finished `release` profile [optimized] target(s) in
|
|
264
|
+
Finished `release` profile [optimized] target(s) in 4m 20s
|
|
@@ -393,32 +393,29 @@ describe('element template', () => {
|
|
|
393
393
|
expect(result.elementTemplates?.some(template => template.compiledTemplate.type === 'list-item')).toBe(true);
|
|
394
394
|
expect(result.code).toMatchInlineSnapshot(`
|
|
395
395
|
"import { jsx as _jsx } from "react/jsx-runtime";
|
|
396
|
-
|
|
397
|
-
const
|
|
396
|
+
import * as ReactLynxInternal from "@lynx-js/react/internal";
|
|
397
|
+
const _et_4f796f70cdd7_bundle = globDynamicComponentEntry;
|
|
398
|
+
const _et_4f796f70cdd7 = \`\${_et_4f796f70cdd7_bundle}:\${"_et_4f796f70cdd7"}\`;
|
|
399
|
+
const _et_b8da8bac988e_bundle = globDynamicComponentEntry;
|
|
400
|
+
const _et_b8da8bac988e = \`\${_et_b8da8bac988e_bundle}:\${"_et_b8da8bac988e"}\`;
|
|
398
401
|
/*#__PURE__*/ _jsx("list", {
|
|
399
402
|
attributes: {
|
|
400
403
|
"id": listId,
|
|
401
404
|
"class": "feed"
|
|
402
405
|
},
|
|
403
406
|
$0: [
|
|
404
|
-
/*#__PURE__*/
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
],
|
|
417
|
-
__listItemPlatformInfo: {
|
|
418
|
-
"item-key": secondKey,
|
|
419
|
-
"recyclable": true
|
|
420
|
-
}
|
|
421
|
-
}, "b")
|
|
407
|
+
/*#__PURE__*/ ReactLynxInternal.__etHost(_et_4f796f70cdd7, "_et_4f796f70cdd7", _et_4f796f70cdd7_bundle, "a", [
|
|
408
|
+
firstKey
|
|
409
|
+
], void 0, {
|
|
410
|
+
"item-key": firstKey,
|
|
411
|
+
"full-span": true
|
|
412
|
+
}),
|
|
413
|
+
/*#__PURE__*/ ReactLynxInternal.__etHost(_et_b8da8bac988e, "_et_b8da8bac988e", _et_b8da8bac988e_bundle, "b", [
|
|
414
|
+
secondKey
|
|
415
|
+
], void 0, {
|
|
416
|
+
"item-key": secondKey,
|
|
417
|
+
"recyclable": true
|
|
418
|
+
})
|
|
422
419
|
]
|
|
423
420
|
});
|
|
424
421
|
"
|
|
@@ -0,0 +1,75 @@
|
|
|
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 { describe, expect, it } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { transformReactLynx } from '../main.js';
|
|
8
|
+
|
|
9
|
+
const options = {
|
|
10
|
+
mode: 'test',
|
|
11
|
+
pluginName: '',
|
|
12
|
+
filename: 'text.jsx',
|
|
13
|
+
sourcemap: false,
|
|
14
|
+
cssScope: false,
|
|
15
|
+
snapshot: {
|
|
16
|
+
preserveJsx: false,
|
|
17
|
+
runtimePkg: '@lynx-js/react',
|
|
18
|
+
jsxImportSource: '@lynx-js/react',
|
|
19
|
+
filename: 'text',
|
|
20
|
+
target: 'MIXED',
|
|
21
|
+
},
|
|
22
|
+
jsx: true,
|
|
23
|
+
directiveDCE: false,
|
|
24
|
+
defineDCE: false,
|
|
25
|
+
shake: false,
|
|
26
|
+
compat: false,
|
|
27
|
+
worklet: false,
|
|
28
|
+
refresh: false,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const input = [
|
|
32
|
+
'const node = <view>',
|
|
33
|
+
' <text>{" Hello\\n\\tWorld & "}</text>',
|
|
34
|
+
' <text>{`Hello ${getName()}`}</text>',
|
|
35
|
+
'</view>;',
|
|
36
|
+
].join('\n');
|
|
37
|
+
|
|
38
|
+
describe('text expression optimization', () => {
|
|
39
|
+
it.each([false, true])('sets text attributes with legacySlot=%s', async (legacySlot) => {
|
|
40
|
+
const result = await transformReactLynx(input, {
|
|
41
|
+
...options,
|
|
42
|
+
engineVersion: '3.1',
|
|
43
|
+
snapshot: { ...options.snapshot, legacySlot },
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
expect(result.errors).toEqual([]);
|
|
47
|
+
expect(result.code).toContain('__SetAttribute(el1, "text", " Hello\\n\\tWorld & ")');
|
|
48
|
+
expect(result.code).toContain('__SetAttribute(ctx.__elements[2], "text", ctx.__values[0])');
|
|
49
|
+
expect(result.code).toContain('`Hello ${getName()}`');
|
|
50
|
+
expect(result.code.match(/getName\(\)/g)).toHaveLength(1);
|
|
51
|
+
expect(result.code).not.toContain('__CreateRawText');
|
|
52
|
+
expect(result.code).not.toContain('__DynamicPart');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it.each([undefined, '3.0'])('keeps children with engineVersion=%s', async (engineVersion) => {
|
|
56
|
+
const result = await transformReactLynx(input, { ...options, engineVersion });
|
|
57
|
+
|
|
58
|
+
expect(result.errors).toEqual([]);
|
|
59
|
+
expect(result.code).toContain('__DynamicPartSlotV2');
|
|
60
|
+
expect(result.code).not.toContain('__SetAttribute');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('keeps children when the JSX backend is disabled', async () => {
|
|
64
|
+
const result = await transformReactLynx(input, {
|
|
65
|
+
...options,
|
|
66
|
+
engineVersion: '3.1',
|
|
67
|
+
snapshot: false,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
expect(result.errors).toEqual([]);
|
|
71
|
+
expect(result.code).toContain('<text>{" Hello\\n\\tWorld & "}</text>');
|
|
72
|
+
expect(result.code).toContain('<text>{`Hello ${getName()}`}</text>');
|
|
73
|
+
expect(result.code).not.toContain('text=');
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -74,7 +74,7 @@ pub struct DarkModeConfig {
|
|
|
74
74
|
pub theme_expr: String,
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
/// {@
|
|
77
|
+
/// {@inheritDoc CompatVisitorConfig.addComponentElement}
|
|
78
78
|
/// @public
|
|
79
79
|
#[derive(Deserialize, Clone, Debug)]
|
|
80
80
|
pub struct AddComponentElementConfig {
|
|
@@ -102,7 +102,7 @@ pub struct AddComponentElementConfig {
|
|
|
102
102
|
pub compiler_only: bool,
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
/// {@
|
|
105
|
+
/// {@inheritDoc PluginReactLynxOptions.compat}
|
|
106
106
|
/// @public
|
|
107
107
|
#[derive(Deserialize, Clone, Debug)]
|
|
108
108
|
pub struct CompatVisitorConfig {
|
|
@@ -337,9 +337,10 @@ pub struct CompatVisitorConfig {
|
|
|
337
337
|
/// })
|
|
338
338
|
/// ```
|
|
339
339
|
pub disable_deprecated_warning: bool,
|
|
340
|
+
/// Dark mode configuration
|
|
341
|
+
///
|
|
340
342
|
/// @public
|
|
341
343
|
/// @deprecated
|
|
342
|
-
/// Dark mode configuration
|
|
343
344
|
///
|
|
344
345
|
/// @defaultValue `undefined`
|
|
345
346
|
///
|
|
@@ -66,7 +66,7 @@ fn convert_dark_mode_option_back(
|
|
|
66
66
|
val.map(|either| either.into())
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
/// {@
|
|
69
|
+
/// {@inheritDoc CompatVisitorConfig.addComponentElement}
|
|
70
70
|
/// @public
|
|
71
71
|
#[napi(object)]
|
|
72
72
|
#[derive(Clone, Debug)]
|
|
@@ -133,7 +133,7 @@ impl From<Either<bool, CoreAddComponentElementConfig>>
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
/// {@
|
|
136
|
+
/// {@inheritDoc PluginReactLynxOptions.compat}
|
|
137
137
|
/// @public
|
|
138
138
|
#[napi(object)]
|
|
139
139
|
#[derive(Clone, Debug)]
|
|
@@ -370,9 +370,10 @@ pub struct CompatVisitorConfig {
|
|
|
370
370
|
/// })
|
|
371
371
|
/// ```
|
|
372
372
|
pub disable_deprecated_warning: bool,
|
|
373
|
+
/// Dark mode configuration
|
|
374
|
+
///
|
|
373
375
|
/// @public
|
|
374
376
|
/// @deprecated
|
|
375
|
-
/// Dark mode configuration
|
|
376
377
|
///
|
|
377
378
|
/// @defaultValue `undefined`
|
|
378
379
|
///
|
|
@@ -2,7 +2,7 @@ use serde::Deserialize;
|
|
|
2
2
|
use serde_json::Value;
|
|
3
3
|
use std::{borrow::Cow, collections::HashSet, fmt::Debug};
|
|
4
4
|
use swc_core::{
|
|
5
|
-
common::{comments::Comments, errors::HANDLER, util::take::Take, DUMMY_SP},
|
|
5
|
+
common::{comments::Comments, errors::HANDLER, util::take::Take, Spanned, DUMMY_SP},
|
|
6
6
|
ecma::{
|
|
7
7
|
ast::*,
|
|
8
8
|
utils::{calc_literal_cost, prepend_stmt},
|
|
@@ -43,7 +43,7 @@ where
|
|
|
43
43
|
opts: DynamicImportVisitorConfig,
|
|
44
44
|
has_inner_lazy_bundle: bool,
|
|
45
45
|
named_imports: HashSet<Ident>,
|
|
46
|
-
|
|
46
|
+
comments: Option<C>,
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
impl<C> Default for DynamicImportVisitor<C>
|
|
@@ -62,11 +62,56 @@ where
|
|
|
62
62
|
pub fn new(opts: DynamicImportVisitorConfig, comments: Option<C>) -> Self {
|
|
63
63
|
DynamicImportVisitor {
|
|
64
64
|
opts,
|
|
65
|
-
|
|
65
|
+
comments,
|
|
66
66
|
has_inner_lazy_bundle: false,
|
|
67
67
|
named_imports: HashSet::new(),
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
+
|
|
71
|
+
/// A `webpackChunkName` is the identity of a chunk group, so the same name in
|
|
72
|
+
/// the main-thread and the background compilation collapses both layers into
|
|
73
|
+
/// one chunk, which then carries no per-layer output. Append the layer to the
|
|
74
|
+
/// name; `@lynx-js/react-webpack-plugin` strips it again so the two groups
|
|
75
|
+
/// still make up a single lazy bundle.
|
|
76
|
+
fn suffix_webpack_chunk_name(&self, call_expr: &CallExpr) {
|
|
77
|
+
if self.opts.layer.is_empty() {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
let Some(comments) = &self.comments else {
|
|
81
|
+
return;
|
|
82
|
+
};
|
|
83
|
+
let pos = call_expr.args[0].expr.span_lo();
|
|
84
|
+
let Some(mut leading) = comments.take_leading(pos) else {
|
|
85
|
+
return;
|
|
86
|
+
};
|
|
87
|
+
let suffix = format!("-{}", self.opts.layer);
|
|
88
|
+
for comment in leading.iter_mut() {
|
|
89
|
+
if let Some(text) = suffix_chunk_name(comment.text.as_str(), &suffix) {
|
|
90
|
+
comment.text = text.into();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
comments.add_leading_comments(pos, leading);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/// Rewrite `webpackChunkName: "foo"` into `webpackChunkName: "foo<suffix>"`,
|
|
98
|
+
/// leaving anything that is not such a comment alone.
|
|
99
|
+
fn suffix_chunk_name(text: &str, suffix: &str) -> Option<String> {
|
|
100
|
+
let key = text.find("webpackChunkName")?;
|
|
101
|
+
let open = text[key..].find(['"', '\''])? + key;
|
|
102
|
+
let quote = text.as_bytes()[open] as char;
|
|
103
|
+
let close = text[open + 1..].find(quote)? + open + 1;
|
|
104
|
+
let name = &text[open + 1..close];
|
|
105
|
+
if name.is_empty() || name.ends_with(suffix) {
|
|
106
|
+
return None;
|
|
107
|
+
}
|
|
108
|
+
Some(format!(
|
|
109
|
+
"{}{}{}{}",
|
|
110
|
+
&text[..close],
|
|
111
|
+
suffix,
|
|
112
|
+
quote,
|
|
113
|
+
&text[close + 1..]
|
|
114
|
+
))
|
|
70
115
|
}
|
|
71
116
|
|
|
72
117
|
fn is_import_call_str_lit(call_expr: &CallExpr) -> (bool, bool, Cow<'_, str>) {
|
|
@@ -226,6 +271,7 @@ where
|
|
|
226
271
|
return;
|
|
227
272
|
}
|
|
228
273
|
|
|
274
|
+
self.suffix_webpack_chunk_name(call_expr);
|
|
229
275
|
self.has_inner_lazy_bundle = true;
|
|
230
276
|
} else {
|
|
231
277
|
let ident: Ident = "__dynamicImport".into();
|
|
@@ -304,6 +350,38 @@ mod tests {
|
|
|
304
350
|
|
|
305
351
|
use super::{DynamicImportVisitor, DynamicImportVisitorConfig};
|
|
306
352
|
|
|
353
|
+
use super::suffix_chunk_name;
|
|
354
|
+
|
|
355
|
+
#[test]
|
|
356
|
+
fn should_suffix_a_chunk_name() {
|
|
357
|
+
assert_eq!(
|
|
358
|
+
suffix_chunk_name(" webpackChunkName: \"comp\" ", "-test").as_deref(),
|
|
359
|
+
Some(" webpackChunkName: \"comp-test\" ")
|
|
360
|
+
);
|
|
361
|
+
assert_eq!(
|
|
362
|
+
suffix_chunk_name("webpackChunkName: 'comp'", "-test").as_deref(),
|
|
363
|
+
Some("webpackChunkName: 'comp-test'")
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
#[test]
|
|
368
|
+
fn should_leave_other_comments_alone() {
|
|
369
|
+
// already suffixed
|
|
370
|
+
assert_eq!(
|
|
371
|
+
suffix_chunk_name(" webpackChunkName: \"comp-test\" ", "-test"),
|
|
372
|
+
None
|
|
373
|
+
);
|
|
374
|
+
// another magic comment
|
|
375
|
+
assert_eq!(suffix_chunk_name(" webpackPrefetch: true ", "-test"), None);
|
|
376
|
+
// empty name
|
|
377
|
+
assert_eq!(suffix_chunk_name(" webpackChunkName: \"\" ", "-test"), None);
|
|
378
|
+
// no closing quote
|
|
379
|
+
assert_eq!(
|
|
380
|
+
suffix_chunk_name(" webpackChunkName: \"comp ", "-test"),
|
|
381
|
+
None
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
|
|
307
385
|
test!(
|
|
308
386
|
module,
|
|
309
387
|
Syntax::Es(EsSyntax {
|
|
@@ -385,6 +463,30 @@ mod tests {
|
|
|
385
463
|
"#
|
|
386
464
|
);
|
|
387
465
|
|
|
466
|
+
test!(
|
|
467
|
+
module,
|
|
468
|
+
Syntax::Es(EsSyntax {
|
|
469
|
+
jsx: true,
|
|
470
|
+
..Default::default()
|
|
471
|
+
}),
|
|
472
|
+
|t| visit_mut_pass(DynamicImportVisitor::new(
|
|
473
|
+
DynamicImportVisitorConfig {
|
|
474
|
+
layer: "react__background".into(),
|
|
475
|
+
inject_lazy_bundle: Some(false),
|
|
476
|
+
..Default::default()
|
|
477
|
+
},
|
|
478
|
+
Some(t.comments.clone())
|
|
479
|
+
)),
|
|
480
|
+
should_suffix_webpack_chunk_name,
|
|
481
|
+
r#"
|
|
482
|
+
(async function () {
|
|
483
|
+
await import(/* webpackChunkName: "comp" */ "./comp.js");
|
|
484
|
+
await import(/* webpackPrefetch: true */ "./other.js");
|
|
485
|
+
await import("./plain.js");
|
|
486
|
+
})();
|
|
487
|
+
"#
|
|
488
|
+
);
|
|
489
|
+
|
|
388
490
|
test!(
|
|
389
491
|
module,
|
|
390
492
|
Syntax::Es(EsSyntax {
|