@lwc/engine-core 2.50.0 → 3.0.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/framework/component.d.ts +3 -0
- package/dist/framework/main.d.ts +1 -1
- package/dist/index.cjs.js +24 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +25 -7
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { APIVersion } from '@lwc/shared';
|
|
1
2
|
import { ReactiveObserver } from './mutation-tracker';
|
|
2
3
|
import { VM } from './vm';
|
|
3
4
|
import { LightningElementConstructor } from './base-lightning-element';
|
|
@@ -6,6 +7,7 @@ import { VNodes } from './vnodes';
|
|
|
6
7
|
type ComponentConstructorMetadata = {
|
|
7
8
|
tmpl: Template;
|
|
8
9
|
sel: string;
|
|
10
|
+
apiVersion: APIVersion;
|
|
9
11
|
};
|
|
10
12
|
/**
|
|
11
13
|
* INTERNAL: This function can only be invoked by compiled code. The compiler
|
|
@@ -14,6 +16,7 @@ type ComponentConstructorMetadata = {
|
|
|
14
16
|
export declare function registerComponent(Ctor: any, metadata: ComponentConstructorMetadata): any;
|
|
15
17
|
export declare function getComponentRegisteredTemplate(Ctor: LightningElementConstructor): Template | undefined;
|
|
16
18
|
export declare function getComponentRegisteredName(Ctor: LightningElementConstructor): string | undefined;
|
|
19
|
+
export declare function getComponentAPIVersion(Ctor: LightningElementConstructor): APIVersion;
|
|
17
20
|
export declare function getTemplateReactiveObserver(vm: VM): ReactiveObserver;
|
|
18
21
|
export declare function renderComponent(vm: VM): VNodes;
|
|
19
22
|
export declare function markComponentAsDirty(vm: VM): void;
|
package/dist/framework/main.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { createVM, connectRootElement, disconnectRootElement, getAssociatedVMIfP
|
|
|
3
3
|
export { createContextProviderWithRegister } from './wiring';
|
|
4
4
|
export { parseFragment, parseSVGFragment } from './template';
|
|
5
5
|
export { hydrateRoot } from './hydration';
|
|
6
|
-
export { registerComponent } from './component';
|
|
6
|
+
export { registerComponent, getComponentAPIVersion } from './component';
|
|
7
7
|
export { registerTemplate } from './secure-template';
|
|
8
8
|
export { registerDecorators } from './decorators/register';
|
|
9
9
|
export { unwrap } from './membrane';
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* proxy-compat-disable */
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (C) 2023 salesforce.com, inc.
|
|
4
3
|
*/
|
|
@@ -256,10 +255,18 @@ class ReactiveObserver {
|
|
|
256
255
|
const { listeners } = this;
|
|
257
256
|
const len = listeners.length;
|
|
258
257
|
if (len > 0) {
|
|
259
|
-
for (let i = 0; i < len; i
|
|
258
|
+
for (let i = 0; i < len; i++) {
|
|
260
259
|
const set = listeners[i];
|
|
261
|
-
|
|
262
|
-
|
|
260
|
+
if (set.length === 1) {
|
|
261
|
+
// Perf optimization for the common case - the length is usually 1, so avoid the indexOf+splice.
|
|
262
|
+
// If the length is 1, we can also be sure that `this` is the first item in the array.
|
|
263
|
+
set.length = 0;
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
// Slow case
|
|
267
|
+
const pos = shared.ArrayIndexOf.call(set, this);
|
|
268
|
+
shared.ArraySplice.call(set, pos, 1);
|
|
269
|
+
}
|
|
263
270
|
}
|
|
264
271
|
listeners.length = 0;
|
|
265
272
|
}
|
|
@@ -5269,6 +5276,17 @@ function getComponentRegisteredName(Ctor) {
|
|
|
5269
5276
|
var _a;
|
|
5270
5277
|
return (_a = registeredComponentMap.get(Ctor)) === null || _a === void 0 ? void 0 : _a.sel;
|
|
5271
5278
|
}
|
|
5279
|
+
function getComponentAPIVersion(Ctor) {
|
|
5280
|
+
const metadata = registeredComponentMap.get(Ctor);
|
|
5281
|
+
const apiVersion = metadata === null || metadata === void 0 ? void 0 : metadata.apiVersion;
|
|
5282
|
+
if (shared.isUndefined(apiVersion)) {
|
|
5283
|
+
// This should only occur in our Karma tests; in practice every component
|
|
5284
|
+
// is registered, and so this code path should not get hit. But to be safe,
|
|
5285
|
+
// return the lowest possible version.
|
|
5286
|
+
return shared.LOWEST_API_VERSION;
|
|
5287
|
+
}
|
|
5288
|
+
return apiVersion;
|
|
5289
|
+
}
|
|
5272
5290
|
function getTemplateReactiveObserver(vm) {
|
|
5273
5291
|
return createReactiveObserver(() => {
|
|
5274
5292
|
const { isDirty } = vm;
|
|
@@ -6906,6 +6924,7 @@ exports.createVM = createVM;
|
|
|
6906
6924
|
exports.disconnectRootElement = disconnectRootElement;
|
|
6907
6925
|
exports.freezeTemplate = freezeTemplate;
|
|
6908
6926
|
exports.getAssociatedVMIfPresent = getAssociatedVMIfPresent;
|
|
6927
|
+
exports.getComponentAPIVersion = getComponentAPIVersion;
|
|
6909
6928
|
exports.getComponentConstructor = getComponentConstructor;
|
|
6910
6929
|
exports.getComponentDef = getComponentDef;
|
|
6911
6930
|
exports.getComponentHtmlPrototype = getComponentHtmlPrototype;
|
|
@@ -6926,5 +6945,5 @@ exports.swapTemplate = swapTemplate;
|
|
|
6926
6945
|
exports.track = track;
|
|
6927
6946
|
exports.unwrap = unwrap;
|
|
6928
6947
|
exports.wire = wire;
|
|
6929
|
-
/** version:
|
|
6948
|
+
/** version: 3.0.1 */
|
|
6930
6949
|
//# sourceMappingURL=index.cjs.js.map
|