@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.
- package/browser/applicationinsights-react-js.js +19 -25
- package/browser/applicationinsights-react-js.js.map +1 -1
- package/browser/applicationinsights-react-js.min.js +2 -2
- package/browser/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.api.json +19 -40
- package/dist/applicationinsights-react-js.api.md +11 -14
- package/dist/applicationinsights-react-js.d.ts +20 -21
- package/dist/applicationinsights-react-js.js +19 -25
- package/dist/applicationinsights-react-js.js.map +1 -1
- package/dist/applicationinsights-react-js.min.js +2 -2
- package/dist/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.rollup.d.ts +20 -21
- package/dist-esm/AppInsightsContext.js +1 -1
- package/dist-esm/AppInsightsErrorBoundary.js +13 -8
- package/dist-esm/AppInsightsErrorBoundary.js.map +1 -1
- package/dist-esm/Interfaces/IReactExtensionConfig.js +1 -1
- package/dist-esm/ReactPlugin.js +7 -6
- package/dist-esm/ReactPlugin.js.map +1 -1
- package/dist-esm/applicationinsights-react-js.js +1 -1
- package/dist-esm/useTrackEvent.js +1 -1
- package/dist-esm/useTrackMetric.js +1 -1
- package/dist-esm/withAITracking.js +5 -5
- package/dist-esm/withAITracking.js.map +1 -1
- package/package.json +79 -83
- package/src/AppInsightsErrorBoundary.tsx +17 -8
- package/src/ReactPlugin.ts +13 -13
- package/src/withAITracking.tsx +5 -5
- package/types/AppInsightsErrorBoundary.d.ts +5 -5
- package/types/ReactPlugin.d.ts +4 -5
- package/types/tsdoc-metadata.json +1 -1
- package/types/withAITracking.d.ts +4 -4
package/src/withAITracking.tsx
CHANGED
|
@@ -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-
|
|
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.
|
|
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.
|
|
16
|
+
render(): React.ReactNode;
|
|
17
17
|
}
|
package/types/ReactPlugin.d.ts
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
* ReactPlugin.ts
|
|
3
3
|
* @copyright Microsoft 2019
|
|
4
4
|
*/
|
|
5
|
-
import { IAppInsights,
|
|
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
|
|
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
|
|
22
|
+
* @param env The event that needs to be processed
|
|
24
23
|
*/
|
|
25
|
-
processTelemetry(
|
|
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;
|
|
@@ -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>;
|