@lynx-js/react 0.129.4 → 0.129.5
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 +9 -1
- package/refresh/.turbo/turbo-build.log +1 -1
- package/runtime/__test__/core/lynx/env.test.ts +146 -0
- package/runtime/__test__/element-template/imports/suspense-lazy.test.ts +47 -4
- package/runtime/__test__/element-template/native/index.test.ts +9 -9
- package/runtime/__test__/element-template/native/mts-destroy.test.ts +55 -2
- package/runtime/__test__/element-template/native/reload.test.ts +15 -5
- package/runtime/__test__/element-template/runtime/background/main-thread-function/compiled-fixtures.test.tsx +1 -1
- package/runtime/__test__/element-template/runtime/hydration/hydration-listener.test.ts +1 -1
- package/runtime/__test__/element-template/runtime/render/render-transform.contract.test.ts +33 -0
- package/runtime/__test__/element-template/vitest.config.ts +1 -1
- package/runtime/__test__/snapshot/debug/profile.test.jsx +147 -26
- package/runtime/__test__/snapshot/lifecycle/reload-delayed-background.test.jsx +54 -0
- package/runtime/__test__/snapshot/lifecycle/transfer.mts.test.jsx +98 -6
- package/runtime/__test__/snapshot/lifecycle/transfer.test.jsx +214 -9
- package/runtime/__test__/snapshot/lynx/suspense.test.jsx +48 -0
- package/runtime/__test__/snapshot/utils/envManager.ts +2 -0
- package/runtime/__test__/worklet-runtime/delayWorkletEvent.test.js +21 -0
- package/runtime/__test__/worklet-runtime/lifecycle.test.js +297 -0
- package/runtime/__test__/worklet-runtime/profile.test.js +12 -6
- package/runtime/lazy/element-template-internal.js +1 -0
- package/runtime/lib/core/compat/componentIs.d.ts +1 -0
- package/runtime/lib/core/compat/componentIs.js +20 -0
- package/runtime/lib/core/compat/componentIs.js.map +1 -0
- package/runtime/lib/core/lynx/env.d.ts +1 -0
- package/runtime/lib/{element-template → core}/lynx/env.js +3 -2
- package/runtime/lib/core/lynx/env.js.map +1 -0
- package/runtime/lib/core/thread-function-call/main-thread.d.ts +1 -0
- package/runtime/lib/core/thread-function-call/main-thread.js +4 -1
- package/runtime/lib/core/thread-function-call/main-thread.js.map +1 -1
- package/runtime/lib/element-template/background/commit-event.d.ts +6 -0
- package/runtime/lib/element-template/background/commit-event.js +36 -0
- package/runtime/lib/element-template/background/commit-event.js.map +1 -0
- package/runtime/lib/element-template/background/commit-hook.js +3 -23
- package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
- package/runtime/lib/element-template/background/destroy.js +1 -1
- package/runtime/lib/element-template/background/destroy.js.map +1 -1
- package/runtime/lib/element-template/background/hydrate.js +1 -2
- package/runtime/lib/element-template/background/hydrate.js.map +1 -1
- package/runtime/lib/element-template/background/hydration-listener.js +5 -25
- package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
- package/runtime/lib/element-template/{runtime/template → background}/main-thread-function.js +4 -4
- package/runtime/lib/element-template/background/main-thread-function.js.map +1 -0
- 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.js +3 -0
- package/runtime/lib/element-template/internal.js.map +1 -1
- package/runtime/lib/element-template/native/index.js +2 -2
- package/runtime/lib/element-template/native/index.js.map +1 -1
- package/runtime/lib/element-template/native/mts-destroy.d.ts +2 -1
- package/runtime/lib/element-template/native/mts-destroy.js +15 -4
- package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
- package/runtime/lib/element-template/native/reload-main-thread.js +2 -2
- package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -1
- package/runtime/lib/element-template/runtime/patch.js +4 -11
- package/runtime/lib/element-template/runtime/patch.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/handle.d.ts +1 -1
- package/runtime/lib/element-template/runtime/template/handle.js +2 -2
- package/runtime/lib/element-template/runtime/template/handle.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-background-function.d.ts +1 -0
- package/runtime/lib/element-template/runtime/template/main-thread-background-function.js +7 -2
- package/runtime/lib/element-template/runtime/template/main-thread-background-function.js.map +1 -1
- package/runtime/lib/internal.js +4 -10
- package/runtime/lib/internal.js.map +1 -1
- package/runtime/lib/snapshot/debug/profileHooks.js +27 -62
- package/runtime/lib/snapshot/debug/profileHooks.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/reload.js +2 -2
- package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
- package/runtime/lib/snapshot/lynx/env.js +2 -32
- package/runtime/lib/snapshot/lynx/env.js.map +1 -1
- package/runtime/lib/snapshot/transfer.d.ts +6 -0
- package/runtime/lib/snapshot/transfer.js +154 -11
- package/runtime/lib/snapshot/transfer.js.map +1 -1
- package/runtime/lib/tsconfig.tsbuildinfo +1 -1
- package/runtime/lib/worklet-runtime/bindings/lifecycle.d.ts +19 -0
- package/runtime/lib/worklet-runtime/bindings/lifecycle.js +49 -0
- package/runtime/lib/worklet-runtime/bindings/lifecycle.js.map +1 -0
- package/runtime/lib/worklet-runtime/delayWorkletEvent.d.ts +1 -1
- package/runtime/lib/worklet-runtime/delayWorkletEvent.js +9 -1
- package/runtime/lib/worklet-runtime/delayWorkletEvent.js.map +1 -1
- package/runtime/lib/worklet-runtime/utils/profile.js +1 -3
- package/runtime/lib/worklet-runtime/utils/profile.js.map +1 -1
- package/runtime/src/core/compat/componentIs.ts +32 -0
- package/runtime/src/{element-template → core}/lynx/env.ts +6 -4
- package/runtime/src/core/thread-function-call/main-thread.ts +5 -1
- package/runtime/src/element-template/background/commit-event.ts +52 -0
- package/runtime/src/element-template/background/commit-hook.ts +4 -31
- package/runtime/src/element-template/background/destroy.ts +1 -1
- package/runtime/src/element-template/background/hydrate.ts +5 -3
- package/runtime/src/element-template/background/hydration-listener.ts +7 -32
- package/runtime/src/element-template/{runtime/template → background}/main-thread-function.ts +4 -7
- package/runtime/src/element-template/index.ts +1 -1
- package/runtime/src/element-template/internal.ts +4 -0
- package/runtime/src/element-template/native/index.ts +2 -2
- package/runtime/src/element-template/native/mts-destroy.ts +21 -4
- package/runtime/src/element-template/native/reload-main-thread.ts +2 -2
- package/runtime/src/element-template/runtime/patch.ts +20 -35
- package/runtime/src/element-template/runtime/template/handle.ts +2 -0
- package/runtime/src/element-template/runtime/template/main-thread-background-function.ts +8 -2
- package/runtime/src/internal.ts +4 -13
- package/runtime/src/snapshot/debug/profileHooks.ts +30 -91
- package/runtime/src/snapshot/lifecycle/reload.ts +2 -3
- package/runtime/src/snapshot/lynx/env.ts +3 -43
- package/runtime/src/snapshot/transfer.ts +169 -13
- package/runtime/src/worklet-runtime/bindings/lifecycle.ts +51 -0
- package/runtime/src/worklet-runtime/delayWorkletEvent.ts +10 -2
- package/runtime/src/worklet-runtime/utils/profile.ts +1 -3
- package/runtime/types/internal-preact.d.ts +2 -0
- package/runtime/vitest.config.ts +0 -1
- package/testing-library/.turbo/turbo-build.log +7 -7
- package/testing-library/src/__tests__/events.test.jsx +1 -1
- package/testing-library/src/fire-event.ts +1 -1
- package/transform/.turbo/turbo-build$colon$wasm.log +67 -66
- package/transform/__test__/fixture.spec.js +1 -1
- package/transform/cjs/browser.cjs +11 -0
- package/transform/crates/swc_plugin_compat/lib.rs +20 -2
- package/transform/crates/swc_plugin_compat/napi.rs +7 -0
- package/transform/crates/swc_plugin_dynamic_import/lib.rs +15 -4
- package/transform/crates/swc_plugin_element_template/attr_name.rs +0 -3
- package/transform/crates/swc_plugin_element_template/extractor.rs +0 -8
- package/transform/crates/swc_plugin_element_template/lib.rs +12 -1
- package/transform/crates/swc_plugin_element_template/tests/element_template_contract.rs +35 -0
- package/transform/crates/swc_plugin_worklet/lib.rs +11 -7
- package/transform/dist/wasm.cjs +1 -1
- package/transform/rspack-napi/lib/index.js +1 -4
- package/transform/rspack-napi/lib/index.js.map +1 -1
- package/transform/rspack-napi/src/index.ts +1 -4
- package/transform/rspack-napi/tsconfig.tsbuildinfo +1 -1
- package/transform/src/lib.rs +394 -27
- package/transform/swc-plugin-reactlynx/.turbo/turbo-build.log +413 -105
- package/transform/swc-plugin-reactlynx/src/lib.rs +99 -22
- package/transform/swc-plugin-reactlynx/swc_plugin_reactlynx.wasm +0 -0
- package/transform/swc-plugin-reactlynx-compat/.turbo/turbo-build.log +28 -359
- package/transform/swc-plugin-reactlynx-compat/swc_plugin_reactlynx_compat.wasm +0 -0
- package/runtime/__test__/element-template/lynx/env.test.ts +0 -242
- package/runtime/lib/element-template/lynx/env.d.ts +0 -1
- package/runtime/lib/element-template/lynx/env.js.map +0 -1
- package/runtime/lib/element-template/runtime/template/main-thread-function.js.map +0 -1
- package/runtime/lib/snapshot/compat/componentIs.d.ts +0 -4
- package/runtime/lib/snapshot/compat/componentIs.js +0 -20
- package/runtime/lib/snapshot/compat/componentIs.js.map +0 -1
- package/runtime/src/snapshot/compat/componentIs.ts +0 -30
- /package/runtime/__test__/element-template/runtime/{template → background}/main-thread-function.test.ts +0 -0
- /package/runtime/lib/element-template/{runtime/template → background}/main-thread-function.d.ts +0 -0
|
@@ -3,30 +3,31 @@ $ node ./scripts/build_wasm.js
|
|
|
3
3
|
Blocking waiting for file lock on package cache
|
|
4
4
|
Blocking waiting for file lock on package cache
|
|
5
5
|
Downloading crates ...
|
|
6
|
-
Downloaded ctor v0.1.26
|
|
7
6
|
Downloaded bitflags v1.3.2
|
|
7
|
+
Downloaded ctor v0.1.26
|
|
8
8
|
Downloaded convert_case v0.6.0
|
|
9
|
-
Downloaded napi v2.10.4
|
|
10
|
-
Downloaded napi-build v2.3.2
|
|
11
9
|
Downloaded napi-sys v2.4.0
|
|
10
|
+
Downloaded napi-build v2.3.2
|
|
11
|
+
Downloaded napi v2.10.4
|
|
12
12
|
Downloaded napi-derive v2.9.3
|
|
13
13
|
Downloaded napi-derive-backend v1.0.40
|
|
14
14
|
Downloaded version-compare v0.2.1
|
|
15
|
+
Blocking waiting for file lock on package cache
|
|
15
16
|
Blocking waiting for file lock on build directory
|
|
16
17
|
Compiling cfg-if v1.0.4
|
|
17
18
|
Compiling serde_core v1.0.229
|
|
18
19
|
Compiling allocator-api2 v0.2.21
|
|
19
20
|
Compiling serde v1.0.229
|
|
20
21
|
Compiling once_cell v1.21.4
|
|
21
|
-
Compiling stable_deref_trait v1.2.1
|
|
22
22
|
Compiling memchr v2.8.3
|
|
23
|
+
Compiling stable_deref_trait v1.2.1
|
|
23
24
|
Compiling zerofrom v0.1.8
|
|
24
|
-
Compiling equivalent v1.0.2
|
|
25
25
|
Compiling foldhash v0.2.0
|
|
26
|
+
Compiling equivalent v1.0.2
|
|
26
27
|
Compiling yoke v0.8.3
|
|
27
28
|
Compiling hashbrown v0.17.1
|
|
28
|
-
Compiling zerovec v0.11.6
|
|
29
29
|
Compiling smallvec v1.15.2
|
|
30
|
+
Compiling zerovec v0.11.6
|
|
30
31
|
Compiling getrandom v0.3.4
|
|
31
32
|
Compiling zerocopy v0.8.55
|
|
32
33
|
Compiling ahash v0.8.12
|
|
@@ -34,11 +35,11 @@ $ node ./scripts/build_wasm.js
|
|
|
34
35
|
Compiling itoa v1.0.18
|
|
35
36
|
Compiling serde_json v1.0.151
|
|
36
37
|
Compiling tinystr v0.8.3
|
|
37
|
-
Compiling writeable v0.6.3
|
|
38
38
|
Compiling litemap v0.8.2
|
|
39
|
+
Compiling writeable v0.6.3
|
|
39
40
|
Compiling potential_utf v0.1.5
|
|
40
|
-
Compiling icu_locale_core v2.2.0
|
|
41
41
|
Compiling zerotrie v0.2.4
|
|
42
|
+
Compiling icu_locale_core v2.2.0
|
|
42
43
|
Compiling utf8_iter v1.0.4
|
|
43
44
|
Compiling icu_collections v2.2.0
|
|
44
45
|
Compiling indexmap v2.14.0
|
|
@@ -48,38 +49,38 @@ $ node ./scripts/build_wasm.js
|
|
|
48
49
|
Compiling icu_properties_data v2.2.0
|
|
49
50
|
Compiling rustc-hash v2.1.3
|
|
50
51
|
Compiling parking_lot_core v0.9.12
|
|
51
|
-
Compiling icu_normalizer v2.2.0
|
|
52
52
|
Compiling icu_properties v2.2.0
|
|
53
|
+
Compiling icu_normalizer v2.2.0
|
|
54
|
+
Compiling hashbrown v0.14.5
|
|
53
55
|
Compiling either v1.17.0
|
|
54
56
|
Compiling scopeguard v1.2.0
|
|
55
57
|
Compiling lock_api v0.4.14
|
|
56
|
-
Compiling hashbrown v0.14.5
|
|
57
58
|
Compiling radium v0.7.0
|
|
58
|
-
Compiling tracing-core v0.1.36
|
|
59
|
-
Compiling tap v1.0.1
|
|
60
59
|
Compiling idna_adapter v1.2.2
|
|
60
|
+
Compiling tracing-core v0.1.36
|
|
61
61
|
Compiling percent-encoding v2.3.2
|
|
62
|
+
Compiling tap v1.0.1
|
|
62
63
|
Compiling form_urlencoded v1.2.2
|
|
63
64
|
Compiling idna v1.1.0
|
|
64
65
|
Compiling wyz v0.5.1
|
|
65
66
|
Compiling anyhow v1.0.104
|
|
66
|
-
Compiling
|
|
67
|
-
Compiling vsimd v0.8.0
|
|
67
|
+
Compiling outref v0.5.2
|
|
68
68
|
Compiling bytes v1.12.1
|
|
69
|
-
Compiling pin-project-lite v0.2.17
|
|
70
69
|
Compiling funty v2.0.0
|
|
71
|
-
Compiling
|
|
72
|
-
Compiling
|
|
73
|
-
Compiling
|
|
70
|
+
Compiling vsimd v0.8.0
|
|
71
|
+
Compiling pin-project-lite v0.2.17
|
|
72
|
+
Compiling uuid v1.24.0
|
|
74
73
|
Compiling tracing v0.1.44
|
|
75
|
-
Compiling bitvec v1.1.1
|
|
76
74
|
Compiling debugid v0.8.0
|
|
75
|
+
Compiling bytes-str v0.2.8
|
|
76
|
+
Compiling base64-simd v0.8.0
|
|
77
|
+
Compiling bitvec v1.1.1
|
|
77
78
|
Compiling url v2.5.8
|
|
78
79
|
Compiling triomphe v0.1.16
|
|
79
|
-
Compiling
|
|
80
|
+
Compiling data-encoding v2.11.0
|
|
80
81
|
Compiling new_debug_unreachable v1.0.6
|
|
81
82
|
Compiling unicode-width v0.2.2
|
|
82
|
-
Compiling
|
|
83
|
+
Compiling if_chain v1.0.3
|
|
83
84
|
Compiling unicode-id-start v1.4.0
|
|
84
85
|
Compiling hstr v4.0.0
|
|
85
86
|
Compiling num-integer v0.1.46
|
|
@@ -88,97 +89,97 @@ $ node ./scripts/build_wasm.js
|
|
|
88
89
|
Compiling num-bigint v0.4.8
|
|
89
90
|
Compiling swc_atoms v10.0.0
|
|
90
91
|
Compiling parking_lot v0.12.5
|
|
91
|
-
Compiling swc_sourcemap v10.0.2
|
|
92
92
|
Compiling swc_visit v2.0.2
|
|
93
93
|
Compiling siphasher v0.3.11
|
|
94
94
|
Compiling termcolor v1.4.1
|
|
95
|
+
Compiling swc_sourcemap v10.0.2
|
|
95
96
|
Compiling bitflags v2.13.1
|
|
96
97
|
Compiling siphasher v1.0.3
|
|
98
|
+
Compiling phf_shared v0.11.3
|
|
97
99
|
Compiling libc v0.2.189
|
|
98
100
|
Compiling dragonbox_ecma v0.1.12
|
|
101
|
+
Compiling phf v0.11.3
|
|
99
102
|
Compiling par-core v2.0.0
|
|
100
103
|
Compiling num_cpus v1.17.0
|
|
101
|
-
Compiling phf_shared v0.11.3
|
|
102
|
-
Compiling phf v0.11.3
|
|
103
104
|
Compiling castaway v0.2.4
|
|
104
105
|
Compiling static_assertions v1.1.0
|
|
105
106
|
Compiling ryu v1.0.23
|
|
106
107
|
Compiling aho-corasick v1.1.4
|
|
107
|
-
Compiling swc_common v26.0.0
|
|
108
108
|
Compiling compact_str v0.7.1
|
|
109
|
+
Compiling swc_common v26.0.0
|
|
109
110
|
Compiling regex-syntax v0.8.11
|
|
111
|
+
Compiling swc_ecma_regexp_common v0.0.1
|
|
110
112
|
Compiling swc_ecma_ast v29.0.0
|
|
111
113
|
Compiling regex-automata v0.4.16
|
|
112
|
-
Compiling swc_ecma_regexp_common v0.0.1
|
|
113
114
|
Compiling typenum v1.20.1
|
|
114
115
|
Compiling swc_ecma_regexp_ast v3.0.0
|
|
115
116
|
Compiling crossbeam-utils v0.8.22
|
|
116
117
|
Compiling swc_ecma_regexp_visit v0.15.0
|
|
117
|
-
Compiling dashmap v6.2.1
|
|
118
118
|
Compiling swc_ecma_visit v29.0.0
|
|
119
119
|
Compiling swc_ecma_parser v45.1.1
|
|
120
120
|
Compiling regex v1.13.1
|
|
121
121
|
Compiling swc_ecma_compat_regexp v9.0.0
|
|
122
122
|
Compiling swc_ecma_regexp v0.15.0
|
|
123
|
+
Compiling dashmap v6.2.1
|
|
123
124
|
Compiling generic-array v0.14.7
|
|
124
|
-
Compiling bstr v1.13.0
|
|
125
125
|
Compiling hashbrown v0.16.1
|
|
126
|
-
Compiling
|
|
126
|
+
Compiling bstr v1.13.0
|
|
127
127
|
Compiling globset v0.4.19
|
|
128
|
-
Compiling
|
|
128
|
+
Compiling regress v0.11.1
|
|
129
129
|
Compiling block-buffer v0.10.4
|
|
130
|
+
Compiling crypto-common v0.1.7
|
|
130
131
|
Compiling digest v0.10.7
|
|
131
132
|
Compiling arrayvec v0.7.8
|
|
132
|
-
Compiling swc_config v6.0.0
|
|
133
|
-
Compiling swc_ecma_utils v35.0.0
|
|
134
|
-
Compiling swc_ecma_hooks v1.0.0
|
|
135
133
|
Compiling thiserror v1.0.69
|
|
136
134
|
Compiling owo-colors v4.3.0
|
|
137
135
|
Compiling semver v1.0.28
|
|
138
|
-
Compiling
|
|
136
|
+
Compiling unicode-linebreak v0.1.5
|
|
137
|
+
Compiling swc_config v6.0.0
|
|
138
|
+
Compiling swc_ecma_utils v35.0.0
|
|
139
|
+
Compiling swc_ecma_hooks v1.0.0
|
|
139
140
|
Compiling fixedbitset v0.5.7
|
|
140
|
-
Compiling swc_ecma_transformer v21.0.1
|
|
141
|
-
Compiling swc_ecma_transforms_classes v49.0.0
|
|
142
141
|
Compiling base64 v0.22.1
|
|
143
|
-
Compiling unicode-linebreak v0.1.5
|
|
144
|
-
Compiling textwrap v0.16.2
|
|
145
|
-
Compiling swc_ecma_compat_common v45.0.0
|
|
146
142
|
Compiling petgraph v0.7.1
|
|
143
|
+
Compiling swc_ecma_transforms_base v49.0.1
|
|
144
|
+
Compiling textwrap v0.16.2
|
|
147
145
|
Compiling bumpalo v3.20.3
|
|
148
146
|
Compiling thread_local v1.1.10
|
|
149
147
|
Compiling unicode-width v0.1.14
|
|
150
|
-
Compiling
|
|
151
|
-
Compiling
|
|
148
|
+
Compiling swc_ecma_transformer v21.0.1
|
|
149
|
+
Compiling swc_ecma_transforms_classes v49.0.0
|
|
152
150
|
Compiling camino v1.2.4
|
|
153
|
-
Compiling
|
|
151
|
+
Compiling miette v7.6.0
|
|
152
|
+
Compiling swc_ecma_compat_common v45.0.0
|
|
154
153
|
Compiling swc_ecma_compat_es2015 v55.0.0
|
|
155
154
|
Compiling swc_ecma_compat_es2022 v53.0.0
|
|
155
|
+
Compiling swc_ecma_transforms_optimization v52.0.0
|
|
156
|
+
Compiling swc_allocator v5.0.0
|
|
156
157
|
Compiling sha1 v0.10.7
|
|
157
158
|
Compiling chrono v0.4.45
|
|
158
159
|
Compiling ascii v1.1.0
|
|
159
|
-
Compiling log v0.4.33
|
|
160
160
|
Compiling syn v1.0.109
|
|
161
161
|
Compiling lazy_static v1.5.0
|
|
162
|
-
Compiling
|
|
162
|
+
Compiling log v0.4.33
|
|
163
163
|
Compiling tracing-log v0.2.0
|
|
164
|
+
Compiling sharded-slab v0.1.7
|
|
164
165
|
Compiling swc_ecma_codegen v32.0.0
|
|
165
|
-
Compiling browserslist-data v0.2.0
|
|
166
166
|
Compiling swc_ecma_compat_bugfixes v56.0.0
|
|
167
|
+
Compiling browserslist-data v0.2.0
|
|
167
168
|
Compiling swc_ecma_transforms_react v55.0.1
|
|
168
169
|
Compiling swc_ecma_compat_es2020 v53.0.0
|
|
169
170
|
Compiling swc_error_reporters v28.0.0
|
|
170
|
-
Compiling swc_ecma_compat_es2017 v50.0.0
|
|
171
171
|
Compiling swc_ecma_compat_es2016 v50.0.0
|
|
172
|
-
Compiling swc_ecma_compat_es2019 v50.0.0
|
|
173
172
|
Compiling swc_ecma_compat_es2018 v51.0.0
|
|
173
|
+
Compiling swc_ecma_compat_es2017 v50.0.0
|
|
174
174
|
Compiling swc_ecma_compat_es2021 v50.0.0
|
|
175
|
+
Compiling swc_ecma_compat_es2019 v50.0.0
|
|
175
176
|
Compiling matchers v0.2.0
|
|
176
177
|
Compiling itertools v0.15.0
|
|
177
178
|
Compiling cargo-platform v0.1.9
|
|
178
179
|
Compiling nom v8.0.0
|
|
179
|
-
Compiling nu-ansi-term v0.50.3
|
|
180
180
|
Compiling diff v0.1.13
|
|
181
181
|
Compiling yansi v1.0.1
|
|
182
|
+
Compiling nu-ansi-term v0.50.3
|
|
182
183
|
Compiling pretty_assertions v1.4.1
|
|
183
184
|
Compiling tracing-subscriber v0.3.23
|
|
184
185
|
Compiling st-map v0.2.4
|
|
@@ -188,33 +189,33 @@ $ node ./scripts/build_wasm.js
|
|
|
188
189
|
Compiling swc_ecma_transforms_typescript v55.0.1
|
|
189
190
|
Compiling swc_ecma_transforms_proposal v49.0.0
|
|
190
191
|
Compiling par-iter v2.0.0
|
|
192
|
+
Compiling pathdiff v0.2.3
|
|
191
193
|
Compiling difference v2.0.0
|
|
192
194
|
Compiling ryu-js v1.0.3
|
|
193
195
|
Compiling radix_fmt v1.0.0
|
|
194
|
-
Compiling pathdiff v0.2.3
|
|
195
196
|
Compiling testing v27.0.0
|
|
197
|
+
Compiling swc_ecma_minifier v61.0.4
|
|
196
198
|
Compiling swc_ecma_transforms v62.0.0
|
|
197
199
|
Compiling preset_env_base v9.0.0
|
|
198
|
-
Compiling swc_ecma_minifier v61.0.4
|
|
199
200
|
Compiling swc_ecma_preset_env v63.0.0
|
|
200
201
|
Compiling sha2 v0.10.9
|
|
201
202
|
Compiling lru v0.18.4
|
|
202
|
-
Compiling
|
|
203
|
+
Compiling foldhash v0.1.5
|
|
203
204
|
Compiling fastrand v2.5.0
|
|
204
|
-
Compiling precomputed-map v0.2.0
|
|
205
205
|
Compiling hex v0.4.3
|
|
206
|
+
Compiling precomputed-map v0.2.0
|
|
207
|
+
Compiling unicode-segmentation v1.13.3
|
|
206
208
|
Compiling path-clean v1.0.1
|
|
207
|
-
Compiling foldhash v0.1.5
|
|
208
209
|
Compiling swc_ecma_loader v27.0.0
|
|
210
|
+
Compiling convert_case v0.6.0
|
|
209
211
|
Compiling swc_ecma_testing v27.0.0
|
|
210
212
|
Compiling tempfile v3.27.0
|
|
211
|
-
Compiling convert_case v0.6.0
|
|
212
213
|
Compiling swc_ecma_ext_transforms v35.0.0
|
|
213
214
|
Compiling swc_node_comments v27.0.0
|
|
214
215
|
Compiling swc_transform_common v20.0.0
|
|
215
216
|
Compiling jsonc-parser v0.26.3
|
|
216
|
-
Compiling ansi_term v0.12.1
|
|
217
217
|
Compiling swc_core v77.1.2
|
|
218
|
+
Compiling ansi_term v0.12.1
|
|
218
219
|
Compiling swc_ecma_transforms_testing v53.0.0
|
|
219
220
|
Compiling napi-derive-backend v1.0.40
|
|
220
221
|
Compiling swc_compiler_base v64.0.0
|
|
@@ -227,28 +228,28 @@ $ node ./scripts/build_wasm.js
|
|
|
227
228
|
Compiling convert_case v0.11.0
|
|
228
229
|
Compiling sha-1 v0.10.1
|
|
229
230
|
Compiling sugar_path v1.2.1
|
|
230
|
-
Compiling swc_plugins_shared v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugins_shared)
|
|
231
231
|
Compiling hybrid-array v0.4.13
|
|
232
|
-
Compiling
|
|
232
|
+
Compiling swc_plugins_shared v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugins_shared)
|
|
233
233
|
Compiling crypto-common v0.2.2
|
|
234
|
+
Compiling block-buffer v0.12.1
|
|
234
235
|
Compiling const-oid v0.10.2
|
|
236
|
+
Compiling digest v0.11.3
|
|
235
237
|
Compiling napi-build v2.3.2
|
|
236
|
-
Compiling react-transform v0.0.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform)
|
|
237
238
|
Compiling getrandom v0.4.3
|
|
238
|
-
Compiling
|
|
239
|
-
Compiling digest v0.11.3
|
|
239
|
+
Compiling react-transform v0.0.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform)
|
|
240
240
|
Compiling sha2 v0.11.0
|
|
241
|
+
Compiling swc_plugin_snapshot v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_snapshot)
|
|
241
242
|
Compiling swc_plugin_define_dce v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_define_dce)
|
|
242
243
|
Compiling swc_plugin_directive_dce v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_directive_dce)
|
|
243
|
-
Compiling swc_plugin_list v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_list)
|
|
244
244
|
Compiling swc_plugin_element_template v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_element_template)
|
|
245
|
+
Compiling swc_plugin_list v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_list)
|
|
246
|
+
Compiling swc_plugin_css_scope v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_css_scope)
|
|
247
|
+
Compiling swc_plugin_compat v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_compat)
|
|
248
|
+
Compiling swc_plugin_text v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_text)
|
|
245
249
|
Compiling swc_plugin_inject v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_inject)
|
|
246
250
|
Compiling swc_plugin_shake v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_shake)
|
|
247
|
-
Compiling swc_plugin_text v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_text)
|
|
248
|
-
Compiling swc_plugin_compat v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_compat)
|
|
249
|
-
Compiling swc_plugin_worklet v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_worklet)
|
|
250
251
|
Compiling swc_plugin_dynamic_import v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_dynamic_import)
|
|
251
|
-
Compiling
|
|
252
|
+
Compiling swc_plugin_worklet v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_worklet)
|
|
252
253
|
Compiling swc_plugin_background_only v0.1.0 (/home/runner/work/lynx-stack/lynx-stack/packages/react/transform/crates/swc_plugin_background_only)
|
|
253
254
|
Compiling version-compare v0.2.1
|
|
254
|
-
Finished `release` profile [optimized] target(s) in
|
|
255
|
+
Finished `release` profile [optimized] target(s) in 5m 06s
|
|
@@ -393,7 +393,7 @@ 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
|
-
import * as ReactLynxInternal from "@lynx-js/react/internal";
|
|
396
|
+
import * as ReactLynxInternal from "@lynx-js/react/element-template/internal";
|
|
397
397
|
const _et_4f796f70cdd7_bundle = globDynamicComponentEntry;
|
|
398
398
|
const _et_4f796f70cdd7 = \`\${_et_4f796f70cdd7_bundle}:\${"_et_4f796f70cdd7"}\`;
|
|
399
399
|
const _et_b8da8bac988e_bundle = globDynamicComponentEntry;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
// The `browser` entry of `@lynx-js/react/transform`: the wasm build only.
|
|
6
|
+
// `main.cjs` also requires the napi build (`../index.cjs`), which is not
|
|
7
|
+
// published, so a bundler targeting the browser could not resolve it.
|
|
8
|
+
|
|
9
|
+
/* eslint-disable n/no-unpublished-require */
|
|
10
|
+
|
|
11
|
+
module.exports = require('../dist/wasm.cjs').default;
|
|
@@ -393,6 +393,8 @@ where
|
|
|
393
393
|
C: Comments + Clone,
|
|
394
394
|
{
|
|
395
395
|
opts: CompatVisitorConfig,
|
|
396
|
+
runtime_entry: Option<String>,
|
|
397
|
+
lazy_import_entry: Option<String>,
|
|
396
398
|
|
|
397
399
|
// state
|
|
398
400
|
is_components_pkg: bool,
|
|
@@ -458,6 +460,8 @@ where
|
|
|
458
460
|
pub fn new(opts: CompatVisitorConfig, comments: Option<C>) -> Self {
|
|
459
461
|
CompatVisitor {
|
|
460
462
|
opts,
|
|
463
|
+
runtime_entry: None,
|
|
464
|
+
lazy_import_entry: None,
|
|
461
465
|
is_components_pkg: false,
|
|
462
466
|
is_old_runtime_pkg: false,
|
|
463
467
|
old_runtime_import_ids: vec![],
|
|
@@ -469,6 +473,12 @@ where
|
|
|
469
473
|
}
|
|
470
474
|
}
|
|
471
475
|
|
|
476
|
+
pub fn with_runtime_entries(mut self, runtime_entry: String, lazy_import_entry: String) -> Self {
|
|
477
|
+
self.runtime_entry = Some(runtime_entry);
|
|
478
|
+
self.lazy_import_entry = Some(lazy_import_entry);
|
|
479
|
+
self
|
|
480
|
+
}
|
|
481
|
+
|
|
472
482
|
fn wrap_with_lynx_component_helper(&mut self, state: AddComponentElementState) -> Expr {
|
|
473
483
|
let (mut primitive_attrs, component_jsx, has_spread, _) = state;
|
|
474
484
|
|
|
@@ -1194,6 +1204,10 @@ where
|
|
|
1194
1204
|
n.visit_mut_children_with(self);
|
|
1195
1205
|
|
|
1196
1206
|
if let Some(runtime_id) = Lazy::<Ident>::get(&self.runtime_id) {
|
|
1207
|
+
let runtime_entry = self
|
|
1208
|
+
.runtime_entry
|
|
1209
|
+
.clone()
|
|
1210
|
+
.unwrap_or_else(|| format!("{}/internal", self.opts.new_runtime_pkg));
|
|
1197
1211
|
prepend_stmt(
|
|
1198
1212
|
&mut n.body,
|
|
1199
1213
|
ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
|
|
@@ -1206,7 +1220,7 @@ where
|
|
|
1206
1220
|
src: Box::new(Str {
|
|
1207
1221
|
span: DUMMY_SP,
|
|
1208
1222
|
raw: None,
|
|
1209
|
-
value:
|
|
1223
|
+
value: runtime_entry.into(),
|
|
1210
1224
|
}),
|
|
1211
1225
|
type_only: Default::default(),
|
|
1212
1226
|
with: Default::default(),
|
|
@@ -1215,6 +1229,10 @@ where
|
|
|
1215
1229
|
}
|
|
1216
1230
|
|
|
1217
1231
|
if self.has_component_is {
|
|
1232
|
+
let lazy_import_entry = self
|
|
1233
|
+
.lazy_import_entry
|
|
1234
|
+
.clone()
|
|
1235
|
+
.unwrap_or_else(|| format!("{}/experimental/lazy/import", self.opts.new_runtime_pkg));
|
|
1218
1236
|
prepend_stmt(
|
|
1219
1237
|
&mut n.body,
|
|
1220
1238
|
ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
|
|
@@ -1224,7 +1242,7 @@ where
|
|
|
1224
1242
|
src: Box::new(Str {
|
|
1225
1243
|
span: DUMMY_SP,
|
|
1226
1244
|
raw: None,
|
|
1227
|
-
value:
|
|
1245
|
+
value: lazy_import_entry.into(),
|
|
1228
1246
|
}),
|
|
1229
1247
|
type_only: Default::default(),
|
|
1230
1248
|
with: Default::default(),
|
|
@@ -475,6 +475,13 @@ where
|
|
|
475
475
|
inner: CoreVisitor::new(cfg.into(), comments),
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
+
|
|
479
|
+
pub fn with_runtime_entries(mut self, runtime_entry: String, lazy_import_entry: String) -> Self {
|
|
480
|
+
self.inner = self
|
|
481
|
+
.inner
|
|
482
|
+
.with_runtime_entries(runtime_entry, lazy_import_entry);
|
|
483
|
+
self
|
|
484
|
+
}
|
|
478
485
|
}
|
|
479
486
|
|
|
480
487
|
impl<C> VisitMut for CompatVisitor<C>
|
|
@@ -319,11 +319,14 @@ where
|
|
|
319
319
|
})),
|
|
320
320
|
);
|
|
321
321
|
|
|
322
|
+
let lazy_import_pkg = self
|
|
323
|
+
.opts
|
|
324
|
+
.runtime_pkg
|
|
325
|
+
.strip_suffix("/internal")
|
|
326
|
+
.unwrap_or(&self.opts.runtime_pkg);
|
|
322
327
|
prepend_stmt(
|
|
323
328
|
&mut n.body,
|
|
324
|
-
create_import_decl(
|
|
325
|
-
&format!("{}/experimental/lazy/import", self.opts.runtime_pkg).replace("/internal", ""),
|
|
326
|
-
),
|
|
329
|
+
create_import_decl(&format!("{lazy_import_pkg}/experimental/lazy/import")),
|
|
327
330
|
);
|
|
328
331
|
}
|
|
329
332
|
if match self.opts.inject_lazy_bundle {
|
|
@@ -332,9 +335,17 @@ where
|
|
|
332
335
|
None => true,
|
|
333
336
|
} && self.has_inner_lazy_bundle
|
|
334
337
|
{
|
|
338
|
+
let lazy_bundle_runtime_pkg =
|
|
339
|
+
if self.opts.runtime_pkg == "@lynx-js/react/element-template/internal" {
|
|
340
|
+
"@lynx-js/react/element-template/internal"
|
|
341
|
+
} else {
|
|
342
|
+
"@lynx-js/react/internal"
|
|
343
|
+
};
|
|
335
344
|
prepend_stmt(
|
|
336
345
|
&mut n.body,
|
|
337
|
-
create_import_decl(
|
|
346
|
+
create_import_decl(&format!(
|
|
347
|
+
"data:text/javascript;charset=utf-8,import {{ loadLazyBundle }} from \"{lazy_bundle_runtime_pkg}\";lynx.loadLazyBundle = loadLazyBundle;"
|
|
348
|
+
)),
|
|
338
349
|
);
|
|
339
350
|
}
|
|
340
351
|
}
|
|
@@ -11,7 +11,6 @@ pub enum AttrName {
|
|
|
11
11
|
Class,
|
|
12
12
|
ID,
|
|
13
13
|
Ref,
|
|
14
|
-
TimingFlag,
|
|
15
14
|
UnsupportedNamespacedRef,
|
|
16
15
|
MTRef,
|
|
17
16
|
Gesture,
|
|
@@ -29,8 +28,6 @@ impl From<String> for AttrName {
|
|
|
29
28
|
AttrName::ID
|
|
30
29
|
} else if name == "ref" {
|
|
31
30
|
AttrName::Ref
|
|
32
|
-
} else if name == "__lynx_timing_flag" {
|
|
33
|
-
AttrName::TimingFlag
|
|
34
31
|
} else if is_lynx_event_attribute_name(name.as_str()) {
|
|
35
32
|
AttrName::Event
|
|
36
33
|
} else {
|
|
@@ -8,7 +8,6 @@ use swc_core::{
|
|
|
8
8
|
utils::is_literal,
|
|
9
9
|
visit::{VisitMut, VisitMutWith},
|
|
10
10
|
},
|
|
11
|
-
quote_expr,
|
|
12
11
|
};
|
|
13
12
|
use swc_plugins_shared::{
|
|
14
13
|
css::get_string_inline_style_from_literal,
|
|
@@ -204,13 +203,6 @@ where
|
|
|
204
203
|
AttrName::Event | AttrName::Ref => {
|
|
205
204
|
self.push_dynamic_attr(*jsx_attr_value((*value).clone()), attr_name, key);
|
|
206
205
|
}
|
|
207
|
-
AttrName::TimingFlag => {
|
|
208
|
-
self.push_dynamic_attr(
|
|
209
|
-
*quote_expr!("{__ltf: $flag}", flag: Expr = *jsx_attr_value((*value).clone())),
|
|
210
|
-
attr_name,
|
|
211
|
-
key,
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
206
|
AttrName::WorkletEvent
|
|
215
207
|
| AttrName::UnsupportedNamespacedRef
|
|
216
208
|
| AttrName::MTRef
|
|
@@ -331,7 +331,18 @@ where
|
|
|
331
331
|
|
|
332
332
|
let span = node.span();
|
|
333
333
|
let opening_span = node.opening.span;
|
|
334
|
-
let
|
|
334
|
+
let mut attrs = node.opening.attrs.take();
|
|
335
|
+
if let Some(css_id) = self.css_id_value {
|
|
336
|
+
attrs.push(jsx_expr_attr(
|
|
337
|
+
"css-id",
|
|
338
|
+
Expr::Lit(Lit::Num(Number {
|
|
339
|
+
span: DUMMY_SP,
|
|
340
|
+
value: css_id,
|
|
341
|
+
raw: None,
|
|
342
|
+
})),
|
|
343
|
+
));
|
|
344
|
+
}
|
|
345
|
+
let (mut rendered_attrs, attributes) = typed_host_attributes_expr(attrs);
|
|
335
346
|
let list_children = if node.children.is_empty() {
|
|
336
347
|
empty_array_expr()
|
|
337
348
|
} else {
|
|
@@ -707,6 +707,41 @@ fn should_keep_static_attribute_values_out_of_et_attribute_slots() {
|
|
|
707
707
|
);
|
|
708
708
|
}
|
|
709
709
|
|
|
710
|
+
#[test]
|
|
711
|
+
fn should_pass_timing_flags_to_native_as_plain_attributes() {
|
|
712
|
+
for input in [
|
|
713
|
+
r#"<text __lynx_timing_flag="__lynx_timing_actual_fmp" />"#,
|
|
714
|
+
r#"<text __lynx_timing_flag={"__lynx_timing_actual_fmp"} />"#,
|
|
715
|
+
] {
|
|
716
|
+
let template = first_user_template_json(input);
|
|
717
|
+
assert_eq!(
|
|
718
|
+
template["attributesArray"],
|
|
719
|
+
serde_json::json!([{
|
|
720
|
+
"kind": "static",
|
|
721
|
+
"key": "__lynx_timing_flag",
|
|
722
|
+
"value": "__lynx_timing_actual_fmp"
|
|
723
|
+
}]),
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
let (code, template) = first_user_template_json_with_code(
|
|
728
|
+
r#"<text __lynx_timing_flag={flag} />"#,
|
|
729
|
+
element_template_config(),
|
|
730
|
+
);
|
|
731
|
+
assert_eq!(
|
|
732
|
+
template["attributesArray"],
|
|
733
|
+
serde_json::json!([{
|
|
734
|
+
"kind": "slot",
|
|
735
|
+
"key": "__lynx_timing_flag",
|
|
736
|
+
"attrSlotIndex": 0.0
|
|
737
|
+
}]),
|
|
738
|
+
);
|
|
739
|
+
assert!(
|
|
740
|
+
without_whitespace(&code).contains(",[flag],"),
|
|
741
|
+
"Expected the raw timing flag in the attribute slot, got: {code}"
|
|
742
|
+
);
|
|
743
|
+
}
|
|
744
|
+
|
|
710
745
|
#[test]
|
|
711
746
|
fn should_not_consume_hidden_et_slots_for_list_item_platform_attrs() {
|
|
712
747
|
let (code, template) = first_user_template_json_with_code(
|
|
@@ -960,13 +960,17 @@ impl WorkletVisitor {
|
|
|
960
960
|
}
|
|
961
961
|
|
|
962
962
|
fn registration_import(&self) -> ModuleItem {
|
|
963
|
-
let runtime_pkg = self
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
963
|
+
let runtime_pkg = if self.cfg.runtime_pkg == "@lynx-js/react/element-template/internal" {
|
|
964
|
+
"@lynx-js/react"
|
|
965
|
+
} else {
|
|
966
|
+
self
|
|
967
|
+
.cfg
|
|
968
|
+
.runtime_pkg
|
|
969
|
+
.strip_suffix("/internal")
|
|
970
|
+
// A scoped package named `internal` is a package root, not an entry.
|
|
971
|
+
.filter(|pkg| !pkg.starts_with('@') || pkg.contains('/'))
|
|
972
|
+
.unwrap_or(&self.cfg.runtime_pkg)
|
|
973
|
+
};
|
|
970
974
|
ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl {
|
|
971
975
|
span: DUMMY_SP,
|
|
972
976
|
phase: ImportPhase::Evaluation,
|