[Release][React] - Increase versions React 3.0.3 (#1354)
[Release][ReactNative] - Increase versions ReactNative 2.2.7
This commit is contained in:
Родитель
81afc5400d
Коммит
5bd00322e3
|
@ -16,6 +16,14 @@
|
|||
- #1350 [BUG] The new IPerfEvent is using Date.now() which is not supported in an ES3 environment
|
||||
- Added additional checks for Date.now() and Performance Api perf.now()
|
||||
|
||||
### Update React plugin to v3.0.3
|
||||
|
||||
- Update Core dependency to ^2.5.8 Core changes
|
||||
|
||||
### Update React Native plugin to v2.2.7
|
||||
|
||||
- Update Core dependency to ^2.5.8 Core changes
|
||||
|
||||
## 2.5.7 (August 7th, 2020)
|
||||
|
||||
### Changelog
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@microsoft/applicationinsights-react-js",
|
||||
"version": "3.0.2",
|
||||
"version": "3.0.3",
|
||||
"description": "Microsoft Application Insights React plugin",
|
||||
"main": "dist/applicationinsights-react-js.js",
|
||||
"module": "dist-esm/applicationinsights-react-js.js",
|
||||
|
@ -20,7 +20,7 @@
|
|||
"lint": "tslint -p tsconfig.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.2",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@types/enzyme": "3.1.8",
|
||||
"@types/history": "4.7.2",
|
||||
"@types/jest": "^24.0.11",
|
||||
|
@ -47,8 +47,8 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@microsoft/applicationinsights-shims": "^1.0.1",
|
||||
"@microsoft/applicationinsights-core-js": "^2.5.7",
|
||||
"@microsoft/applicationinsights-common": "^2.5.7",
|
||||
"@microsoft/applicationinsights-core-js": "^2.5.8",
|
||||
"@microsoft/applicationinsights-common": "^2.5.8",
|
||||
"history": "^4.10.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { useEffect, useRef } from "react";
|
||||
import { CoreUtils } from "@microsoft/applicationinsights-core-js";
|
||||
import ReactPlugin from "./ReactPlugin";
|
||||
|
||||
interface ITrackedData {
|
||||
|
@ -13,7 +14,7 @@ interface ITrackedData {
|
|||
|
||||
function getEngagementTimeSeconds(trackedData: ITrackedData) {
|
||||
return (
|
||||
(Date.now() -
|
||||
(CoreUtils.dateNow() -
|
||||
trackedData.firstActiveTimestamp -
|
||||
trackedData.totalIdleTime -
|
||||
trackedData.idleCount * trackedData.idleTimeout) /
|
||||
|
@ -26,7 +27,7 @@ const useComponentTracking = (
|
|||
componentName: string
|
||||
) => {
|
||||
const tracking = useRef<ITrackedData>({
|
||||
hookTimestamp: Date.now(),
|
||||
hookTimestamp: CoreUtils.dateNow(),
|
||||
firstActiveTimestamp: 0,
|
||||
totalIdleTime: 0,
|
||||
lastActiveTimestamp: 0,
|
||||
|
@ -41,9 +42,9 @@ const useComponentTracking = (
|
|||
if (
|
||||
trackedData.lastActiveTimestamp > 0 &&
|
||||
trackedData.idleStartTimestamp === 0 &&
|
||||
Date.now() - trackedData.lastActiveTimestamp >= trackedData.idleTimeout
|
||||
CoreUtils.dateNow() - trackedData.lastActiveTimestamp >= trackedData.idleTimeout
|
||||
) {
|
||||
trackedData.idleStartTimestamp = Date.now();
|
||||
trackedData.idleStartTimestamp = CoreUtils.dateNow();
|
||||
trackedData.idleCount++;
|
||||
}
|
||||
};
|
||||
|
@ -83,10 +84,10 @@ const useComponentTracking = (
|
|||
const trackActivity = () => {
|
||||
let trackedData = tracking.current;
|
||||
if (trackedData.firstActiveTimestamp === 0) {
|
||||
trackedData.firstActiveTimestamp = Date.now();
|
||||
trackedData.firstActiveTimestamp = CoreUtils.dateNow();
|
||||
trackedData.lastActiveTimestamp = trackedData.firstActiveTimestamp;
|
||||
} else {
|
||||
trackedData.lastActiveTimestamp = Date.now();
|
||||
trackedData.lastActiveTimestamp = CoreUtils.dateNow();
|
||||
}
|
||||
|
||||
if (trackedData.idleStartTimestamp > 0) {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT License.
|
||||
|
||||
import { IMetricTelemetry } from '@microsoft/applicationinsights-common';
|
||||
import { CoreUtils } from '@microsoft/applicationinsights-core-js';
|
||||
import * as React from 'react';
|
||||
import ReactPlugin from './ReactPlugin';
|
||||
|
||||
|
@ -38,7 +39,7 @@ export default function withAITracking<P>(reactPlugin: ReactPlugin, Component: R
|
|||
private _intervalId?: any;
|
||||
|
||||
public componentDidMount() {
|
||||
this._mountTimestamp = Date.now();
|
||||
this._mountTimestamp = CoreUtils.dateNow();
|
||||
this._firstActiveTimestamp = 0;
|
||||
this._totalIdleTime = 0;
|
||||
this._lastActiveTimestamp = 0;
|
||||
|
@ -46,8 +47,8 @@ export default function withAITracking<P>(reactPlugin: ReactPlugin, Component: R
|
|||
this._idleCount = 0;
|
||||
|
||||
this._intervalId = setInterval(() => {
|
||||
if (this._lastActiveTimestamp > 0 && this._idleStartTimestamp === 0 && Date.now() - this._lastActiveTimestamp >= this._idleTimeout) {
|
||||
this._idleStartTimestamp = Date.now();
|
||||
if (this._lastActiveTimestamp > 0 && this._idleStartTimestamp === 0 && CoreUtils.dateNow() - this._lastActiveTimestamp >= this._idleTimeout) {
|
||||
this._idleStartTimestamp = CoreUtils.dateNow();
|
||||
this._idleCount++;
|
||||
}
|
||||
}, 100);
|
||||
|
@ -94,10 +95,10 @@ export default function withAITracking<P>(reactPlugin: ReactPlugin, Component: R
|
|||
|
||||
private trackActivity = (e: React.SyntheticEvent<any>): void => {
|
||||
if (this._firstActiveTimestamp === 0) {
|
||||
this._firstActiveTimestamp = Date.now();
|
||||
this._firstActiveTimestamp = CoreUtils.dateNow();
|
||||
this._lastActiveTimestamp = this._firstActiveTimestamp;
|
||||
} else {
|
||||
this._lastActiveTimestamp = Date.now();
|
||||
this._lastActiveTimestamp = CoreUtils.dateNow();
|
||||
}
|
||||
|
||||
if (this._idleStartTimestamp > 0) {
|
||||
|
@ -108,7 +109,7 @@ export default function withAITracking<P>(reactPlugin: ReactPlugin, Component: R
|
|||
}
|
||||
|
||||
private getEngagementTimeSeconds(): number {
|
||||
return (Date.now() - this._firstActiveTimestamp - this._totalIdleTime - this._idleCount * this._idleTimeout) / 1000;
|
||||
return (CoreUtils.dateNow() - this._firstActiveTimestamp - this._totalIdleTime - this._idleCount * this._idleTimeout) / 1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@microsoft/applicationinsights-react-native",
|
||||
"version": "2.2.6",
|
||||
"version": "2.2.7",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -886,18 +886,18 @@
|
|||
}
|
||||
},
|
||||
"@microsoft/applicationinsights-common": {
|
||||
"version": "2.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-2.5.7.tgz",
|
||||
"integrity": "sha512-s3zMAKur8uPMa9+ncLod/WvPbeDqxuRXUqRRaz3Pff2NU9yhUMUWnEW31YcCg7f20lcU9D0p9vtw0Zvyq6CWcA==",
|
||||
"version": "2.5.8",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-2.5.8.tgz",
|
||||
"integrity": "sha512-RIMAJTsF0H5wiRZxYIF9H8sbMe2W5Ig4yMuH0/lho69DcNZpHf8p6PSa4Qhhli0AnoWYfLE7/WlWO1eR5SkByw==",
|
||||
"requires": {
|
||||
"@microsoft/applicationinsights-core-js": "2.5.7",
|
||||
"@microsoft/applicationinsights-core-js": "2.5.8",
|
||||
"@microsoft/applicationinsights-shims": "1.0.1"
|
||||
}
|
||||
},
|
||||
"@microsoft/applicationinsights-core-js": {
|
||||
"version": "2.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.5.7.tgz",
|
||||
"integrity": "sha512-afFP3m23YorXcRIaRx2WJsmDBvFsLmMPqqT/nsjIjyRufmthFKWLqzikdePCWRar1QpB+7EVVadnX0fUQ3W6kw==",
|
||||
"version": "2.5.8",
|
||||
"resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.5.8.tgz",
|
||||
"integrity": "sha512-NxxIViHKuqgpla+KdQk7Qy48Dm8lN4oy2mMEpv9kM5GW5MBJ8nZ4A5RV1kokF3kXuDmTUTHlWBXeLR8hauA3qQ==",
|
||||
"requires": {
|
||||
"@microsoft/applicationinsights-shims": "1.0.1",
|
||||
"@microsoft/dynamicproto-js": "^1.0.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@microsoft/applicationinsights-react-native",
|
||||
"version": "2.2.6",
|
||||
"version": "2.2.7",
|
||||
"description": "Microsoft Application Insights React Native Plugin",
|
||||
"main": "dist-esm/index.js",
|
||||
"types": "dist-esm/index.d.ts",
|
||||
|
@ -38,8 +38,8 @@
|
|||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.0.0",
|
||||
"@microsoft/applicationinsights-shims": "^1.0.1",
|
||||
"@microsoft/applicationinsights-common": "^2.5.7",
|
||||
"@microsoft/applicationinsights-core-js": "^2.5.7"
|
||||
"@microsoft/applicationinsights-common": "^2.5.8",
|
||||
"@microsoft/applicationinsights-core-js": "^2.5.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react-native": "*",
|
||||
|
|
Загрузка…
Ссылка в новой задаче