@lwc/engine-core 6.5.0 → 6.5.2

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/LICENSE.md ADDED
@@ -0,0 +1,88 @@
1
+ # LWC core license
2
+
3
+ MIT LICENSE
4
+
5
+ Copyright (c) 2024, Salesforce, Inc.
6
+ All rights reserved.
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+
14
+ # Licenses of bundled dependencies
15
+
16
+ ## @parse5/tools
17
+
18
+ MIT license defined in package.json in v0.4.0.
19
+
20
+ ## entities
21
+
22
+ Copyright (c) Felix Böhm
23
+ All rights reserved.
24
+
25
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
26
+
27
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
28
+
29
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
30
+
31
+ THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
32
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+
34
+ ## estree-walker
35
+
36
+ Copyright (c) 2015-20 [these people](https://github.com/Rich-Harris/estree-walker/graphs/contributors)
37
+
38
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
39
+
40
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43
+
44
+ ## observable-membrane
45
+
46
+ MIT License
47
+
48
+ Copyright (c) 2017 Salesforce
49
+
50
+ Permission is hereby granted, free of charge, to any person obtaining a copy
51
+ of this software and associated documentation files (the "Software"), to deal
52
+ in the Software without restriction, including without limitation the rights
53
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
54
+ copies of the Software, and to permit persons to whom the Software is
55
+ furnished to do so, subject to the following conditions:
56
+
57
+ The above copyright notice and this permission notice shall be included in all
58
+ copies or substantial portions of the Software.
59
+
60
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
61
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
62
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
63
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
64
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
65
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
66
+ SOFTWARE.
67
+
68
+ ## parse5
69
+
70
+ Copyright (c) 2013-2019 Ivan Nikulin (ifaaan@gmail.com, https://github.com/inikulin)
71
+
72
+ Permission is hereby granted, free of charge, to any person obtaining a copy
73
+ of this software and associated documentation files (the "Software"), to deal
74
+ in the Software without restriction, including without limitation the rights
75
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
76
+ copies of the Software, and to permit persons to whom the Software is
77
+ furnished to do so, subject to the following conditions:
78
+
79
+ The above copyright notice and this permission notice shall be included in
80
+ all copies or substantial portions of the Software.
81
+
82
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
83
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
84
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
85
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
86
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
87
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
88
+ THE SOFTWARE.
@@ -14,7 +14,7 @@ declare function i(iterable: Iterable<any>, factory: (value: any, index: number,
14
14
  * [f]lattening
15
15
  * @param items
16
16
  */
17
- declare function f(items: Readonly<Array<Readonly<Array<VNodes>> | VNodes>>): VNodes;
17
+ declare function f(items: ReadonlyArray<VNodes> | VNodes): VNodes;
18
18
  declare function t(text: string): VText;
19
19
  declare function co(text: string): VComment;
20
20
  declare function d(value: any): string;
@@ -15,7 +15,12 @@ export declare const enum VStaticPartType {
15
15
  Element = 1
16
16
  }
17
17
  export type VNode = VText | VComment | VElement | VCustomElement | VStatic | VFragment | VScopedSlotFragment;
18
- export type VNodes = Readonly<Array<VNode | null>>;
18
+ export type VNodes = ReadonlyArray<VNode | null>;
19
+ /**
20
+ * Mutable version of {@link VNodes}. It should only be used inside functions to build an array;
21
+ * it should never be used as a parameter or return type.
22
+ */
23
+ export type MutableVNodes = Array<VNode | null>;
19
24
  export interface BaseVParent {
20
25
  children: VNodes;
21
26
  }
@@ -100,7 +105,7 @@ export interface VNodeData {
100
105
  readonly className?: string;
101
106
  readonly style?: string;
102
107
  readonly classMap?: Readonly<Record<string, boolean>>;
103
- readonly styleDecls?: Readonly<Array<[string, string, boolean]>>;
108
+ readonly styleDecls?: ReadonlyArray<[string, string, boolean]>;
104
109
  readonly context?: Readonly<Record<string, Readonly<Record<string, any>>>>;
105
110
  readonly on?: Readonly<Record<string, (event: Event) => any>>;
106
111
  readonly svg?: boolean;
package/dist/index.cjs.js CHANGED
@@ -261,16 +261,17 @@ class ReactiveObserver {
261
261
  if (len > 0) {
262
262
  for (let i = 0; i < len; i++) {
263
263
  const set = listeners[i];
264
- if (set.length === 1) {
265
- // Perf optimization for the common case - the length is usually 1, so avoid the indexOf+splice.
266
- // If the length is 1, we can also be sure that `this` is the first item in the array.
267
- set.length = 0;
268
- }
269
- else {
270
- // Slow case
271
- const pos = shared.ArrayIndexOf.call(set, this);
272
- shared.ArraySplice.call(set, pos, 1);
264
+ const setLength = set.length;
265
+ // The length is usually 1, so avoid doing an indexOf when we know for certain
266
+ // that `this` is the first item in the array.
267
+ if (setLength > 1) {
268
+ // Swap with the last item before removal.
269
+ // (Avoiding splice here is a perf optimization, and the order doesn't matter.)
270
+ const index = shared.ArrayIndexOf.call(set, this);
271
+ set[index] = set[setLength - 1];
273
272
  }
273
+ // Remove the last item
274
+ shared.ArrayPop.call(set);
274
275
  }
275
276
  listeners.length = 0;
276
277
  }
@@ -2056,7 +2057,7 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
2056
2057
  }
2057
2058
 
2058
2059
  /*
2059
- * Copyright (c) 2023, salesforce.com, inc.
2060
+ * Copyright (c) 2024, Salesforce, Inc.
2060
2061
  * All rights reserved.
2061
2062
  * SPDX-License-Identifier: MIT
2062
2063
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -2215,7 +2216,8 @@ function installWireAdapters(vm) {
2215
2216
  vm.debugInfo[WIRE_DEBUG_ENTRY] = shared.create(null);
2216
2217
  }
2217
2218
  const wiredConnecting = (context.wiredConnecting = []);
2218
- const wiredDisconnecting = (context.wiredDisconnecting = []);
2219
+ const wiredDisconnecting = (context.wiredDisconnecting =
2220
+ []);
2219
2221
  for (const fieldNameOrMethod in wire) {
2220
2222
  const descriptor = wire[fieldNameOrMethod];
2221
2223
  const wireDef = WireMetaMap.get(descriptor);
@@ -2716,7 +2718,7 @@ function sanitizeAttribute(tagName, namespaceUri, attrName, attrValue) {
2716
2718
  }
2717
2719
 
2718
2720
  /*
2719
- * Copyright (c) 2018, salesforce.com, inc.
2721
+ * Copyright (c) 2024, Salesforce, Inc.
2720
2722
  * All rights reserved.
2721
2723
  * SPDX-License-Identifier: MIT
2722
2724
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -3625,7 +3627,7 @@ function createStylesheet(vm, stylesheets) {
3625
3627
  }
3626
3628
 
3627
3629
  /*
3628
- * Copyright (c) 2018, salesforce.com, inc.
3630
+ * Copyright (c) 2024, Salesforce, Inc.
3629
3631
  * All rights reserved.
3630
3632
  * SPDX-License-Identifier: MIT
3631
3633
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -4145,7 +4147,7 @@ function hydrateStaticParts(vnode, renderer) {
4145
4147
  }
4146
4148
 
4147
4149
  /*
4148
- * Copyright (c) 2018, salesforce.com, inc.
4150
+ * Copyright (c) 2024, Salesforce, Inc.
4149
4151
  * All rights reserved.
4150
4152
  * SPDX-License-Identifier: MIT
4151
4153
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -4915,7 +4917,7 @@ function updateStaticChildren(c1, c2, parent, renderer) {
4915
4917
  }
4916
4918
 
4917
4919
  /*
4918
- * Copyright (c) 2018, salesforce.com, inc.
4920
+ * Copyright (c) 2024, Salesforce, Inc.
4919
4921
  * All rights reserved.
4920
4922
  * SPDX-License-Identifier: MIT
4921
4923
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -5197,6 +5199,7 @@ function i(iterable, factory) {
5197
5199
  shared.ArrayPush.apply(list, vnode);
5198
5200
  }
5199
5201
  else {
5202
+ // `isArray` doesn't narrow this block properly...
5200
5203
  shared.ArrayPush.call(list, vnode);
5201
5204
  }
5202
5205
  if (process.env.NODE_ENV !== 'production') {
@@ -5248,6 +5251,7 @@ function f(items) {
5248
5251
  shared.ArrayPush.apply(flattened, item);
5249
5252
  }
5250
5253
  else {
5254
+ // `isArray` doesn't narrow this block properly...
5251
5255
  shared.ArrayPush.call(flattened, item);
5252
5256
  }
5253
5257
  }
@@ -5577,7 +5581,7 @@ function logGlobalOperationEnd(opId, vm) {
5577
5581
  }
5578
5582
 
5579
5583
  /*
5580
- * Copyright (c) 2018, salesforce.com, inc.
5584
+ * Copyright (c) 2024, Salesforce, Inc.
5581
5585
  * All rights reserved.
5582
5586
  * SPDX-License-Identifier: MIT
5583
5587
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -7548,7 +7552,7 @@ function setHooks(hooks) {
7548
7552
  }
7549
7553
 
7550
7554
  /*
7551
- * Copyright (c) 2018, salesforce.com, inc.
7555
+ * Copyright (c) 2024, Salesforce, Inc.
7552
7556
  * All rights reserved.
7553
7557
  * SPDX-License-Identifier: MIT
7554
7558
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -7616,9 +7620,9 @@ function warnOnArrayMutation(stylesheets) {
7616
7620
  // we can at least warn when they use the most common mutation methods.
7617
7621
  for (const prop of ARRAY_MUTATION_METHODS) {
7618
7622
  const originalArrayMethod = getOriginalArrayMethod(prop);
7623
+ // Assertions used here because TypeScript can't handle mapping over our types
7619
7624
  stylesheets[prop] = function arrayMutationWarningWrapper() {
7620
7625
  reportTemplateViolation('stylesheets');
7621
- // @ts-expect-error can't properly determine the right `this`
7622
7626
  return originalArrayMethod.apply(this, arguments);
7623
7627
  };
7624
7628
  }
@@ -7847,5 +7851,5 @@ exports.swapTemplate = swapTemplate;
7847
7851
  exports.track = track;
7848
7852
  exports.unwrap = unwrap;
7849
7853
  exports.wire = wire;
7850
- /** version: 6.5.0 */
7854
+ /** version: 6.5.2 */
7851
7855
  //# sourceMappingURL=index.cjs.js.map