@lwc/engine-core 5.0.2 → 5.0.3

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.
@@ -1,10 +1,12 @@
1
+ import { ShadowMode } from './vm';
1
2
  export declare const enum ReportingEventId {
2
3
  CrossRootAriaInSyntheticShadow = "CrossRootAriaInSyntheticShadow",
3
4
  CompilerRuntimeVersionMismatch = "CompilerRuntimeVersionMismatch",
4
5
  NonStandardAriaReflection = "NonStandardAriaReflection",
5
6
  TemplateMutation = "TemplateMutation",
6
7
  StylesheetMutation = "StylesheetMutation",
7
- ConnectedCallbackWhileDisconnected = "ConnectedCallbackWhileDisconnected"
8
+ ConnectedCallbackWhileDisconnected = "ConnectedCallbackWhileDisconnected",
9
+ ShadowModeUsage = "ShadowModeUsage"
8
10
  }
9
11
  export interface BasePayload {
10
12
  tagName?: string;
@@ -29,6 +31,9 @@ export interface StylesheetMutationPayload extends BasePayload {
29
31
  }
30
32
  export interface ConnectedCallbackWhileDisconnectedPayload extends BasePayload {
31
33
  }
34
+ export interface ShadowModeUsagePayload extends BasePayload {
35
+ mode: ShadowMode;
36
+ }
32
37
  export type ReportingPayloadMapping = {
33
38
  [ReportingEventId.CrossRootAriaInSyntheticShadow]: CrossRootAriaInSyntheticShadowPayload;
34
39
  [ReportingEventId.CompilerRuntimeVersionMismatch]: CompilerRuntimeVersionMismatchPayload;
@@ -36,6 +41,7 @@ export type ReportingPayloadMapping = {
36
41
  [ReportingEventId.TemplateMutation]: TemplateMutationPayload;
37
42
  [ReportingEventId.StylesheetMutation]: StylesheetMutationPayload;
38
43
  [ReportingEventId.ConnectedCallbackWhileDisconnected]: ConnectedCallbackWhileDisconnectedPayload;
44
+ [ReportingEventId.ShadowModeUsage]: ShadowModeUsagePayload;
39
45
  };
40
46
  export type ReportingDispatcher<T extends ReportingEventId = ReportingEventId> = (reportingEventId: T, payload: ReportingPayloadMapping[T]) => void;
41
47
  /** Callbacks to invoke when reporting is enabled **/
package/dist/index.cjs.js CHANGED
@@ -5810,6 +5810,13 @@ function createVM(elm, ctor, renderer, options) {
5810
5810
  vm.stylesheets = computeStylesheets(vm, def.ctor);
5811
5811
  vm.shadowMode = computeShadowMode(def, vm.owner, renderer);
5812
5812
  vm.tro = getTemplateReactiveObserver(vm);
5813
+ // We don't need to report the shadow mode if we're rendering in light DOM
5814
+ if (isReportingEnabled() && vm.renderMode === 1 /* RenderMode.Shadow */) {
5815
+ report("ShadowModeUsage" /* ReportingEventId.ShadowModeUsage */, {
5816
+ tagName: vm.tagName,
5817
+ mode: vm.shadowMode,
5818
+ });
5819
+ }
5813
5820
  if (process.env.NODE_ENV !== 'production') {
5814
5821
  vm.toString = () => {
5815
5822
  return `[object:vm ${def.name} (${vm.idx})]`;
@@ -7352,5 +7359,5 @@ exports.swapTemplate = swapTemplate;
7352
7359
  exports.track = track;
7353
7360
  exports.unwrap = unwrap;
7354
7361
  exports.wire = wire;
7355
- /** version: 5.0.2 */
7362
+ /** version: 5.0.3 */
7356
7363
  //# sourceMappingURL=index.cjs.js.map