github microsoft/ApplicationInsights-JS 2.8.0

latest releases: 3.2.0, nightly-240412-01, nightly-240410-01...
2 years ago
  • Updates React Plugin to v3.3.0 (with v2.8.0 as dependency) -- using React 17
  • Updates React Native Plugin to 2.5.0 (with v2.8.9 as dependency)
  • Updates Chrome Debug Extension to 0.3.0

Potential Breaking Change

  • fetch Ajax tracking was also been change to be on by default from this version moving forward, if you are running in an environment without fetch support and you are using an incompatible polyfill (that doesn't identify itself as a polyfill) or the SDK you start seeing recursive or duplicate (fetch and XHR requests) being reported you WILL need to add disableFetchTracking with a value of true to your configuration to disable this functionality.
  • TypeScript 4.x required for some typings from the core EnumHelperFuncs.d.ts

Significant changes

This release adds support for the SDK to

  • TelemetryInitializers have been moved to BaseCore so they are now available as part of all Sku's and not just those using the analytics plugin (@microsoft/applicationinsights-analytics-js) using the appInsights.addTelemetryInitializer(...)
  • Web Events (addEventHandler) now support "event namespaces" (similar to jQuery) to enable the removing of events by just specifying the namespace and new specific eventOn(...) and eventOff(...) API's.
  • Fully unload, removing all internal event handlers (may be re-initialized) via the appInsights.unload(...) function.
  • Dynamically add a plugin to an already initialized SDK (optionally replacing an existing) via new appInsights.addPlugin(...) function
  • New helper to get any plugin from an initialized SDK via appInsights.getPlugin("...identifier...")
  • Dynamically remove a plugin via the appInsights.getPlugin("...identifier..").remove()
  • Enable / Disable any plugin (even if the plugin doesn't support disabling itself) via appInsights.getPlugin("...identifier...").setEnabled(true/false)
  • The standard name from the analytics plugin @microsoft/applicationinsights-analytics-js has been renamed and is now exported as AnalyticsPlugin, for backward compatibility it is also exported as it's previous name ApplicationInsights, if you are using it directly it is recommended that you update to use the new exported name.

While this release contains a substantial amount of additional functionality and code, there has also been significant minification efforts (which also drove some of the SDK naming) to keep the minified code around the same size. We intend to keep working on additional improvements to attempt to bring the size changes down further. However, the minification improvements do generally cause a lower level of GZip compression most because of the removal of duplicate names. The main readme for the AISKU has a table of the CDN base SKU sizes, as the CDN version includes all public API's (older versions for backward compatibility and newer smaller versions) when using NPM you should see smaller sizes than those shown.

Note:
Due to the above changes required to support the above, there may be some minor TypeScript Type compatibility warnings when you attempt to use components from v2.8.0 with older SDK's (forward compatibility), backward compatibility, using Core v2.8.0 with older components is supported and v2.8.0 is completely backward compatible. This is due to some API's now support both older (for back compat) and new enhanced arguments, we have attempted to keep these changes to a minimum.
If you are getting typing errors such as "Argument of type 'XXXXX' os not assignable to parameter of type 'YYYY'", please ensure that you are using all v2.8.0 components and raise an issue if this does not resolve you issue. As a work around casting to work around this warning should not cause any issues.

Due to the size of this change, the above date is the NPM release date and CDN deployment will be over an extended period.

Changelog - RELEASES.md

Changelog

  • Task 13064945: Enable the option to remove all "added" SDK event listeners as part of calling teardown()
    • Partial, foundational support for #1427 Dynamically updating config (for extensions in my case)
  • #1773 [BUG] IConfig and IConfiguration define different configuration "names" for the cookie manager config
  • #1779 Allow including custom properties in useTrackMetric
  • #1791 Merge remote-tracking branch upstream/beta into master
    • 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)
    • 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
    • Additional Performance enhancements to use provided functions rather than internal polyfill's (#1758)
    • 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)
      • Add Core SDK Unload support
    • Fix telemetry chain for null and undefined
    • Beta Part 4: Part of Mega Dynamic Load/Unload support (#1781)
      • 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
    • 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)
  • #1793 Master Minification Improvements
  • #1796 Minification - Change to only use const enums internally
  • #1798 More Common Minification Updates
  • #1468 Enable fetch automatic dependency tracking by default
  • #1805 Finalize and Update the processTelemetry helper functions

What's Changed

  • remove article link in the ReadMe by @Karlie-777 in #1771
  • Allow including custom properties in useTrackMetric by @simonurmi in #1779
  • Merge remote-tracking branch 'upstream/beta' into MSNev/MergeBetaToMaster by @MSNev in #1791
  • Master Minification Improvements by @MSNev in #1793
  • Minification - Change to only use const enums internally by @MSNev in #1796
  • More Common Minification Updates by @MSNev in #1798
  • Enable fetch automatic dependency tracking by default by @hectorhdzg in #1468
  • Finalize and Update the processTelemetry helper functions by @MSNev in #1805
  • [Release] Increase version to v2.8.0 by @MSNev in #1806

New Contributors

Full Changelog: 2.7.4...2.8.0

Don't miss a new ApplicationInsights-JS release

NewReleases is sending notifications on new releases.