Disable window namespace overwrite (#1185)

* fix: window namespace overwrite

* refactor: move assignment to multiple lines

* refactor: disable namespace overwrite

* docs: update release changelog

* docs: add missing changelog

* rollup: revert namespace change
This commit is contained in:
Mark Wolff 2020-02-05 11:58:13 -08:00 коммит произвёл GitHub
Родитель b3f32df7bf
Коммит 7d60cd68b7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
17 изменённых файлов: 60 добавлений и 53 удалений

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-web",
"version": "2.4.3",
"version": "2.4.4",
"description": "Microsoft Application Insights Javascript SDK API 1.0 beta",
"main": "dist/applicationinsights-web.js",
"module": "dist-esm/applicationinsights-web.js",
@ -49,12 +49,12 @@
"typescript": "2.5.3"
},
"dependencies": {
"@microsoft/applicationinsights-analytics-js": "2.4.3",
"@microsoft/applicationinsights-channel-js": "2.4.3",
"@microsoft/applicationinsights-common": "2.4.3",
"@microsoft/applicationinsights-core-js": "2.4.3",
"@microsoft/applicationinsights-dependencies-js": "2.4.3",
"@microsoft/applicationinsights-properties-js": "2.4.3",
"@microsoft/applicationinsights-analytics-js": "2.4.4",
"@microsoft/applicationinsights-channel-js": "2.4.4",
"@microsoft/applicationinsights-common": "2.4.4",
"@microsoft/applicationinsights-core-js": "2.4.4",
"@microsoft/applicationinsights-dependencies-js": "2.4.4",
"@microsoft/applicationinsights-properties-js": "2.4.4",
"tslib": "^1.9.3"
}
}

Просмотреть файл

