@lwc/engine-core 7.0.3-alpha.0 → 7.0.4
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/utils.d.ts +0 -1
- package/dist/index.cjs.js +14 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +14 -18
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -6,7 +6,6 @@ export declare const EmptyObject: any;
|
|
|
6
6
|
export declare const EmptyArray: never[];
|
|
7
7
|
export declare function addCallbackToNextTick(callback: Callback): void;
|
|
8
8
|
export declare function guid(): string;
|
|
9
|
-
export declare function shouldUseNativeCustomElementLifecycle(ctor: LightningElementConstructor): boolean;
|
|
10
9
|
export declare function parseStyleText(cssText: string): {
|
|
11
10
|
[name: string]: string;
|
|
12
11
|
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -449,14 +449,6 @@ function guid() {
|
|
|
449
449
|
}
|
|
450
450
|
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
|
451
451
|
}
|
|
452
|
-
function shouldUseNativeCustomElementLifecycle(ctor) {
|
|
453
|
-
if (lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
454
|
-
// temporary "kill switch"
|
|
455
|
-
return false;
|
|
456
|
-
}
|
|
457
|
-
const apiVersion = getComponentAPIVersion(ctor);
|
|
458
|
-
return shared.isAPIFeatureEnabled(7 /* APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE */, apiVersion);
|
|
459
|
-
}
|
|
460
452
|
// Borrowed from Vue template compiler.
|
|
461
453
|
// https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
|
|
462
454
|
const DECLARATION_DELIMITER = /;(?![^(]*\))/g;
|
|
@@ -507,7 +499,7 @@ function assertNotProd() {
|
|
|
507
499
|
function shouldBeFormAssociated(Ctor) {
|
|
508
500
|
const ctorFormAssociated = Boolean(Ctor.formAssociated);
|
|
509
501
|
const apiVersion = getComponentAPIVersion(Ctor);
|
|
510
|
-
const apiFeatureEnabled = shared.isAPIFeatureEnabled(
|
|
502
|
+
const apiFeatureEnabled = shared.isAPIFeatureEnabled(7 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion);
|
|
511
503
|
if (process.env.NODE_ENV !== 'production' && ctorFormAssociated && !apiFeatureEnabled) {
|
|
512
504
|
const tagName = getComponentRegisteredName(Ctor);
|
|
513
505
|
logWarnOnce(`Component <${tagName}> set static formAssociated to true, but form ` +
|
|
@@ -1750,7 +1742,7 @@ LightningElement.prototype = {
|
|
|
1750
1742
|
attachInternals() {
|
|
1751
1743
|
const vm = getAssociatedVM(this);
|
|
1752
1744
|
const { elm, apiVersion, renderer: { attachInternals }, } = vm;
|
|
1753
|
-
if (!shared.isAPIFeatureEnabled(
|
|
1745
|
+
if (!shared.isAPIFeatureEnabled(7 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion)) {
|
|
1754
1746
|
throw new Error(`The attachInternals API is only supported in API version 61 and above. ` +
|
|
1755
1747
|
`The current version is ${apiVersion}. ` +
|
|
1756
1748
|
`To use this API, update the LWC component API version. https://lwc.dev/guide/versioning`);
|
|
@@ -1790,7 +1782,7 @@ LightningElement.prototype = {
|
|
|
1790
1782
|
shared.assert.fail('this.hostElement is not supported in this environment');
|
|
1791
1783
|
}
|
|
1792
1784
|
const apiVersion = getComponentAPIVersion(vm.def.ctor);
|
|
1793
|
-
if (!shared.isAPIFeatureEnabled(
|
|
1785
|
+
if (!shared.isAPIFeatureEnabled(8 /* APIFeature.ENABLE_THIS_DOT_HOST_ELEMENT */, apiVersion)) {
|
|
1794
1786
|
if (process.env.NODE_ENV !== 'production') {
|
|
1795
1787
|
logWarnOnce('The `this.hostElement` API within LightningElement is ' +
|
|
1796
1788
|
'only supported in API version 62 and above. Increase the API version to use it.');
|
|
@@ -1932,7 +1924,7 @@ LightningElement.prototype = {
|
|
|
1932
1924
|
get style() {
|
|
1933
1925
|
const { elm, renderer, def } = getAssociatedVM(this);
|
|
1934
1926
|
const apiVersion = getComponentAPIVersion(def.ctor);
|
|
1935
|
-
if (!shared.isAPIFeatureEnabled(
|
|
1927
|
+
if (!shared.isAPIFeatureEnabled(9 /* APIFeature.ENABLE_THIS_DOT_STYLE */, apiVersion)) {
|
|
1936
1928
|
if (process.env.NODE_ENV !== 'production') {
|
|
1937
1929
|
logWarnOnce('The `this.style` API within LightningElement returning the CSSStyleDeclaration is ' +
|
|
1938
1930
|
'only supported in API version 62 and above. Increase the API version to use it.');
|
|
@@ -4504,7 +4496,7 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
4504
4496
|
// compiler may generate tagnames with uppercase letters so - for backwards
|
|
4505
4497
|
// compatibility, we lower case the tagname here.
|
|
4506
4498
|
const normalizedTagname = sel.toLowerCase();
|
|
4507
|
-
const useNativeLifecycle =
|
|
4499
|
+
const useNativeLifecycle = !lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE;
|
|
4508
4500
|
const isFormAssociated = shouldBeFormAssociated(ctor);
|
|
4509
4501
|
const elm = createCustomElement(normalizedTagname, upgradeCallback, useNativeLifecycle, isFormAssociated);
|
|
4510
4502
|
vnode.elm = elm;
|
|
@@ -5651,8 +5643,11 @@ function ncls(value) {
|
|
|
5651
5643
|
}
|
|
5652
5644
|
}
|
|
5653
5645
|
}
|
|
5654
|
-
else if (shared.isObject(value)) {
|
|
5655
|
-
|
|
5646
|
+
else if (shared.isObject(value) && !shared.isNull(value)) {
|
|
5647
|
+
// Iterate own enumerable keys of the object
|
|
5648
|
+
const keys = shared.keys(value);
|
|
5649
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
5650
|
+
const key = keys[i];
|
|
5656
5651
|
if (value[key]) {
|
|
5657
5652
|
res += key + ' ';
|
|
5658
5653
|
}
|
|
@@ -5875,6 +5870,7 @@ function buildSerializeExpressionFn(parts) {
|
|
|
5875
5870
|
// 4. For non-attributes everything from index 1 to the string length is the partId.
|
|
5876
5871
|
// Ex, attribute: a0:data-name, a = an attribute, 0 = partId, data-name = attribute name.
|
|
5877
5872
|
// Ex, style: s0, s = a style attribute, 0 = partId.
|
|
5873
|
+
// Note some attributes contain a `:`, e.g. `xlink:href` may be encoded as `a0:xlink:href`.
|
|
5878
5874
|
const type = shared.StringCharAt.call(partToken, 0);
|
|
5879
5875
|
let delimiterIndex = partToken.length;
|
|
5880
5876
|
let attrName = '';
|
|
@@ -6381,7 +6377,7 @@ function resetComponentStateWhenRemoved(vm) {
|
|
|
6381
6377
|
// old vnode.children is removed from the DOM.
|
|
6382
6378
|
function removeVM(vm) {
|
|
6383
6379
|
if (process.env.NODE_ENV !== 'production') {
|
|
6384
|
-
if (
|
|
6380
|
+
if (lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
6385
6381
|
// With native lifecycle, we cannot be certain that connectedCallback was called before a component
|
|
6386
6382
|
// was removed from the VDOM. If the component is disconnected, then connectedCallback will not fire
|
|
6387
6383
|
// in native mode, although it will fire in synthetic mode due to appendChild triggering it.
|
|
@@ -6705,7 +6701,7 @@ function runConnectedCallback(vm) {
|
|
|
6705
6701
|
// This test only makes sense in the browser, with synthetic lifecycle, and when reporting is enabled or
|
|
6706
6702
|
// we're in dev mode. This is to detect a particular issue with synthetic lifecycle.
|
|
6707
6703
|
if (process.env.IS_BROWSER &&
|
|
6708
|
-
|
|
6704
|
+
lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE &&
|
|
6709
6705
|
(process.env.NODE_ENV !== 'production' || isReportingEnabled())) {
|
|
6710
6706
|
if (!vm.renderer.isConnected(vm.elm)) {
|
|
6711
6707
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -8076,5 +8072,5 @@ exports.swapTemplate = swapTemplate;
|
|
|
8076
8072
|
exports.track = track;
|
|
8077
8073
|
exports.unwrap = unwrap;
|
|
8078
8074
|
exports.wire = wire;
|
|
8079
|
-
/** version: 7.0.
|
|
8075
|
+
/** version: 7.0.4 */
|
|
8080
8076
|
//# sourceMappingURL=index.cjs.js.map
|