@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/README.md CHANGED
@@ -96,11 +96,6 @@ This experimental API enables the identification of LWC constructors.
96
96
  This experimental API enables the creation of a reactive readonly membrane around any object
97
97
  value.
98
98
 
99
- ### register()
100
-
101
- This experimental API enables the registration of 'services' in LWC by exposing hooks into the
102
- component life-cycle.
103
-
104
99
  ### setHooks()
105
100
 
106
101
  This experimental API allows setting overridable hooks with an application specific implementation.
@@ -18,7 +18,6 @@ export { getComponentConstructor } from './get-component-constructor';
18
18
  export type { RendererAPI, LifecycleCallback } from './renderer';
19
19
  export type { ConfigValue as WireConfigValue, ContextValue as WireContextValue, DataCallback, WireAdapter, WireAdapterConstructor, WireAdapterSchemaValue, WireContextSubscriptionPayload, WireContextSubscriptionCallback, } from './wiring';
20
20
  export { LightningElement } from './base-lightning-element';
21
- export { register } from './services';
22
21
  export { default as api } from './decorators/api';
23
22
  export { default as track } from './decorators/track';
24
23
  export { default as wire } from './decorators/wire';
@@ -82,7 +82,6 @@ export interface VNodeData {
82
82
  readonly on?: Readonly<Record<string, (event: Event) => any>>;
83
83
  readonly svg?: boolean;
84
84
  readonly renderer?: RendererAPI;
85
- readonly spread?: Readonly<Record<string, any>>;
86
85
  }
87
86
  export interface VElementData extends VNodeData {
88
87
  readonly key: Key;
package/dist/index.cjs.js CHANGED
@@ -3379,28 +3379,20 @@ function isLiveBindingProp(sel, key) {
3379
3379
  return sel === 'input' && (key === 'value' || key === 'checked');
3380
3380
  }
3381
3381
  function patchProps(oldVnode, vnode, renderer) {
3382
- let { props } = vnode.data;
3383
- const { spread } = vnode.data;
3384
- if (shared.isUndefined(props) && shared.isUndefined(spread)) {
3382
+ const { props } = vnode.data;
3383
+ if (shared.isUndefined(props)) {
3385
3384
  return;
3386
3385
  }
3387
3386
  let oldProps;
3388
3387
  if (!shared.isNull(oldVnode)) {
3389
3388
  oldProps = oldVnode.data.props;
3390
- const oldSpread = oldVnode.data.spread;
3391
3389
  // Props may be the same due to the static content optimization, so we can skip diffing
3392
- if (oldProps === props && oldSpread === spread) {
3390
+ if (oldProps === props) {
3393
3391
  return;
3394
3392
  }
3395
3393
  if (shared.isUndefined(oldProps)) {
3396
3394
  oldProps = EmptyObject;
3397
3395
  }
3398
- if (!shared.isUndefined(oldSpread)) {
3399
- oldProps = shared.assign({}, oldProps, oldSpread);
3400
- }
3401
- }
3402
- if (!shared.isUndefined(spread)) {
3403
- props = shared.assign({}, props, spread);
3404
3396
  }
3405
3397
  const isFirstPatch = shared.isNull(oldVnode);
3406
3398
  const { elm, sel } = vnode;
@@ -5336,44 +5328,6 @@ function getWrappedComponentsListener(vm, listener) {
5336
5328
  return wrappedListener;
5337
5329
  }
5338
5330
 
5339
- /*
5340
- * Copyright (c) 2018, salesforce.com, inc.
5341
- * All rights reserved.
5342
- * SPDX-License-Identifier: MIT
5343
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5344
- */
5345
- const Services = shared.create(null);
5346
- const hooks = ['rendered', 'connected', 'disconnected'];
5347
- /**
5348
- * EXPERIMENTAL: This function allows for the registration of "services"
5349
- * in LWC by exposing hooks into the component life-cycle. This API is
5350
- * subject to change or being removed.
5351
- */
5352
- function register(service) {
5353
- if (process.env.NODE_ENV !== 'production') {
5354
- shared.assert.isTrue(shared.isObject(service), `Invalid service declaration, ${service}: service must be an object`);
5355
- }
5356
- for (let i = 0; i < hooks.length; ++i) {
5357
- const hookName = hooks[i];
5358
- if (hookName in service) {
5359
- let l = Services[hookName];
5360
- if (shared.isUndefined(l)) {
5361
- Services[hookName] = l = [];
5362
- }
5363
- shared.ArrayPush.call(l, service[hookName]);
5364
- }
5365
- }
5366
- }
5367
- function invokeServiceHook(vm, cbs) {
5368
- if (process.env.NODE_ENV !== 'production') {
5369
- shared.assert.isTrue(shared.isArray(cbs) && cbs.length > 0, `Optimize invokeServiceHook() to be invoked only when needed`);
5370
- }
5371
- const { component, def, context } = vm;
5372
- for (let i = 0, len = cbs.length; i < len; ++i) {
5373
- cbs[i].call(undefined, component, {}, def, context);
5374
- }
5375
- }
5376
-
5377
5331
  /*
5378
5332
  * Copyright (c) 2023, Salesforce.com, inc.
5379
5333
  * All rights reserved.
@@ -5432,7 +5386,13 @@ function resetComponentStateWhenRemoved(vm) {
5432
5386
  // old vnode.children is removed from the DOM.
5433
5387
  function removeVM(vm) {
5434
5388
  if (process.env.NODE_ENV !== 'production') {
5435
- shared.assert.isTrue(vm.state === 1 /* VMState.connected */ || vm.state === 2 /* VMState.disconnected */, `${vm} must have been connected.`);
5389
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
5390
+ // With native lifecycle, we cannot be certain that connectedCallback was called before a component
5391
+ // was removed from the VDOM. If the component is disconnected, then connectedCallback will not fire
5392
+ // in native mode, although it will fire in synthetic mode due to appendChild triggering it.
5393
+ // See: W-14037619 for details
5394
+ shared.assert.isTrue(vm.state === 1 /* VMState.connected */ || vm.state === 2 /* VMState.disconnected */, `${vm} must have been connected.`);
5395
+ }
5436
5396
  }
5437
5397
  resetComponentStateWhenRemoved(vm);
5438
5398
  }