@ -18,7 +18,7 @@ const browserRollupConfigFactory = (isProduction, libVersion = '2') => {
file: `browser/ai.${libVersion}.js`,
banner: banner,
format: "umd",
name: "Microsoft.ApplicationInsightsJS",
name: "Microsoft.ApplicationInsights",
sourcemap: true
},
plugins: [
@ -61,7 +61,7 @@ const nodeUmdRollupConfigFactory = (isProduction) => {
file: `dist/applicationinsights-web.js`,
banner: banner,
format: "umd",
name: "Microsoft.ApplicationInsightsJS",
name: "Microsoft.ApplicationInsights",
sourcemap: true
},
plugins: [

Просмотреть файл

@ -48,13 +48,13 @@ try {
// Hack: If legacy SDK exists, skip this step (Microsoft.ApplicationInsights exists).
// else write what was there for v2 SDK prior to rollup bundle output name change.
// e.g Microsoft.ApplicationInsights.ApplicationInsights, Microsoft.ApplicationInsights.Telemetry
if (typeof window !== Undefined && window && !((window as any).Microsoft && (window as any).Microsoft.ApplicationInsights)) {
(window as any).Microsoft = {
ApplicationInsights: {
ApplicationInsights, Telemetry
}
}
}
// @todo uncomment once integration tests for this can be added
// if (typeof window !== Undefined && window && ((window as any).Microsoft && !(window as any).Microsoft.ApplicationInsights)) {
// (window as any).Microsoft = (window as any).Microsoft || {};
// (window as any).Microsoft.ApplicationInsights = {
// ApplicationInsights, Telemetry
// };
// }
} catch (e) {
_logWarn(aiName, e.message);
}

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-web-basic",
"version": "2.4.3",
"version": "2.4.4",
"description": "Microsoft Application Insights Javascript SDK core and channel",
"main": "dist/applicationinsights-web-basic.js",
"module": "dist-esm/index.js",
@ -26,9 +26,9 @@
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/applicationinsights-common": "2.4.3",
"@microsoft/applicationinsights-channel-js": "2.4.3",
"@microsoft/applicationinsights-core-js": "2.4.3"
"@microsoft/applicationinsights-common": "2.4.4",
"@microsoft/applicationinsights-channel-js": "2.4.4",
"@microsoft/applicationinsights-core-js": "2.4.4"
},
"peerDependencies": {
"tslib": "^1.9.3"

Просмотреть файл

@ -1,5 +1,12 @@
# Releases
## 2.4.4
### Changelog
- #1182 Fix error TS2430: Interface 'Window' incorrectly extends interface 'WindowEventHandlers'
- #1185 Rollback namespace overwrite change
## 2.4.3
## Changelog
@ -102,7 +109,7 @@ To assist with creating plugins we have also introduced a base class that you ca
Patch release containing fixes to automatic Single Page Application route change tracking via `enableAutoRouteTracking`
### Changelog
#970 - Fixes #967 #969
#970 - Fixes #967 #969
## v 2.1.0
### Highlights
@ -141,13 +148,13 @@ appInsights.trackException({ error: new Error() });
appInsights.trackException({ exception: new Error() });
```
### Correlation Header Domain Whitelisting #869
### Correlation Header Domain Whitelisting #869
Second, the ability to only send correlation headers to specific, whitelisted domains is now available as a configuration option , `correlationHeaderDomains`. It accepts an `array` of domain `strings`. Wildcards ("*") are okay. By populating this array, all other domains which your application makes requests to will **not** have correlation headers included. This setting makes it easy to avoid OPTIONS requests to services outside of your control.
You can use the inclusion list and the exclusion list in conjunction with each other to add correlation headers to a particular domain, `example.com`, and at the same time exclude headers from a prefixed version of it, `no-headers.example.com`.
### Tag Override Change #903
### Tag Override Change #903
Performing custom tag overrides is now more consistent with all of the other Application Insights SDKs, in that it is modified via a simple key-value dictionary. There are no breaking changes with this update, and if you are setting any tags via the old way, they will still work as they do now. You are encouraged to update them since the old way will be deprecated in a future major version release.

Просмотреть файл

@ -260,7 +260,7 @@ export class SenderTests extends TestClass {
}
},
tags: [{"ai.internal.sdkVersion": "javascript:2.4.3"}],
tags: [{"ai.internal.sdkVersion": "javascript:2.4.4"}],
data: {
"property1": "val1",
"measurement1": 50.0,
@ -305,7 +305,7 @@ export class SenderTests extends TestClass {
Assert.equal("d041d2e5fa834b4f9eee41ac163bf402", appInsightsEnvelope.tags["ai.session.id"]);
Assert.equal("browser", appInsightsEnvelope.tags["ai.device.id"]);
Assert.equal("Browser", appInsightsEnvelope.tags["ai.device.type"]);
Assert.equal("javascript:2.4.3", appInsightsEnvelope.tags["ai.internal.sdkVersion"]);
Assert.equal("javascript:2.4.4", appInsightsEnvelope.tags["ai.internal.sdkVersion"]);
// Assert name
Assert.ok(appInsightsEnvelope.name);
@ -375,7 +375,7 @@ export class SenderTests extends TestClass {
Assert.ok(baseData.ver);
Assert.equal(2, baseData.ver);
Assert.equal("javascript:2.4.3", appInsightsEnvelope.tags["ai.internal.sdkVersion"]);
Assert.equal("javascript:2.4.4", appInsightsEnvelope.tags["ai.internal.sdkVersion"]);
}
})

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-channel-js",
"version": "2.4.3",
"version": "2.4.4",
"description": "Microsoft Application Insights JavaScript SDK Channel",
"main": "dist/applicationinsights-channel-js.js",
"module": "dist-esm/applicationinsights-channel-js.js",
@ -31,8 +31,8 @@
"rollup": "^0.66.0"
},
"dependencies": {
"@microsoft/applicationinsights-core-js": "2.4.3",
"@microsoft/applicationinsights-common": "2.4.3",
"@microsoft/applicationinsights-core-js": "2.4.4",
"@microsoft/applicationinsights-common": "2.4.4",
"tslib": "^1.9.3"
},
"license": "MIT"

Просмотреть файл

@ -20,7 +20,7 @@ const baseType: string = "baseType";
const baseData: string = "baseData";
export abstract class EnvelopeCreator {
public static Version = "2.4.3";
public static Version = "2.4.4";
protected static extractPropsAndMeasurements(data: { [key: string]: any }, properties: { [key: string]: any }, measurements: { [key: string]: any }) {
if (!CoreUtils.isNullOrUndefined(data)) {

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-analytics-js",
"version": "2.4.3",
"version": "2.4.4",
"description": "Microsoft Application Insights Javascript SDK apis",
"main": "dist/applicationinsights-analytics-js.js",
"module": "dist-esm/applicationinsights-analytics-js.js",
@ -19,7 +19,7 @@
},
"devDependencies": {
"@microsoft/applicationinsights-rollup-es3" : "1.1.1",
"@microsoft/applicationinsights-properties-js": "2.4.3",
"@microsoft/applicationinsights-properties-js": "2.4.4",
"typescript": "2.5.3",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-replace": "^2.1.0",
@ -33,8 +33,8 @@
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/applicationinsights-core-js": "2.4.3",
"@microsoft/applicationinsights-common": "2.4.3",
"@microsoft/applicationinsights-core-js": "2.4.4",
"@microsoft/applicationinsights-common": "2.4.4",
"tslib": "^1.9.3"
},
"license": "MIT"

Просмотреть файл

@ -36,7 +36,7 @@ function _dispatchEvent(target:EventTarget, evnt: Event) {
}
export class ApplicationInsights extends BaseTelemetryPlugin implements IAppInsights, IAppInsightsInternal {
public static Version = "2.4.3"; // Not currently used anywhere
public static Version = "2.4.4"; // Not currently used anywhere
public static getDefaultConfig(config?: IConfig): IConfig {
if (!config) {
@ -50,7 +50,7 @@ export class ApplicationInsights extends BaseTelemetryPlugin implements IAppInsi
config.autoTrackPageVisitTime = Util.stringToBoolOrDefault(config.autoTrackPageVisitTime);
config.overridePageViewDuration = Util.stringToBoolOrDefault(config.overridePageViewDuration);
config.enableUnhandledPromiseRejectionTracking = Util.stringToBoolOrDefault(config.enableUnhandledPromiseRejectionTracking);
if (isNaN(config.samplingPercentage) || config.samplingPercentage <= 0 || config.samplingPercentage >= 100) {
config.samplingPercentage = 100;
}
@ -643,7 +643,7 @@ export class ApplicationInsights extends BaseTelemetryPlugin implements IAppInsi
_window.addEventListener(_self.config.namePrefix + "popstate",()=>{
_dispatchEvent(_window, Util.createDomEvent(_self.config.namePrefix + "locationchange"));
});
_window.addEventListener(_self.config.namePrefix + "locationchange", () => {
if (_self._properties && _self._properties.context && _self._properties.context.telemetryTrace) {
_self._properties.context.telemetryTrace.traceID = Util.generateW3CId();

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-angular-js",
"version": "2.4.3",
"version": "2.4.4",
"description": "Microsoft Application Insights Angular plugin",
"main": "dist/applicationinsights-angular-js.js",
"module": "dist-esm/applicationinsights-angular-js.js",
@ -38,8 +38,8 @@
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/applicationinsights-common": "2.4.3",
"@microsoft/applicationinsights-core-js": "2.4.3",
"@microsoft/applicationinsights-common": "2.4.4",
"@microsoft/applicationinsights-core-js": "2.4.4",
"tslib": "^1.9.3"
},
"license": "MIT"

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-dependencies-js",
"version": "2.4.3",
"version": "2.4.4",
"description": "Microsoft Application Insights XHR dependencies plugin",
"main": "dist/applicationinsights-dependencies-js.js",
"module": "dist-esm/applicationinsights-dependencies-js.js",
@ -32,8 +32,8 @@
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/applicationinsights-core-js": "2.4.3",
"@microsoft/applicationinsights-common": "2.4.3",
"@microsoft/applicationinsights-core-js": "2.4.4",
"@microsoft/applicationinsights-common": "2.4.4",
"tslib": "^1.9.3"
},
"license": "MIT"

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-properties-js",
"version": "2.4.3",
"version": "2.4.4",
"description": "Microsoft Application Insights properties (Part A) plugin",
"main": "dist/applicationinsights-properties-js.js",
"module": "dist-esm/applicationinsights-properties-js.js",
@ -32,8 +32,8 @@
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/applicationinsights-core-js": "2.4.3",
"@microsoft/applicationinsights-common": "2.4.3",
"@microsoft/applicationinsights-core-js": "2.4.4",
"@microsoft/applicationinsights-common": "2.4.4",
"tslib": "^1.9.3"
},
"license": "MIT"

Просмотреть файл

@ -4,7 +4,7 @@
import { IInternal } from '@microsoft/applicationinsights-common';
import { ITelemetryConfig } from '../Interfaces/ITelemetryConfig';
const Version = "2.4.3";
const Version = "2.4.4";
export class Internal implements IInternal {

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-react-js",
"version": "2.4.3",
"version": "2.4.4",
"description": "Microsoft Application Insights React plugin",
"main": "dist/applicationinsights-react-js.js",
"module": "dist-esm/applicationinsights-react-js.js",
@ -42,8 +42,8 @@
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/applicationinsights-core-js": "2.4.3",
"@microsoft/applicationinsights-common": "2.4.3",
"@microsoft/applicationinsights-core-js": "2.4.4",
"@microsoft/applicationinsights-common": "2.4.4",
"tslib": "^1.9.3",
"react": "^16.8.6",
"history": "^4.9.0"

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-common",
"version": "2.4.3",
"version": "2.4.4",
"description": "Microsoft Application Insights Common JavaScript Library",
"main": "./dist/applicationinsights-common.js",
"module": "./dist-esm/applicationinsights-common.js",
@ -33,7 +33,7 @@
"rollup": "^0.66.0"
},
"dependencies": {
"@microsoft/applicationinsights-core-js": "2.4.3",
"@microsoft/applicationinsights-core-js": "2.4.4",
"tslib": "^1.9.3"
},
"license": "MIT"

Просмотреть файл

@ -1,7 +1,7 @@
{
"name": "@microsoft/applicationinsights-core-js",
"author": "Microsoft Corporation",
"version": "2.4.3",
"version": "2.4.4",
"description": "Microsoft Application Insights Core Javascript SDK",
"keywords": [
"azure",