### New (Beta) extension applicationinsights-debugplugin-js
- Created the initial extension to help developers understand, track, visualize and fix issues with events
- This extension injects a UI onto your page details for the component is available at https://github.com/microsoft/ApplicationInsights-JS/tree/master/extensions/applicationinsights-debugplugin-js
- This is a beta release so the UI, config etc are not yet complete, feedback for features, suggestions or changes are welcome -- please create an Issue
- The detailed view is still under construction and contains known bugs, these will be address in the next few months (releases) as we build out the module. We had not originally planed to have any detailed view as part of this initial beta release.
### Changelog
-#1311 Allow the generated modules to extend the namespace defined by "name" in rollup config -- rather than always replace.
- Changes the way the "Microsoft.ApplicationInsights" is defined for each module to all modules to be added to the same namespace
-#1309 When using prototype js the SessionStorage become corrupted causing requests internal exceptions
-#1303 Task 7027291: Investigate CDN Configuration to support custom domain (automate CDN deployment scripts)
-#1299 Releasing core queue as soon as possible (fixes lost events from page load immediate unload with no additional events)
-#1297 Created initial applicationinsights-debugplugin-js
-#1289 [Documentation] doc: SPO set up instruction
-#1286 [Documentation] Update JS SDK Snippet documentation with bug fixes (new v4 snippet)
-#1283 [BUG] (Snippet v3) AppInsights stub methods captured incorrect method names in the closure
-#1262 [BUG] Custom properties added with addTelemetryInitializer are ignored for exceptions
-#1245 React Native - AI (Internal): 19 message: "Could not add handler for beforeunload and pagehide"
- Add isReactNative() function for detecting the runtime environment
-#1095 Add an Error Boundary to the React plugin
-#1089 Blocking certain URIs/Patterns from fetch tracking (patch included)
- Added new config 'correlationHeaderExcludePatterns' to allow disabling correlation headers using regular expressions
### Updated React plugin to v3.0.1
-#1311 Allow the generated modules to extend the namespace defined by "name" in rollup config -- rather than always replace.
- Changes the way the "Microsoft.ApplicationInsights" is defined for each module to all modules to be added to the same namespace
### Update applicationinsights-rollup-es3 to v1.1.2
-#1311 Allow the generated modules to extend the namespace defined by "name" in rollup config -- rather than always replace.
-#1204 When a fetch polyfill is installed there reporting endpoint is also causing events to be sent
-#1202 ai_user and ai_session cookies not set #1203
-#1201 add to auto track exceptions in react native plugin
-#1199 Build is breaking when you do a "rush update --full --purge --recheck" due to tslib v1.11.0 update
-#1194 XHR/Fetch enhancement - add additional telemetry from window.performance #1195
-#1193 add sanitizer for operationName
-#1189 Add the option to specify the refUri with stopTrackPage #1190
-#1186 App Insights initialization setting 'enableAjaxErrorStatusText' is not working #1187
#### XHR/Fetch enhancement
Adds additional performance data derived from the window.performance.getEntries() for the fetch or XHR request.
Configuration options
| Name | Default | Description |
|------|---------|-------------|
| enableAjaxPerfTracking | false | Default false. Flag to enable looking up and including additional browser window.performance timings in the reported ajax (XHR and fetch) reported metrics.
| maxAjaxPerfLookupAttempts | 3 | Defaults to 3. The maximum number of times to look for the window.performance timings (if available), this is required as not all browsers populate the window.performance before reporting the end of the XHR request and for fetch requests this is added after its complete.
| ajaxPerfLookupDelay | 25 | Defaults to 25ms. The amount of time to wait before re-attempting to find the windows.performance timings for an ajax request, time is in milliseconds and is passed directly to setTimeout().
#### Auto track exception React Native Plugin
This has been enabled by default in the updated version.
It can be disabled by adding the ```disableExceptionCollection``` config value with a value of true.
With this release the source files can be loaded in an ES3 environment (IE7/8) and send requests to the server. As part of this change you will now receive requests from users using an older browser, prior to this version users using an ES3 base browser will (most likely) have been getting a javascript error, which would have caused no data to be sent.
### Enable support for reusing plugins in multiple instances of AppInsights #1132
We have added upport to enable reusing the same plugin in different instances of AppInsights, owned by the same application (but using different Instrumentation keys) is required so that they can reuse a single Plugin instance for all instances.
This changes introduces a new [`IProcessTelemetryContext`](https://github.com/microsoft/ApplicationInsights-JS/blob/master/shared/AppInsightsCore/src/JavaScriptSDK/ProcessTelemetryContext.ts) interface that is passed to the processTelemetry() method so that the plugins can use the current request context for the event rather than the context during initialization.
To assist with creating plugins we have also introduced a base class that you can use for creating new plugins [BaseTelemetryPlugin](https://github.com/microsoft/ApplicationInsights-JS/blob/master/shared/AppInsightsCore/src/JavaScriptSDK/BaseTelemetryPlugin.ts), details are included on the [Readme](https://github.com/microsoft/ApplicationInsights-JS/blob/master/README.md)
### Changelog
-#1175 [BUG] Typescript build with 2.4.0 breaks #1173
> *You do not need to upgrade for drag and drop to work. It will work on all previous and future versions of the javascript (and Node.js) SDK
https://i.imgur.com/Efue9nU.gif
You can now drag and drop your source maps onto your Exception Telemetry in the Azure Portal to unminify your callstack. Please open an issue or use the Feedback button in the Portal if a source map you've uploaded is not working as intended. This is a first iteration and in a future update, your source maps will be automatically unminified.
#### SPA Route Change Tracking
You can set `enableAutoRouteTracking: true` to enable state based route tracking for your Single Page Application (React, Angular, Vue, etc). You do not need to install a separate plugin to use this configuration option.
This setting will cause a new Page View telemetry item to be sent each time your app's route changes (**including** Hash route changes).
### Changelog
-#920 Resolve jest testing issues when using React plugin
-#928 Make analytics plugin have last priority
-#936 Fallback to XHR Sender when beacon sender tries to send >64 KB
This update has a couple of **non-breaking** API changes. Namely, `trackException` is now consistent with the Node.js SDK. The only change here is the named argument is renamed from **`error`** to **`exception`**. A shim is in place so **any existing usages of `trackException` will still work**, and the old field is marked as optional, so any type-checked files will still "compile". There are no breaking changes with this change, but you are encouraged to use `exception` as your named argument field as error will be deprecated in a future major version.
#### Old
```js
appInsights.trackException({ error: new Error() });
```
#### New
```js
appInsights.trackException({ exception: new Error() });
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`.
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.
#### Old
```js
var telemetryInitializer = (item) => {
item.tags.push({ "ai.cloud.role": "My Web App" });