Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into MSNev/beta (#1821)
Browse files Browse the repository at this point in the history
* Update version.json (#1767)

* [Release] Increase version to 2.7.4 (#1770)

- Updates React Plugin to v3.2.4 (with v2.7.4 as dependency)
- Updates React Native Plugin to 2.4.4 (with v2.7.4 as dependency)
- Updates Chrome Debug Extension to 0.2.4

This release is primarily a performance improvement release where we will now use any built in (or provided polyfill) function
over the internal polyfills for

- String trim()
- String endsWith()
- String startsWith()
- Additional Date toISOString()
- Array isArray()
- Array indexOf()
- Array map()
- Array reduce()
- Object freeze()
- Object seal()

* remove article link in the ReadMe (#1771)

* remove article links

* fix readme error

* Add custom properties argument to useTrackMetric (#1779)

* Merge remote-tracking branch 'upstream/beta' into MSNev/MergeBetaToMaster (#1791)

* Update version update script to support default "next" release version (major/minor) not just patch (#1756) (#1757)

* Merge [master] branch to [beta] and Enable GitHub Actions on [beta] branch (#1762)

* Update version update script to support default "next" release version (major/minor) not just patch (#1756)

* Additional Performance enhancements to use provided functions rather than internal polyfill's (#1758)

* [BUG] 2.7.4-nightly.2202-03 builds have a bug where objKeys() is not returning the keys #1763 (#1764)

* Enable GitHub Actions on [beta] branch

* Beta Part 1: Part of Mega Dynamic Load/Unload support (#1766)

- Refactor TelemetryPluginChain ready to start supporting load/unload
- Move TelemetryInitializer to BaseCore
- add getPlugin (will be used for remove)
- Address Channel flush issue

* Merge remote-tracking branch 'upstream/master' into beta (#1772)

* Additional Performance enhancements to use provided functions rather than internal polyfill's (#1758)

* [BUG] 2.7.4-nightly.2202-03 builds have a bug where objKeys() is not returning the keys #1763 (#1764)

* Update version.json (#1767)

* [Release] Increase version to 2.7.4 (#1770)

- Updates React Plugin to v3.2.4 (with v2.7.4 as dependency)
- Updates React Native Plugin to 2.4.4 (with v2.7.4 as dependency)
- Updates Chrome Debug Extension to 0.2.4

This release is primarily a performance improvement release where we will now use any built in (or provided polyfill) function
over the internal polyfills for

- String trim()
- String endsWith()
- String startsWith()
- Additional Date toISOString()
- Array isArray()
- Array indexOf()
- Array map()
- Array reduce()
- Object freeze()
- Object seal()

* [Beta] Keep version.json next as minor and resync shrinkwrap
- Fix merge issue

* Beta Part 2: Part of Mega Dynamic Load/Unload support (#1768)

- Add Event Namespace support
- Minification of constant values
- Add part of the unload functionality (required for unified `teardown()` functionality)

* Beta Part 3: Part of Mega Dynamic Load/Unload support (#1780)

* Beta Part 3: Part of Mega Dynamic Load/Unload support
- Add Core SDK Unload support

* Fix telemetry chain for null and undefined

* Beta Part 4: Part of Mega Dynamic Load/Unload support (#1781)

* Beta Part 4: Part of Mega Dynamic Load/Unload support
- Fix function typing issues
- Update Analytics Extension to start supporting teardown / unload (more tests required)
- Adds namespace option to instrumentation hooks (for debugging teardown issues)
- Update AITest Class to log and optionally assert events and hooks that have not been removed
- Add Update callback when plugins are added / removed (will be extended for config updates)
- Some minor minification improvements

* Update comments

* Add missing enum definition

* Update Sender tests

* Beta Part 5: Part of Mega Dynamic Load/Unload support (#1782)

- Add Missing Exports
- AnalyticsPlugin: Implement teardown and initial test validation
- Dependencies Plugin: Implement teardown and initial test validation
- Add flush() to IAppInsightsCore

* AI Beta: Minor bug fixes and additional debug info (#1787)

* Lint fixes: Enable Automatic formatting fixes (#1788)

* Beta Part 6: Part of Mega Dynamic Load/Unload support (#1782) (#1789)

- Add basic minimal unload / teardown support to all remaining components
- Update rollup cleanup dependencies

* Beta: Component Governance Updates to address known dependency issues (#1790)

* Master Minification Improvements (#1793)

* Master Minification Improvements
- Remove Generated classes
- And Convert to interfaces rather than classes

* Update version.json so next is a minor release

* Minification - Change to only use const enums internally (#1796)

- Remove Angular config from CodeQL

* More Common Minification Updates (#1798)

- SeverityLevel => const enum
- RequestHeaders
- TraceParent

* Enable fetch automatic dependency tracking by default (#1468)

* Finalize and Update the processTelemetry helper functions (#1805)

* [Release] Increase version to v2.8.0 (#1806)

* [BUG] Adding new on-by-default telemetry is a breaking change, and should involve a major version bump #1808 (#1809)

* v2.8.0 has incompatible TypeScript 3.x type declaration (#1810)

- [BUG] Angular project doesn't build after install latest version v.2.8.0 #1807

* [BUG] Browser exceptions are no longer automatically tracked after 2.8.0 #1812 (#1815)

* [Release] Increase version to 2.8.1 (#1816)

* [BUG] v2.8.1 with a Hosted IE environment fails to initialize for a hosted instance of IE #1822 (#1824)

[BUG] IE8 Support was broken by several components #1823

* [Release] Increase version to 2.7.4 (#1770)

- Updates React Plugin to v3.2.4 (with v2.7.4 as dependency)
- Updates React Native Plugin to 2.4.4 (with v2.7.4 as dependency)
- Updates Chrome Debug Extension to 0.2.4

This release is primarily a performance improvement release where we will now use any built in (or provided polyfill) function
over the internal polyfills for

- String trim()
- String endsWith()
- String startsWith()
- Additional Date toISOString()
- Array isArray()
- Array indexOf()
- Array map()
- Array reduce()
- Object freeze()
- Object seal()

* Merge remote-tracking branch 'upstream/beta' into MSNev/MergeBetaToMaster (#1791)

* Update version update script to support default "next" release version (major/minor) not just patch (#1756) (#1757)

* Merge [master] branch to [beta] and Enable GitHub Actions on [beta] branch (#1762)

* Update version update script to support default "next" release version (major/minor) not just patch (#1756)

* Additional Performance enhancements to use provided functions rather than internal polyfill's (#1758)

* [BUG] 2.7.4-nightly.2202-03 builds have a bug where objKeys() is not returning the keys #1763 (#1764)

* Enable GitHub Actions on [beta] branch

* Beta Part 1: Part of Mega Dynamic Load/Unload support (#1766)

- Refactor TelemetryPluginChain ready to start supporting load/unload
- Move TelemetryInitializer to BaseCore
- add getPlugin (will be used for remove)
- Address Channel flush issue

* Merge remote-tracking branch 'upstream/master' into beta (#1772)

* Additional Performance enhancements to use provided functions rather than internal polyfill's (#1758)

* [BUG] 2.7.4-nightly.2202-03 builds have a bug where objKeys() is not returning the keys #1763 (#1764)

* Update version.json (#1767)

* [Release] Increase version to 2.7.4 (#1770)

- Updates React Plugin to v3.2.4 (with v2.7.4 as dependency)
- Updates React Native Plugin to 2.4.4 (with v2.7.4 as dependency)
- Updates Chrome Debug Extension to 0.2.4

This release is primarily a performance improvement release where we will now use any built in (or provided polyfill) function
over the internal polyfills for

- String trim()
- String endsWith()
- String startsWith()
- Additional Date toISOString()
- Array isArray()
- Array indexOf()
- Array map()
- Array reduce()
- Object freeze()
- Object seal()

* [Beta] Keep version.json next as minor and resync shrinkwrap
- Fix merge issue

* Beta Part 2: Part of Mega Dynamic Load/Unload support (#1768)

- Add Event Namespace support
- Minification of constant values
- Add part of the unload functionality (required for unified `teardown()` functionality)

* Beta Part 3: Part of Mega Dynamic Load/Unload support (#1780)

* Beta Part 3: Part of Mega Dynamic Load/Unload support
- Add Core SDK Unload support

* Fix telemetry chain for null and undefined

* Beta Part 4: Part of Mega Dynamic Load/Unload support (#1781)

* Beta Part 4: Part of Mega Dynamic Load/Unload support
- Fix function typing issues
- Update Analytics Extension to start supporting teardown / unload (more tests required)
- Adds namespace option to instrumentation hooks (for debugging teardown issues)
- Update AITest Class to log and optionally assert events and hooks that have not been removed
- Add Update callback when plugins are added / removed (will be extended for config updates)
- Some minor minification improvements

* Update comments

* Add missing enum definition

* Update Sender tests

* Beta Part 5: Part of Mega Dynamic Load/Unload support (#1782)

- Add Missing Exports
- AnalyticsPlugin: Implement teardown and initial test validation
- Dependencies Plugin: Implement teardown and initial test validation
- Add flush() to IAppInsightsCore

* AI Beta: Minor bug fixes and additional debug info (#1787)

* Lint fixes: Enable Automatic formatting fixes (#1788)

* Beta Part 6: Part of Mega Dynamic Load/Unload support (#1782) (#1789)

- Add basic minimal unload / teardown support to all remaining components
- Update rollup cleanup dependencies

* Beta: Component Governance Updates to address known dependency issues (#1790)

* Master Minification Improvements (#1793)

* Master Minification Improvements
- Remove Generated classes
- And Convert to interfaces rather than classes

* Update version.json so next is a minor release

* Minification - Change to only use const enums internally (#1796)

- Remove Angular config from CodeQL

* More Common Minification Updates (#1798)

- SeverityLevel => const enum
- RequestHeaders
- TraceParent

* Enable fetch automatic dependency tracking by default (#1468)

* Finalize and Update the processTelemetry helper functions (#1805)

* [Release] Increase version to v2.8.0 (#1806)

* [BUG] Adding new on-by-default telemetry is a breaking change, and should involve a major version bump #1808 (#1809)

* v2.8.0 has incompatible TypeScript 3.x type declaration (#1810)

- [BUG] Angular project doesn't build after install latest version v.2.8.0 #1807

* [BUG] Browser exceptions are no longer automatically tracked after 2.8.0 #1812 (#1815)

* [Release] Increase version to 2.8.1 (#1816)

* Fix merge Issues -- full compare with master
- Update version.json so next beta will be 3.0.0

* Set next beta release as major

Co-authored-by: Karlie-777 <79606506+Karlie-777@users.noreply.github.com>
Co-authored-by: Simo Nurmi <simo.aleksi.nurmi@gmail.com>
Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com>
  • Loading branch information
4 people committed Apr 30, 2022
1 parent 544a4bc commit af9f1ab
Show file tree
Hide file tree
Showing 132 changed files with 4,694 additions and 4,670 deletions.
1 change: 0 additions & 1 deletion .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ paths-ignore:
- '**/Tests/'
- '**/dist-history/'
- '**/rollup.config.js'
- '/extensions/applicationinsights-angularplugin-js/'
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Node.js CI

on:
push:
branches: [ master, beta ]
branches: [ master, beta, Release2.7 ]
pull_request:
branches: [ master, beta ]
branches: [ master, beta, Release2.7 ]

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ master, beta ]
branches: [ master, beta, Release2.7 ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master, beta ]
branches: [ master, beta, Release2.7 ]
schedule:
- cron: '17 15 * * 2'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,4 @@ aicore.tests.js*
aicore.tests.d.ts
ai.tests.d.ts
/.vs
/index.html
2 changes: 2 additions & 0 deletions AISKU/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Refer to [our GitHub page](https://github.com/microsoft/applicationinsights-js)
| Version | Full Size | Raw Minified | GZip Size
|---------|-----------|--------------|-------------
| &lt;nightly&gt; | [![full size size](https://img.badgesize.io/https://js.monitor.azure.com/nightly/ai.2-nightly.js.svg?label=full%20size&color=blue)](https://img.badgesize.io/https://js.monitor.azure.com/nightly/ai.2-nightly.js.svg?label=full%20size&color=blue)| ![minified size size](https://img.badgesize.io/https://js.monitor.azure.com/nightly/ai.2-nightly.min.js.svg?label=minified%20size&color=darkorchid) | ![gzip size](https://img.badgesize.io/https://js.monitor.azure.com/nightly/ai.2-nightly.min.js.svg?compression=gzip&softmax=30000&max=35000)
| 2.8.1: | [![full size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.8.1.js.svg?label=full%20size&color=blue)](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.8.1.js.svg?label=full%20size&color=blue)| ![minified size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.8.1.min.js.svg?label=minified%20size&color=darkorchid) | ![gzip size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.8.1.min.js.svg?compression=gzip&softmax=30000&max=35000)
| 2.8.0: | [![full size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.8.0.js.svg?label=full%20size&color=blue)](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.8.0.js.svg?label=full%20size&color=blue)| ![minified size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.8.0.min.js.svg?label=minified%20size&color=darkorchid) | ![gzip size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.8.0.min.js.svg?compression=gzip&softmax=30000&max=35000)
| 2.7.4: | [![full size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.4.js.svg?label=full%20size&color=blue)](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.4.js.svg?label=full%20size&color=blue)| ![minified size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.4.min.js.svg?label=minified%20size&color=darkorchid) | ![gzip size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.4.min.js.svg?compression=gzip&softmax=30000&max=35000)
| 2.7.3: | [![full size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.3.js.svg?label=full%20size&color=blue)](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.3.js.svg?label=full%20size&color=blue)| ![minified size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.3.min.js.svg?label=minified%20size&color=darkorchid) | ![gzip size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.3.min.js.svg?compression=gzip&softmax=30000&max=35000)
| 2.7.2: | [![full size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.2.js.svg?label=full%20size&color=blue)](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.2.js.svg?label=full%20size&color=blue)| ![minified size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.2.min.js.svg?label=minified%20size&color=darkorchid) | ![gzip size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.2.7.2.min.js.svg?compression=gzip&softmax=30000&max=35000)
Expand Down
76 changes: 47 additions & 29 deletions AISKU/Tests/Perf/src/AISKUPerf.Tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ function addSnippetLoadingTimeEvent(AISKUPerfTest: any, endtime: number): void {
createPerfEvent(AISKUPerfTest, "SDKInit", duration, true, `AppInsightsInit-Init: Script LoadingTime: ${duration} ms added`);
}


export class AISKUPerf extends AITestClass {
public AISKUPerfTest: AppInsightsInitPerfTestClass;
public perfMgr: any;
Expand All @@ -137,7 +136,6 @@ export class AISKUPerf extends AITestClass {
public testInitialize() {
try {
this.AISKUPerfTest = new AppInsightsInitPerfTestClass();
this.AISKUPerfTest.loadScriptOnInit = () => {return this._loadScriptOnInit();}
Assert.ok(window["oneDS"], "oneDS exists");
Assert.ok(window["Microsoft"]?.ApplicationInsights?.PerfMarkMeasureManager, "perfMgr exists");
Assert.ok(window["Microsoft"]?.ApplicationInsights?.doPerf, "doPerf exists");
Expand Down Expand Up @@ -167,6 +165,7 @@ export class AISKUPerf extends AITestClass {
this.testCaseAsync({
name: "AppInsights AISKU perf Test",
stepDelay: 10000,
assertNoHooks: false,
steps: [() => {
Assert.ok(window["appInsightsInitPerftest"], "global appInsightsInitPerftest exists");
Assert.ok(window["oneDS"], "oneDS exists");
Expand Down Expand Up @@ -199,16 +198,27 @@ export class AISKUPerf extends AITestClass {
});
}

protected _loadScriptOnInit(): void {
protected _loadScriptOnInit(theModule: any): void {
var snippetLoadingEndTime = performance.now();
this._addMemoryPerfEvent(this.initialMemoryUsage);
Assert.ok(true,"AppInsights script loaded");

addSnippetLoadingTimeEvent(this.AISKUPerfTest,snippetLoadingEndTime);
addSnippetLoadingTimeEvent(this.AISKUPerfTest, snippetLoadingEndTime);

let appInsights = window["appInsights"];
this.appInsights = appInsights;

this.onDone(() => {
if (appInsights && appInsights.unload && appInsights.core && appInsights.core.isInitialized()) {
Assert.ok(true, "Unloading...");
appInsights.unload(false);
} else {
Assert.ok(true, "Unload not supported...");
}

appInsights = null;
this.appInsights = null;
});
try {
let notificationManager = this.appInsights.core["_notificationManager"] ||this.appInsights.core?.getNotifyMgr();
if (notificationManager) {
Expand All @@ -230,29 +240,31 @@ export class AISKUPerf extends AITestClass {
}

protected _loadSnippet():void {
this.initialMemoryUsage = performance["memory"]?.usedJSHeapSize;
var tag = document.createElement("script");
tag.innerText = this.getSnippet();
this.AISKUPerfTest.snippetStartTime = performance.now();
document.getElementsByTagName("head")[0].appendChild(tag);
}

public getSnippet(): string {
return `
loadSdkUsingRequire({
src: "https://js.monitor.azure.com/scripts/b/ai.${this.AISKUPerfTest.version}.min.js?${this.AISKUPerfTest.testPostfix}",
onInit: function (appInsights) {
console.log("snippet loaded");
appInsightsInitPerftest.loadScriptOnInit();
},
cfg: {
instrumentationKey: "key",
enablePerfMgr: true,
maxBatchSizeInBytes: 1000000,
maxBatchInterval: 30000000,
extensionConfig: {}
}
});`;
let self = this;
self.initialMemoryUsage = performance["memory"]?.usedJSHeapSize;
window["loadSdkUsingRequire"]({
src: self.getScriptSrc(),
onInit: function (theInstance) {
console.log("snippet loaded");
self._loadScriptOnInit(theInstance);

self.onDone(() => {
if (theInstance && theInstance.unload && theInstance.core && theInstance.core.isInitialized()) {
Assert.ok(true, "Unloading from onInit...");
theInstance.unload(false);
} else {
Assert.ok(true, "Unload not supported in onInit...");
}
});
},
cfg: {
instrumentationKey: "key",
enablePerfMgr: true,
maxBatchSizeInBytes: 1000000,
maxBatchInterval: 30000000,
extensionConfig: {}
}
});
}

public addPerfEvents() {
Expand All @@ -277,8 +289,14 @@ export class AISKUPerf extends AITestClass {
}

public getScriptSrc(): string {
return `https://js.monitor.azure.com/scripts/b/ai.${this.AISKUPerfTest.version}.min.js?${this.AISKUPerfTest.testPostfix}`;
}
let baseUrl = "https://js.monitor.azure.com/scripts/b/ai.";

if (this.AISKUPerfTest.version.indexOf("nightly") !== -1) {
baseUrl = "https://js.monitor.azure.com/nightly/ai.";
}

return baseUrl + `${this.AISKUPerfTest.version}.min.js?${this.AISKUPerfTest.testPostfix}`;
}

private _addMemoryPerfEvent(initialMemoryUsage: number, metric?: string): void {
let curMemory = performance["memory"]?.usedJSHeapSize;
Expand Down
2 changes: 1 addition & 1 deletion AISKU/Tests/Perf/src/AISKUPerf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class AppInsightsInitPerfTestClass {
* should update version after new release
* version with doperf(): after 2.5.6
* */
var defaultVer = "2.7.4";
var defaultVer = "2.8.1";
this.version = ver? ver:this._getQueryParameterVersion(defaultVer);
this.perfEventsBuffer = [];
this.perfEventWaitBuffer = [];
Expand Down
4 changes: 3 additions & 1 deletion AISKU/Tests/PerfTests.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
};

if (snippetCfg.onInit) {
appInsights.queue.push(snippetCfg.onInit);
appInsights.queue.push(function() {
snippetCfg.onInit(appInsights);
});
}

window["appInsights"] = appInsights;
Expand Down
16 changes: 8 additions & 8 deletions AISKU/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-web",
"version": "2.7.4",
"version": "2.8.1",
"description": "Microsoft Application Insights JavaScript SDK - Web",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"author": "Microsoft Application Insights Team",
Expand Down Expand Up @@ -64,14 +64,14 @@
"tslib": "*"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.4",
"@microsoft/dynamicproto-js": "^1.1.5",
"@microsoft/applicationinsights-shims": "2.0.1",
"@microsoft/applicationinsights-analytics-js": "2.7.4",
"@microsoft/applicationinsights-channel-js": "2.7.4",
"@microsoft/applicationinsights-common": "2.7.4",
"@microsoft/applicationinsights-core-js": "2.7.4",
"@microsoft/applicationinsights-dependencies-js": "2.7.4",
"@microsoft/applicationinsights-properties-js": "2.7.4"
"@microsoft/applicationinsights-analytics-js": "2.8.1",
"@microsoft/applicationinsights-channel-js": "2.8.1",
"@microsoft/applicationinsights-common": "2.8.1",
"@microsoft/applicationinsights-core-js": "2.8.1",
"@microsoft/applicationinsights-dependencies-js": "2.8.1",
"@microsoft/applicationinsights-properties-js": "2.8.1"
},
"license": "MIT"
}
4 changes: 2 additions & 2 deletions AISKU/src/ApplicationInsightsDeprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
IEventTelemetry, IEnvelope, ProcessLegacy
} from "@microsoft/applicationinsights-common";
import { Snippet, Initialization as ApplicationInsights } from "./Initialization";
import { ITelemetryItem, IDiagnosticLogger, IConfiguration, proxyAssign, throwError, ICookieMgr } from "@microsoft/applicationinsights-core-js";
import { ITelemetryItem, IDiagnosticLogger, IConfiguration, proxyAssign, throwError, ICookieMgr, arrIndexOf } from "@microsoft/applicationinsights-core-js";

// This is an exclude list of properties that should not be updated during initialization
// They include a combination of private and internal property names
Expand Down Expand Up @@ -187,7 +187,7 @@ export class AppInsightsDeprecated implements IAppInsightsDeprecated {
// Note: This must be called before loadAppInsights is called
proxyAssign(snippet, this, (name: string) => {
// Not excluding names prefixed with "_" as we need to proxy some functions like _onError
return name && _ignoreUpdateSnippetProperties.indexOf(name) === -1;
return name && arrIndexOf(_ignoreUpdateSnippetProperties, name) === -1;
});
}

Expand Down
25 changes: 11 additions & 14 deletions AISKU/src/Initialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@

import dynamicProto from "@microsoft/dynamicproto-js";
import {
IConfiguration, AppInsightsCore, IAppInsightsCore, LoggingSeverity, _InternalMessageId, ITelemetryItem, ICustomProperties,
IConfiguration, AppInsightsCore, IAppInsightsCore, eLoggingSeverity, _eInternalMessageId, ITelemetryItem, ICustomProperties,
IChannelControls, hasWindow, hasDocument, isReactNative, doPerf, IDiagnosticLogger, INotificationManager, objForEachKey, proxyAssign, proxyFunctions,
arrForEach, isString, isFunction, isNullOrUndefined, isArray, throwError, ICookieMgr, addPageUnloadEventListener, addPageHideEventListener,
createUniqueNamespace, ITelemetryPlugin, IPlugin, ILoadedPlugin, UnloadHandler, removePageUnloadEventListener, removePageHideEventListener,
ITelemetryInitializerHandler, ITelemetryUnloadState, mergeEvtNamespace
ITelemetryInitializerHandler, ITelemetryUnloadState, mergeEvtNamespace, _throwInternal, arrIndexOf
} from "@microsoft/applicationinsights-core-js";
import { AnalyticsPlugin, ApplicationInsights } from "@microsoft/applicationinsights-analytics-js";
import { Sender } from "@microsoft/applicationinsights-channel-js";
import { PropertiesPlugin } from "@microsoft/applicationinsights-properties-js";
import { AjaxPlugin as DependenciesPlugin, IDependenciesPlugin } from "@microsoft/applicationinsights-dependencies-js";
import {
IUtil, Util, ICorrelationIdHelper, CorrelationIdHelper, IUrlHelper, UrlHelper, IDateTimeUtils, DateTimeUtils, ConnectionStringParser, FieldType,
IRequestHeaders, RequestHeaders, DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod, DEFAULT_BREEZE_ENDPOINT, AIData, AIBase,
Envelope, Event, Exception, Metric, PageView, PageViewData, RemoteDependencyData, IEventTelemetry,
IRequestHeaders, RequestHeaders, DisabledPropertyName, ProcessLegacy, SampleRate, HttpMethod, DEFAULT_BREEZE_ENDPOINT,
Envelope, Event, Exception, Metric, PageView, RemoteDependencyData, IEventTelemetry,
ITraceTelemetry, IMetricTelemetry, IDependencyTelemetry, IExceptionTelemetry, IAutoExceptionTelemetry,
IPageViewTelemetry, IPageViewPerformanceTelemetry, Trace, PageViewPerformance, Data, SeverityLevel,
IConfig, ConfigurationManager, ContextTagKeys, IDataSanitizer, DataSanitizer, TelemetryItemCreator, IAppInsights, CtxTagKeys, Extensions,
Expand Down Expand Up @@ -124,14 +124,11 @@ export const Telemetry = {
SampleRate,
HttpMethod,
DEFAULT_BREEZE_ENDPOINT,
AIData,
AIBase,
Envelope,
Event,
Exception,
Metric,
PageView,
PageViewData,
RemoteDependencyData,
Trace,
PageViewPerformance,
Expand Down Expand Up @@ -238,7 +235,7 @@ export class Initialization implements IApplicationInsights {
if (isString(field) &&
!isFunction(value) &&
field && field[0] !== "_" && // Don't copy "internal" values
_ignoreUpdateSnippetProperties.indexOf(field) === -1) {
arrIndexOf(_ignoreUpdateSnippetProperties, field) === -1) {
snippet[field as string] = value;
}
});
Expand Down Expand Up @@ -280,7 +277,7 @@ export class Initialization implements IApplicationInsights {
// Note: This must be called before loadAppInsights is called
proxyAssign(snippet, _self, (name: string) => {
// Not excluding names prefixed with "_" as we need to proxy some functions like _onError
return name && _ignoreUpdateSnippetProperties.indexOf(name) === -1;
return name && arrIndexOf(_ignoreUpdateSnippetProperties, name) === -1;
});
};

Expand All @@ -306,8 +303,8 @@ export class Initialization implements IApplicationInsights {

// need from core
// Microsoft.ApplicationInsights._InternalLogging.throwInternal(
// LoggingSeverity.WARNING,
// _InternalMessageId.FailedToSendQueuedTelemetry,
// eLoggingSeverity.WARNING,
// _eInternalMessageId.FailedToSendQueuedTelemetry,
// "Failed to send queued telemetry",
// properties);
}
Expand Down Expand Up @@ -362,9 +359,9 @@ export class Initialization implements IApplicationInsights {
// A reactNative app may not have a window and therefore the beforeunload/pagehide events -- so don't
// log the failure in this case
if (!added && !isReactNative()) {
appInsightsInstance.appInsights.core.logger.throwInternal(
LoggingSeverity.CRITICAL,
_InternalMessageId.FailedToAddHandlerForOnBeforeUnload,
_throwInternal(appInsightsInstance.appInsights.core.logger,
eLoggingSeverity.CRITICAL,
_eInternalMessageId.FailedToAddHandlerForOnBeforeUnload,
"Could not add handler for beforeunload and pagehide");
}
}
Expand Down
3 changes: 3 additions & 0 deletions AISKU/src/applicationinsights-web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export {
AppInsightsCore,
IAppInsightsCore,
LoggingSeverity,
eLoggingSeverity,
_InternalMessageId,
_eInternalMessageId,
ITelemetryItem,
ITelemetryPlugin,
IPerfEvent,
Expand Down Expand Up @@ -49,6 +51,7 @@ export {
IEventTelemetry,
IAppInsights,
SeverityLevel,
eSeverityLevel,
Event,
Exception,
Metric,
Expand Down
10 changes: 5 additions & 5 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.7.4",
"version": "2.8.1",
"description": "Microsoft Application Insights Javascript SDK core and channel",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"author": "Microsoft Application Insights Team",
Expand Down Expand Up @@ -49,11 +49,11 @@
"tslib": "*"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.4",
"@microsoft/dynamicproto-js": "^1.1.5",
"@microsoft/applicationinsights-shims": "2.0.1",
"@microsoft/applicationinsights-common": "2.7.4",
"@microsoft/applicationinsights-channel-js": "2.7.4",
"@microsoft/applicationinsights-core-js": "2.7.4"
"@microsoft/applicationinsights-common": "2.8.1",
"@microsoft/applicationinsights-channel-js": "2.8.1",
"@microsoft/applicationinsights-core-js": "2.8.1"
},
"license": "MIT"
}
1 change: 1 addition & 0 deletions AISKULight/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export {
} from "@microsoft/applicationinsights-core-js";
export {
SeverityLevel,
eSeverityLevel,
IPageViewTelemetry,
IDependencyTelemetry,
IAutoExceptionTelemetry,
Expand Down
Loading

0 comments on commit af9f1ab

Please sign in to comment.