@lynx-js/react 0.129.0 → 0.129.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 +24 -0
- package/components/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/refresh/.turbo/turbo-build.log +1 -1
- package/runtime/__test__/core/globalProps.test.ts +27 -6
- package/runtime/__test__/core/hooks/useLynxGlobalEventListener.test.jsx +1 -1
- package/runtime/__test__/element-template/fixtures/gesture/direct/index.tsx +33 -0
- package/runtime/__test__/element-template/fixtures/spread/mts/index.tsx +197 -0
- package/runtime/__test__/element-template/imports/no-legacy-imports.test.ts +7 -6
- package/runtime/__test__/element-template/internal/legacy-internal-guardrail.test.ts +1 -2
- package/runtime/__test__/element-template/native/callDestroyLifetimeFun.test.ts +89 -3
- package/runtime/__test__/element-template/native/main-thread-api.test.ts +5 -2
- package/runtime/__test__/element-template/native/mts-destroy.test.ts +88 -0
- package/runtime/__test__/element-template/native/reload-dual-thread-communication.test.ts +3 -0
- package/runtime/__test__/element-template/native/reload.test.ts +118 -2
- package/runtime/__test__/element-template/runtime/background/global-props/compiled-fixtures.test.tsx +5 -5
- package/runtime/__test__/element-template/runtime/background/global-props.test.tsx +1 -1
- package/runtime/__test__/element-template/runtime/background/hydrate.test.ts +70 -0
- package/runtime/__test__/element-template/runtime/background/ref/compiled-fixtures.test.tsx +3 -4
- package/runtime/__test__/element-template/runtime/background/reload.test.ts +74 -0
- package/runtime/__test__/element-template/runtime/background/update-timing.test.ts +15 -0
- package/runtime/__test__/element-template/runtime/patch/element-template-patch.test.tsx +212 -7
- package/runtime/__test__/element-template/runtime/patch/update-timing.test.ts +4 -1
- package/runtime/__test__/element-template/runtime/prop-adapters/gesture-compiled.test.ts +200 -0
- package/runtime/__test__/element-template/runtime/prop-adapters/gesture.test.ts +420 -0
- package/runtime/__test__/element-template/runtime/prop-adapters/spread-mts-compiled.test.ts +527 -0
- package/runtime/__test__/element-template/runtime/prop-adapters/spread.test.ts +185 -6
- package/runtime/__test__/element-template/runtime/render/render-direct-native.test.tsx +21 -1
- package/runtime/__test__/element-template/runtime/render/render-direct-suspense.test.ts +4 -1
- package/runtime/__test__/element-template/runtime/render/render-direct.test.ts +4 -1
- package/runtime/__test__/element-template/runtime/render/render-main-thread.test.ts +101 -1
- package/runtime/__test__/element-template/runtime/template/element-template-handle.test.ts +32 -0
- package/runtime/__test__/element-template/runtime/template/main-thread-dynamic-attr-state.test.ts +309 -26
- package/runtime/__test__/element-template/test-utils/debug/envManager.ts +8 -5
- package/runtime/__test__/element-template/test-utils/mock/mockNativePapi.ts +35 -2
- package/runtime/__test__/guardrails/snapshot-containment.test.ts +45 -11
- package/runtime/__test__/shared/component-stack.test.ts +211 -0
- package/runtime/__test__/snapshot/debug/formatPatch.test.ts +0 -8
- package/runtime/__test__/snapshot/gesture/prepareGestureForCommit.test.js +1 -1
- package/runtime/__test__/snapshot/lifecycle/updateGlobalProps.event.test.jsx +2 -2
- package/runtime/__test__/snapshot/lifecycle/updateGlobalProps.test.jsx +3 -3
- package/runtime/__test__/snapshot/lynx/timing.test.jsx +3 -0
- package/runtime/__test__/snapshot/preact.test.jsx +0 -3
- package/runtime/__test__/snapshot/ref.test.jsx +30 -0
- package/runtime/__test__/snapshot/snapshotPatch.test.jsx +0 -33
- package/runtime/__test__/worklet-runtime/jsFunctionLifecycle.test.js +12 -0
- package/runtime/__test__/worklet-runtime/loadRuntime.test.js +68 -0
- package/runtime/__test__/worklet-runtime/workletRuntime.test.js +30 -0
- package/runtime/lazy/element-template-internal.js +1 -1
- package/runtime/lazy/internal.js +1 -1
- package/runtime/lazy/jsx-dev-runtime.js +1 -1
- package/runtime/lazy/jsx-runtime.js +1 -1
- package/runtime/lazy/legacy-react-runtime.js +1 -1
- package/runtime/lazy/react-lepus.js +1 -1
- package/runtime/lazy/react.js +1 -1
- package/runtime/lib/core/capture-main-thread-object.js +2 -1
- package/runtime/lib/core/capture-main-thread-object.js.map +1 -1
- package/runtime/lib/core/compat/legacy-react-runtime.js +1 -1
- package/runtime/lib/core/compat/legacy-react-runtime.js.map +1 -1
- package/runtime/lib/core/globalProps.js +1 -1
- package/runtime/lib/core/globalProps.js.map +1 -1
- package/runtime/lib/core/lynx/lazy-bundle.js +1 -1
- package/runtime/lib/core/lynx/lazy-bundle.js.map +1 -1
- package/runtime/lib/core/lynx-data-processors.d.ts +125 -1
- package/runtime/lib/core/lynx-data-processors.js +3 -0
- package/runtime/lib/core/lynx-data-processors.js.map +1 -1
- package/runtime/lib/core/runtime-destroy.js +1 -1
- package/runtime/lib/core/runtime-destroy.js.map +1 -1
- package/runtime/lib/document.js +0 -5
- package/runtime/lib/document.js.map +1 -1
- package/runtime/lib/element-template/background/attr-slots.js +5 -2
- package/runtime/lib/element-template/background/attr-slots.js.map +1 -1
- package/runtime/lib/element-template/background/commit-hook.js +11 -12
- package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
- package/runtime/lib/element-template/background/destroy.js +16 -11
- package/runtime/lib/element-template/background/destroy.js.map +1 -1
- package/runtime/lib/element-template/background/hydrate.js +23 -0
- package/runtime/lib/element-template/background/hydrate.js.map +1 -1
- package/runtime/lib/element-template/client/root.d.ts +1 -1
- package/runtime/lib/element-template/client/root.js.map +1 -1
- package/runtime/lib/element-template/debug/alog.d.ts +1 -1
- package/runtime/lib/element-template/debug/alog.js +4 -1
- package/runtime/lib/element-template/debug/alog.js.map +1 -1
- package/runtime/lib/element-template/index.d.ts +2 -2
- package/runtime/lib/element-template/index.js.map +1 -1
- package/runtime/lib/element-template/internal.d.ts +2 -2
- package/runtime/lib/element-template/internal.js +1 -14
- package/runtime/lib/element-template/internal.js.map +1 -1
- package/runtime/lib/element-template/lynx/env.js.map +1 -1
- package/runtime/lib/element-template/native/callDestroyLifetimeFun.js +6 -1
- package/runtime/lib/element-template/native/callDestroyLifetimeFun.js.map +1 -1
- package/runtime/lib/element-template/native/flush.d.ts +1 -0
- package/runtime/lib/element-template/native/flush.js +9 -0
- package/runtime/lib/element-template/native/flush.js.map +1 -0
- package/runtime/lib/element-template/native/main-thread-api.js +3 -7
- package/runtime/lib/element-template/native/main-thread-api.js.map +1 -1
- package/runtime/lib/element-template/native/mts-destroy.js +8 -2
- package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
- package/runtime/lib/element-template/native/patch-listener.js +57 -50
- package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
- package/runtime/lib/element-template/native/reload-background.js +1 -1
- package/runtime/lib/element-template/native/reload-background.js.map +1 -1
- package/runtime/lib/element-template/native/reload-main-thread.js +35 -10
- package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -1
- package/runtime/lib/element-template/prop-adapters/gesture.d.ts +23 -0
- package/runtime/lib/element-template/prop-adapters/gesture.js +97 -0
- package/runtime/lib/element-template/prop-adapters/gesture.js.map +1 -0
- package/runtime/lib/element-template/prop-adapters/spread.d.ts +6 -1
- package/runtime/lib/element-template/prop-adapters/spread.js +72 -2
- package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -1
- package/runtime/lib/element-template/protocol/opcodes.d.ts +1 -0
- package/runtime/lib/element-template/protocol/opcodes.js +1 -0
- package/runtime/lib/element-template/protocol/opcodes.js.map +1 -1
- package/runtime/lib/element-template/protocol/types.d.ts +7 -1
- package/runtime/lib/element-template/protocol/types.js.map +1 -1
- package/runtime/lib/element-template/runtime/page/root-instance.d.ts +0 -1
- package/runtime/lib/element-template/runtime/page/root-instance.js.map +1 -1
- package/runtime/lib/element-template/runtime/patch.js +31 -2
- package/runtime/lib/element-template/runtime/patch.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/render-components.js +4 -4
- package/runtime/lib/element-template/runtime/render/render-components.js.map +1 -1
- package/runtime/lib/element-template/runtime/render/render-main-thread.js +2 -0
- package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/attr-slot-plan.d.ts +4 -2
- package/runtime/lib/element-template/runtime/template/attr-slot-plan.js +17 -4
- package/runtime/lib/element-template/runtime/template/attr-slot-plan.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-background-function.js +8 -1
- package/runtime/lib/element-template/runtime/template/main-thread-background-function.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.d.ts +7 -1
- package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js +380 -50
- package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.d.ts +3 -2
- package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.js +10 -1
- package/runtime/lib/element-template/runtime/template/main-thread-ref-ctx.js.map +1 -1
- package/runtime/lib/element-template/runtime/template/typed-attributes.js +3 -3
- package/runtime/lib/element-template/runtime/template/typed-attributes.js.map +1 -1
- package/runtime/lib/internal.d.ts +1 -1
- package/runtime/lib/internal.js +1 -1
- package/runtime/lib/internal.js.map +1 -1
- package/runtime/lib/lynx-api.d.ts +2 -125
- package/runtime/lib/lynx-api.js.map +1 -1
- package/runtime/lib/shared/component-stack.d.ts +0 -4
- package/runtime/lib/shared/component-stack.js +21 -5
- package/runtime/lib/shared/component-stack.js.map +1 -1
- package/runtime/lib/snapshot/gesture/{processGestureBagkround.js → processGestureBackground.js} +1 -1
- package/runtime/lib/snapshot/gesture/processGestureBackground.js.map +1 -0
- package/runtime/lib/snapshot/lifecycle/destroy.js +23 -17
- package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.d.ts +0 -1
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js +0 -5
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatch.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js +0 -10
- package/runtime/lib/snapshot/lifecycle/patch/snapshotPatchApply.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js +56 -51
- package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/ref/delay.d.ts +5 -0
- package/runtime/lib/snapshot/lifecycle/ref/delay.js +1 -1
- package/runtime/lib/snapshot/lifecycle/ref/delay.js.map +1 -1
- package/runtime/lib/snapshot/list/listUpdateInfo.js +0 -30
- package/runtime/lib/snapshot/list/listUpdateInfo.js.map +1 -1
- package/runtime/lib/snapshot/lynx/calledByNative.js +11 -8
- package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/hydrate.js +0 -52
- package/runtime/lib/snapshot/renderToOpcodes/hydrate.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/index.js +10 -10
- package/runtime/lib/snapshot/renderToOpcodes/index.js.map +1 -1
- package/runtime/lib/snapshot/renderToOpcodes/opcodes.js +0 -51
- package/runtime/lib/snapshot/renderToOpcodes/opcodes.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +1 -1
- package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
- package/runtime/lib/tsconfig.tsbuildinfo +1 -1
- package/runtime/lib/worklet-runtime/bindings/index.d.ts +1 -0
- package/runtime/lib/worklet-runtime/bindings/index.js +1 -0
- package/runtime/lib/worklet-runtime/bindings/index.js.map +1 -1
- package/runtime/lib/worklet-runtime/bindings/loadRuntime.d.ts +8 -0
- package/runtime/lib/worklet-runtime/bindings/loadRuntime.js +23 -0
- package/runtime/lib/worklet-runtime/bindings/loadRuntime.js.map +1 -0
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.d.ts +2 -0
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js +6 -0
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +1 -1
- package/runtime/lib/worklet-runtime/workletRuntime.js +2 -0
- package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
- package/runtime/package.json +2 -3
- package/runtime/src/core/capture-main-thread-object.ts +2 -1
- package/runtime/src/core/compat/legacy-react-runtime.ts +1 -1
- package/runtime/src/core/globalProps.ts +1 -1
- package/runtime/src/core/lynx/lazy-bundle.ts +1 -1
- package/runtime/src/core/lynx-data-processors.ts +124 -1
- package/runtime/src/core/runtime-destroy.ts +1 -1
- package/runtime/src/document.ts +0 -6
- package/runtime/src/element-template/background/attr-slots.ts +5 -1
- package/runtime/src/element-template/background/commit-hook.ts +18 -12
- package/runtime/src/element-template/background/destroy.ts +16 -13
- package/runtime/src/element-template/background/hydrate.ts +23 -0
- package/runtime/src/element-template/client/root.ts +1 -3
- package/runtime/src/element-template/debug/alog.ts +5 -2
- package/runtime/src/element-template/index.ts +2 -2
- package/runtime/src/element-template/internal.ts +1 -20
- package/runtime/src/element-template/lynx/env.ts +1 -1
- package/runtime/src/element-template/native/callDestroyLifetimeFun.ts +5 -1
- package/runtime/src/element-template/native/flush.ts +10 -0
- package/runtime/src/element-template/native/main-thread-api.ts +3 -6
- package/runtime/src/element-template/native/mts-destroy.ts +7 -2
- package/runtime/src/element-template/native/patch-listener.ts +62 -57
- package/runtime/src/element-template/native/reload-background.ts +1 -1
- package/runtime/src/element-template/native/reload-main-thread.ts +32 -11
- package/runtime/src/element-template/prop-adapters/gesture.ts +144 -0
- package/runtime/src/element-template/prop-adapters/spread.ts +110 -2
- package/runtime/src/element-template/protocol/opcodes.ts +1 -0
- package/runtime/src/element-template/protocol/types.ts +8 -13
- package/runtime/src/element-template/runtime/page/root-instance.ts +0 -1
- package/runtime/src/element-template/runtime/patch.ts +38 -0
- package/runtime/src/element-template/runtime/render/render-components.ts +3 -3
- package/runtime/src/element-template/runtime/render/render-main-thread.ts +2 -0
- package/runtime/src/element-template/runtime/template/attr-slot-plan.ts +31 -4
- package/runtime/src/element-template/runtime/template/main-thread-background-function.ts +8 -1
- package/runtime/src/element-template/runtime/template/main-thread-dynamic-attr-state.ts +456 -50
- package/runtime/src/element-template/runtime/template/main-thread-ref-ctx.ts +14 -4
- package/runtime/src/element-template/runtime/template/typed-attributes.ts +3 -3
- package/runtime/src/element-template/types.d.ts +6 -0
- package/runtime/src/internal.ts +1 -1
- package/runtime/src/lynx-api.ts +2 -124
- package/runtime/src/shared/component-stack.ts +22 -5
- package/runtime/src/snapshot/lifecycle/destroy.ts +23 -18
- package/runtime/src/snapshot/lifecycle/patch/snapshotPatch.ts +0 -5
- package/runtime/src/snapshot/lifecycle/patch/snapshotPatchApply.ts +0 -10
- package/runtime/src/snapshot/lifecycle/patch/updateMainThread.ts +62 -58
- package/runtime/src/snapshot/lifecycle/ref/delay.ts +1 -1
- package/runtime/src/snapshot/list/listUpdateInfo.ts +0 -52
- package/runtime/src/snapshot/lynx/calledByNative.ts +11 -9
- package/runtime/src/snapshot/renderToOpcodes/hydrate.ts +0 -58
- package/runtime/src/snapshot/renderToOpcodes/index.ts +8 -8
- package/runtime/src/snapshot/renderToOpcodes/opcodes.ts +0 -57
- package/runtime/src/snapshot/snapshot/backgroundSnapshot.ts +1 -1
- package/runtime/src/worklet-runtime/README.md +30 -10
- package/runtime/src/worklet-runtime/bindings/index.ts +2 -0
- package/runtime/src/worklet-runtime/bindings/loadRuntime.ts +25 -0
- package/runtime/src/worklet-runtime/jsFunctionLifecycle.ts +6 -0
- package/runtime/src/worklet-runtime/workletRuntime.ts +2 -0
- package/runtime/types/types.d.ts +2 -1
- package/runtime/vitest.config.ts +0 -2
- package/testing-library/.turbo/turbo-build.log +7 -7
- package/testing-library/src/__tests__/act.test.jsx +0 -7
- package/testing-library/src/__tests__/alog.test.jsx +12 -54
- package/testing-library/src/__tests__/end-to-end.test.jsx +0 -7
- package/testing-library/src/__tests__/renderComponent.test.jsx +0 -14
- package/testing-library/src/__tests__/worklet.test.jsx +49 -0
- package/transform/.turbo/turbo-build$colon$wasm.log +133 -297
- package/transform/__test__/defines.spec.js +30 -0
- package/transform/__test__/fixture.spec.js +11 -11
- package/transform/__test__/main-thread-object-compat.spec.js +111 -0
- package/transform/__test__/object-methods.spec.js +79 -0
- package/transform/crates/swc_plugin_element_template/lib.rs +11 -0
- package/transform/crates/swc_plugin_element_template/tests/element_template_contract.rs +113 -0
- package/transform/crates/swc_plugin_worklet/extract_ident.rs +99 -49
- package/transform/crates/swc_plugin_worklet/gen_stmt.rs +63 -57
- package/transform/crates/swc_plugin_worklet/lib.rs +393 -589
- package/transform/crates/swc_plugin_worklet/napi.rs +4 -6
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_capture_env_js.js +3 -3
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_capture_env_lepus.js +3 -3
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_2_js.js +11 -6
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_2_lepus.js +12 -6
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_js.js +14 -5
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_extract_member_expr_lepus.js +17 -6
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_preserve_main_thread_objects_in_class_js.js +5 -5
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_preserve_main_thread_objects_in_class_lepus.js +5 -5
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_js.js +1 -1
- package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_transform_lepus.js +1 -1
- package/transform/dist/wasm.cjs +1 -1
- package/transform/package.json +0 -1
- package/transform/src/lib.rs +1 -1
- package/transform/swc-plugin-reactlynx/.turbo/turbo-build.log +167 -69
- package/transform/swc-plugin-reactlynx/src/lib.rs +1 -4
- package/transform/swc-plugin-reactlynx/swc_plugin_reactlynx.wasm +0 -0
- package/transform/swc-plugin-reactlynx-compat/.turbo/turbo-build.log +226 -132
- package/runtime/lib/snapshot/gesture/processGestureBagkround.js.map +0 -1
- package/runtime/lib/snapshot/worklet/hmr.d.ts +0 -1
- package/runtime/lib/snapshot/worklet/hmr.js +0 -28
- package/runtime/lib/snapshot/worklet/hmr.js.map +0 -1
- package/runtime/src/snapshot/worklet/hmr.ts +0 -34
- /package/runtime/lib/snapshot/gesture/{processGestureBagkround.d.ts → processGestureBackground.d.ts} +0 -0
- /package/runtime/src/snapshot/gesture/{processGestureBagkround.ts → processGestureBackground.ts} +0 -0
|
@@ -6,9 +6,7 @@ use swc_core::ecma::ast::*;
|
|
|
6
6
|
use swc_core::ecma::visit::{noop_visit_mut_type, VisitMut};
|
|
7
7
|
|
|
8
8
|
use crate::{WorkletVisitor as CoreVisitor, WorkletVisitorConfig as CoreConfig};
|
|
9
|
-
use swc_plugins_shared::{
|
|
10
|
-
defines::DefinesCollector, target_napi::TransformTarget, transform_mode_napi::TransformMode,
|
|
11
|
-
};
|
|
9
|
+
use swc_plugins_shared::{defines::DefinesCollector, target_napi::TransformTarget};
|
|
12
10
|
|
|
13
11
|
#[derive(Clone, Debug)]
|
|
14
12
|
#[napi(object)]
|
|
@@ -69,7 +67,7 @@ pub struct WorkletVisitor {
|
|
|
69
67
|
|
|
70
68
|
impl Default for WorkletVisitor {
|
|
71
69
|
fn default() -> Self {
|
|
72
|
-
WorkletVisitor::new(
|
|
70
|
+
WorkletVisitor::new(WorkletVisitorConfig::default())
|
|
73
71
|
}
|
|
74
72
|
}
|
|
75
73
|
|
|
@@ -117,9 +115,9 @@ impl WorkletVisitor {
|
|
|
117
115
|
self
|
|
118
116
|
}
|
|
119
117
|
|
|
120
|
-
pub fn new(
|
|
118
|
+
pub fn new(cfg: WorkletVisitorConfig) -> Self {
|
|
121
119
|
Self {
|
|
122
|
-
inner: CoreVisitor::new(
|
|
120
|
+
inner: CoreVisitor::new(cfg.into()),
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
123
|
}
|
package/transform/crates/swc_plugin_worklet/tests/__swc_snapshots__/lib.rs/should_capture_env_js.js
CHANGED
|
@@ -6,11 +6,11 @@ let Y = {
|
|
|
6
6
|
y2,
|
|
7
7
|
y3,
|
|
8
8
|
y4,
|
|
9
|
-
y5: captureMainThreadObject(y5) ?? {
|
|
9
|
+
y5: captureMainThreadObject?.(y5) ?? {
|
|
10
10
|
r: y5.r
|
|
11
11
|
},
|
|
12
|
-
props: captureMainThreadObject(props) ?? {
|
|
13
|
-
value: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
12
|
+
props: captureMainThreadObject?.(props) ?? {
|
|
13
|
+
value: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
14
14
|
get: __mainThreadObjectSource.get
|
|
15
15
|
})(props.value)
|
|
16
16
|
}
|
|
@@ -7,11 +7,11 @@ let Y = {
|
|
|
7
7
|
y2,
|
|
8
8
|
y3,
|
|
9
9
|
y4,
|
|
10
|
-
y5: captureMainThreadObject(y5) ?? {
|
|
10
|
+
y5: captureMainThreadObject?.(y5) ?? {
|
|
11
11
|
r: y5.r
|
|
12
12
|
},
|
|
13
|
-
props: captureMainThreadObject(props) ?? {
|
|
14
|
-
value: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
13
|
+
props: captureMainThreadObject?.(props) ?? {
|
|
14
|
+
value: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
15
15
|
get: __mainThreadObjectSource.get
|
|
16
16
|
})(props.value)
|
|
17
17
|
}
|
|
@@ -10,22 +10,27 @@ let onTapLepus = {
|
|
|
10
10
|
_wkltId: "a123:test:1",
|
|
11
11
|
...{
|
|
12
12
|
aaaa: this.aaaa,
|
|
13
|
-
bbbb: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
14
|
-
cccc: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
13
|
+
bbbb: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
14
|
+
cccc: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
15
15
|
dddd: __mainThreadObjectSource.dddd
|
|
16
16
|
})(__mainThreadObjectSource.cccc)
|
|
17
17
|
})(this.bbbb),
|
|
18
18
|
eeee: this.eeee,
|
|
19
19
|
ffff: this.ffff,
|
|
20
|
-
hhhh: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
20
|
+
hhhh: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
21
21
|
'iiii': __mainThreadObjectSource['iiii'],
|
|
22
22
|
kkkk: __mainThreadObjectSource.kkkk
|
|
23
23
|
})(this.hhhh),
|
|
24
24
|
llll: this.llll,
|
|
25
|
-
mmmm: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
26
|
-
nnnn: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
25
|
+
mmmm: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
26
|
+
nnnn: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
27
27
|
'oooo': __mainThreadObjectSource['oooo']
|
|
28
28
|
})(__mainThreadObjectSource.nnnn)
|
|
29
|
-
})(this.mmmm)
|
|
29
|
+
})(this.mmmm),
|
|
30
|
+
pppp: ((__mainThreadObjectSource)=>__mainThreadObjectSource == null ? __mainThreadObjectSource : captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
31
|
+
qqqq: ((__mainThreadObjectSource)=>__mainThreadObjectSource == null ? __mainThreadObjectSource : captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
32
|
+
rrrr: __mainThreadObjectSource.rrrr
|
|
33
|
+
})(__mainThreadObjectSource.qqqq)
|
|
34
|
+
})(this.pppp)
|
|
30
35
|
}
|
|
31
36
|
};
|
|
@@ -11,23 +11,28 @@ let onTapLepus = {
|
|
|
11
11
|
_wkltId: "a123:test:1",
|
|
12
12
|
...{
|
|
13
13
|
aaaa: this.aaaa,
|
|
14
|
-
bbbb: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
15
|
-
cccc: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
14
|
+
bbbb: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
15
|
+
cccc: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
16
16
|
dddd: __mainThreadObjectSource.dddd
|
|
17
17
|
})(__mainThreadObjectSource.cccc)
|
|
18
18
|
})(this.bbbb),
|
|
19
19
|
eeee: this.eeee,
|
|
20
20
|
ffff: this.ffff,
|
|
21
|
-
hhhh: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
21
|
+
hhhh: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
22
22
|
'iiii': __mainThreadObjectSource['iiii'],
|
|
23
23
|
kkkk: __mainThreadObjectSource.kkkk
|
|
24
24
|
})(this.hhhh),
|
|
25
25
|
llll: this.llll,
|
|
26
|
-
mmmm: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
27
|
-
nnnn: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
26
|
+
mmmm: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
27
|
+
nnnn: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
28
28
|
'oooo': __mainThreadObjectSource['oooo']
|
|
29
29
|
})(__mainThreadObjectSource.nnnn)
|
|
30
|
-
})(this.mmmm)
|
|
30
|
+
})(this.mmmm),
|
|
31
|
+
pppp: ((__mainThreadObjectSource)=>__mainThreadObjectSource == null ? __mainThreadObjectSource : captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
32
|
+
qqqq: ((__mainThreadObjectSource)=>__mainThreadObjectSource == null ? __mainThreadObjectSource : captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
33
|
+
rrrr: __mainThreadObjectSource.rrrr
|
|
34
|
+
})(__mainThreadObjectSource.qqqq)
|
|
35
|
+
})(this.pppp)
|
|
31
36
|
}
|
|
32
37
|
};
|
|
33
38
|
__registerWorklet("main-thread", "a123:test:1", function() {
|
|
@@ -47,6 +52,7 @@ __registerWorklet("main-thread", "a123:test:1", function() {
|
|
|
47
52
|
this.hhhh.kkkk;
|
|
48
53
|
this.hhhh.iiii.jjjj;
|
|
49
54
|
this.llll[this.mmmm.nnnn['oooo']];
|
|
55
|
+
this.pppp?.qqqq?.rrrr;
|
|
50
56
|
aaaa;
|
|
51
57
|
bbbb;
|
|
52
58
|
eeee;
|
|
@@ -2,23 +2,32 @@ import { captureMainThreadObject as __captureMainThreadObject } from "@lynx-js/r
|
|
|
2
2
|
var captureMainThreadObject = __captureMainThreadObject;
|
|
3
3
|
let onTapLepus = {
|
|
4
4
|
_c: {
|
|
5
|
-
aaaa: captureMainThreadObject(aaaa) ?? {
|
|
5
|
+
aaaa: captureMainThreadObject?.(aaaa) ?? {
|
|
6
6
|
bbbb: aaaa.bbbb
|
|
7
7
|
},
|
|
8
|
-
cccc: captureMainThreadObject(cccc) ?? {
|
|
8
|
+
cccc: captureMainThreadObject?.(cccc) ?? {
|
|
9
9
|
dddd: cccc.dddd
|
|
10
10
|
},
|
|
11
|
-
hhhh: captureMainThreadObject(hhhh) ?? {
|
|
11
|
+
hhhh: captureMainThreadObject?.(hhhh) ?? {
|
|
12
12
|
iiii: hhhh.iiii
|
|
13
13
|
},
|
|
14
14
|
llll,
|
|
15
|
-
oooo: captureMainThreadObject(oooo) ?? {
|
|
15
|
+
oooo: captureMainThreadObject?.(oooo) ?? {
|
|
16
16
|
pppp: oooo.pppp,
|
|
17
17
|
qqqq: oooo.qqqq
|
|
18
18
|
},
|
|
19
19
|
rrrr,
|
|
20
|
-
uuuu: captureMainThreadObject(uuuu) ?? {
|
|
20
|
+
uuuu: captureMainThreadObject?.(uuuu) ?? {
|
|
21
21
|
"__??__": uuuu["__??__"]
|
|
22
|
+
},
|
|
23
|
+
enabled,
|
|
24
|
+
handlers: handlers == null ? handlers : captureMainThreadObject?.(handlers) ?? {
|
|
25
|
+
start: handlers.start
|
|
26
|
+
},
|
|
27
|
+
vvvv: vvvv == null ? vvvv : captureMainThreadObject?.(vvvv) ?? {
|
|
28
|
+
wwww: ((__mainThreadObjectSource)=>__mainThreadObjectSource == null ? __mainThreadObjectSource : captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
29
|
+
xxxx: __mainThreadObjectSource.xxxx
|
|
30
|
+
})(vvvv.wwww)
|
|
22
31
|
}
|
|
23
32
|
},
|
|
24
33
|
_wkltId: "a123:test:1"
|
|
@@ -3,30 +3,39 @@ import { captureMainThreadObject as __captureMainThreadObject } from "@lynx-js/r
|
|
|
3
3
|
var captureMainThreadObject = __captureMainThreadObject;
|
|
4
4
|
let onTapLepus = {
|
|
5
5
|
_c: {
|
|
6
|
-
aaaa: captureMainThreadObject(aaaa) ?? {
|
|
6
|
+
aaaa: captureMainThreadObject?.(aaaa) ?? {
|
|
7
7
|
bbbb: aaaa.bbbb
|
|
8
8
|
},
|
|
9
|
-
cccc: captureMainThreadObject(cccc) ?? {
|
|
9
|
+
cccc: captureMainThreadObject?.(cccc) ?? {
|
|
10
10
|
dddd: cccc.dddd
|
|
11
11
|
},
|
|
12
|
-
hhhh: captureMainThreadObject(hhhh) ?? {
|
|
12
|
+
hhhh: captureMainThreadObject?.(hhhh) ?? {
|
|
13
13
|
iiii: hhhh.iiii
|
|
14
14
|
},
|
|
15
15
|
llll,
|
|
16
|
-
oooo: captureMainThreadObject(oooo) ?? {
|
|
16
|
+
oooo: captureMainThreadObject?.(oooo) ?? {
|
|
17
17
|
pppp: oooo.pppp,
|
|
18
18
|
qqqq: oooo.qqqq
|
|
19
19
|
},
|
|
20
20
|
rrrr,
|
|
21
|
-
uuuu: captureMainThreadObject(uuuu) ?? {
|
|
21
|
+
uuuu: captureMainThreadObject?.(uuuu) ?? {
|
|
22
22
|
"__??__": uuuu["__??__"]
|
|
23
|
+
},
|
|
24
|
+
enabled,
|
|
25
|
+
handlers: handlers == null ? handlers : captureMainThreadObject?.(handlers) ?? {
|
|
26
|
+
start: handlers.start
|
|
27
|
+
},
|
|
28
|
+
vvvv: vvvv == null ? vvvv : captureMainThreadObject?.(vvvv) ?? {
|
|
29
|
+
wwww: ((__mainThreadObjectSource)=>__mainThreadObjectSource == null ? __mainThreadObjectSource : captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
30
|
+
xxxx: __mainThreadObjectSource.xxxx
|
|
31
|
+
})(vvvv.wwww)
|
|
23
32
|
}
|
|
24
33
|
},
|
|
25
34
|
_wkltId: "a123:test:1"
|
|
26
35
|
};
|
|
27
36
|
__registerWorklet("main-thread", "a123:test:1", function() {
|
|
28
37
|
const onTapLepus = lynxWorkletImpl._workletMap["a123:test:1"].bind(this);
|
|
29
|
-
let { aaaa, cccc, hhhh, llll, oooo, rrrr, uuuu } = this["_c"];
|
|
38
|
+
let { aaaa, cccc, hhhh, llll, oooo, rrrr, uuuu, enabled, handlers, vvvv } = this["_c"];
|
|
30
39
|
"main thread";
|
|
31
40
|
aaaa.bbbb[cccc.dddd].eeee;
|
|
32
41
|
aaaa.bbbb[cccc.dddd].eeee;
|
|
@@ -43,4 +52,6 @@ __registerWorklet("main-thread", "a123:test:1", function() {
|
|
|
43
52
|
rrrr.ssss;
|
|
44
53
|
rrrr.ssss.tttt;
|
|
45
54
|
uuuu["__??__"];
|
|
55
|
+
if (enabled && handlers?.start) handlers.start();
|
|
56
|
+
vvvv?.wwww?.xxxx;
|
|
46
57
|
});
|
|
@@ -8,12 +8,12 @@ class App extends Component {
|
|
|
8
8
|
return {
|
|
9
9
|
_wkltId: "a123:test:1",
|
|
10
10
|
...{
|
|
11
|
-
value: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
11
|
+
value: ((__mainThreadObjectSource)=>__mainThreadObjectSource == null ? __mainThreadObjectSource : captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
12
12
|
"get": __mainThreadObjectSource["get"],
|
|
13
13
|
set: __mainThreadObjectSource.set
|
|
14
14
|
})(this.value),
|
|
15
|
-
props: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
16
|
-
value: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
15
|
+
props: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
16
|
+
value: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
17
17
|
get: __mainThreadObjectSource.get
|
|
18
18
|
})(__mainThreadObjectSource.value)
|
|
19
19
|
})(this.props),
|
|
@@ -25,7 +25,7 @@ class App extends Component {
|
|
|
25
25
|
return {
|
|
26
26
|
_wkltId: "a123:test:2",
|
|
27
27
|
...{
|
|
28
|
-
value: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
28
|
+
value: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
29
29
|
get: __mainThreadObjectSource.get
|
|
30
30
|
})(this.value)
|
|
31
31
|
}
|
|
@@ -34,7 +34,7 @@ class App extends Component {
|
|
|
34
34
|
static onStatic = {
|
|
35
35
|
_wkltId: "a123:test:3",
|
|
36
36
|
...{
|
|
37
|
-
value: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
37
|
+
value: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
38
38
|
get: __mainThreadObjectSource.get
|
|
39
39
|
})(this.value)
|
|
40
40
|
}
|
|
@@ -8,12 +8,12 @@ class App extends Component {
|
|
|
8
8
|
onTap = {
|
|
9
9
|
_wkltId: "a123:test:1",
|
|
10
10
|
...{
|
|
11
|
-
value: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
11
|
+
value: ((__mainThreadObjectSource)=>__mainThreadObjectSource == null ? __mainThreadObjectSource : captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
12
12
|
"get": __mainThreadObjectSource["get"],
|
|
13
13
|
set: __mainThreadObjectSource.set
|
|
14
14
|
})(this.value),
|
|
15
|
-
props: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
16
|
-
value: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
15
|
+
props: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
16
|
+
value: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
17
17
|
get: __mainThreadObjectSource.get
|
|
18
18
|
})(__mainThreadObjectSource.value)
|
|
19
19
|
})(this.props),
|
|
@@ -23,7 +23,7 @@ class App extends Component {
|
|
|
23
23
|
onMove = {
|
|
24
24
|
_wkltId: "a123:test:2",
|
|
25
25
|
...{
|
|
26
|
-
value: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
26
|
+
value: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
27
27
|
get: __mainThreadObjectSource.get
|
|
28
28
|
})(this.value)
|
|
29
29
|
}
|
|
@@ -31,7 +31,7 @@ class App extends Component {
|
|
|
31
31
|
static onStatic = {
|
|
32
32
|
_wkltId: "a123:test:3",
|
|
33
33
|
...{
|
|
34
|
-
value: ((__mainThreadObjectSource)=>captureMainThreadObject(__mainThreadObjectSource) ?? {
|
|
34
|
+
value: ((__mainThreadObjectSource)=>captureMainThreadObject?.(__mainThreadObjectSource) ?? {
|
|
35
35
|
get: __mainThreadObjectSource.get
|
|
36
36
|
})(this.value)
|
|
37
37
|
}
|