@lynx-js/react 0.111.1 → 0.112.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 +71 -0
- package/components/lib/DeferredListItem.d.ts +3 -1
- package/components/lib/DeferredListItem.jsx +4 -2
- package/components/lib/DeferredListItem.jsx.map +1 -1
- package/components/lib/Page.js.map +1 -1
- package/components/src/DeferredListItem.tsx +5 -3
- package/components/src/Page.ts +2 -2
- package/package.json +15 -2
- package/refresh/.turbo/turbo-build.log +2 -2
- package/runtime/compat/index.d.ts +40 -0
- package/runtime/compat/index.js +15 -0
- package/runtime/debug/index.cjs +8 -0
- package/runtime/debug/index.d.ts +4 -0
- package/runtime/debug/index.js +5 -0
- package/runtime/lazy/compat.js +51 -0
- package/runtime/lazy/import.js +9 -0
- package/runtime/lazy/target.js +1 -0
- package/runtime/lib/alog/index.d.ts +1 -0
- package/runtime/lib/alog/index.js +8 -0
- package/runtime/lib/alog/index.js.map +1 -0
- package/runtime/lib/alog/render.d.ts +1 -0
- package/runtime/lib/alog/render.js +19 -0
- package/runtime/lib/alog/render.js.map +1 -0
- package/runtime/lib/backgroundSnapshot.d.ts +1 -0
- package/runtime/lib/backgroundSnapshot.js +31 -17
- package/runtime/lib/backgroundSnapshot.js.map +1 -1
- package/runtime/lib/debug/component-stack.d.ts +33 -0
- package/runtime/lib/debug/component-stack.js +145 -0
- package/runtime/lib/debug/component-stack.js.map +1 -0
- package/runtime/lib/debug/formatPatch.d.ts +2 -0
- package/runtime/lib/debug/formatPatch.js +27 -0
- package/runtime/lib/debug/formatPatch.js.map +1 -0
- package/runtime/lib/debug/printSnapshot.d.ts +1 -1
- package/runtime/lib/debug/printSnapshot.js +0 -4
- package/runtime/lib/debug/printSnapshot.js.map +1 -1
- package/runtime/lib/debug/profile.js +3 -5
- package/runtime/lib/debug/profile.js.map +1 -1
- package/runtime/lib/hydrate.js +11 -7
- package/runtime/lib/hydrate.js.map +1 -1
- package/runtime/lib/index.js +3 -5
- package/runtime/lib/index.js.map +1 -1
- package/runtime/lib/lifecycle/patch/commit.js +3 -3
- package/runtime/lib/lifecycle/patch/commit.js.map +1 -1
- package/runtime/lib/lifecycle/patch/isMainThreadHydrating.d.ts +2 -0
- package/runtime/lib/lifecycle/patch/{isMainThreadHydrationFinished.js → isMainThreadHydrating.js} +5 -5
- package/runtime/lib/lifecycle/patch/isMainThreadHydrating.js.map +1 -0
- package/runtime/lib/lifecycle/patch/snapshotPatch.d.ts +4 -0
- package/runtime/lib/lifecycle/patch/snapshotPatch.js +28 -0
- package/runtime/lib/lifecycle/patch/snapshotPatch.js.map +1 -1
- package/runtime/lib/lifecycle/patch/updateMainThread.js +20 -13
- package/runtime/lib/lifecycle/patch/updateMainThread.js.map +1 -1
- package/runtime/lib/lifecycle/reload.js +0 -2
- package/runtime/lib/lifecycle/reload.js.map +1 -1
- package/runtime/lib/lynx/lazy-bundle.js +0 -19
- package/runtime/lib/lynx/lazy-bundle.js.map +1 -1
- package/runtime/lib/lynx/performance.js +2 -2
- package/runtime/lib/lynx/performance.js.map +1 -1
- package/runtime/lib/lynx/runWithForce.js +2 -2
- package/runtime/lib/lynx/runWithForce.js.map +1 -1
- package/runtime/lib/lynx-api.js +17 -3
- package/runtime/lib/lynx-api.js.map +1 -1
- package/runtime/lib/lynx.js +16 -1
- package/runtime/lib/lynx.js.map +1 -1
- package/runtime/lib/pendingListUpdates.d.ts +2 -1
- package/runtime/lib/pendingListUpdates.js +16 -4
- package/runtime/lib/pendingListUpdates.js.map +1 -1
- package/runtime/lib/renderToOpcodes/constants.d.ts +2 -0
- package/runtime/lib/renderToOpcodes/constants.js +2 -0
- package/runtime/lib/renderToOpcodes/constants.js.map +1 -1
- package/runtime/lib/renderToOpcodes/index.js +36 -11
- package/runtime/lib/renderToOpcodes/index.js.map +1 -1
- package/runtime/lib/root.d.ts +6 -0
- package/runtime/lib/root.js +4 -0
- package/runtime/lib/root.js.map +1 -1
- package/runtime/lib/snapshot/gesture.js +2 -2
- package/runtime/lib/snapshot/gesture.js.map +1 -1
- package/runtime/lib/snapshot/platformInfo.js +5 -3
- package/runtime/lib/snapshot/platformInfo.js.map +1 -1
- package/runtime/lib/snapshot/ref.d.ts +2 -2
- package/runtime/lib/snapshot/spread.js +3 -1
- package/runtime/lib/snapshot/spread.js.map +1 -1
- package/runtime/lib/snapshot/workletEvent.js +2 -2
- package/runtime/lib/snapshot/workletEvent.js.map +1 -1
- package/runtime/lib/snapshot/workletRef.js +2 -2
- package/runtime/lib/snapshot/workletRef.js.map +1 -1
- package/runtime/lib/snapshot.js +13 -7
- package/runtime/lib/snapshot.js.map +1 -1
- package/runtime/lib/utils.d.ts +2 -0
- package/runtime/lib/utils.js +23 -2
- package/runtime/lib/utils.js.map +1 -1
- package/testing-library/dist/env/vitest.js +20 -10
- package/testing-library/dist/vitest-global-setup.js +0 -6
- package/testing-library/dist/vitest.config.js +1 -4
- package/transform/dist/wasm.cjs +1 -1
- package/types/react.d.ts +13 -1
- package/runtime/lib/lifecycle/patch/isMainThreadHydrationFinished.d.ts +0 -2
- package/runtime/lib/lifecycle/patch/isMainThreadHydrationFinished.js.map +0 -1
- package/runtime/src/backgroundSnapshot.ts +0 -501
- package/runtime/src/compat/componentIs.ts +0 -30
- package/runtime/src/compat/initData.ts +0 -150
- package/runtime/src/compat/lynxComponent.ts +0 -79
- package/runtime/src/debug/debug.ts +0 -9
- package/runtime/src/debug/printSnapshot.ts +0 -28
- package/runtime/src/debug/profile.ts +0 -55
- package/runtime/src/document.ts +0 -84
- package/runtime/src/gesture/processGesture.ts +0 -89
- package/runtime/src/gesture/processGestureBagkround.ts +0 -19
- package/runtime/src/gesture/types.ts +0 -44
- package/runtime/src/hooks/react.ts +0 -62
- package/runtime/src/hooks/useLynxGlobalEventListener.ts +0 -59
- package/runtime/src/hydrate.ts +0 -368
- package/runtime/src/index.ts +0 -94
- package/runtime/src/internal.ts +0 -63
- package/runtime/src/legacy-react-runtime/index.ts +0 -42
- package/runtime/src/lifecycle/destroy.ts +0 -34
- package/runtime/src/lifecycle/event/delayEvents.ts +0 -11
- package/runtime/src/lifecycle/event/delayLifecycleEvents.ts +0 -15
- package/runtime/src/lifecycle/event/jsReady.ts +0 -34
- package/runtime/src/lifecycle/pass.ts +0 -14
- package/runtime/src/lifecycle/patch/commit.ts +0 -214
- package/runtime/src/lifecycle/patch/error.ts +0 -61
- package/runtime/src/lifecycle/patch/isMainThreadHydrationFinished.ts +0 -13
- package/runtime/src/lifecycle/patch/snapshotPatch.ts +0 -65
- package/runtime/src/lifecycle/patch/snapshotPatchApply.ts +0 -145
- package/runtime/src/lifecycle/patch/updateMainThread.ts +0 -64
- package/runtime/src/lifecycle/ref/delay.ts +0 -99
- package/runtime/src/lifecycle/reload.ts +0 -97
- package/runtime/src/lifecycle/render.ts +0 -54
- package/runtime/src/lifecycleConstant.ts +0 -21
- package/runtime/src/list.ts +0 -307
- package/runtime/src/listUpdateInfo.ts +0 -221
- package/runtime/src/lynx/calledByNative.ts +0 -160
- package/runtime/src/lynx/component.ts +0 -113
- package/runtime/src/lynx/dynamic-js.ts +0 -36
- package/runtime/src/lynx/env.ts +0 -109
- package/runtime/src/lynx/injectLepusMethods.ts +0 -53
- package/runtime/src/lynx/lazy-bundle.ts +0 -175
- package/runtime/src/lynx/performance.ts +0 -148
- package/runtime/src/lynx/runWithForce.ts +0 -67
- package/runtime/src/lynx/tt.ts +0 -215
- package/runtime/src/lynx-api.ts +0 -455
- package/runtime/src/lynx.ts +0 -58
- package/runtime/src/opcodes.ts +0 -155
- package/runtime/src/pendingListUpdates.ts +0 -18
- package/runtime/src/renderToOpcodes/constants.ts +0 -24
- package/runtime/src/renderToOpcodes/index.ts +0 -306
- package/runtime/src/root.ts +0 -23
- package/runtime/src/snapshot/dynamicPartType.ts +0 -16
- package/runtime/src/snapshot/event.ts +0 -33
- package/runtime/src/snapshot/gesture.ts +0 -30
- package/runtime/src/snapshot/list.ts +0 -36
- package/runtime/src/snapshot/platformInfo.ts +0 -62
- package/runtime/src/snapshot/ref.ts +0 -139
- package/runtime/src/snapshot/spread.ts +0 -330
- package/runtime/src/snapshot/workletEvent.ts +0 -35
- package/runtime/src/snapshot/workletRef.ts +0 -88
- package/runtime/src/snapshot.ts +0 -634
- package/runtime/src/snapshotInstanceHydrationMap.ts +0 -17
- package/runtime/src/utils.ts +0 -44
- package/runtime/src/worklet/ctx.ts +0 -22
- package/runtime/src/worklet/destroy.ts +0 -16
- package/runtime/src/worklet/execMap.ts +0 -51
- package/runtime/src/worklet/functionCall.ts +0 -42
- package/runtime/src/worklet/functionality.ts +0 -29
- package/runtime/src/worklet/hmr.ts +0 -34
- package/runtime/src/worklet/indexMap.ts +0 -23
- package/runtime/src/worklet/runOnBackground.ts +0 -147
- package/runtime/src/worklet/runOnMainThread.ts +0 -50
- package/runtime/src/worklet/transformToWorklet.ts +0 -26
- package/runtime/src/worklet/workletRef.ts +0 -231
- package/runtime/src/worklet/workletRefPool.ts +0 -29
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 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
|
-
/**
|
|
6
|
-
* Implements the reload (thinking of "refresh" in browser) for both main thread
|
|
7
|
-
* and background thread.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { render } from 'preact';
|
|
11
|
-
|
|
12
|
-
import { hydrate } from '../hydrate.js';
|
|
13
|
-
import { LifecycleConstant } from '../lifecycleConstant.js';
|
|
14
|
-
import { __pendingListUpdates } from '../pendingListUpdates.js';
|
|
15
|
-
import { __root, setRoot } from '../root.js';
|
|
16
|
-
import { destroyBackground } from './destroy.js';
|
|
17
|
-
import { applyRefQueue } from '../snapshot/workletRef.js';
|
|
18
|
-
import { SnapshotInstance, __page, snapshotInstanceManager } from '../snapshot.js';
|
|
19
|
-
import { isEmptyObject } from '../utils.js';
|
|
20
|
-
import { destroyWorklet } from '../worklet/destroy.js';
|
|
21
|
-
import { clearJSReadyEventIdSwap, isJSReady } from './event/jsReady.js';
|
|
22
|
-
import { increaseReloadVersion } from './pass.js';
|
|
23
|
-
import { setMainThreadHydrationFinished } from './patch/isMainThreadHydrationFinished.js';
|
|
24
|
-
import { deinitGlobalSnapshotPatch } from './patch/snapshotPatch.js';
|
|
25
|
-
import { shouldDelayUiOps } from './ref/delay.js';
|
|
26
|
-
import { renderMainThread } from './render.js';
|
|
27
|
-
|
|
28
|
-
function reloadMainThread(data: unknown, options: UpdatePageOption): void {
|
|
29
|
-
if (__PROFILE__) {
|
|
30
|
-
console.profile('reloadTemplate');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
increaseReloadVersion();
|
|
34
|
-
|
|
35
|
-
if (typeof data == 'object' && !isEmptyObject(data as Record<string, unknown>)) {
|
|
36
|
-
Object.assign(lynx.__initData, data);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
destroyWorklet();
|
|
40
|
-
snapshotInstanceManager.clear();
|
|
41
|
-
__pendingListUpdates.clear();
|
|
42
|
-
clearJSReadyEventIdSwap();
|
|
43
|
-
setMainThreadHydrationFinished(false);
|
|
44
|
-
|
|
45
|
-
const oldRoot = __root;
|
|
46
|
-
setRoot(new SnapshotInstance('root'));
|
|
47
|
-
__root.__jsx = oldRoot.__jsx;
|
|
48
|
-
renderMainThread();
|
|
49
|
-
hydrate(oldRoot as SnapshotInstance, __root as SnapshotInstance, {
|
|
50
|
-
skipUnRef: true,
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// always call this before `__FlushElementTree`
|
|
54
|
-
__pendingListUpdates.flush();
|
|
55
|
-
applyRefQueue();
|
|
56
|
-
|
|
57
|
-
if (isJSReady) {
|
|
58
|
-
__OnLifecycleEvent([
|
|
59
|
-
LifecycleConstant.firstScreen, /* FIRST_SCREEN */
|
|
60
|
-
{
|
|
61
|
-
root: JSON.stringify(__root),
|
|
62
|
-
},
|
|
63
|
-
]);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
__FlushElementTree(__page, options);
|
|
67
|
-
|
|
68
|
-
if (__PROFILE__) {
|
|
69
|
-
console.profileEnd();
|
|
70
|
-
}
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function reloadBackground(updateData: Record<string, any>): void {
|
|
75
|
-
if (__PROFILE__) {
|
|
76
|
-
console.profile('reload');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
deinitGlobalSnapshotPatch();
|
|
80
|
-
|
|
81
|
-
destroyBackground();
|
|
82
|
-
|
|
83
|
-
increaseReloadVersion();
|
|
84
|
-
|
|
85
|
-
// COW when modify `lynx.__initData` to make sure Provider & Consumer works
|
|
86
|
-
lynx.__initData = Object.assign({}, lynx.__initData, updateData);
|
|
87
|
-
|
|
88
|
-
shouldDelayUiOps.value = true;
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
90
|
-
render(__root.__jsx, __root as any);
|
|
91
|
-
|
|
92
|
-
if (__PROFILE__) {
|
|
93
|
-
console.profileEnd();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export { reloadBackground, reloadMainThread };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 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
|
-
/**
|
|
6
|
-
* Implements the IFR (Instant First-Frame Rendering) on main thread.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { render } from 'preact';
|
|
10
|
-
|
|
11
|
-
import { renderOpcodesInto } from '../opcodes.js';
|
|
12
|
-
import { render as renderToString } from '../renderToOpcodes/index.js';
|
|
13
|
-
import { __root } from '../root.js';
|
|
14
|
-
|
|
15
|
-
function renderMainThread(): void {
|
|
16
|
-
/* v8 ignore start */
|
|
17
|
-
if (
|
|
18
|
-
process.env['NODE_ENV'] === 'test' && typeof __TESTING_FORCE_RENDER_TO_OPCODE__ !== 'undefined'
|
|
19
|
-
&& !__TESTING_FORCE_RENDER_TO_OPCODE__
|
|
20
|
-
) {
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
22
|
-
render(__root.__jsx, __root as any);
|
|
23
|
-
} else {
|
|
24
|
-
let opcodes;
|
|
25
|
-
try {
|
|
26
|
-
if (__PROFILE__) {
|
|
27
|
-
console.profile('renderToString');
|
|
28
|
-
}
|
|
29
|
-
opcodes = renderToString(__root.__jsx, undefined);
|
|
30
|
-
} catch (e) {
|
|
31
|
-
lynx.reportError(e as Error);
|
|
32
|
-
opcodes = [];
|
|
33
|
-
} finally {
|
|
34
|
-
if (__PROFILE__) {
|
|
35
|
-
console.profileEnd();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (__PROFILE__) {
|
|
40
|
-
console.profile('renderOpcodesInto');
|
|
41
|
-
}
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
43
|
-
renderOpcodesInto(opcodes, __root as any);
|
|
44
|
-
if (__ENABLE_SSR__) {
|
|
45
|
-
__root.__opcodes = opcodes;
|
|
46
|
-
}
|
|
47
|
-
if (__PROFILE__) {
|
|
48
|
-
console.profileEnd();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/* v8 ignore stop */
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export { renderMainThread };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 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
|
-
export const enum LifecycleConstant {
|
|
5
|
-
firstScreen = 'rLynxFirstScreen',
|
|
6
|
-
updateFromRoot = 'updateFromRoot',
|
|
7
|
-
globalEventFromLepus = 'globalEventFromLepus',
|
|
8
|
-
jsReady = 'rLynxJSReady',
|
|
9
|
-
patchUpdate = 'rLynxChange',
|
|
10
|
-
publishEvent = 'rLynxPublishEvent',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface FirstScreenData {
|
|
14
|
-
root: string;
|
|
15
|
-
jsReadyEventIdSwap: Record<string | number, number>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const enum NativeUpdateDataType {
|
|
19
|
-
UPDATE = 0,
|
|
20
|
-
RESET = 1,
|
|
21
|
-
}
|
package/runtime/src/list.ts
DELETED
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 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
|
-
import { LifecycleConstant } from './lifecycleConstant.js';
|
|
5
|
-
import { applyRefQueue } from './snapshot/workletRef.js';
|
|
6
|
-
import type { SnapshotInstance } from './snapshot.js';
|
|
7
|
-
import { maybePromise } from './utils.js';
|
|
8
|
-
|
|
9
|
-
export const gSignMap: Record<number, Map<number, SnapshotInstance>> = {};
|
|
10
|
-
export const gRecycleMap: Record<number, Map<string, Map<number, SnapshotInstance>>> = {};
|
|
11
|
-
const gParentWeakMap: WeakMap<SnapshotInstance, unknown> = new WeakMap();
|
|
12
|
-
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
13
|
-
|
|
14
|
-
export function clearListGlobal(): void {
|
|
15
|
-
for (const key in gSignMap) {
|
|
16
|
-
delete gSignMap[key];
|
|
17
|
-
}
|
|
18
|
-
for (const key in gRecycleMap) {
|
|
19
|
-
delete gRecycleMap[key];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function componentAtIndexFactory(
|
|
24
|
-
ctx: SnapshotInstance[],
|
|
25
|
-
hydrateFunction: (before: SnapshotInstance, after: SnapshotInstance) => void,
|
|
26
|
-
): [ComponentAtIndexCallback, ComponentAtIndexesCallback] {
|
|
27
|
-
// A hack workaround to ensure childCtx has no direct reference through `__parent` to list,
|
|
28
|
-
// to avoid memory leak.
|
|
29
|
-
// TODO(hzy): make `__parent` a WeakRef or `#__parent` in the future.
|
|
30
|
-
ctx.forEach((childCtx) => {
|
|
31
|
-
if (gParentWeakMap.has(childCtx)) {
|
|
32
|
-
// do it only once
|
|
33
|
-
} else {
|
|
34
|
-
gParentWeakMap.set(childCtx, childCtx.parentNode!);
|
|
35
|
-
Object.defineProperty(childCtx, '__parent', {
|
|
36
|
-
get: () => gParentWeakMap.get(childCtx)!,
|
|
37
|
-
set: (value: unknown) => {
|
|
38
|
-
gParentWeakMap.set(childCtx, value);
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const componentAtChildCtx = (
|
|
45
|
-
list: FiberElement,
|
|
46
|
-
listID: number,
|
|
47
|
-
childCtx: SnapshotInstance,
|
|
48
|
-
operationID: number,
|
|
49
|
-
enableReuseNotification: boolean,
|
|
50
|
-
enableBatchRender: boolean = false,
|
|
51
|
-
asyncFlush: boolean = false,
|
|
52
|
-
) => {
|
|
53
|
-
const signMap = gSignMap[listID];
|
|
54
|
-
const recycleMap = gRecycleMap[listID];
|
|
55
|
-
if (!signMap || !recycleMap) {
|
|
56
|
-
throw new Error('componentAtIndex called on removed list');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const platformInfo = childCtx.__listItemPlatformInfo ?? {};
|
|
60
|
-
|
|
61
|
-
// The lifecycle of this `__extraProps.isReady`:
|
|
62
|
-
// 0 -> Promise<number> -> 1
|
|
63
|
-
// 0: The initial state, the list-item is not ready yet, we will send a event to background
|
|
64
|
-
// when `componentAtIndex` is called on it
|
|
65
|
-
// Promise<number>: A promise that will be resolved when the list-item is ready
|
|
66
|
-
// 1: The list-item is ready, we can use it to render the list
|
|
67
|
-
if (childCtx.__extraProps?.['isReady'] === 0) {
|
|
68
|
-
if (
|
|
69
|
-
typeof __GetAttributeByName === 'function'
|
|
70
|
-
&& __GetAttributeByName(list, 'custom-list-name') === 'list-container'
|
|
71
|
-
) {
|
|
72
|
-
// we are in supported env
|
|
73
|
-
// do not throw
|
|
74
|
-
} else {
|
|
75
|
-
throw new Error(
|
|
76
|
-
'Unsupported: `<list-item/>` with `defer={true}` must be used with `<list custom-list-name="list-container"/>`',
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
__OnLifecycleEvent([LifecycleConstant.publishEvent, {
|
|
81
|
-
handlerName: `${childCtx.__id}:__extraProps:onComponentAtIndex`,
|
|
82
|
-
data: {},
|
|
83
|
-
}]);
|
|
84
|
-
|
|
85
|
-
let p: Promise<number>;
|
|
86
|
-
return (p = new Promise<number>((resolve) => {
|
|
87
|
-
Object.defineProperty(childCtx.__extraProps, 'isReady', {
|
|
88
|
-
set(isReady) {
|
|
89
|
-
if (isReady === 1) {
|
|
90
|
-
delete childCtx.__extraProps!['isReady'];
|
|
91
|
-
childCtx.__extraProps!['isReady'] = 1;
|
|
92
|
-
|
|
93
|
-
void resolvedPromise.then(() => {
|
|
94
|
-
// the cellIndex may be changed already, but the `childCtx` is the same
|
|
95
|
-
resolve(componentAtChildCtx(list, listID, childCtx, operationID, enableReuseNotification));
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
get() {
|
|
100
|
-
return p;
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
}));
|
|
104
|
-
} else if (maybePromise<number>(childCtx.__extraProps?.['isReady'])) {
|
|
105
|
-
throw new Error('componentAtIndex was called on a pending deferred list item');
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const uniqID = childCtx.type + (platformInfo['reuse-identifier'] ?? '');
|
|
109
|
-
const recycleSignMap = recycleMap.get(uniqID);
|
|
110
|
-
|
|
111
|
-
if (childCtx.__elements) {
|
|
112
|
-
/**
|
|
113
|
-
* If this situation is encountered, there might be two cases:
|
|
114
|
-
* 1. Reusing with itself
|
|
115
|
-
* In this case, enqueueComponent will be triggered first, followed by componentAtIndex.
|
|
116
|
-
* 2. Moving
|
|
117
|
-
* In this case, the trigger order is uncertain; componentAtIndex might be triggered first, or enqueueComponent might be triggered first.
|
|
118
|
-
*
|
|
119
|
-
* When enqueueComponent is triggered first, there must be an item in the reuse pool with the same sign as here, which can be returned directly.
|
|
120
|
-
* When componentAtIndex is triggered first, a clone needs to be made first, then follow the logic for adding or reusing. The cloned item will enter the reuse pool in the subsequent enqueueComponent.
|
|
121
|
-
*/
|
|
122
|
-
const root = childCtx.__elements[0]!;
|
|
123
|
-
const sign = __GetElementUniqueID(root);
|
|
124
|
-
|
|
125
|
-
if (recycleSignMap?.has(sign)) {
|
|
126
|
-
signMap.set(sign, childCtx);
|
|
127
|
-
recycleSignMap.delete(sign);
|
|
128
|
-
if (!enableBatchRender) {
|
|
129
|
-
__FlushElementTree(root, { triggerLayout: true, operationID, elementID: sign, listID });
|
|
130
|
-
} else if (enableBatchRender && asyncFlush) {
|
|
131
|
-
__FlushElementTree(root, { asyncFlush: true });
|
|
132
|
-
}
|
|
133
|
-
// enableBatchRender == true && asyncFlush == false
|
|
134
|
-
// in this case, no need to invoke __FlushElementTree because in the end of componentAtIndexes(), the list will invoke __FlushElementTree.
|
|
135
|
-
return sign;
|
|
136
|
-
} else {
|
|
137
|
-
const newCtx = childCtx.takeElements();
|
|
138
|
-
signMap.set(sign, newCtx);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (recycleSignMap && recycleSignMap.size > 0) {
|
|
143
|
-
const [first] = recycleSignMap;
|
|
144
|
-
const [sign, oldCtx] = first!;
|
|
145
|
-
recycleSignMap.delete(sign);
|
|
146
|
-
hydrateFunction(oldCtx, childCtx);
|
|
147
|
-
oldCtx.unRenderElements();
|
|
148
|
-
if (!oldCtx.__id) {
|
|
149
|
-
oldCtx.tearDown();
|
|
150
|
-
} else if (oldCtx.__extraProps?.['isReady'] === 1) {
|
|
151
|
-
__OnLifecycleEvent([LifecycleConstant.publishEvent, {
|
|
152
|
-
handlerName: `${oldCtx.__id}:__extraProps:onRecycleComponent`,
|
|
153
|
-
data: {},
|
|
154
|
-
}]);
|
|
155
|
-
}
|
|
156
|
-
const root = childCtx.__element_root!;
|
|
157
|
-
applyRefQueue();
|
|
158
|
-
if (!enableBatchRender) {
|
|
159
|
-
const flushOptions: FlushOptions = {
|
|
160
|
-
triggerLayout: true,
|
|
161
|
-
operationID,
|
|
162
|
-
elementID: sign,
|
|
163
|
-
listID,
|
|
164
|
-
};
|
|
165
|
-
if (enableReuseNotification) {
|
|
166
|
-
flushOptions.listReuseNotification = {
|
|
167
|
-
listElement: list,
|
|
168
|
-
itemKey: platformInfo['item-key']!,
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
__FlushElementTree(root, flushOptions);
|
|
172
|
-
} else if (enableBatchRender && asyncFlush) {
|
|
173
|
-
const flushOptions: FlushOptions = {
|
|
174
|
-
asyncFlush: true,
|
|
175
|
-
};
|
|
176
|
-
if (enableReuseNotification) {
|
|
177
|
-
flushOptions.listReuseNotification = {
|
|
178
|
-
listElement: list,
|
|
179
|
-
itemKey: platformInfo['item-key']!,
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
__FlushElementTree(root, flushOptions);
|
|
183
|
-
}
|
|
184
|
-
signMap.set(sign, childCtx);
|
|
185
|
-
return sign;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
childCtx.ensureElements();
|
|
189
|
-
const root = childCtx.__element_root!;
|
|
190
|
-
__AppendElement(list, root);
|
|
191
|
-
const sign = __GetElementUniqueID(root);
|
|
192
|
-
applyRefQueue();
|
|
193
|
-
if (!enableBatchRender) {
|
|
194
|
-
__FlushElementTree(root, {
|
|
195
|
-
triggerLayout: true,
|
|
196
|
-
operationID,
|
|
197
|
-
elementID: sign,
|
|
198
|
-
listID,
|
|
199
|
-
});
|
|
200
|
-
} else if (enableBatchRender && asyncFlush) {
|
|
201
|
-
__FlushElementTree(root, {
|
|
202
|
-
asyncFlush: true,
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
signMap.set(sign, childCtx);
|
|
206
|
-
return sign;
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
function componentAtIndex(
|
|
210
|
-
list: FiberElement,
|
|
211
|
-
listID: number,
|
|
212
|
-
cellIndex: number,
|
|
213
|
-
operationID: number,
|
|
214
|
-
enableReuseNotification: boolean,
|
|
215
|
-
) {
|
|
216
|
-
const childCtx = ctx[cellIndex];
|
|
217
|
-
if (!childCtx) {
|
|
218
|
-
throw new Error('childCtx not found');
|
|
219
|
-
}
|
|
220
|
-
const r = componentAtChildCtx(list, listID, childCtx, operationID, enableReuseNotification);
|
|
221
|
-
|
|
222
|
-
/* v8 ignore start */
|
|
223
|
-
if (process.env['NODE_ENV'] === 'test') {
|
|
224
|
-
return r;
|
|
225
|
-
} else {
|
|
226
|
-
return typeof r === 'number' ? r : undefined;
|
|
227
|
-
}
|
|
228
|
-
/* v8 ignore end */
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function componentAtIndexes(
|
|
232
|
-
list: FiberElement,
|
|
233
|
-
listID: number,
|
|
234
|
-
cellIndexes: number[],
|
|
235
|
-
operationIDs: number[],
|
|
236
|
-
enableReuseNotification: boolean,
|
|
237
|
-
asyncFlush: boolean,
|
|
238
|
-
) {
|
|
239
|
-
let hasUnready = false;
|
|
240
|
-
const p: Array<Promise<number> | number> = [];
|
|
241
|
-
|
|
242
|
-
cellIndexes.forEach((cellIndex, index) => {
|
|
243
|
-
const operationID = operationIDs[index]!;
|
|
244
|
-
const childCtx = ctx[cellIndex];
|
|
245
|
-
if (!childCtx) {
|
|
246
|
-
throw new Error('childCtx not found');
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
const u = componentAtChildCtx(list, listID, childCtx, operationID, enableReuseNotification, true, asyncFlush);
|
|
250
|
-
if (typeof u === 'number') {
|
|
251
|
-
// ready
|
|
252
|
-
} else {
|
|
253
|
-
hasUnready = true;
|
|
254
|
-
}
|
|
255
|
-
p.push(u);
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
// We need __FlushElementTree twice:
|
|
259
|
-
// 1. The first time is sync, we flush the items that are ready, with unready items' uiSign as -1.
|
|
260
|
-
// 2. The second time is async, with all the uiSigns.
|
|
261
|
-
// NOTE: The `operationIDs` passed to __FlushElementTree must be the one passed in,
|
|
262
|
-
// not the one generated by any code here, to workaround a bug of Lynx Engine.
|
|
263
|
-
// So we CANNOT split the `operationIDs` into two parts: one for ready items, one for unready items.
|
|
264
|
-
if (hasUnready) {
|
|
265
|
-
void Promise.all(p).then((uiSigns) => {
|
|
266
|
-
__FlushElementTree(list, {
|
|
267
|
-
triggerLayout: true,
|
|
268
|
-
operationIDs,
|
|
269
|
-
elementIDs: uiSigns,
|
|
270
|
-
listID,
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
__FlushElementTree(list, {
|
|
275
|
-
triggerLayout: true,
|
|
276
|
-
operationIDs,
|
|
277
|
-
elementIDs: cellIndexes.map((_, index) => typeof p[index] === 'number' ? p[index] : -1),
|
|
278
|
-
listID,
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
return [componentAtIndex, componentAtIndexes] as const;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
export function enqueueComponentFactory(): EnqueueComponentCallback {
|
|
285
|
-
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
286
|
-
const enqueueComponent = (_: FiberElement, listID: number, sign: number) => {
|
|
287
|
-
const signMap = gSignMap[listID];
|
|
288
|
-
const recycleMap = gRecycleMap[listID];
|
|
289
|
-
if (!signMap || !recycleMap) {
|
|
290
|
-
throw new Error('enqueueComponent called on removed list');
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
const childCtx = signMap.get(sign)!;
|
|
294
|
-
if (!childCtx) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
const platformInfo = childCtx.__listItemPlatformInfo ?? {};
|
|
299
|
-
|
|
300
|
-
const uniqID = childCtx.type + (platformInfo['reuse-identifier'] ?? '');
|
|
301
|
-
if (!recycleMap.has(uniqID)) {
|
|
302
|
-
recycleMap.set(uniqID, new Map());
|
|
303
|
-
}
|
|
304
|
-
recycleMap.get(uniqID)!.set(sign, childCtx);
|
|
305
|
-
};
|
|
306
|
-
return enqueueComponent;
|
|
307
|
-
}
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 The Lynx Authors. All rights reserved.
|
|
2
|
-
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
-
// LICENSE file in the root directory of this source tree.
|
|
4
|
-
|
|
5
|
-
import { hydrate } from './hydrate.js';
|
|
6
|
-
import { componentAtIndexFactory, enqueueComponentFactory } from './list.js';
|
|
7
|
-
import type { SnapshotInstance } from './snapshot.js';
|
|
8
|
-
|
|
9
|
-
export interface ListUpdateInfo {
|
|
10
|
-
flush(): void;
|
|
11
|
-
onInsertBefore(
|
|
12
|
-
newNode: SnapshotInstance,
|
|
13
|
-
existingNode?: SnapshotInstance,
|
|
14
|
-
): void;
|
|
15
|
-
onRemoveChild(child: SnapshotInstance): void;
|
|
16
|
-
onSetAttribute(child: SnapshotInstance, attr: any, oldAttr: any): void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// class ListUpdateInfoDiffing implements ListUpdateInfo {
|
|
20
|
-
// private oldChildNodes: SnapshotInstance[];
|
|
21
|
-
// constructor(private list: SnapshotInstance) {
|
|
22
|
-
// this.oldChildNodes = list.childNodes;
|
|
23
|
-
// }
|
|
24
|
-
// flush(): void {
|
|
25
|
-
// Object.defineProperty(SnapshotInstance.prototype, "key", {
|
|
26
|
-
// get: function () {
|
|
27
|
-
// return this.values[0]["item-key"];
|
|
28
|
-
// },
|
|
29
|
-
// });
|
|
30
|
-
|
|
31
|
-
// }
|
|
32
|
-
// onInsertBefore(newNode: SnapshotInstance, existingNode?: SnapshotInstance | undefined): void {}
|
|
33
|
-
// onRemoveChild(child: SnapshotInstance): void {}
|
|
34
|
-
// onSetAttribute(child: SnapshotInstance, attr: any): void {
|
|
35
|
-
// throw new Error("Method not implemented.");
|
|
36
|
-
// }
|
|
37
|
-
// }
|
|
38
|
-
|
|
39
|
-
interface InsertAction {
|
|
40
|
-
position: number;
|
|
41
|
-
type: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface UpdateAction {
|
|
45
|
-
from: number;
|
|
46
|
-
to: number;
|
|
47
|
-
type: string;
|
|
48
|
-
flush: boolean;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
interface ListOperations {
|
|
52
|
-
insertAction: InsertAction[];
|
|
53
|
-
removeAction: number[];
|
|
54
|
-
updateAction: UpdateAction[];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export class ListUpdateInfoRecording implements ListUpdateInfo {
|
|
58
|
-
constructor(private list: SnapshotInstance) {
|
|
59
|
-
this.oldChildNodes = list.childNodes;
|
|
60
|
-
// this.oldChildNodesSet = new Set(this.oldChildNodes);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// private __commitAndReset() {
|
|
64
|
-
// (this.__pendingAttributes ??= []).push(this.__toAttribute());
|
|
65
|
-
// this.oldChildNodes = this.list.childNodes;
|
|
66
|
-
// this.oldChildNodesSet = new Set(this.oldChildNodes);
|
|
67
|
-
// this.removeChild1.clear();
|
|
68
|
-
// this.removeChild2.clear();
|
|
69
|
-
// this.insertBefore.clear();
|
|
70
|
-
// this.appendChild.length = 0;
|
|
71
|
-
// this.platformInfoUpdate.clear();
|
|
72
|
-
// }
|
|
73
|
-
|
|
74
|
-
flush(): void {
|
|
75
|
-
const elementIndex = this.list.__snapshot_def.slot[0]![1];
|
|
76
|
-
const listElement = this.list.__elements![elementIndex]!;
|
|
77
|
-
// this.__pendingAttributes?.forEach(pendingAttribute => {
|
|
78
|
-
// __SetAttribute(listElement, "update-list-info", pendingAttribute);
|
|
79
|
-
// __FlushElementTree(listElement);
|
|
80
|
-
// });
|
|
81
|
-
__SetAttribute(listElement, 'update-list-info', this.__toAttribute());
|
|
82
|
-
const [componentAtIndex, componentAtIndexes] = componentAtIndexFactory(this.list.childNodes, hydrate);
|
|
83
|
-
__UpdateListCallbacks(
|
|
84
|
-
listElement,
|
|
85
|
-
componentAtIndex,
|
|
86
|
-
enqueueComponentFactory(),
|
|
87
|
-
componentAtIndexes,
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
private oldChildNodes: SnapshotInstance[];
|
|
92
|
-
// private oldChildNodesSet: Set<SnapshotInstance>;
|
|
93
|
-
private removeChild = new Set<SnapshotInstance>();
|
|
94
|
-
private insertBefore = new Map<SnapshotInstance, SnapshotInstance[]>(); // insert V before K
|
|
95
|
-
private appendChild = [] as SnapshotInstance[];
|
|
96
|
-
private platformInfoUpdate = new Map<SnapshotInstance, any>();
|
|
97
|
-
|
|
98
|
-
onInsertBefore(newNode: SnapshotInstance, existingNode?: SnapshotInstance): void {
|
|
99
|
-
if (newNode.parentNode) {
|
|
100
|
-
// if (!this.oldChildNodesSet.has(newNode)) {
|
|
101
|
-
// this.__commitAndReset();
|
|
102
|
-
// }
|
|
103
|
-
this.removeChild.add(newNode);
|
|
104
|
-
}
|
|
105
|
-
if (existingNode) {
|
|
106
|
-
// if (!this.oldChildNodesSet.has(existingNode)) {
|
|
107
|
-
// this.__commitAndReset();
|
|
108
|
-
// }
|
|
109
|
-
const newChildren = this.insertBefore.get(existingNode) ?? [];
|
|
110
|
-
newChildren.push(newNode);
|
|
111
|
-
this.insertBefore.set(existingNode, newChildren);
|
|
112
|
-
} else {
|
|
113
|
-
this.appendChild.push(newNode);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
onRemoveChild(child: SnapshotInstance): void {
|
|
118
|
-
// if (!this.oldChildNodesSet.has(child)) {
|
|
119
|
-
// this.__commitAndReset();
|
|
120
|
-
// }
|
|
121
|
-
this.removeChild.add(child);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
onSetAttribute(child: SnapshotInstance, attr: any, _oldAttr: any): void {
|
|
125
|
-
this.platformInfoUpdate.set(child, attr);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
private __toAttribute(): ListOperations {
|
|
129
|
-
const { removeChild, insertBefore, appendChild, platformInfoUpdate } = this;
|
|
130
|
-
|
|
131
|
-
const removals: number[] = [];
|
|
132
|
-
const insertions: InsertAction[] = [];
|
|
133
|
-
const updates: UpdateAction[] = [];
|
|
134
|
-
|
|
135
|
-
let j = 0;
|
|
136
|
-
for (let i = 0; i < this.oldChildNodes.length; i++, j++) {
|
|
137
|
-
const child = this.oldChildNodes[i]!;
|
|
138
|
-
if (platformInfoUpdate.has(child)) {
|
|
139
|
-
updates.push({
|
|
140
|
-
...platformInfoUpdate.get(child),
|
|
141
|
-
from: +j,
|
|
142
|
-
to: +j,
|
|
143
|
-
// no flush
|
|
144
|
-
flush: false,
|
|
145
|
-
type: child.type,
|
|
146
|
-
} as UpdateAction);
|
|
147
|
-
}
|
|
148
|
-
if (insertBefore.has(child)) {
|
|
149
|
-
const children = insertBefore.get(child)!;
|
|
150
|
-
children.forEach(c => {
|
|
151
|
-
insertions.push({
|
|
152
|
-
position: j,
|
|
153
|
-
type: c.type,
|
|
154
|
-
...c.__listItemPlatformInfo,
|
|
155
|
-
} as InsertAction);
|
|
156
|
-
j++;
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
if (removeChild.has(child)) {
|
|
160
|
-
removals.push(i);
|
|
161
|
-
removeChild.delete(child);
|
|
162
|
-
j--;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
for (let i = 0; i < appendChild.length; i++) {
|
|
166
|
-
const child = appendChild[i]!;
|
|
167
|
-
insertions.push({
|
|
168
|
-
position: j + i,
|
|
169
|
-
type: child.type,
|
|
170
|
-
...child.__listItemPlatformInfo,
|
|
171
|
-
} as InsertAction);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
insertions.sort((a, b) => a.position - b.position);
|
|
175
|
-
removals.sort((a, b) => a - b);
|
|
176
|
-
|
|
177
|
-
if (
|
|
178
|
-
SystemInfo.lynxSdkVersion === '2.14'
|
|
179
|
-
|| SystemInfo.lynxSdkVersion === '2.15'
|
|
180
|
-
|| SystemInfo.lynxSdkVersion === '2.16'
|
|
181
|
-
|| SystemInfo.lynxSdkVersion === '2.17'
|
|
182
|
-
|| SystemInfo.lynxSdkVersion === '2.18'
|
|
183
|
-
) {
|
|
184
|
-
const elementIndex = this.list.__snapshot_def.slot[0]![1];
|
|
185
|
-
const listElement = this.list.__elements![elementIndex]!;
|
|
186
|
-
|
|
187
|
-
// `__GetAttributeByName` is available since Lynx 2.14
|
|
188
|
-
if (__GetAttributeByName(listElement, 'custom-list-name') === 'list-container') {
|
|
189
|
-
// `updateAction` must be full (not incremental) when Lynx version <= 2.18 and
|
|
190
|
-
// when `custom-list-name` is `list-container` (available when Lynx version >= 2.14) is true,
|
|
191
|
-
updates.length = 0;
|
|
192
|
-
this.list.childNodes.forEach((child, index) => {
|
|
193
|
-
updates.push({
|
|
194
|
-
...child.__listItemPlatformInfo,
|
|
195
|
-
from: index,
|
|
196
|
-
to: index,
|
|
197
|
-
// no flush
|
|
198
|
-
flush: false,
|
|
199
|
-
type: child.type,
|
|
200
|
-
} as UpdateAction);
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return {
|
|
206
|
-
insertAction: insertions,
|
|
207
|
-
removeAction: removals,
|
|
208
|
-
updateAction: updates,
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
toJSON(): [ListOperations] {
|
|
213
|
-
// if (this.__pendingAttributes) {
|
|
214
|
-
// return [...this.__pendingAttributes, this.__toAttribute()];
|
|
215
|
-
// } else {
|
|
216
|
-
// return [this.__toAttribute()];
|
|
217
|
-
// }
|
|
218
|
-
|
|
219
|
-
return [this.__toAttribute()] as const;
|
|
220
|
-
}
|
|
221
|
-
}
|