@lwc/engine-core 7.0.5 → 7.1.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
@@ -3227,9 +3227,9 @@ function unrenderStylesheet(stylesheet) {
3227
3227
  }
3228
3228
  for (const cssContent of cssContents) {
3229
3229
  const abortController = cssContentToAbortControllers.get(cssContent);
3230
- /* istanbul ignore if */
3231
3230
  if (isUndefined$1(abortController)) {
3232
- throw new Error('Cannot find AbortController for CSS content');
3231
+ // Two stylesheets with the same content will share an abort controller, in which case it only needs to be called once.
3232
+ continue;
3233
3233
  }
3234
3234
  abortController.abort();
3235
3235
  // remove association with AbortController in case stylesheet is rendered again
@@ -5627,6 +5627,11 @@ function shc(content) {
5627
5627
  * https://github.com/vuejs/core/blob/e790e1bdd7df7be39e14780529db86e4da47a3db/packages/shared/src/normalizeProp.ts#L63-L82
5628
5628
  */
5629
5629
  function ncls(value) {
5630
+ if (isUndefined$1(value) || isNull(value)) {
5631
+ // Returning undefined here improves initial render cost, because the old vnode's class will be considered
5632
+ // undefined in the `patchClassAttribute` routine, so `oldClass === newClass` will be true so we return early
5633
+ return undefined;
5634
+ }
5630
5635
  let res = '';
5631
5636
  if (isString(value)) {
5632
5637
  res = value;
@@ -6691,7 +6696,14 @@ function runConnectedCallback(vm) {
6691
6696
  const { connectedCallback } = vm.def;
6692
6697
  if (!isUndefined$1(connectedCallback)) {
6693
6698
  logOperationStart(3 /* OperationId.ConnectedCallback */, vm);
6699
+ if (!process.env.IS_BROWSER) {
6700
+ // Track host element mutations in SSR mode to add the `data-lwc-host-mutated` attribute if necessary
6701
+ vm.renderer.startTrackingMutations(vm.elm);
6702
+ }
6694
6703
  invokeComponentCallback(vm, connectedCallback);
6704
+ if (!process.env.IS_BROWSER) {
6705
+ vm.renderer.stopTrackingMutations(vm.elm);
6706
+ }
6695
6707
  logOperationEnd(3 /* OperationId.ConnectedCallback */, vm);
6696
6708
  }
6697
6709
  // This test only makes sense in the browser, with synthetic lifecycle, and when reporting is enabled or
@@ -7262,7 +7274,12 @@ function textNodeContentsAreEqual(node, vnode, renderer) {
7262
7274
  // The validationOptOut static property can be an array of attribute names.
7263
7275
  // Any attribute names specified in that array will not be validated, and the
7264
7276
  // LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
7265
- function getValidationPredicate(optOutStaticProp) {
7277
+ function getValidationPredicate(elm, renderer, optOutStaticProp) {
7278
+ // `data-lwc-host-mutated` is a special attribute added by the SSR engine itself,
7279
+ // which does the same thing as an explicit `static validationOptOut = true`.
7280
+ if (renderer.getAttribute(elm, 'data-lwc-host-mutated') === '') {
7281
+ return (_attrName) => false;
7282
+ }
7266
7283
  if (isUndefined$1(optOutStaticProp)) {
7267
7284
  return (_attrName) => true;
7268
7285
  }
@@ -7380,7 +7397,7 @@ function hydrateElement(elm, vnode, renderer) {
7380
7397
  }
7381
7398
  function hydrateCustomElement(elm, vnode, renderer) {
7382
7399
  const { validationOptOut } = vnode.ctor;
7383
- const shouldValidateAttr = getValidationPredicate(validationOptOut);
7400
+ const shouldValidateAttr = getValidationPredicate(elm, renderer, validationOptOut);
7384
7401
  // The validationOptOut static property can be an array of attribute names.
7385
7402
  // Any attribute names specified in that array will not be validated, and the
7386
7403
  // LWC runtime will assume that VDOM attrs and DOM attrs are in sync.
@@ -8025,5 +8042,5 @@ function readonly(obj) {
8025
8042
  }
8026
8043
 
8027
8044
  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 };
8028
- /** version: 7.0.5 */
8045
+ /** version: 7.1.1 */
8029
8046
  //# sourceMappingURL=index.js.map