@microsoft/applicationinsights-react-js 19.3.9-nightly.2604-01 → 19.4.0

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.
Files changed (31) hide show
  1. package/browser/applicationinsights-react-js.js +19 -25
  2. package/browser/applicationinsights-react-js.js.map +1 -1
  3. package/browser/applicationinsights-react-js.min.js +2 -2
  4. package/browser/applicationinsights-react-js.min.js.map +1 -1
  5. package/dist/applicationinsights-react-js.api.json +19 -40
  6. package/dist/applicationinsights-react-js.api.md +11 -14
  7. package/dist/applicationinsights-react-js.d.ts +20 -21
  8. package/dist/applicationinsights-react-js.js +19 -25
  9. package/dist/applicationinsights-react-js.js.map +1 -1
  10. package/dist/applicationinsights-react-js.min.js +2 -2
  11. package/dist/applicationinsights-react-js.min.js.map +1 -1
  12. package/dist/applicationinsights-react-js.rollup.d.ts +20 -21
  13. package/dist-esm/AppInsightsContext.js +1 -1
  14. package/dist-esm/AppInsightsErrorBoundary.js +13 -8
  15. package/dist-esm/AppInsightsErrorBoundary.js.map +1 -1
  16. package/dist-esm/Interfaces/IReactExtensionConfig.js +1 -1
  17. package/dist-esm/ReactPlugin.js +7 -6
  18. package/dist-esm/ReactPlugin.js.map +1 -1
  19. package/dist-esm/applicationinsights-react-js.js +1 -1
  20. package/dist-esm/useTrackEvent.js +1 -1
  21. package/dist-esm/useTrackMetric.js +1 -1
  22. package/dist-esm/withAITracking.js +5 -5
  23. package/dist-esm/withAITracking.js.map +1 -1
  24. package/package.json +79 -83
  25. package/src/AppInsightsErrorBoundary.tsx +17 -8
  26. package/src/ReactPlugin.ts +13 -13
  27. package/src/withAITracking.tsx +5 -5
  28. package/types/AppInsightsErrorBoundary.d.ts +5 -5
  29. package/types/ReactPlugin.d.ts +4 -5
  30. package/types/tsdoc-metadata.json +1 -1
  31. package/types/withAITracking.d.ts +4 -4
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation. All rights reserved.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { IMetricTelemetry } from '@microsoft/applicationinsights-common';
4
+ import { IMetricTelemetry } from '@microsoft/applicationinsights-core-js';
5
5
  import { dateNow } from '@microsoft/applicationinsights-core-js';
6
6
  import * as React from 'react';
7
7
  import ReactPlugin from './ReactPlugin';
@@ -92,10 +92,10 @@ export abstract class AITrackedComponentBase<P> extends React.Component<P> {
92
92
  * Higher-order component function to hook Application Insights tracking
93
93
  * in a React component's lifecycle.
94
94
  *
95
- * @param reactPlugin ReactPlugin instance
96
- * @param Component the React component to be instrumented
97
- * @param componentName (optional) component name
98
- * @param className (optional) className of the HOC div
95
+ * @param reactPlugin - ReactPlugin instance
96
+ * @param Component - the React component to be instrumented
97
+ * @param componentName - (optional) component name
98
+ * @param className - (optional) className of the HOC div
99
99
  */
100
100
  export default function withAITracking<P>(reactPlugin: ReactPlugin, Component: React.ComponentType<P>, componentName?: string, className?: string): React.ComponentClass<P> {
101
101
 
@@ -3,15 +3,15 @@ import ReactPlugin from "./ReactPlugin";
3
3
  export interface IAppInsightsErrorBoundaryProps {
4
4
  appInsights: ReactPlugin;
5
5
  onError: React.ComponentType<any>;
6
- children: React.ReactElement;
6
+ children: React.ReactNode;
7
7
  }
8
8
  export interface IAppInsightsErrorBoundaryState {
9
9
  hasError: boolean;
10
+ error: Error | null;
11
+ errorInfo: React.ErrorInfo | null;
10
12
  }
11
13
  export default class AppInsightsErrorBoundary extends React.Component<IAppInsightsErrorBoundaryProps, IAppInsightsErrorBoundaryState> {
12
- state: {
13
- hasError: boolean;
14
- };
14
+ state: IAppInsightsErrorBoundaryState;
15
15
  componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
16
- render(): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
16
+ render(): React.ReactNode;
17
17
  }
@@ -2,14 +2,13 @@
2
2
  * ReactPlugin.ts
3
3
  * @copyright Microsoft 2019
4
4
  */
5
- import { IAppInsights, IConfig, IEventTelemetry, IExceptionTelemetry, IMetricTelemetry, IPageViewTelemetry, ITraceTelemetry, ITelemetryContext as Common_ITelemetryContext } from "@microsoft/applicationinsights-common";
6
- import { BaseTelemetryPlugin, IAppInsightsCore, IConfiguration, ICookieMgr, ICustomProperties, IPlugin, IProcessTelemetryContext, ITelemetryItem, ITelemetryPluginChain } from "@microsoft/applicationinsights-core-js";
5
+ import { IAppInsights, IEventTelemetry, IExceptionTelemetry, IMetricTelemetry, IPageViewTelemetry, ITraceTelemetry, ITelemetryContext as Common_ITelemetryContext, BaseTelemetryPlugin, IAppInsightsCore, IConfiguration, ICookieMgr, ICustomProperties, IPlugin, IProcessTelemetryContext, ITelemetryItem, ITelemetryPluginChain } from "@microsoft/applicationinsights-core-js";
7
6
  export default class ReactPlugin extends BaseTelemetryPlugin {
8
7
  priority: number;
9
8
  identifier: string;
10
9
  readonly context: Common_ITelemetryContext;
11
10
  constructor();
12
- initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
11
+ initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
13
12
  /**
14
13
  * Get the current cookie manager for this instance
15
14
  */
@@ -20,9 +19,9 @@ export default class ReactPlugin extends BaseTelemetryPlugin {
20
19
  getAppInsights(): IAppInsights;
21
20
  /**
22
21
  * Add Part A fields to the event
23
- * @param event The event that needs to be processed
22
+ * @param env The event that needs to be processed
24
23
  */
25
- processTelemetry(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
24
+ processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
26
25
  trackMetric(metric: IMetricTelemetry, customProperties: ICustomProperties): void;
27
26
  trackPageView(pageView: IPageViewTelemetry): void;
28
27
  trackEvent(event: IEventTelemetry, customProperties?: ICustomProperties): void;
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.8"
8
+ "packageVersion": "7.58.1"
9
9
  }
10
10
  ]
11
11
  }
@@ -25,9 +25,9 @@ export declare abstract class AITrackedComponentBase<P> extends React.Component<
25
25
  * Higher-order component function to hook Application Insights tracking
26
26
  * in a React component's lifecycle.
27
27
  *
28
- * @param reactPlugin ReactPlugin instance
29
- * @param Component the React component to be instrumented
30
- * @param componentName (optional) component name
31
- * @param className (optional) className of the HOC div
28
+ * @param reactPlugin - ReactPlugin instance
29
+ * @param Component - the React component to be instrumented
30
+ * @param componentName - (optional) component name
31
+ * @param className - (optional) className of the HOC div
32
32
  */
33
33
  export default function withAITracking<P>(reactPlugin: ReactPlugin, Component: React.ComponentType<P>, componentName?: string, className?: string): React.ComponentClass<P>;