@lwc/engine-core 3.2.0 → 3.3.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
@@ -3375,28 +3375,20 @@ function isLiveBindingProp(sel, key) {
3375
3375
  return sel === 'input' && (key === 'value' || key === 'checked');
3376
3376
  }
3377
3377
  function patchProps(oldVnode, vnode, renderer) {
3378
- let { props } = vnode.data;
3379
- const { spread } = vnode.data;
3380
- if (isUndefined$1(props) && isUndefined$1(spread)) {
3378
+ const { props } = vnode.data;
3379
+ if (isUndefined$1(props)) {
3381
3380
  return;
3382
3381
  }
3383
3382
  let oldProps;
3384
3383
  if (!isNull(oldVnode)) {
3385
3384
  oldProps = oldVnode.data.props;
3386
- const oldSpread = oldVnode.data.spread;
3387
3385
  // Props may be the same due to the static content optimization, so we can skip diffing
3388
- if (oldProps === props && oldSpread === spread) {
3386
+ if (oldProps === props) {
3389
3387
  return;
3390
3388
  }
3391
3389
  if (isUndefined$1(oldProps)) {
3392
3390
  oldProps = EmptyObject;
3393
3391
  }
3394
- if (!isUndefined$1(oldSpread)) {
3395
- oldProps = assign({}, oldProps, oldSpread);
3396
- }
3397
- }
3398
- if (!isUndefined$1(spread)) {
3399
- props = assign({}, props, spread);
3400
3392
  }
3401
3393
  const isFirstPatch = isNull(oldVnode);
3402
3394
  const { elm, sel } = vnode;
@@ -5332,44 +5324,6 @@ function getWrappedComponentsListener(vm, listener) {
5332
5324
  return wrappedListener;
5333
5325
  }
5334
5326
 
5335
- /*
5336
- * Copyright (c) 2018, salesforce.com, inc.
5337
- * All rights reserved.
5338
- * SPDX-License-Identifier: MIT
5339
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5340
- */
5341
- const Services = create(null);
5342
- const hooks = ['rendered', 'connected', 'disconnected'];
5343
- /**
5344
- * EXPERIMENTAL: This function allows for the registration of "services"
5345
- * in LWC by exposing hooks into the component life-cycle. This API is
5346
- * subject to change or being removed.
5347
- */
5348
- function register(service) {
5349
- if (process.env.NODE_ENV !== 'production') {
5350
- assert.isTrue(isObject(service), `Invalid service declaration, ${service}: service must be an object`);
5351
- }
5352
- for (let i = 0; i < hooks.length; ++i) {
5353
- const hookName = hooks[i];
5354
- if (hookName in service) {
5355
- let l = Services[hookName];
5356
- if (isUndefined$1(l)) {
5357
- Services[hookName] = l = [];
5358
- }
5359
- ArrayPush$1.call(l, service[hookName]);
5360
- }
5361
- }
5362
- }
5363
- function invokeServiceHook(vm, cbs) {
5364
- if (process.env.NODE_ENV !== 'production') {
5365
- assert.isTrue(isArray$1(cbs) && cbs.length > 0, `Optimize invokeServiceHook() to be invoked only when needed`);
5366
- }
5367
- const { component, def, context } = vm;
5368
- for (let i = 0, len = cbs.length; i < len; ++i) {
5369
- cbs[i].call(undefined, component, {}, def, context);
5370
- }
5371
- }
5372
-
5373
5327
  /*
5374
5328
  * Copyright (c) 2023, Salesforce.com, inc.
5375
5329
  * All rights reserved.
@@ -5428,7 +5382,13 @@ function resetComponentStateWhenRemoved(vm) {
5428
5382
  // old vnode.children is removed from the DOM.
5429
5383
  function removeVM(vm) {
5430
5384
  if (process.env.NODE_ENV !== 'production') {
5431
- assert.isTrue(vm.state === 1 /* VMState.connected */ || vm.state === 2 /* VMState.disconnected */, `${vm} must have been connected.`);
5385
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
5386
+ // With native lifecycle, we cannot be certain that connectedCallback was called before a component
5387
+ // was removed from the VDOM. If the component is disconnected, then connectedCallback will not fire
5388
+ // in native mode, although it will fire in synthetic mode due to appendChild triggering it.
5389
+ // See: W-14037619 for details
5390
+ assert.isTrue(vm.state === 1 /* VMState.connected */ || vm.state === 2 /* VMState.disconnected */, `${vm} must have been connected.`);
5391
+ }
5432
5392
  }
5433
5393
  resetComponentStateWhenRemoved(vm);
5434
5394
  }
@@ -5671,10 +5631,6 @@ function runRenderedCallback(vm) {
5671
5631
  if (!process.env.IS_BROWSER) {
5672
5632
  return;
5673
5633
  }
5674
- const { rendered } = Services;
5675
- if (rendered) {
5676
- invokeServiceHook(vm, rendered);
5677
- }
5678
5634
  if (!isUndefined$1(renderedCallback)) {
5679
5635
  logOperationStart(4 /* OperationId.RenderedCallback */, vm);
5680
5636
  invokeComponentCallback(vm, renderedCallback);
@@ -5717,11 +5673,6 @@ function runConnectedCallback(vm) {
5717
5673
  return; // nothing to do since it was already connected
5718
5674
  }
5719
5675
  vm.state = 1 /* VMState.connected */;
5720
- // reporting connection
5721
- const { connected } = Services;
5722
- if (connected) {
5723
- invokeServiceHook(vm, connected);
5724
- }
5725
5676
  if (hasWireAdapters(vm)) {
5726
5677
  connectWireAdapters(vm);
5727
5678
  }
@@ -5747,11 +5698,6 @@ function runDisconnectedCallback(vm) {
5747
5698
  vm.isDirty = true;
5748
5699
  }
5749
5700
  vm.state = 2 /* VMState.disconnected */;
5750
- // reporting disconnection
5751
- const { disconnected } = Services;
5752
- if (disconnected) {
5753
- invokeServiceHook(vm, disconnected);
5754
- }
5755
5701
  if (hasWireAdapters(vm)) {
5756
5702
  disconnectWireAdapters(vm);
5757
5703
  }
@@ -6909,6 +6855,6 @@ function readonly(obj) {
6909
6855
  return getReadOnlyProxy(obj);
6910
6856
  }
6911
6857
 
6912
- 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, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
6913
- /** version: 3.2.0 */
6858
+ 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, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
6859
+ /** version: 3.3.1 */
6914
6860
  //# sourceMappingURL=index.js.map