@microsoft/applicationinsights-react-js 3.3.0-beta.2203-04 → 3.3.0-beta.2203-07
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/applicationinsights-react-js.js +80 -11
- package/browser/applicationinsights-react-js.js.map +1 -1
- package/browser/applicationinsights-react-js.min.js +2 -2
- package/browser/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.d.ts +1 -1
- package/dist/applicationinsights-react-js.js +80 -11
- package/dist/applicationinsights-react-js.js.map +1 -1
- package/dist/applicationinsights-react-js.min.js +2 -2
- package/dist/applicationinsights-react-js.min.js.map +1 -1
- package/dist/applicationinsights-react-js.rollup.d.ts +1 -1
- package/dist-esm/AppInsightsContext.js +1 -1
- package/dist-esm/AppInsightsErrorBoundary.js +1 -1
- package/dist-esm/Interfaces/IReactExtensionConfig.js +1 -1
- package/dist-esm/ReactPlugin.js +1 -1
- package/dist-esm/applicationinsights-react-js.js +1 -1
- package/dist-esm/useTrackEvent.js +1 -1
- package/dist-esm/useTrackMetric.js +1 -1
- package/dist-esm/withAITracking.js +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Plugin, 3.3.0-beta.2203-
|
|
2
|
+
* Application Insights JavaScript SDK - React Plugin, 3.3.0-beta.2203-07
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -363,6 +363,7 @@
|
|
|
363
363
|
var strIsInitialized = "isInitialized";
|
|
364
364
|
var strTeardown = "teardown";
|
|
365
365
|
var strCore = "core";
|
|
366
|
+
var strUpdate = "update";
|
|
366
367
|
var strDisabled = "disabled";
|
|
367
368
|
var strDoTeardown = "_doTeardown";
|
|
368
369
|
|
|
@@ -744,7 +745,7 @@
|
|
|
744
745
|
});
|
|
745
746
|
return objFreeze(enumClass);
|
|
746
747
|
}
|
|
747
|
-
function objExtend(
|
|
748
|
+
function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
748
749
|
var theArgs = arguments;
|
|
749
750
|
var extended = theArgs[0] || {};
|
|
750
751
|
var argLen = theArgs.length;
|
|
@@ -1064,6 +1065,10 @@
|
|
|
1064
1065
|
}
|
|
1065
1066
|
return DiagnosticLogger;
|
|
1066
1067
|
}());
|
|
1068
|
+
function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
|
|
1069
|
+
if (isUserAct === void 0) { isUserAct = false; }
|
|
1070
|
+
(logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
|
|
1071
|
+
}
|
|
1067
1072
|
|
|
1068
1073
|
var strExecutionContextKey = "ctx";
|
|
1069
1074
|
var PerfEvent = /** @class */ (function () {
|
|
@@ -1404,7 +1409,7 @@
|
|
|
1404
1409
|
completeDetails.func.call(completeDetails.self, completeDetails.args);
|
|
1405
1410
|
}
|
|
1406
1411
|
catch (e) {
|
|
1407
|
-
core.logger
|
|
1412
|
+
_throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
|
|
1408
1413
|
}
|
|
1409
1414
|
});
|
|
1410
1415
|
_onComplete = [];
|
|
@@ -1503,6 +1508,27 @@
|
|
|
1503
1508
|
context.createNew = _createNew;
|
|
1504
1509
|
return context;
|
|
1505
1510
|
}
|
|
1511
|
+
function createProcessTelemetryUpdateContext(telemetryChain, config, core, startAt) {
|
|
1512
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1513
|
+
var context = internalContext.ctx;
|
|
1514
|
+
function _processNext(updateState) {
|
|
1515
|
+
return context.iterate(function (plugin) {
|
|
1516
|
+
if (isFunction(plugin[strUpdate])) {
|
|
1517
|
+
plugin[strUpdate](context, updateState);
|
|
1518
|
+
}
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
function _createNew(plugins, startAt) {
|
|
1522
|
+
if (plugins === void 0) { plugins = null; }
|
|
1523
|
+
if (isArray(plugins)) {
|
|
1524
|
+
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1525
|
+
}
|
|
1526
|
+
return createProcessTelemetryUpdateContext(plugins || context.getNext(), config, core, startAt);
|
|
1527
|
+
}
|
|
1528
|
+
context.processNext = _processNext;
|
|
1529
|
+
context.createNew = _createNew;
|
|
1530
|
+
return context;
|
|
1531
|
+
}
|
|
1506
1532
|
function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
1507
1533
|
var firstProxy = null;
|
|
1508
1534
|
var add = startAt ? false : true;
|
|
@@ -1549,6 +1575,7 @@
|
|
|
1549
1575
|
},
|
|
1550
1576
|
processTelemetry: _processTelemetry,
|
|
1551
1577
|
unload: _unloadPlugin,
|
|
1578
|
+
update: _updatePlugin,
|
|
1552
1579
|
_id: chainId,
|
|
1553
1580
|
_setNext: function (nextPlugin) {
|
|
1554
1581
|
nextProxy = nextPlugin;
|
|
@@ -1588,7 +1615,7 @@
|
|
|
1588
1615
|
hasRun = true;
|
|
1589
1616
|
}
|
|
1590
1617
|
if (!nextProxy || !hasNextRun) {
|
|
1591
|
-
itemCtx.diagLog()
|
|
1618
|
+
_throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
1592
1619
|
}
|
|
1593
1620
|
}
|
|
1594
1621
|
}, details, isAsync);
|
|
@@ -1636,6 +1663,24 @@
|
|
|
1636
1663
|
unloadCtx.processNext(unloadState);
|
|
1637
1664
|
}
|
|
1638
1665
|
}
|
|
1666
|
+
function _updatePlugin(updateCtx, updateState) {
|
|
1667
|
+
function _callUpdate() {
|
|
1668
|
+
var hasRun = false;
|
|
1669
|
+
if (plugin) {
|
|
1670
|
+
var pluginState = _getPluginState(plugin);
|
|
1671
|
+
var pluginCore = plugin[strCore] || pluginState.core;
|
|
1672
|
+
if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) {
|
|
1673
|
+
if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) {
|
|
1674
|
+
hasRun = true;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
return hasRun;
|
|
1679
|
+
}
|
|
1680
|
+
if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
|
|
1681
|
+
updateCtx.processNext(updateState);
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1639
1684
|
return objFreeze(proxyChain);
|
|
1640
1685
|
}
|
|
1641
1686
|
|
|
@@ -1805,7 +1850,7 @@
|
|
|
1805
1850
|
_supportsCookies = doc[strCookie] !== undefined;
|
|
1806
1851
|
}
|
|
1807
1852
|
catch (e) {
|
|
1808
|
-
logger
|
|
1853
|
+
_throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1809
1854
|
}
|
|
1810
1855
|
}
|
|
1811
1856
|
return _supportsCookies;
|
|
@@ -1899,7 +1944,7 @@
|
|
|
1899
1944
|
handler(unloadCtx, unloadState);
|
|
1900
1945
|
}
|
|
1901
1946
|
catch (e) {
|
|
1902
|
-
unloadCtx.diagLog()
|
|
1947
|
+
_throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
|
|
1903
1948
|
}
|
|
1904
1949
|
});
|
|
1905
1950
|
handlers = [];
|
|
@@ -1958,6 +2003,30 @@
|
|
|
1958
2003
|
}
|
|
1959
2004
|
return result;
|
|
1960
2005
|
};
|
|
2006
|
+
_self.update = function (updateCtx, updateState) {
|
|
2007
|
+
if (!_self.core || (updateCtx && _self.core !== updateCtx.core())) {
|
|
2008
|
+
return;
|
|
2009
|
+
}
|
|
2010
|
+
var result;
|
|
2011
|
+
var updateDone = false;
|
|
2012
|
+
var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
2013
|
+
var theUpdateState = updateState || {
|
|
2014
|
+
reason: 0
|
|
2015
|
+
};
|
|
2016
|
+
function _updateCallback() {
|
|
2017
|
+
if (!updateDone) {
|
|
2018
|
+
updateDone = true;
|
|
2019
|
+
_setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext());
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
|
|
2023
|
+
_updateCallback();
|
|
2024
|
+
}
|
|
2025
|
+
else {
|
|
2026
|
+
result = true;
|
|
2027
|
+
}
|
|
2028
|
+
return result;
|
|
2029
|
+
};
|
|
1961
2030
|
_self._addHook = function (hooks) {
|
|
1962
2031
|
if (hooks) {
|
|
1963
2032
|
if (isArray(hooks)) {
|
|
@@ -2046,12 +2115,12 @@
|
|
|
2046
2115
|
}
|
|
2047
2116
|
return name;
|
|
2048
2117
|
}
|
|
2049
|
-
function _getEvtNamespace(eventName,
|
|
2050
|
-
if (
|
|
2118
|
+
function _getEvtNamespace(eventName, evtNamespace) {
|
|
2119
|
+
if (evtNamespace) {
|
|
2051
2120
|
var theNamespace_1 = "";
|
|
2052
|
-
if (isArray(
|
|
2121
|
+
if (isArray(evtNamespace)) {
|
|
2053
2122
|
theNamespace_1 = "";
|
|
2054
|
-
arrForEach(
|
|
2123
|
+
arrForEach(evtNamespace, function (name) {
|
|
2055
2124
|
name = _normalizeNamespace(name);
|
|
2056
2125
|
if (name) {
|
|
2057
2126
|
if (name[0] !== ".") {
|
|
@@ -2062,7 +2131,7 @@
|
|
|
2062
2131
|
});
|
|
2063
2132
|
}
|
|
2064
2133
|
else {
|
|
2065
|
-
theNamespace_1 = _normalizeNamespace(
|
|
2134
|
+
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
2066
2135
|
}
|
|
2067
2136
|
if (theNamespace_1) {
|
|
2068
2137
|
if (theNamespace_1[0] !== ".") {
|