@@ -5675,10 +5635,6 @@ function runRenderedCallback(vm) {
5675
5635
  if (!process.env.IS_BROWSER) {
5676
5636
  return;
5677
5637
  }
5678
- const { rendered } = Services;
5679
- if (rendered) {
5680
- invokeServiceHook(vm, rendered);
5681
- }
5682
5638
  if (!shared.isUndefined(renderedCallback)) {
5683
5639
  logOperationStart(4 /* OperationId.RenderedCallback */, vm);
5684
5640
  invokeComponentCallback(vm, renderedCallback);
@@ -5721,11 +5677,6 @@ function runConnectedCallback(vm) {
5721
5677
  return; // nothing to do since it was already connected
5722
5678
  }
5723
5679
  vm.state = 1 /* VMState.connected */;
5724
- // reporting connection
5725
- const { connected } = Services;
5726
- if (connected) {
5727
- invokeServiceHook(vm, connected);
5728
- }
5729
5680
  if (hasWireAdapters(vm)) {
5730
5681
  connectWireAdapters(vm);
5731
5682
  }
@@ -5751,11 +5702,6 @@ function runDisconnectedCallback(vm) {
5751
5702
  vm.isDirty = true;
5752
5703
  }
5753
5704
  vm.state = 2 /* VMState.disconnected */;
5754
- // reporting disconnection
5755
- const { disconnected } = Services;
5756
- if (disconnected) {
5757
- invokeServiceHook(vm, disconnected);
5758
- }
5759
5705
  if (hasWireAdapters(vm)) {
5760
5706
  disconnectWireAdapters(vm);
5761
5707
  }
@@ -6941,7 +6887,6 @@ exports.isComponentConstructor = isComponentConstructor;
6941
6887
  exports.parseFragment = parseFragment;
6942
6888
  exports.parseSVGFragment = parseSVGFragment;
6943
6889
  exports.readonly = readonly;
6944
- exports.register = register;
6945
6890
  exports.registerComponent = registerComponent;
6946
6891
  exports.registerDecorators = registerDecorators;
6947
6892
  exports.registerTemplate = registerTemplate;
@@ -6953,5 +6898,5 @@ exports.swapTemplate = swapTemplate;
6953
6898
  exports.track = track;
6954
6899
  exports.unwrap = unwrap;
6955
6900
  exports.wire = wire;
6956
- /** version: 3.2.0 */
6901
+ /** version: 3.3.1 */
6957
6902
  //# sourceMappingURL=index.cjs.js.map