@lwc/engine-core 7.1.0 → 7.1.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.
@@ -55,7 +55,7 @@ declare function shc(content: unknown): string;
55
55
  * This implementation is borrowed from Vue:
56
56
  * https://github.com/vuejs/core/blob/e790e1bdd7df7be39e14780529db86e4da47a3db/packages/shared/src/normalizeProp.ts#L63-L82
57
57
  */
58
- declare function ncls(value: unknown): string;
58
+ declare function ncls(value: unknown): string | undefined;
59
59
  declare const api: Readonly<{
60
60
  s: typeof s;
61
61
  h: typeof h;
package/dist/index.cjs.js CHANGED
@@ -3231,9 +3231,9 @@ function unrenderStylesheet(stylesheet) {
3231
3231
  }
3232
3232
  for (const cssContent of cssContents) {
3233
3233
  const abortController = cssContentToAbortControllers.get(cssContent);
3234
- /* istanbul ignore if */
3235
3234
  if (shared.isUndefined(abortController)) {
3236
- throw new Error('Cannot find AbortController for CSS content');
3235
+ // Two stylesheets with the same content will share an abort controller, in which case it only needs to be called once.
3236
+ continue;
3237
3237
  }
3238
3238
  abortController.abort();
3239
3239
  // remove association with AbortController in case stylesheet is rendered again
@@ -5631,6 +5631,11 @@ function shc(content) {
5631
5631
  * https://github.com/vuejs/core/blob/e790e1bdd7df7be39e14780529db86e4da47a3db/packages/shared/src/normalizeProp.ts#L63-L82
5632
5632
  */
5633
5633
  function ncls(value) {
5634
+ if (shared.isUndefined(value) || shared.isNull(value)) {
5635
+ // Returning undefined here improves initial render cost, because the old vnode's class will be considered
5636
+ // undefined in the `patchClassAttribute` routine, so `oldClass === newClass` will be true so we return early
5637
+ return undefined;
5638
+ }
5634
5639
  let res = '';
5635
5640
  if (shared.isString(value)) {
5636
5641
  res = value;
@@ -7275,9 +7280,11 @@ function textNodeContentsAreEqual(node, vnode, renderer) {
7275
7280
  // LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
7276
7281
  function getValidationPredicate(elm, renderer, optOutStaticProp) {
7277
7282
  // `data-lwc-host-mutated` is a special attribute added by the SSR engine itself,
7278
- // which does the same thing as an explicit `static validationOptOut = true`.
7279
- if (renderer.getAttribute(elm, 'data-lwc-host-mutated') === '') {
7280
- return (_attrName) => false;
7283
+ // which does the same thing as an explicit `static validationOptOut = ['attr1', 'attr2']`.
7284
+ const hostMutatedValue = renderer.getAttribute(elm, 'data-lwc-host-mutated');
7285
+ if (shared.isString(hostMutatedValue)) {
7286
+ const mutatedAttrValues = new Set(shared.StringSplit.call(hostMutatedValue, / /));
7287
+ return (attrName) => !mutatedAttrValues.has(attrName);
7281
7288
  }
7282
7289
  if (shared.isUndefined(optOutStaticProp)) {
7283
7290
  return (_attrName) => true;
@@ -8084,5 +8091,5 @@ exports.swapTemplate = swapTemplate;
8084
8091
  exports.track = track;
8085
8092
  exports.unwrap = unwrap;
8086
8093
  exports.wire = wire;
8087
- /** version: 7.1.0 */
8094
+ /** version: 7.1.2 */
8088
8095
  //# sourceMappingURL=index.cjs.js.map