@lynx-js/react 0.128.0 → 0.129.0
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 +20 -0
- package/components/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/refresh/.turbo/turbo-build.log +1 -1
- package/runtime/__test__/core/entry-re-eval.test.ts +161 -0
- package/runtime/__test__/core/reload-scoped-dual-thread-communication.test.ts +129 -0
- package/runtime/__test__/core/thread-function-call.test.ts +1 -0
- package/runtime/__test__/element-template/fixtures/background/render/_shared.tsx +2 -0
- package/runtime/__test__/element-template/native/index.test.ts +8 -0
- package/runtime/__test__/element-template/native/main-thread-ref-init-value.test.ts +100 -0
- package/runtime/__test__/element-template/native/reload-dual-thread-communication.test.ts +101 -0
- package/runtime/__test__/element-template/native/reload.test.ts +50 -1
- package/runtime/__test__/element-template/runtime/background/commit-hook.test.ts +104 -47
- package/runtime/__test__/element-template/runtime/background/main-thread-function/compiled-fixtures.test.tsx +7 -1
- package/runtime/__test__/element-template/runtime/background/re-eval-reload.test.ts +69 -0
- package/runtime/__test__/element-template/runtime/hydration/hydration-listener.test.ts +31 -5
- package/runtime/__test__/element-template/runtime/patch/element-template-patch.test.tsx +17 -3
- package/runtime/__test__/element-template/runtime/render/render-transform.contract.test.ts +2 -0
- package/runtime/__test__/element-template/runtime/template/main-thread-function.test.ts +89 -2
- package/runtime/__test__/element-template/test-utils/debug/compiledFixtureModule.ts +5 -0
- package/runtime/__test__/snapshot/lifecycle/re-eval-reload.test.jsx +114 -0
- package/runtime/__test__/snapshot/lifecycle/reload-background-function.test.jsx +169 -0
- package/runtime/__test__/snapshot/lifecycle/reload-delayed-background.test.jsx +63 -0
- package/runtime/__test__/snapshot/lifecycle/reload-delayed-main-thread.test.jsx +103 -0
- package/runtime/__test__/snapshot/lifecycle.test.jsx +61 -1
- package/runtime/__test__/snapshot/lynx/lazy-effect-scheduling.test.jsx +105 -0
- package/runtime/__test__/snapshot/ssr.test.jsx +2 -2
- package/runtime/__test__/snapshot/worklet/runOnBackground.test.js +6 -11
- package/runtime/__test__/snapshot/worklet/runOnMainThread.test.jsx +1 -1
- package/runtime/__test__/snapshot/worklet/workletRef.test.jsx +24 -1
- package/runtime/__test__/worklet-runtime/jsFunctionLifecycle.test.js +15 -1
- package/runtime/__test__/worklet-runtime/mainThreadObject.test.js +46 -0
- package/runtime/__test__/worklet-runtime/runOnMainThread.test.js +3 -3
- package/runtime/lib/core/background-function/exec-map.d.ts +2 -0
- package/runtime/lib/core/background-function/exec-map.js +7 -0
- package/runtime/lib/core/background-function/exec-map.js.map +1 -1
- package/runtime/lib/core/background-function/run-on-background.js +15 -16
- package/runtime/lib/core/background-function/run-on-background.js.map +1 -1
- package/runtime/lib/core/card-lifetime.d.ts +5 -0
- package/runtime/lib/core/card-lifetime.js +17 -0
- package/runtime/lib/core/card-lifetime.js.map +1 -0
- package/runtime/lib/core/entry-reload.d.ts +7 -0
- package/runtime/lib/core/entry-reload.js +49 -0
- package/runtime/lib/core/entry-reload.js.map +1 -0
- package/runtime/lib/core/lynx/lazy-bundle.js +4 -1
- package/runtime/lib/core/lynx/lazy-bundle.js.map +1 -1
- package/runtime/lib/core/main-thread-ref-id.js +4 -4
- package/runtime/lib/core/main-thread-ref-id.js.map +1 -1
- package/runtime/lib/core/reload-scoped-event.d.ts +5 -0
- package/runtime/lib/core/reload-scoped-event.js +26 -0
- package/runtime/lib/core/reload-scoped-event.js.map +1 -0
- package/runtime/lib/core/reload-version.js +4 -3
- package/runtime/lib/core/reload-version.js.map +1 -1
- package/runtime/lib/core/runtime-destroy.d.ts +2 -0
- package/runtime/lib/core/runtime-destroy.js +9 -0
- package/runtime/lib/core/runtime-destroy.js.map +1 -1
- package/runtime/lib/core/thread-function-call/main-thread.js +5 -4
- package/runtime/lib/core/thread-function-call/main-thread.js.map +1 -1
- package/runtime/lib/core/thread-function-call/return-value.js +6 -5
- package/runtime/lib/core/thread-function-call/return-value.js.map +1 -1
- package/runtime/lib/element-template/background/commit-hook.js +19 -16
- package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
- package/runtime/lib/element-template/background/hydration-listener.js +2 -6
- package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
- package/runtime/lib/element-template/main-thread-ref-init-value.d.ts +3 -0
- package/runtime/lib/element-template/main-thread-ref-init-value.js +38 -0
- package/runtime/lib/element-template/main-thread-ref-init-value.js.map +1 -0
- package/runtime/lib/element-template/native/index.js +2 -0
- package/runtime/lib/element-template/native/index.js.map +1 -1
- package/runtime/lib/element-template/native/mts-destroy.js +2 -0
- package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
- package/runtime/lib/element-template/native/patch-listener.js +1 -4
- package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
- package/runtime/lib/element-template/native/reload-background.d.ts +1 -1
- package/runtime/lib/element-template/native/reload-background.js +12 -1
- package/runtime/lib/element-template/native/reload-background.js.map +1 -1
- package/runtime/lib/element-template/native/reload-main-thread.d.ts +6 -0
- package/runtime/lib/element-template/native/reload-main-thread.js +18 -2
- package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -1
- package/runtime/lib/element-template/protocol/lifecycle-constant.d.ts +2 -1
- package/runtime/lib/element-template/protocol/lifecycle-constant.js +1 -0
- package/runtime/lib/element-template/protocol/lifecycle-constant.js.map +1 -1
- package/runtime/lib/element-template/protocol/types.d.ts +0 -2
- package/runtime/lib/element-template/protocol/types.js.map +1 -1
- package/runtime/lib/shared/index-map.d.ts +4 -1
- package/runtime/lib/shared/index-map.js +5 -2
- package/runtime/lib/shared/index-map.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/destroy.js +6 -0
- package/runtime/lib/snapshot/lifecycle/destroy.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/event/firstScreenSync.d.ts +6 -2
- package/runtime/lib/snapshot/lifecycle/event/firstScreenSync.js +21 -18
- package/runtime/lib/snapshot/lifecycle/event/firstScreenSync.js.map +1 -1
- package/runtime/lib/snapshot/lifecycle/reload.d.ts +9 -2
- package/runtime/lib/snapshot/lifecycle/reload.js +29 -8
- package/runtime/lib/snapshot/lifecycle/reload.js.map +1 -1
- package/runtime/lib/snapshot/list/list.js +3 -2
- package/runtime/lib/snapshot/list/list.js.map +1 -1
- package/runtime/lib/snapshot/lynx/calledByNative.js +3 -3
- package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/list.js +2 -1
- package/runtime/lib/snapshot/snapshot/list.js.map +1 -1
- package/runtime/lib/snapshot/snapshot/snapshotInstanceManager.d.ts +4 -2
- package/runtime/lib/snapshot/snapshot/snapshotInstanceManager.js +11 -11
- package/runtime/lib/snapshot/snapshot/snapshotInstanceManager.js.map +1 -1
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.d.ts +1 -0
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.js +6 -1
- package/runtime/lib/snapshot/worklet/call/runOnMainThread.js.map +1 -1
- package/runtime/lib/snapshot/worklet/ctx.d.ts +1 -1
- package/runtime/lib/snapshot/worklet/ctx.js +6 -1
- package/runtime/lib/snapshot/worklet/ctx.js.map +1 -1
- package/runtime/lib/snapshot/worklet/ref/updateInitValue.js +6 -0
- package/runtime/lib/snapshot/worklet/ref/updateInitValue.js.map +1 -1
- package/runtime/lib/tsconfig.tsbuildinfo +1 -1
- package/runtime/lib/worklet-runtime/delayRunOnBackground.js +3 -1
- package/runtime/lib/worklet-runtime/delayRunOnBackground.js.map +1 -1
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js +2 -1
- package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +1 -1
- package/runtime/lib/worklet-runtime/listeners.js +2 -2
- package/runtime/lib/worklet-runtime/listeners.js.map +1 -1
- package/runtime/lib/worklet-runtime/mainThreadObject.js +3 -1
- package/runtime/lib/worklet-runtime/mainThreadObject.js.map +1 -1
- package/runtime/lib/worklet-runtime/runOnMainThread.js +4 -3
- package/runtime/lib/worklet-runtime/runOnMainThread.js.map +1 -1
- package/runtime/src/core/background-function/exec-map.ts +9 -0
- package/runtime/src/core/background-function/run-on-background.ts +14 -16
- package/runtime/src/core/card-lifetime.ts +18 -0
- package/runtime/src/core/entry-reload.ts +63 -0
- package/runtime/src/core/lynx/lazy-bundle.ts +4 -1
- package/runtime/src/core/main-thread-ref-id.ts +5 -4
- package/runtime/src/core/reload-scoped-event.ts +35 -0
- package/runtime/src/core/reload-version.ts +5 -3
- package/runtime/src/core/runtime-destroy.ts +11 -0
- package/runtime/src/core/thread-function-call/main-thread.ts +4 -4
- package/runtime/src/core/thread-function-call/return-value.ts +6 -5
- package/runtime/src/element-template/background/commit-hook.ts +20 -17
- package/runtime/src/element-template/background/hydration-listener.ts +2 -6
- package/runtime/src/element-template/main-thread-ref-init-value.ts +44 -0
- package/runtime/src/element-template/native/index.ts +2 -0
- package/runtime/src/element-template/native/mts-destroy.ts +3 -0
- package/runtime/src/element-template/native/patch-listener.ts +0 -5
- package/runtime/src/element-template/native/reload-background.ts +13 -1
- package/runtime/src/element-template/native/reload-main-thread.ts +30 -2
- package/runtime/src/element-template/protocol/lifecycle-constant.ts +1 -0
- package/runtime/src/element-template/protocol/types.ts +0 -2
- package/runtime/src/shared/index-map.ts +3 -2
- package/runtime/src/snapshot/lifecycle/destroy.ts +7 -0
- package/runtime/src/snapshot/lifecycle/event/firstScreenSync.ts +26 -19
- package/runtime/src/snapshot/lifecycle/reload.ts +47 -11
- package/runtime/src/snapshot/list/list.ts +9 -2
- package/runtime/src/snapshot/lynx/calledByNative.ts +3 -4
- package/runtime/src/snapshot/snapshot/list.ts +5 -1
- package/runtime/src/snapshot/snapshot/snapshotInstanceManager.ts +19 -12
- package/runtime/src/snapshot/worklet/call/runOnMainThread.ts +10 -1
- package/runtime/src/snapshot/worklet/ctx.ts +10 -1
- package/runtime/src/snapshot/worklet/ref/updateInitValue.ts +6 -0
- package/runtime/src/worklet-runtime/README.md +13 -0
- package/runtime/src/worklet-runtime/delayRunOnBackground.ts +3 -1
- package/runtime/src/worklet-runtime/jsFunctionLifecycle.ts +2 -1
- package/runtime/src/worklet-runtime/listeners.ts +4 -7
- package/runtime/src/worklet-runtime/mainThreadObject.ts +2 -1
- package/runtime/src/worklet-runtime/runOnMainThread.ts +4 -3
- package/runtime/types/types.d.ts +3 -1
- package/testing-library/.turbo/turbo-build.log +7 -7
- package/testing-library/src/__tests__/worklet.test.jsx +10 -5
- package/transform/.turbo/turbo-build$colon$wasm.log +339 -134
- package/transform/__test__/defines.spec.js +107 -0
- package/transform/crates/swc_plugin_worklet/definition_imports.rs +97 -0
- package/transform/crates/swc_plugin_worklet/lib.rs +7 -6
- package/transform/dist/wasm.cjs +1 -1
- package/transform/index.d.ts +3 -1
- package/transform/src/lib.rs +172 -11
- package/transform/swc-plugin-reactlynx/.turbo/turbo-build.log +57 -55
- package/transform/swc-plugin-reactlynx/swc_plugin_reactlynx.wasm +0 -0
- package/transform/swc-plugin-reactlynx-compat/.turbo/turbo-build.log +66 -274
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
createRunOnMainThread,
|
|
7
|
+
takeDelayedRunOnMainThreadData,
|
|
8
|
+
} from '../../../core/thread-function-call/main-thread.js';
|
|
9
|
+
import { resetFunctionCallReturnListener } from '../../../core/thread-function-call/return-value.js';
|
|
6
10
|
import { isRendering } from '../../lifecycle/isRendering.js';
|
|
7
11
|
import { __globalSnapshotPatch } from '../../lifecycle/patch/snapshotPatch.js';
|
|
8
12
|
|
|
@@ -37,3 +41,8 @@ export function runOnMainThread<R, Fn extends (...args: any[]) => R>(
|
|
|
37
41
|
): (...args: Parameters<Fn>) => Promise<R> {
|
|
38
42
|
return runOnMainThreadImpl(fn);
|
|
39
43
|
}
|
|
44
|
+
|
|
45
|
+
export function resetSnapshotMainThreadFunctionRuntime(): void {
|
|
46
|
+
takeDelayedRunOnMainThreadData();
|
|
47
|
+
resetFunctionCallReturnListener();
|
|
48
|
+
}
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
import type { Worklet } from '@lynx-js/react/worklet-runtime/bindings';
|
|
5
5
|
|
|
6
6
|
import { isMtsEnabled, isRunOnBackgroundEnabled } from './functionality.js';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
registerBackgroundFunctionCtx,
|
|
9
|
+
resetBackgroundFunctionRuntime,
|
|
10
|
+
} from '../../core/background-function/run-on-background.js';
|
|
11
|
+
import { resetFunctionCallReturnListener } from '../../core/thread-function-call/return-value.js';
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* @internal
|
|
@@ -20,3 +24,8 @@ export function onPostWorkletCtx(afterValue: Worklet | null): Worklet | null {
|
|
|
20
24
|
registerBackgroundFunctionCtx(afterValue);
|
|
21
25
|
return afterValue;
|
|
22
26
|
}
|
|
27
|
+
|
|
28
|
+
export function resetSnapshotBackgroundFunctionRuntime(): void {
|
|
29
|
+
resetBackgroundFunctionRuntime();
|
|
30
|
+
resetFunctionCallReturnListener();
|
|
31
|
+
}
|
|
@@ -12,6 +12,9 @@ function updateMTRefInitValue({ data }: { data: string }): void {
|
|
|
12
12
|
// This update ignores reloadVersion check.
|
|
13
13
|
// MainThreadRefs created before reloadTemplate may still be referenced by user in some cases after reloadTemplate.
|
|
14
14
|
const patch = JSON.parse(data) as MainThreadRefInitValuePatch;
|
|
15
|
+
if (typeof __ALOG__ !== 'undefined' && __ALOG__) {
|
|
16
|
+
console.alog?.('[ReactLynxDebug] Snapshot MTS updateMTRefInitValue:\n' + data);
|
|
17
|
+
}
|
|
15
18
|
updateWorkletRefInitValueChanges(patch);
|
|
16
19
|
}
|
|
17
20
|
|
|
@@ -26,5 +29,8 @@ export function sendMTRefInitValueToMainThread(): void {
|
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
const data = JSON.stringify(patch);
|
|
32
|
+
if (typeof __ALOG__ !== 'undefined' && __ALOG__) {
|
|
33
|
+
console.alog?.('[ReactLynxDebug] Snapshot BTS -> MTS sendMTRefInitValue:\n' + data);
|
|
34
|
+
}
|
|
29
35
|
lynx.getNativeApp().callLepusMethod(LifecycleConstant.updateMTRefInitValue, { data });
|
|
30
36
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Background-function lifecycle cleanup
|
|
2
|
+
|
|
3
|
+
Reference tracking publishes its retained marker and count only after
|
|
4
|
+
`FinalizationRegistry.register` succeeds. A failed registration leaves the same
|
|
5
|
+
target eligible for retry and cannot create an untracked reference count.
|
|
6
|
+
|
|
7
|
+
Delayed replay drops the consumed queue rather than truncating its array.
|
|
8
|
+
PrimJS can keep truncated array storage alive, retaining completed tasks and
|
|
9
|
+
function handles after their external owners disappear. Dropping the queue lets
|
|
10
|
+
those targets be collected and their background executions released.
|
|
11
|
+
|
|
12
|
+
These cleanup rules do not establish ownership across Native dictionary cloning.
|
|
13
|
+
Native event descriptors still require a separate local-context ownership bridge.
|
|
@@ -36,7 +36,9 @@ function delayRunOnBackground(fnObj: JsFnHandle, task: (fnId: number, execId: nu
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function clearDelayedBackgroundFunctions(): void {
|
|
39
|
-
|
|
39
|
+
// PrimJS can keep truncated array storage alive; drop the consumed queue so
|
|
40
|
+
// its tasks and hydrated handles stop retaining their background executions.
|
|
41
|
+
impl!.delayedBackgroundFunctionArray = [];
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
function runDelayedBackgroundFunctions(): void {
|
|
@@ -26,12 +26,13 @@ class JsFunctionLifecycleManager {
|
|
|
26
26
|
if (this.retainedObjects.has(objToRef)) {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
+
// A failed engine registration must leave the target eligible for a retry.
|
|
30
|
+
this.registry.register(objToRef, execId);
|
|
29
31
|
this.retainedObjects.add(objToRef);
|
|
30
32
|
this.execIdRefCount.set(
|
|
31
33
|
execId,
|
|
32
34
|
(this.execIdRefCount.get(execId) ?? 0) + 1,
|
|
33
35
|
);
|
|
34
|
-
this.registry.register(objToRef, execId);
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
removeRef(execId: number): void {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
import { addReloadScopedEventListener } from '../core/reload-scoped-event.js';
|
|
4
5
|
import { WorkletEvents } from './bindings/events.js';
|
|
5
6
|
import type { ReleaseWorkletRefData, RunWorkletCtxData } from './bindings/events.js';
|
|
6
7
|
import type { ClosureValueType } from './bindings/types.js';
|
|
@@ -10,13 +11,9 @@ import { removeValueFromWorkletRefMap } from './workletRef.js';
|
|
|
10
11
|
|
|
11
12
|
function initEventListeners(): void {
|
|
12
13
|
const jsContext = lynx.getJSContext();
|
|
13
|
-
jsContext.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const data = JSON.parse(event.data as string) as RunWorkletCtxData;
|
|
17
|
-
runRunOnMainThreadTask(data.worklet, data.params as ClosureValueType[], data.resolveId);
|
|
18
|
-
},
|
|
19
|
-
);
|
|
14
|
+
addReloadScopedEventListener(jsContext, WorkletEvents.runWorkletCtx, (data: RunWorkletCtxData) => {
|
|
15
|
+
runRunOnMainThreadTask(data.worklet, data.params as ClosureValueType[], data.resolveId);
|
|
16
|
+
});
|
|
20
17
|
jsContext.addEventListener(
|
|
21
18
|
WorkletEvents.releaseWorkletRef,
|
|
22
19
|
(event: Event) => {
|
|
@@ -33,8 +33,9 @@ function registerMainThreadObjectType(
|
|
|
33
33
|
`Conflicting MainThreadObject registration for type "${type}". A type key must always use the same create function.`,
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
|
-
return;
|
|
36
|
+
if (registered.create === create) return;
|
|
37
37
|
}
|
|
38
|
+
// A re-evaluated module brings a factory bound to its own module state.
|
|
38
39
|
mainThreadObjectDefinitions.set(type, { create });
|
|
39
40
|
}
|
|
40
41
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright 2025 The Lynx Authors. All rights reserved.
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
import { dispatchReloadScopedEvent } from '../core/reload-scoped-event.js';
|
|
4
5
|
import { WorkletEvents } from './bindings/index.js';
|
|
5
6
|
import type { ClosureValueType, RunWorkletCtxRetData, Worklet } from './bindings/index.js';
|
|
6
7
|
|
|
@@ -10,12 +11,12 @@ export function runRunOnMainThreadTask(task: Worklet, params: ClosureValueType[]
|
|
|
10
11
|
returnValue = runWorklet(task, params);
|
|
11
12
|
} finally {
|
|
12
13
|
// TODO: Should be more proper to reject the promise if there is an error.
|
|
13
|
-
lynx.getJSContext()
|
|
14
|
+
dispatchReloadScopedEvent(lynx.getJSContext(), {
|
|
14
15
|
type: WorkletEvents.FunctionCallRet,
|
|
15
|
-
data:
|
|
16
|
+
data: {
|
|
16
17
|
resolveId,
|
|
17
18
|
returnValue,
|
|
18
|
-
} as RunWorkletCtxRetData
|
|
19
|
+
} as RunWorkletCtxRetData,
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
}
|
package/runtime/types/types.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ declare global {
|
|
|
35
35
|
declare const __GLOBAL_PROPS_MODE__: 'reactive' | 'event' | undefined;
|
|
36
36
|
declare const __LAZY_BUNDLE_FETCHER__: 'FetchBundle' | 'QueryComponent';
|
|
37
37
|
declare const __RUNTIME_VERSION__: string | undefined;
|
|
38
|
+
declare const __EXPERIMENTAL_RE_EVAL_JS_ON_RELOAD__: boolean | undefined;
|
|
38
39
|
declare function __CreatePage(componentId: string, cssId: number): FiberElement;
|
|
39
40
|
declare function __CreateElement(
|
|
40
41
|
tag: string,
|
|
@@ -222,7 +223,8 @@ declare global {
|
|
|
222
223
|
callDestroyLifetimeFun: () => void;
|
|
223
224
|
updateGlobalProps: (newData: Record<string, unknown>) => void;
|
|
224
225
|
updateCardData: (newData: Record<string, any>, options?: Record<string, unknown>) => void;
|
|
225
|
-
onAppReload: (updateData: Record<string, any>) => void;
|
|
226
|
+
onAppReload: (updateData: Record<string, any>, options?: Record<string, unknown>) => void;
|
|
227
|
+
reloadCard?: (updateData?: object, options?: Record<string, unknown>) => boolean;
|
|
226
228
|
processCardConfig: () => void;
|
|
227
229
|
callBeforePublishEvent?: (data: unknown) => void;
|
|
228
230
|
getDynamicComponentExports: (schema: string) => { default: React.ComponentType<any> } | null | undefined;
|
|
@@ -2,14 +2,14 @@ $ rslib
|
|
|
2
2
|
Rslib v1.0.2
|
|
3
3
|
|
|
4
4
|
info build started...
|
|
5
|
-
start generating declaration files... (esm0)
|
|
6
5
|
start generating declaration files... (esm2)
|
|
7
|
-
ready built in 0.
|
|
8
|
-
|
|
9
|
-
ready built in
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
ready declaration files generated in
|
|
6
|
+
ready built in 0.55s (esm2)
|
|
7
|
+
start generating declaration files... (esm0)
|
|
8
|
+
ready built in 0.65s (esm1)
|
|
9
|
+
ready built in 0.88s (esm0)
|
|
10
|
+
info declaration files prepared with tsgo in 1.39 s (esm2)
|
|
11
|
+
ready declaration files generated in 6.51 s (esm0)
|
|
12
|
+
ready declaration files bundled successfully: dist/index.d.ts in 3.66 s (esm2)
|
|
13
13
|
|
|
14
14
|
File (esm0) Size
|
|
15
15
|
dist/rslib-runtime-0.js 1.6 kB
|
|
@@ -9,6 +9,11 @@ import {
|
|
|
9
9
|
useMainThreadRef,
|
|
10
10
|
} from '@lynx-js/react';
|
|
11
11
|
|
|
12
|
+
expect.addSnapshotSerializer({
|
|
13
|
+
test: value => typeof value === 'string' && /"_execId":\d+/.test(value),
|
|
14
|
+
print: (value, serialize) => serialize(value.replace(/"_execId":\d+/g, '"_execId":"[number]"')),
|
|
15
|
+
});
|
|
16
|
+
|
|
12
17
|
const guardedClassCaptureType = defineMainThreadObjectType({
|
|
13
18
|
type: '@test/guarded-class-capture',
|
|
14
19
|
create: initialValue => ({
|
|
@@ -108,7 +113,7 @@ describe('worklet', () => {
|
|
|
108
113
|
[
|
|
109
114
|
"rLynxChange",
|
|
110
115
|
{
|
|
111
|
-
"data": "{"patchList":[{"snapshotPatch":[3,-2,0,{"_wkltId":"15ab:test:2","_workletType":"main-thread","_execId":
|
|
116
|
+
"data": "{"patchList":[{"snapshotPatch":[3,-2,0,{"_wkltId":"15ab:test:2","_workletType":"main-thread","_execId":"[number]"}],"id":2}]}",
|
|
112
117
|
"patchOptions": {
|
|
113
118
|
"isHydration": true,
|
|
114
119
|
"pipelineOptions": {
|
|
@@ -189,7 +194,7 @@ describe('worklet', () => {
|
|
|
189
194
|
[
|
|
190
195
|
"rLynxChange",
|
|
191
196
|
{
|
|
192
|
-
"data": "{"patchList":[{"snapshotPatch":[3,-2,1,{"_c":{"props":{"main-thread:onClick":{"_wkltId":"15ab:test:3"}}},"_wkltId":"15ab:test:4","_execId":
|
|
197
|
+
"data": "{"patchList":[{"snapshotPatch":[3,-2,1,{"_c":{"props":{"main-thread:onClick":{"_wkltId":"15ab:test:3"}}},"_wkltId":"15ab:test:4","_execId":"[number]"}],"id":2}]}",
|
|
193
198
|
"patchOptions": {
|
|
194
199
|
"isHydration": true,
|
|
195
200
|
"pipelineOptions": {
|
|
@@ -278,7 +283,7 @@ describe('worklet', () => {
|
|
|
278
283
|
[
|
|
279
284
|
"rLynxChange",
|
|
280
285
|
{
|
|
281
|
-
"data": "{"patchList":[{"snapshotPatch":[3,-2,0,{"_c":{"props":{"main-thread:onScroll":{"_wkltId":"15ab:test:5"}}},"_wkltId":"15ab:test:6","_execId":
|
|
286
|
+
"data": "{"patchList":[{"snapshotPatch":[3,-2,0,{"_c":{"props":{"main-thread:onScroll":{"_wkltId":"15ab:test:5"}}},"_wkltId":"15ab:test:6","_execId":"[number]"}],"id":2}]}",
|
|
282
287
|
"patchOptions": {
|
|
283
288
|
"isHydration": true,
|
|
284
289
|
"pipelineOptions": {
|
|
@@ -370,7 +375,7 @@ describe('worklet', () => {
|
|
|
370
375
|
[
|
|
371
376
|
"rLynxChange",
|
|
372
377
|
{
|
|
373
|
-
"data": "{"patchList":[{"snapshotPatch":[3,-2,0,{"_wkltId":"15ab:test:8","_jsFn":{"_jsFn1":{"_jsFnId":2,"_fn":"[BackgroundFunction]"}},"_execId":
|
|
378
|
+
"data": "{"patchList":[{"snapshotPatch":[3,-2,0,{"_wkltId":"15ab:test:8","_jsFn":{"_jsFn1":{"_jsFnId":2,"_fn":"[BackgroundFunction]"}},"_execId":"[number]"}],"id":2}]}",
|
|
374
379
|
"patchOptions": {
|
|
375
380
|
"isHydration": true,
|
|
376
381
|
"pipelineOptions": {
|
|
@@ -473,7 +478,7 @@ describe('worklet', () => {
|
|
|
473
478
|
[
|
|
474
479
|
"rLynxChange",
|
|
475
480
|
{
|
|
476
|
-
"data": "{"patchList":[{"snapshotPatch":[3,-2,0,{"_wvid":1},3,-2,1,{"_c":{"ref":{"_wvid":1},"num":{"_wvid":2}},"_wkltId":"15ab:test:9","_execId":
|
|
481
|
+
"data": "{"patchList":[{"snapshotPatch":[3,-2,0,{"_wvid":1},3,-2,1,{"_c":{"ref":{"_wvid":1},"num":{"_wvid":2}},"_wkltId":"15ab:test:9","_execId":"[number]"}],"id":2}]}",
|
|
477
482
|
"patchOptions": {
|
|
478
483
|
"isHydration": true,
|
|
479
484
|
"pipelineOptions": {
|