@lwc/engine-core 2.32.0 → 2.32.1
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/dist/engine-core.cjs.js +215 -252
- package/dist/engine-core.js +216 -253
- package/package.json +3 -3
- package/types/framework/api.d.ts +3 -3
- package/types/framework/base-lightning-element.d.ts +2 -2
- package/types/framework/decorators/register.d.ts +4 -4
- package/types/framework/def.d.ts +1 -1
- package/types/framework/profiler.d.ts +2 -2
- package/types/framework/renderer.d.ts +5 -5
- package/types/framework/rendering.d.ts +1 -1
- package/types/framework/restrictions.d.ts +1 -0
- package/types/framework/services.d.ts +1 -1
- package/types/framework/stylesheet.d.ts +2 -2
- package/types/framework/utils.d.ts +1 -1
- package/types/framework/vm.d.ts +3 -9
- package/types/framework/vnodes.d.ts +4 -4
- package/types/framework/wiring.d.ts +5 -5
- package/types/libs/mutation-tracker/index.d.ts +2 -2
- package/types/framework/accessor-reactive-observer.d.ts +0 -9
|
@@ -10,12 +10,12 @@ export declare const enum OperationId {
|
|
|
10
10
|
GlobalHydrate = 7,
|
|
11
11
|
GlobalRehydrate = 8
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
type GlobalOperationId = OperationId.GlobalHydrate | OperationId.GlobalRehydrate;
|
|
14
14
|
declare const enum Phase {
|
|
15
15
|
Start = 0,
|
|
16
16
|
Stop = 1
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
type LogDispatcher = (opId: OperationId, phase: Phase, cmpName?: string, vmIndex?: number, renderMode?: RenderMode, shadowMode?: ShadowMode) => void;
|
|
19
19
|
export declare const profilerControl: {
|
|
20
20
|
enableProfiler(): void;
|
|
21
21
|
disableProfiler(): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
1
|
+
export type HostNode = any;
|
|
2
|
+
export type HostElement = any;
|
|
3
|
+
type N = HostNode;
|
|
4
|
+
type E = HostElement;
|
|
5
|
+
export type LifecycleCallback = (elm: E) => void;
|
|
6
6
|
export interface RendererAPI {
|
|
7
7
|
isNativeShadowDefined: boolean;
|
|
8
8
|
isSyntheticShadowDefined: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RendererAPI } from './renderer';
|
|
2
2
|
import { VM } from './vm';
|
|
3
|
-
import { VNode, VNodes
|
|
3
|
+
import { VCustomElement, VNode, VNodes } from './vnodes';
|
|
4
4
|
export declare function patchChildren(c1: VNodes, c2: VNodes, parent: ParentNode, renderer: RendererAPI): void;
|
|
5
5
|
export declare function mount(node: VNode, parent: ParentNode, renderer: RendererAPI, anchor: Node | null): void;
|
|
6
6
|
export declare function removeNode(node: Node, parent: ParentNode, renderer: RendererAPI): void;
|
|
@@ -4,6 +4,7 @@ export declare function lockDomMutation(): void;
|
|
|
4
4
|
export declare function patchElementWithRestrictions(elm: Element, options: {
|
|
5
5
|
isPortal: boolean;
|
|
6
6
|
isLight: boolean;
|
|
7
|
+
isSynthetic: boolean;
|
|
7
8
|
}): void;
|
|
8
9
|
export declare function patchShadowRootWithRestrictions(sr: ShadowRoot): void;
|
|
9
10
|
export declare function patchCustomElementWithRestrictions(elm: HTMLElement): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentDef } from './def';
|
|
2
2
|
import { VM, Context } from './vm';
|
|
3
3
|
import { VNodeData } from './vnodes';
|
|
4
|
-
|
|
4
|
+
type ServiceCallback = (component: object, data: VNodeData, def: ComponentDef, context: Context) => void;
|
|
5
5
|
interface ServiceDef {
|
|
6
6
|
connected?: ServiceCallback;
|
|
7
7
|
disconnected?: ServiceCallback;
|
|
@@ -5,13 +5,13 @@ import { VCustomElement, VNode } from './vnodes';
|
|
|
5
5
|
* Function producing style based on a host and a shadow selector. This function is invoked by
|
|
6
6
|
* the engine with different values depending on the mode that the component is running on.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type StylesheetFactory = (stylesheetToken: string | undefined, useActualHostSelector: boolean, useNativeDirPseudoclass: boolean) => string;
|
|
9
9
|
/**
|
|
10
10
|
* The list of stylesheets associated with a template. Each entry is either a StylesheetFactory or a
|
|
11
11
|
* TemplateStylesheetFactory a given stylesheet depends on other external stylesheets (via the
|
|
12
12
|
* @import CSS declaration).
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type TemplateStylesheetFactories = Array<StylesheetFactory | TemplateStylesheetFactories>;
|
|
15
15
|
export declare function updateStylesheetToken(vm: VM, template: Template): void;
|
|
16
16
|
export declare function getStylesheetsContent(vm: VM, template: Template): string[];
|
|
17
17
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StylesheetFactory, TemplateStylesheetFactories } from './stylesheet';
|
|
2
2
|
import { VM } from './vm';
|
|
3
3
|
import { VBaseElement } from './vnodes';
|
|
4
|
-
|
|
4
|
+
type Callback = () => void;
|
|
5
5
|
export declare const SPACE_CHAR = 32;
|
|
6
6
|
export declare const EmptyObject: any;
|
|
7
7
|
export declare const EmptyArray: never[];
|
package/types/framework/vm.d.ts
CHANGED
|
@@ -3,9 +3,8 @@ import { Template } from './template';
|
|
|
3
3
|
import { ComponentDef } from './def';
|
|
4
4
|
import { LightningElement, LightningElementConstructor } from './base-lightning-element';
|
|
5
5
|
import { ReactiveObserver } from './mutation-tracker';
|
|
6
|
-
import { AccessorReactiveObserver } from './accessor-reactive-observer';
|
|
7
6
|
import { VNodes, VCustomElement, VNode, VBaseElement } from './vnodes';
|
|
8
|
-
|
|
7
|
+
type ShadowRootMode = 'open' | 'closed';
|
|
9
8
|
export interface TemplateCache {
|
|
10
9
|
[key: string]: any;
|
|
11
10
|
}
|
|
@@ -54,7 +53,7 @@ export interface Context {
|
|
|
54
53
|
/** List of wire hooks that are invoked when the component gets disconnected. */
|
|
55
54
|
wiredDisconnecting: Array<() => void>;
|
|
56
55
|
}
|
|
57
|
-
export
|
|
56
|
+
export type RefVNodes = {
|
|
58
57
|
[name: string]: VBaseElement;
|
|
59
58
|
};
|
|
60
59
|
export interface VM<N = HostNode, E = HostElement> {
|
|
@@ -118,11 +117,6 @@ export interface VM<N = HostNode, E = HostElement> {
|
|
|
118
117
|
renderRoot: ShadowRoot | HostElement;
|
|
119
118
|
/** The template reactive observer. */
|
|
120
119
|
tro: ReactiveObserver;
|
|
121
|
-
/** The accessor reactive observers. Is only used when the ENABLE_REACTIVE_SETTER feature flag
|
|
122
|
-
* is enabled. */
|
|
123
|
-
oar: {
|
|
124
|
-
[name: string]: AccessorReactiveObserver;
|
|
125
|
-
};
|
|
126
120
|
/** Hook invoked whenever a property is accessed on the host element. This hook is used by
|
|
127
121
|
* Locker only. */
|
|
128
122
|
setHook: (cmp: LightningElement, prop: PropertyKey, newValue: any) => void;
|
|
@@ -139,7 +133,7 @@ export interface VM<N = HostNode, E = HostElement> {
|
|
|
139
133
|
* Debug info bag. Stores useful debug information about the component. */
|
|
140
134
|
debugInfo?: Record<string, any>;
|
|
141
135
|
}
|
|
142
|
-
|
|
136
|
+
type VMAssociable = HostNode | LightningElement;
|
|
143
137
|
export declare function rerenderVM(vm: VM): void;
|
|
144
138
|
export declare function connectRootElement(elm: any): void;
|
|
145
139
|
export declare function disconnectRootElement(elm: any): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VM } from './vm';
|
|
2
2
|
import type { RendererAPI } from './renderer';
|
|
3
|
-
export
|
|
3
|
+
export type Key = string | number;
|
|
4
4
|
export declare const enum VNodeType {
|
|
5
5
|
Text = 0,
|
|
6
6
|
Comment = 1,
|
|
@@ -10,8 +10,8 @@ export declare const enum VNodeType {
|
|
|
10
10
|
Fragment = 5,
|
|
11
11
|
ScopedSlotFragment = 6
|
|
12
12
|
}
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type VNode = VText | VComment | VElement | VCustomElement | VStatic | VFragment | VScopedSlotFragment;
|
|
14
|
+
export type VNodes = Readonly<Array<VNode | null>>;
|
|
15
15
|
export interface BaseVParent {
|
|
16
16
|
children: VNodes;
|
|
17
17
|
}
|
|
@@ -23,7 +23,7 @@ export interface BaseVNode {
|
|
|
23
23
|
owner: VM;
|
|
24
24
|
}
|
|
25
25
|
export interface VScopedSlotFragment extends BaseVNode {
|
|
26
|
-
factory: (value: any) =>
|
|
26
|
+
factory: (value: any, key: any) => VFragment;
|
|
27
27
|
type: VNodeType.ScopedSlotFragment;
|
|
28
28
|
slotName: string;
|
|
29
29
|
}
|
|
@@ -9,18 +9,18 @@ export declare class WireContextRegistrationEvent extends CustomEvent<undefined>
|
|
|
9
9
|
readonly setDisconnectedCallback: (disconnectCallback: () => void) => void;
|
|
10
10
|
constructor(adapterToken: string, { setNewContext, setDisconnectedCallback }: WireContextInternalEventPayload);
|
|
11
11
|
}
|
|
12
|
-
export
|
|
13
|
-
export
|
|
12
|
+
export type DataCallback = (value: any) => void;
|
|
13
|
+
export type ConfigValue = Record<string, any>;
|
|
14
14
|
export interface WireAdapter {
|
|
15
15
|
update(config: ConfigValue, context?: ContextValue): void;
|
|
16
16
|
connect(): void;
|
|
17
17
|
disconnect(): void;
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type WireAdapterSchemaValue = 'optional' | 'required';
|
|
20
20
|
export declare function getAdapterToken(adapter: WireAdapterConstructor): string | undefined;
|
|
21
21
|
export declare function setAdapterToken(adapter: WireAdapterConstructor, token: string): void;
|
|
22
|
-
export
|
|
23
|
-
export
|
|
22
|
+
export type ContextValue = Record<string, any>;
|
|
23
|
+
export type ConfigCallback = (component: LightningElement) => ConfigValue;
|
|
24
24
|
export interface WireAdapterConstructor {
|
|
25
25
|
new (callback: DataCallback): WireAdapter;
|
|
26
26
|
configSchema?: Record<string, WireAdapterSchemaValue>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare function valueMutated(target: object, key: PropertyKey): void;
|
|
2
2
|
export declare function valueObserved(target: object, key: PropertyKey): void;
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type CallbackFunction = (rp: ReactiveObserver) => void;
|
|
4
|
+
export type JobFunction = () => void;
|
|
5
5
|
export declare class ReactiveObserver {
|
|
6
6
|
private listeners;
|
|
7
7
|
private callback;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ReactiveObserver } from '../libs/mutation-tracker';
|
|
2
|
-
import { VM } from './vm';
|
|
3
|
-
export declare class AccessorReactiveObserver extends ReactiveObserver {
|
|
4
|
-
private value;
|
|
5
|
-
private debouncing;
|
|
6
|
-
constructor(vm: VM, set: (v: any) => void);
|
|
7
|
-
reset(value?: any): void;
|
|
8
|
-
}
|
|
9
|
-
export declare function createAccessorReactiveObserver(vm: VM, set: (v: any) => void): AccessorReactiveObserver;
|