@lwc/engine-core 7.0.1-alpha.0 → 7.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.
@@ -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(8 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion);
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(8 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion)) {
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(9 /* APIFeature.ENABLE_THIS_DOT_HOST_ELEMENT */, apiVersion)) {
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(10 /* APIFeature.ENABLE_THIS_DOT_STYLE */, apiVersion)) {
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 = shouldUseNativeCustomElementLifecycle(ctor);
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;
@@ -6381,7 +6373,7 @@ function resetComponentStateWhenRemoved(vm) {
6381
6373
  // old vnode.children is removed from the DOM.
6382
6374
  function removeVM(vm) {
6383
6375
  if (process.env.NODE_ENV !== 'production') {
6384
- if (!shouldUseNativeCustomElementLifecycle(vm.component.constructor)) {
6376
+ if (lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
6385
6377
  // With native lifecycle, we cannot be certain that connectedCallback was called before a component
6386
6378
  // was removed from the VDOM. If the component is disconnected, then connectedCallback will not fire
6387
6379
  // in native mode, although it will fire in synthetic mode due to appendChild triggering it.
@@ -6705,7 +6697,7 @@ function runConnectedCallback(vm) {
6705
6697
  // This test only makes sense in the browser, with synthetic lifecycle, and when reporting is enabled or
6706
6698
  // we're in dev mode. This is to detect a particular issue with synthetic lifecycle.
6707
6699
  if (process.env.IS_BROWSER &&
6708
- !shouldUseNativeCustomElementLifecycle(vm.component.constructor) &&
6700
+ lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE &&
6709
6701
  (process.env.NODE_ENV !== 'production' || isReportingEnabled())) {
6710
6702
  if (!vm.renderer.isConnected(vm.elm)) {
6711
6703
  if (process.env.NODE_ENV !== 'production') {
@@ -8076,5 +8068,5 @@ exports.swapTemplate = swapTemplate;
8076
8068
  exports.track = track;
8077
8069
  exports.unwrap = unwrap;
8078
8070
  exports.wire = wire;
8079
- /** version: 7.0.0 */
8071
+ /** version: 7.0.1 */
8080
8072
  //# sourceMappingURL=index.cjs.js.map