@lwc/engine-core 2.38.1 → 2.39.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lwc/engine-core",
3
- "version": "2.38.1",
3
+ "version": "2.39.0",
4
4
  "description": "Core LWC engine APIs.",
5
5
  "homepage": "https://lwc.dev/",
6
6
  "repository": {
@@ -24,9 +24,9 @@
24
24
  "types/"
25
25
  ],
26
26
  "dependencies": {
27
- "@lwc/aria-reflection": "2.38.1",
28
- "@lwc/features": "2.38.1",
29
- "@lwc/shared": "2.38.1"
27
+ "@lwc/aria-reflection": "2.39.0",
28
+ "@lwc/features": "2.39.0",
29
+ "@lwc/shared": "2.39.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "observable-membrane": "2.0.0"
@@ -21,9 +21,15 @@ declare function k(compilerKey: number, obj: any): string | void;
21
21
  declare function gid(id: string | undefined | null): string | null | undefined;
22
22
  declare function fid(url: string | undefined | null): string | null | undefined;
23
23
  /**
24
- * create a dynamic component via `<x-foo lwc:dynamic={Ctor}>`
24
+ * [ddc] - create a (deprecated) dynamic component via `<x-foo lwc:dynamic={Ctor}>`
25
+ *
26
+ * TODO [#3331]: remove usage of lwc:dynamic in 246
25
27
  */
26
- declare function dc(sel: string, Ctor: LightningElementConstructor | null | undefined, data: VElementData, children?: VNodes): VCustomElement | null;
28
+ declare function ddc(sel: string, Ctor: LightningElementConstructor | null | undefined, data: VElementData, children?: VNodes): VCustomElement | null;
29
+ /**
30
+ * [dc] - create a dynamic component via `<lwc:component lwc:is={Ctor}>`
31
+ */
32
+ declare function dc(Ctor: LightningElementConstructor | null | undefined, data: VElementData, children?: VNodes): VCustomElement | null;
27
33
  export type SanitizeHtmlContentHook = (content: unknown) => string;
28
34
  /**
29
35
  * Sets the sanitizeHtmlContentHook.
@@ -49,6 +55,7 @@ declare const api: Readonly<{
49
55
  fid: typeof fid;
50
56
  shc: typeof shc;
51
57
  ssf: typeof ssf;
58
+ ddc: typeof ddc;
52
59
  }>;
53
60
  export default api;
54
61
  export type RenderAPI = typeof api;
@@ -3,15 +3,19 @@ import { VM } from './vm';
3
3
  import { LightningElementConstructor } from './base-lightning-element';
4
4
  import { Template } from './template';
5
5
  import { VNodes } from './vnodes';
6
+ type ComponentConstructorMetadata = {
7
+ tmpl: Template;
8
+ sel: string;
9
+ };
6
10
  /**
7
11
  * INTERNAL: This function can only be invoked by compiled code. The compiler
8
12
  * will prevent this function from being imported by userland code.
9
13
  */
10
- export declare function registerComponent(Ctor: any, { tmpl }: {
11
- tmpl: Template;
12
- }): any;
14
+ export declare function registerComponent(Ctor: any, metadata: ComponentConstructorMetadata): any;
13
15
  export declare function getComponentRegisteredTemplate(Ctor: LightningElementConstructor): Template | undefined;
16
+ export declare function getComponentRegisteredName(Ctor: LightningElementConstructor): string | undefined;
14
17
  export declare function getTemplateReactiveObserver(vm: VM): ReactiveObserver;
15
18
  export declare function renderComponent(vm: VM): VNodes;
16
19
  export declare function markComponentAsDirty(vm: VM): void;
17
20
  export declare function getWrappedComponentsListener(vm: VM, listener: EventListener): EventListener;
21
+ export {};
@@ -6,7 +6,6 @@ export declare function getTemplateOrSwappedTemplate(tpl: Template): Template;
6
6
  export declare function getComponentOrSwappedComponent(Ctor: LightningElementConstructor): LightningElementConstructor;
7
7
  export declare function getStyleOrSwappedStyle(style: StylesheetFactory): StylesheetFactory;
8
8
  export declare function setActiveVM(vm: VM): void;
9
- export declare function removeActiveVM(vm: VM): void;
10
9
  export declare function swapTemplate(oldTpl: Template, newTpl: Template): boolean;
11
10
  export declare function swapComponent(oldComponent: LightningElementConstructor, newComponent: LightningElementConstructor): boolean;
12
11
  export declare function swapStyle(oldStyle: StylesheetFactory, newStyle: StylesheetFactory): boolean;
@@ -87,6 +87,6 @@ export interface VElementData extends VNodeData {
87
87
  }
88
88
  export declare function isVBaseElement(vnode: VNode): vnode is VElement | VCustomElement;
89
89
  export declare function isSameVnode(vnode1: VNode, vnode2: VNode): boolean;
90
- export declare function isVCustomElement(vnode: VBaseElement): vnode is VCustomElement;
90
+ export declare function isVCustomElement(vnode: VNode | VBaseElement): vnode is VCustomElement;
91
91
  export declare function isVFragment(vnode: VNode): vnode is VFragment;
92
92
  export declare function isVScopedSlotFragment(vnode: VNode): vnode is VScopedSlotFragment;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * A map where the keys are weakly held and the values are a Set that are also each weakly held.
3
+ * The goal is to avoid leaking the values, which is what would happen with a WeakMap<K, Set<V>>.
4
+ *
5
+ * Note that this is currently only intended to be used in dev/PRODDEBUG environments.
6
+ * It leaks in legacy browsers, which may be undesired.
7
+ */
8
+ export interface WeakMultiMap<T extends object, V extends object> {
9
+ get(key: T): ReadonlySet<V>;
10
+ add(key: T, vm: V): void;
11
+ delete(key: T): void;
12
+ }
13
+ declare class LegacyWeakMultiMap<K extends object, V extends object> implements WeakMultiMap<K, V> {
14
+ private _map;
15
+ private _getValues;
16
+ get(key: K): ReadonlySet<V>;
17
+ add(key: K, vm: V): void;
18
+ delete(key: K): void;
19
+ }
20
+ declare class ModernWeakMultiMap<K extends object, V extends object> implements WeakMultiMap<K, V> {
21
+ private _map;
22
+ private _registry;
23
+ private _getWeakRefs;
24
+ get(key: K): ReadonlySet<V>;
25
+ add(key: K, value: V): void;
26
+ delete(key: K): void;
27
+ }
28
+ export declare const WeakMultiMap: typeof LegacyWeakMultiMap | typeof ModernWeakMultiMap;
29
+ export {};