From b5b9eeade566fb904af4f5c33a46eaf90237df22 Mon Sep 17 00:00:00 2001 From: siyuniu-ms <123212536+siyuniu-ms@users.noreply.github.com> Date: Mon, 12 Feb 2024 15:15:59 -0800 Subject: [PATCH] [main] [Possible Break] Removed Tags[] from ITelemetryItem as this was breaking later versions of TypeScript by using the intersection type instead of union type for tags property #2258 (#2269) --- AISKU/API.md | 2 +- RELEASES.md | 21 +++++++++++++++++++ .../ITelemetryItem.ts | 2 +- .../src/applicationinsights-web-snippet.ts | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/AISKU/API.md b/AISKU/API.md index 741f4f916..cc67ccc3a 100644 --- a/AISKU/API.md +++ b/AISKU/API.md @@ -205,7 +205,7 @@ interface ITelemetryItem { /** * Part A custom extensions */ - tags?: Tags[]; + tags?: Tags; // Tags[] is deprecated since 4.1.0 /** * Telemetry type used for part B diff --git a/RELEASES.md b/RELEASES.md index c2ea5cd2b..ce5f3d1f2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2,6 +2,27 @@ > 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. +## 4.0.1 (Feb 12nd, 2024) + +### Potential break change + +This release contains a potential break change with 'tags' type [change](https://github.com/microsoft/ApplicationInsights-JS/pull/2269) + +#### Old +```ts + tags?: Tags & Tags[]; +``` +#### New +```ts + tags?: Tags; + +``` + +### Changelog + + + + ## 3.0.7 (Dec 14th, 2023) ### Changelog diff --git a/shared/AppInsightsCore/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts b/shared/AppInsightsCore/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts index b91b6bc74..528fe5fb2 100644 --- a/shared/AppInsightsCore/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts +++ b/shared/AppInsightsCore/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts @@ -34,7 +34,7 @@ export interface ITelemetryItem { /** * System context property extensions that are not global (not in ctx) */ - tags?: Tags & Tags[]; // Tags[] will be deprecated. + tags?: Tags; // Tags[] is deprecated since 4.1.0 /** * Custom data diff --git a/tools/applicationinsights-web-snippet/src/applicationinsights-web-snippet.ts b/tools/applicationinsights-web-snippet/src/applicationinsights-web-snippet.ts index 3a275ab1d..147af1dfc 100644 --- a/tools/applicationinsights-web-snippet/src/applicationinsights-web-snippet.ts +++ b/tools/applicationinsights-web-snippet/src/applicationinsights-web-snippet.ts @@ -18,7 +18,7 @@ function getSdkLoaderScript(config: SdkLoaderConfig) { snippet = webSnippetCs.replace("YOUR_CONNECTION_STRING", config.connectionString); } else if (config && config.instrumentationKey) { snippet = webSnippet.replace("InstrumentationKey=INSTRUMENTATION_KEY", config.instrumentationKey); - } + } return snippet; }