@lwc/engine-core 7.0.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.
package/dist/index.js CHANGED
@@ -445,14 +445,6 @@ function guid() {
445
445
  }
446
446
  return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
447
447
  }
448
- function shouldUseNativeCustomElementLifecycle(ctor) {
449
- if (lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
450
- // temporary "kill switch"
451
- return false;
452
- }
453
- const apiVersion = getComponentAPIVersion(ctor);
454
- return isAPIFeatureEnabled(7 /* APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE */, apiVersion);
455
- }
456
448
  // Borrowed from Vue template compiler.
457
449
  // https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
458
450
  const DECLARATION_DELIMITER = /;(?![^(]*\))/g;
@@ -503,7 +495,7 @@ function assertNotProd() {
503
495
  function shouldBeFormAssociated(Ctor) {
504
496
  const ctorFormAssociated = Boolean(Ctor.formAssociated);
505
497
  const apiVersion = getComponentAPIVersion(Ctor);
506
- const apiFeatureEnabled = isAPIFeatureEnabled(8 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion);
498
+ const apiFeatureEnabled = isAPIFeatureEnabled(7 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion);
507
499
  if (process.env.NODE_ENV !== 'production' && ctorFormAssociated && !apiFeatureEnabled) {
508
500
  const tagName = getComponentRegisteredName(Ctor);
509
501
  logWarnOnce(`Component <${tagName}> set static formAssociated to true, but form ` +
@@ -1746,7 +1738,7 @@ LightningElement.prototype = {
1746
1738
  attachInternals() {
1747
1739
  const vm = getAssociatedVM(this);
1748
1740
  const { elm, apiVersion, renderer: { attachInternals }, } = vm;
1749
- if (!isAPIFeatureEnabled(8 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion)) {
1741
+ if (!isAPIFeatureEnabled(7 /* APIFeature.ENABLE_ELEMENT_INTERNALS_AND_FACE */, apiVersion)) {
1750
1742
  throw new Error(`The attachInternals API is only supported in API version 61 and above. ` +
1751
1743
  `The current version is ${apiVersion}. ` +
1752
1744
  `To use this API, update the LWC component API version. https://lwc.dev/guide/versioning`);
@@ -1786,7 +1778,7 @@ LightningElement.prototype = {
1786
1778
  assert.fail('this.hostElement is not supported in this environment');
1787
1779
  }
1788
1780
  const apiVersion = getComponentAPIVersion(vm.def.ctor);
1789
- if (!isAPIFeatureEnabled(9 /* APIFeature.ENABLE_THIS_DOT_HOST_ELEMENT */, apiVersion)) {
1781
+ if (!isAPIFeatureEnabled(8 /* APIFeature.ENABLE_THIS_DOT_HOST_ELEMENT */, apiVersion)) {
1790
1782
  if (process.env.NODE_ENV !== 'production') {
1791
1783
  logWarnOnce('The `this.hostElement` API within LightningElement is ' +
1792
1784
  'only supported in API version 62 and above. Increase the API version to use it.');
@@ -1928,7 +1920,7 @@ LightningElement.prototype = {
1928
1920
  get style() {
1929
1921
  const { elm, renderer, def } = getAssociatedVM(this);
1930
1922
  const apiVersion = getComponentAPIVersion(def.ctor);
1931
- if (!isAPIFeatureEnabled(10 /* APIFeature.ENABLE_THIS_DOT_STYLE */, apiVersion)) {
1923
+ if (!isAPIFeatureEnabled(9 /* APIFeature.ENABLE_THIS_DOT_STYLE */, apiVersion)) {
1932
1924
  if (process.env.NODE_ENV !== 'production') {
1933
1925
  logWarnOnce('The `this.style` API within LightningElement returning the CSSStyleDeclaration is ' +
1934
1926
  'only supported in API version 62 and above. Increase the API version to use it.');
@@ -4500,7 +4492,7 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
4500
4492
  // compiler may generate tagnames with uppercase letters so - for backwards
4501
4493
  // compatibility, we lower case the tagname here.
4502
4494
  const normalizedTagname = sel.toLowerCase();
4503
- const useNativeLifecycle = shouldUseNativeCustomElementLifecycle(ctor);
4495
+ const useNativeLifecycle = !lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE;
4504
4496
  const isFormAssociated = shouldBeFormAssociated(ctor);
4505
4497
  const elm = createCustomElement(normalizedTagname, upgradeCallback, useNativeLifecycle, isFormAssociated);
4506
4498
  vnode.elm = elm;
@@ -6377,7 +6369,7 @@ function resetComponentStateWhenRemoved(vm) {
6377
6369
  // old vnode.children is removed from the DOM.
6378
6370
  function removeVM(vm) {
6379
6371
  if (process.env.NODE_ENV !== 'production') {
6380
- if (!shouldUseNativeCustomElementLifecycle(vm.component.constructor)) {
6372
+ if (lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
6381
6373
  // With native lifecycle, we cannot be certain that connectedCallback was called before a component
6382
6374
  // was removed from the VDOM. If the component is disconnected, then connectedCallback will not fire
6383
6375
  // in native mode, although it will fire in synthetic mode due to appendChild triggering it.
@@ -6701,7 +6693,7 @@ function runConnectedCallback(vm) {
6701
6693
  // This test only makes sense in the browser, with synthetic lifecycle, and when reporting is enabled or
6702
6694
  // we're in dev mode. This is to detect a particular issue with synthetic lifecycle.
6703
6695
  if (process.env.IS_BROWSER &&
6704
- !shouldUseNativeCustomElementLifecycle(vm.component.constructor) &&
6696
+ lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE &&
6705
6697
  (process.env.NODE_ENV !== 'production' || isReportingEnabled())) {
6706
6698
  if (!vm.renderer.isConnected(vm.elm)) {
6707
6699
  if (process.env.NODE_ENV !== 'production') {
@@ -8029,5 +8021,5 @@ function readonly(obj) {
8029
8021
  }
8030
8022
 
8031
8023
  export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, computeShadowAndRenderMode, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentAPIVersion, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, runFormAssociatedCallback, runFormDisabledCallback, runFormResetCallback, runFormStateRestoreCallback, sanitizeAttribute, setHooks, shouldBeFormAssociated, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
8032
- /** version: 7.0.0 */
8024
+ /** version: 7.0.1 */
8033
8025
  //# sourceMappingURL=index.js.map