Skip to content

Commit

Permalink
Disable window namespace overwrite (#1185)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Mark Wolff authored Feb 5, 2020
1 parent b3f32df commit 7d60cd6
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 53 deletions.
14 changes: 7 additions & 7 deletions AISKU/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
}
}
4 changes: 2 additions & 2 deletions AISKU/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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: [
Expand Down
14 changes: 7 additions & 7 deletions AISKU/src/Init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
8 changes: 4 additions & 4 deletions AISKULight/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down
13 changes: 10 additions & 3 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions channels/applicationinsights-channel-js/Tests/Sender.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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"]);

}
})
Expand Down
6 changes: 3 additions & 3 deletions channels/applicationinsights-channel-js/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
8 changes: 4 additions & 4 deletions extensions/applicationinsights-analytics-js/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions extensions/applicationinsights-angular-js/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions extensions/applicationinsights-dependencies-js/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions extensions/applicationinsights-properties-js/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
6 changes: 3 additions & 3 deletions extensions/applicationinsights-react-js/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions shared/AppInsightsCommon/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion shared/AppInsightsCore/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 7d60cd6

Please sign in to comment.