Skip to content

Commit

Permalink
Merge branch 'siyu/miniLoader' of https://github.com/microsoft/Applic…
Browse files Browse the repository at this point in the history
…ationInsights-JS into siyu/miniLoader
  • Loading branch information
siyuniu-ms committed May 2, 2024
2 parents 51ac9e8 + 26584df commit 1ec7b39
Show file tree
Hide file tree
Showing 62 changed files with 1,551 additions and 782 deletions.
132 changes: 67 additions & 65 deletions AISKU/README.md

Large diffs are not rendered by default.

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 = "3.1.2";
var defaultVer = "3.2.0";
this.version = ver? ver:this._getQueryParameterVersion(defaultVer);
this.perfEventsBuffer = [];
this.perfEventWaitBuffer = [];
Expand Down
10 changes: 5 additions & 5 deletions AISKU/Tests/Unit/src/AISKUSize.Tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { Snippet } from "../../../src/Snippet";
import { utlRemoveSessionStorage } from "@microsoft/applicationinsights-common";

export class AISKUSizeCheck extends AITestClass {
private readonly MAX_RAW_SIZE = 140;
private readonly MAX_BUNDLE_SIZE = 140;
private readonly MAX_RAW_DEFLATE_SIZE = 56;
private readonly MAX_BUNDLE_DEFLATE_SIZE = 56;
private readonly MAX_RAW_SIZE = 141;
private readonly MAX_BUNDLE_SIZE = 141;
private readonly MAX_RAW_DEFLATE_SIZE = 57;
private readonly MAX_BUNDLE_DEFLATE_SIZE = 57;
private readonly rawFilePath = "../dist/es5/applicationinsights-web.min.js";
// Automatically updated by version scripts
private readonly currentVer = "3.1.2";
private readonly currentVer = "3.2.0";
private readonly prodFilePath = `../browser/es5/ai.${this.currentVer[0]}.min.js`;

public testInitialize() {
Expand Down
2 changes: 1 addition & 1 deletion AISKU/Tests/Unit/src/CdnPackaging.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const enum CdnFormat {

export class CdnPackagingChecks extends AITestClass {
// Automatically updated by version scripts
private readonly currentVer = "3.1.2";
private readonly currentVer = "3.2.0";

public testInitialize() {
}
Expand Down
12 changes: 10 additions & 2 deletions AISKU/Tests/Unit/src/SnippetInitialization.Tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,11 @@ export class SnippetInitializationTests extends AITestClass {
if(this.successSpy.called) {
let currentCount: number = 0;
this.successSpy.args.forEach(call => {
call[0].forEach(message => {
call[0].forEach(item => {
let message = item;
if (typeof item !== "string") {
message = item.item;
}
// Ignore the internal SendBrowserInfoOnUserInit message (Only occurs when running tests in a browser)
if (!message || message.indexOf("AI (Internal): 72 ") == -1) {
currentCount ++;
Expand Down Expand Up @@ -1086,7 +1090,11 @@ export class SnippetInitializationTests extends AITestClass {
if(this.successSpy.called) {
let currentCount: number = 0;
this.successSpy.args.forEach(call => {
call[0].forEach(message => {
call[0].forEach(item => {
let message = item.item;
if (typeof item === "string") {
message = item;
}
// Ignore the internal SendBrowserInfoOnUserInit message (Only occurs when running tests in a browser)
if (!message || message.indexOf("AI (Internal): 72 ") == -1) {
currentCount ++;
Expand Down
1 change: 1 addition & 0 deletions AISKU/Tests/Unit/src/applicationinsights.e2e.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ export class ApplicationInsightsTests extends AITestClass {
ai.config.extensionConfig = ai.config.extensionConfig || {};
let extConfig = ai.config.extensionConfig["AppInsightsCfgSyncPlugin"];
Assert.equal(extConfig.cfgUrl, CONFIG_ENDPOINT_URL, "default cdn endpoint should be set");
Assert.equal(extConfig.syncMode, 2, "default mode should be set to receive");

let featureOptIn = config.featureOptIn || {};
Assert.equal(featureOptIn["iKeyUsage"].mode, FeatureOptInMode.enable, "ikey message should be turned on");
Expand Down
4 changes: 2 additions & 2 deletions AISKU/Tests/Unit/src/sender.e2e.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Assert, AITestClass, PollingAssert} from "@microsoft/ai-test-framework"

export class SenderE2ETests extends AITestClass {
private readonly _instrumentationKey = 'b7170927-2d1c-44f1-acec-59f4e1751c11';
private readonly _bufferName = 'AI_buffer';
private readonly _sentBufferName = 'AI_sentBuffer';
private readonly _bufferName = 'AI_buffer_1';
private readonly _sentBufferName = 'AI_sentBuffer_1';

private _ai: IApplicationInsights;
private _sender: Sender;
Expand Down
6 changes: 5 additions & 1 deletion AISKU/Tests/Unit/src/validate.e2e.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ export class ValidateE2ETests extends AITestClass {
.concat(() => {
let acceptedItems = 0;
this.successSpy.args.forEach(call => {
call[0].forEach(message => {
call[0].forEach(item => {
let message = item;
if (typeof item !== "string") {
message = item.item;
}
// Ignore the internal SendBrowserInfoOnUserInit message (Only occurs when running tests in a browser)
if (message.indexOf("AI (Internal): 72 ") == -1) {
acceptedItems ++;
Expand Down
6 changes: 3 additions & 3 deletions AISKU/Tests/es6-module-type-check/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@microsoft/applicationinsights-test-module-type-check",
"author": "Microsoft Application Insights Team and Contributors",
"version": "3.1.2",
"version": "3.2.0",
"description": "Microsoft Application Insights ES6 Module and Type check Example",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"keywords": [
Expand Down Expand Up @@ -32,7 +32,7 @@
"tslib": "*"
},
"dependencies": {
"@microsoft/applicationinsights-common": "3.1.2",
"@microsoft/applicationinsights-web": "3.1.2"
"@microsoft/applicationinsights-common": "3.2.0",
"@microsoft/applicationinsights-web": "3.2.0"
}
}
20 changes: 10 additions & 10 deletions AISKU/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-web",
"version": "3.1.2",
"version": "3.2.0",
"description": "Microsoft Application Insights JavaScript SDK - Web",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"author": "Microsoft Application Insights Team",
Expand Down Expand Up @@ -63,15 +63,15 @@
"dependencies": {
"@microsoft/dynamicproto-js": "^2.0.3",
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/applicationinsights-analytics-js": "3.1.2",
"@microsoft/applicationinsights-channel-js": "3.1.2",
"@microsoft/applicationinsights-cfgsync-js": "3.1.2",
"@microsoft/applicationinsights-common": "3.1.2",
"@microsoft/applicationinsights-core-js": "3.1.2",
"@microsoft/applicationinsights-dependencies-js": "3.1.2",
"@microsoft/applicationinsights-properties-js": "3.1.2",
"@nevware21/ts-utils": ">= 0.11.0 < 2.x",
"@nevware21/ts-async": ">= 0.3.0 < 2.x"
"@microsoft/applicationinsights-analytics-js": "3.2.0",
"@microsoft/applicationinsights-channel-js": "3.2.0",
"@microsoft/applicationinsights-cfgsync-js": "3.2.0",
"@microsoft/applicationinsights-common": "3.2.0",
"@microsoft/applicationinsights-core-js": "3.2.0",
"@microsoft/applicationinsights-dependencies-js": "3.2.0",
"@microsoft/applicationinsights-properties-js": "3.2.0",
"@nevware21/ts-utils": ">= 0.11.1 < 2.x",
"@nevware21/ts-async": ">= 0.5.1 < 2.x"
},
"license": "MIT"
}
5 changes: 3 additions & 2 deletions AISKU/src/AISku.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import dynamicProto from "@microsoft/dynamicproto-js";
import { AnalyticsPlugin, ApplicationInsights } from "@microsoft/applicationinsights-analytics-js";
import { CfgSyncPlugin, ICfgSyncConfig } from "@microsoft/applicationinsights-cfgsync-js";
import { CfgSyncPlugin, ICfgSyncConfig, ICfgSyncMode } from "@microsoft/applicationinsights-cfgsync-js";
import { Sender } from "@microsoft/applicationinsights-channel-js";
import {
AnalyticsPluginIdentifier, DEFAULT_BREEZE_PATH, IAutoExceptionTelemetry, IConfig, IDependencyTelemetry, IEventTelemetry,
Expand Down Expand Up @@ -92,7 +92,8 @@ const defaultConfigValues: IConfigDefaults<IConfiguration & IConfig> = {
),
extensionConfig: cfgDfMerge<{[key: string]: any}>({
["AppInsightsCfgSyncPlugin"]: cfgDfMerge<ICfgSyncConfig>({
cfgUrl: CONFIG_ENDPOINT_URL
cfgUrl: CONFIG_ENDPOINT_URL,
syncMode: ICfgSyncMode.Receive
})
})
};
Expand Down
6 changes: 3 additions & 3 deletions AISKULight/Tests/Unit/src/AISKULightSize.Tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { AITestClass, Assert } from "@microsoft/ai-test-framework";
import * as pako from "pako";

export class AISKULightSizeCheck extends AITestClass {
private readonly MAX_RAW_SIZE = 87;
private readonly MAX_BUNDLE_SIZE = 87;
private readonly MAX_RAW_SIZE = 88;
private readonly MAX_BUNDLE_SIZE = 88;
private readonly MAX_RAW_DEFLATE_SIZE = 36;
private readonly MAX_BUNDLE_DEFLATE_SIZE = 36;
private readonly rawFilePath = "../dist/es5/applicationinsights-web-basic.min.js";
private readonly currentVer = "3.1.2";
private readonly currentVer = "3.2.0";
private readonly prodFilePath = `../browser/es5/aib.${this.currentVer[0]}.min.js`;

public testInitialize() {
Expand Down
12 changes: 6 additions & 6 deletions AISKULight/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/applicationinsights-web-basic",
"version": "3.1.2",
"version": "3.2.0",
"description": "Microsoft Application Insights JavaScript SDK - Web Basic",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
"author": "Microsoft Application Insights Team",
Expand Down Expand Up @@ -57,11 +57,11 @@
"dependencies": {
"@microsoft/dynamicproto-js": "^2.0.3",
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/applicationinsights-common": "3.1.2",
"@microsoft/applicationinsights-channel-js": "3.1.2",
"@microsoft/applicationinsights-core-js": "3.1.2",
"@nevware21/ts-utils": ">= 0.11.0 < 2.x",
"@nevware21/ts-async": ">= 0.3.0 < 2.x"
"@microsoft/applicationinsights-common": "3.2.0",
"@microsoft/applicationinsights-channel-js": "3.2.0",
"@microsoft/applicationinsights-core-js": "3.2.0",
"@nevware21/ts-utils": ">= 0.11.1 < 2.x",
"@nevware21/ts-async": ">= 0.5.1 < 2.x"
},
"license": "MIT"
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
[![GitHub Workflow Status (main)](https://img.shields.io/github/actions/workflow/status/microsoft/ApplicationInsights-JS/ci.yml?branch=main)](https://github.com/microsoft/ApplicationInsights-JS/tree/main)
[![Build Status](https://dev.azure.com/mseng/AppInsights/_apis/build/status%2FAppInsights%20-%20DevTools%2F1DS%20JavaScript%20SDK%20web%20SKU%20(main%3B%20master)?branchName=main)](https://dev.azure.com/mseng/AppInsights/_build/latest?definitionId=8184&branchName=main)
[![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-web.svg)](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-web)
[![minified size size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/3.min.js.svg?label=minified%20size)](https://js.monitor.azure.com/scripts/b/ai.3.min.js)
[![gzip size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.3.min.js.svg?compression=gzip&softmax=30000&max=35000)](https://js.monitor.azure.com/scripts/b/ai.3.min.js)
[![minified size size](https://js.monitor.azure.com/scripts/b/3.min.js.svg)](https://js.monitor.azure.com/scripts/b/ai.3.min.js)
[![gzip size](https://js.monitor.azure.com/scripts/b/ai.3.min.js.gzip.svg)](https://js.monitor.azure.com/scripts/b/ai.3.min.js)

## Before Getting Started

Expand Down Expand Up @@ -572,7 +572,7 @@ While the script downloads from the CDN, all tracking of your page is queued. On
> Summary:
>
> - ![current npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-web.svg)
> - ![gzip compressed size](https://img.badgesize.io/https://js.monitor.azure.com/scripts/b/ai.3.gbl.min.js.svg?compression=gzip)
> - ![gzip compressed size](https://js.monitor.azure.com/scripts/b/ai.3.gbl.min.js.gzip.svg)
> - **~15 ms** overall initialization time
> - **Zero** tracking missed during life cycle of page
Expand Down
19 changes: 19 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

> Note: ES3/IE8 compatibility will be removed in the future v3.x.x releases (scheduled for mid-late 2022), so if you need to retain ES3 compatibility you will need to remain on the 2.x.x versions of the SDK or your runtime will need install polyfill's to your ES3 environment before loading / initializing the SDK.
## 3.2.0 (Apr 23rd, 2024)

!! CfgSync plugin is turned on. Throttling Ikey depreciation message is enabled with sampling rate 0.0001%
[##2317](https://github.com/microsoft/ApplicationInsights-JS/pull/2317)

!! Sender has breaking changes. The key used for session storage is changed and items stored in the storage now contain retry counts.
[##2324](https://github.com/microsoft/ApplicationInsights-JS/pull/2324)

### Changelog

- #2371 [Main][Task]27365739 Turn on Ikey depreciation message with sampling rate 0.0001%
- #2319 [Main] Fix config release script overwrite flag and cache time
- #2321 [Main] Default request headers content-type for 1ds should be x-json-stream only ing
- #2324 [Main][Task]27079894 Add a max retry count for Sender
- #2325 [Main][Task]25716927: Change default CfgSync values to turn on the ikey deprecation message
- #2331 [Main] Resetting the DataCacheHelper version number back to current version (from 3.0.5)
- #2332 [Main][Task]27742145: Change nonOverrideCfgs to be added only during initialization
- #2333 [Main][Task]27749889: Change AISKU Sync Mode to Receive

## 3.1.2 (Mar 21st, 2024)

!! Critical Bug fix for Memoery Leak !!
Expand Down
8 changes: 4 additions & 4 deletions channels/1ds-post-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/1ds-post-js",
"version": "4.1.2",
"version": "4.2.0",
"description": "Microsoft Application Insights JavaScript SDK - 1ds-post-channel-js",
"author": "Microsoft Application Insights Team",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
Expand All @@ -27,9 +27,9 @@
"dependencies": {
"@microsoft/applicationinsights-shims": "3.0.1",
"@microsoft/dynamicproto-js": "^2.0.3",
"@microsoft/1ds-core-js": "4.1.2",
"@nevware21/ts-utils": ">= 0.11.0 < 2.x",
"@nevware21/ts-async": ">= 0.3.0 < 2.x"
"@microsoft/1ds-core-js": "4.2.0",
"@nevware21/ts-utils": ">= 0.11.1 < 2.x",
"@nevware21/ts-async": ">= 0.5.1 < 2.x"
},
"devDependencies": {
"@microsoft/ai-test-framework": "0.0.1",
Expand Down

0 comments on commit 1ec7b39

Please sign in to comment.