@cloudcare/browser-rum 3.3.16 → 3.3.18
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/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/disabledRumPublicApi.js +41 -0
- package/cjs/boot/disabledRumPublicApi.js.map +1 -0
- package/cjs/boot/rum.entry.js +3 -2
- package/cjs/boot/rum.entry.js.map +1 -1
- package/cjs/boot/rum.slim.entry.js +1 -1
- package/cjs/boot/rum.slim.entry.js.map +1 -1
- package/cjs/boot/rumEntryFactory.js +12 -3
- package/cjs/boot/rumEntryFactory.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +1 -1
- package/cjs/domain/replay/record/canvasCommandCapture.js +2 -1
- package/cjs/domain/replay/record/canvasCommandCapture.js.map +1 -1
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js +2 -1
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
- package/cjs/domain/replay/record/canvasContinuousScheduler.js +1 -1
- package/cjs/domain/replay/record/canvasContinuousScheduler.js.map +1 -1
- package/cjs/domain/replay/record/canvasEncodeWorker.js +1 -1
- package/cjs/domain/replay/record/mutationObserver.js +12 -12
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
- package/cjs/domain/replay/record/observers.js +2 -2
- package/cjs/domain/replay/record/observers.js.map +1 -1
- package/cjs/domain/replay/record/record.js +29 -21
- package/cjs/domain/replay/record/record.js.map +1 -1
- package/cjs/domain/replay/record/serialize.js +6 -9
- package/cjs/domain/replay/record/serialize.js.map +1 -1
- package/cjs/domain/replay/record/shadowRootsController.js +3 -3
- package/cjs/domain/replay/record/shadowRootsController.js.map +1 -1
- package/cjs/domain/replay/replayStats.js +2 -1
- package/cjs/domain/replay/replayStats.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segment.js +14 -10
- package/cjs/domain/replay/segmentCollection/segment.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +9 -8
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js +1 -1
- package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js +1 -1
- package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/webSocketCollection.js +1 -1
- package/cjs/domain/rumEventsCollection/resource/webSocketCollection.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/disabledRumPublicApi.js +35 -0
- package/esm/boot/disabledRumPublicApi.js.map +1 -0
- package/esm/boot/rum.entry.js +3 -2
- package/esm/boot/rum.entry.js.map +1 -1
- package/esm/boot/rum.slim.entry.js +1 -1
- package/esm/boot/rum.slim.entry.js.map +1 -1
- package/esm/boot/rumEntryFactory.js +13 -4
- package/esm/boot/rumEntryFactory.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/replay/record/canvasCommandCapture.js +2 -1
- package/esm/domain/replay/record/canvasCommandCapture.js.map +1 -1
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js +2 -1
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
- package/esm/domain/replay/record/canvasContinuousScheduler.js +2 -1
- package/esm/domain/replay/record/canvasContinuousScheduler.js.map +1 -1
- package/esm/domain/replay/record/canvasEncodeWorker.js +1 -1
- package/esm/domain/replay/record/mutationObserver.js +13 -12
- package/esm/domain/replay/record/mutationObserver.js.map +1 -1
- package/esm/domain/replay/record/observers.js +3 -2
- package/esm/domain/replay/record/observers.js.map +1 -1
- package/esm/domain/replay/record/record.js +31 -22
- package/esm/domain/replay/record/record.js.map +1 -1
- package/esm/domain/replay/record/serialize.js +6 -8
- package/esm/domain/replay/record/serialize.js.map +1 -1
- package/esm/domain/replay/record/shadowRootsController.js +4 -3
- package/esm/domain/replay/record/shadowRootsController.js.map +1 -1
- package/esm/domain/replay/replayStats.js +2 -1
- package/esm/domain/replay/replayStats.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segment.js +14 -10
- package/esm/domain/replay/segmentCollection/segment.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segmentCollection.js +9 -8
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js +2 -1
- package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js +2 -1
- package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js +2 -1
- package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/webSocketCollection.js +2 -1
- package/esm/domain/rumEventsCollection/resource/webSocketCollection.js.map +1 -1
- package/package.json +4 -4
- package/src/boot/disabledRumPublicApi.js +39 -0
- package/src/boot/rum.entry.js +3 -2
- package/src/boot/rum.slim.entry.js +1 -1
- package/src/boot/rumEntryFactory.js +13 -5
- package/src/domain/replay/record/canvasCommandCapture.js +2 -1
- package/src/domain/replay/record/canvasCommandSerializeArgs.js +2 -1
- package/src/domain/replay/record/canvasContinuousScheduler.js +2 -1
- package/src/domain/replay/record/mutationObserver.js +14 -13
- package/src/domain/replay/record/observers.js +3 -2
- package/src/domain/replay/record/record.js +33 -29
- package/src/domain/replay/record/serialize.js +6 -15
- package/src/domain/replay/record/shadowRootsController.js +4 -3
- package/src/domain/replay/replayStats.js +2 -1
- package/src/domain/replay/segmentCollection/segment.js +16 -9
- package/src/domain/replay/segmentCollection/segmentCollection.js +18 -14
- package/src/domain/rumEventsCollection/actions/getActionNameFromElement.js +2 -1
- package/src/domain/rumEventsCollection/actions/interactionSelectorCache.js +2 -1
- package/src/domain/rumEventsCollection/resource/resourceTrackerManager.js +2 -1
- package/src/domain/rumEventsCollection/resource/webSocketCollection.js +2 -1
- package/types/index.d.ts +5 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKMap } from '@cloudcare/browser-core'
|
|
1
2
|
import {
|
|
2
3
|
noop,
|
|
3
4
|
isNodeShadowHost,
|
|
@@ -443,7 +444,7 @@ export function processMutations(
|
|
|
443
444
|
}
|
|
444
445
|
var transactionState =
|
|
445
446
|
mutationBatchContext && mutationBatchContext.transaction
|
|
446
|
-
var nodePrivacyLevelCache = new
|
|
447
|
+
var nodePrivacyLevelCache = new SDKMap()
|
|
447
448
|
var pendingRootTasksToRefresh = new Set()
|
|
448
449
|
var childListMutations = []
|
|
449
450
|
var characterDataMutations = []
|
|
@@ -742,7 +743,7 @@ export function processMutations(
|
|
|
742
743
|
currentSourceState,
|
|
743
744
|
transactionState &&
|
|
744
745
|
(transactionState.$rHandledAttributeMutations ||
|
|
745
|
-
(transactionState.$rHandledAttributeMutations = new
|
|
746
|
+
(transactionState.$rHandledAttributeMutations = new SDKMap()))
|
|
746
747
|
)
|
|
747
748
|
consumeMutationNormalizationBudget(
|
|
748
749
|
normalizationState,
|
|
@@ -943,9 +944,9 @@ function processChildListMutations(
|
|
|
943
944
|
// two mutation records, one with a "removedNodes" and the other with "addedNodes". In this case,
|
|
944
945
|
// the node will be in both sets.
|
|
945
946
|
var addedAndMovedNodes = new Set()
|
|
946
|
-
var removedNodes = new
|
|
947
|
+
var removedNodes = new SDKMap()
|
|
947
948
|
var replacementNodes = new Set()
|
|
948
|
-
var singleReplacementNodes = new
|
|
949
|
+
var singleReplacementNodes = new SDKMap()
|
|
949
950
|
for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {
|
|
950
951
|
var mutation = mutations_1[_i]
|
|
951
952
|
var coalescedTextReplacementMarker = undefined
|
|
@@ -1618,7 +1619,7 @@ function processAttributesMutations(
|
|
|
1618
1619
|
var attributeMutations = []
|
|
1619
1620
|
|
|
1620
1621
|
// Deduplicate mutations based on their target node and changed attribute
|
|
1621
|
-
handledElements = handledElements || new
|
|
1622
|
+
handledElements = handledElements || new SDKMap()
|
|
1622
1623
|
var filteredMutations = mutations.filter(function (mutation) {
|
|
1623
1624
|
if (
|
|
1624
1625
|
consumeMutationNormalizationBudget(
|
|
@@ -1641,7 +1642,7 @@ function processAttributesMutations(
|
|
|
1641
1642
|
})
|
|
1642
1643
|
|
|
1643
1644
|
// Emit mutations
|
|
1644
|
-
var emittedMutations = new
|
|
1645
|
+
var emittedMutations = new SDKMap()
|
|
1645
1646
|
for (
|
|
1646
1647
|
var _i = 0, filteredMutations_2 = filteredMutations;
|
|
1647
1648
|
_i < filteredMutations_2.length;
|
|
@@ -1852,7 +1853,7 @@ export function createMutationTasksController(
|
|
|
1852
1853
|
var deferredRootTaskCount = 0
|
|
1853
1854
|
var deferredRootTaskOutstandingCount = 0
|
|
1854
1855
|
var pendingRootTaskByRootNode = new WeakMap()
|
|
1855
|
-
var pendingRootTaskBySequence = new
|
|
1856
|
+
var pendingRootTaskBySequence = new SDKMap()
|
|
1856
1857
|
var scheduledFlush = undefined
|
|
1857
1858
|
var stopped = false
|
|
1858
1859
|
var overflowed = false
|
|
@@ -1860,7 +1861,7 @@ export function createMutationTasksController(
|
|
|
1860
1861
|
var retainedRootTaskApproxBytes = 0
|
|
1861
1862
|
var retainedMutationGroupApproxBytes = 0
|
|
1862
1863
|
var retainedMutationBudgetReservation
|
|
1863
|
-
var completedRootTasksBySequence = new
|
|
1864
|
+
var completedRootTasksBySequence = new SDKMap()
|
|
1864
1865
|
var locallyDroppedRootNodes = new WeakSet()
|
|
1865
1866
|
|
|
1866
1867
|
return {
|
|
@@ -1934,10 +1935,10 @@ export function createMutationTasksController(
|
|
|
1934
1935
|
retainedRootTaskApproxBytes = 0
|
|
1935
1936
|
retainedMutationGroupApproxBytes = 0
|
|
1936
1937
|
updateRetainedMutationResourceBudget()
|
|
1937
|
-
completedRootTasksBySequence = new
|
|
1938
|
+
completedRootTasksBySequence = new SDKMap()
|
|
1938
1939
|
locallyDroppedRootNodes = new WeakSet()
|
|
1939
1940
|
pendingRootTaskByRootNode = new WeakMap()
|
|
1940
|
-
pendingRootTaskBySequence = new
|
|
1941
|
+
pendingRootTaskBySequence = new SDKMap()
|
|
1941
1942
|
}
|
|
1942
1943
|
|
|
1943
1944
|
function reset() {
|
|
@@ -3052,13 +3053,13 @@ export function createMutationTasksController(
|
|
|
3052
3053
|
var emissionGeneration = generation
|
|
3053
3054
|
var ungroupedAdds = []
|
|
3054
3055
|
var ungroupedAddsApproxBytes = 64
|
|
3055
|
-
var queuedRootParentIds = new
|
|
3056
|
+
var queuedRootParentIds = new SDKMap()
|
|
3056
3057
|
var siblingResolutionState = [
|
|
3057
3058
|
getCurrentTime() + MUTATION_NORMALIZATION_MAX_DURATION_MS,
|
|
3058
3059
|
0,
|
|
3059
3060
|
false,
|
|
3060
|
-
new
|
|
3061
|
-
new
|
|
3061
|
+
new SDKMap(),
|
|
3062
|
+
new SDKMap()
|
|
3062
3063
|
]
|
|
3063
3064
|
|
|
3064
3065
|
for (
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKMap } from '@cloudcare/browser-core'
|
|
1
2
|
import {
|
|
2
3
|
instrumentSetter,
|
|
3
4
|
instrumentMethod,
|
|
@@ -649,7 +650,7 @@ export function initInputObserver(
|
|
|
649
650
|
var rootState = radioGroupStateByRoot.get(root)
|
|
650
651
|
if (!rootState) {
|
|
651
652
|
rootState = {
|
|
652
|
-
groupsWithoutForm: new
|
|
653
|
+
groupsWithoutForm: new SDKMap(),
|
|
653
654
|
groupsByForm: new WeakMap()
|
|
654
655
|
}
|
|
655
656
|
radioGroupStateByRoot.set(root, rootState)
|
|
@@ -659,7 +660,7 @@ export function initInputObserver(
|
|
|
659
660
|
}
|
|
660
661
|
var formGroups = rootState.groupsByForm.get(form)
|
|
661
662
|
if (!formGroups) {
|
|
662
|
-
formGroups = new
|
|
663
|
+
formGroups = new SDKMap()
|
|
663
664
|
rootState.groupsByForm.set(form, formGroups)
|
|
664
665
|
}
|
|
665
666
|
return formGroups
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKMap } from '@cloudcare/browser-core'
|
|
1
2
|
import {
|
|
2
3
|
timeStampNow,
|
|
3
4
|
getScrollX,
|
|
@@ -28,8 +29,7 @@ import {
|
|
|
28
29
|
SerializationContextStatus,
|
|
29
30
|
getSerializedNodeApproxBytes,
|
|
30
31
|
SERIALIZATION_MAX_NODE_COUNT,
|
|
31
|
-
SERIALIZATION_MAX_APPROX_BYTES
|
|
32
|
-
FULL_SNAPSHOT_SERIALIZATION_MAX_APPROX_BYTES,
|
|
32
|
+
SERIALIZATION_MAX_APPROX_BYTES
|
|
33
33
|
} from './serialize'
|
|
34
34
|
import { initInputObserver, initObservers } from './observers'
|
|
35
35
|
|
|
@@ -1958,10 +1958,11 @@ export function record(options) {
|
|
|
1958
1958
|
serializerTask.processedNodeCount + SERIALIZATION_MAX_NODE_COUNT,
|
|
1959
1959
|
FULL_SNAPSHOT_SERIALIZATION_MAX_NODE_COUNT
|
|
1960
1960
|
)
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1961
|
+
// The byte watermark yields traversal work; it must not reject an entire
|
|
1962
|
+
// baseline just because its DOM and complete CSS exceed the encoder's
|
|
1963
|
+
// backlog watermark. Keep advancing until the snapshot is complete.
|
|
1964
|
+
var maxApproxBytes =
|
|
1965
|
+
serializerTask.approxBytes + SERIALIZATION_MAX_APPROX_BYTES
|
|
1965
1966
|
var completed = serializerTask.advance(
|
|
1966
1967
|
deadline,
|
|
1967
1968
|
maxNodeCount,
|
|
@@ -1974,10 +1975,7 @@ export function record(options) {
|
|
|
1974
1975
|
(serializerTask.isMaxDepthReached ||
|
|
1975
1976
|
serializerTask.isMaxNodeComplexityReached ||
|
|
1976
1977
|
(serializerTask.isMaxNodeCountReached &&
|
|
1977
|
-
maxNodeCount >= FULL_SNAPSHOT_SERIALIZATION_MAX_NODE_COUNT)
|
|
1978
|
-
(serializerTask.isMaxApproxBytesReached &&
|
|
1979
|
-
maxApproxBytes >=
|
|
1980
|
-
FULL_SNAPSHOT_SERIALIZATION_MAX_APPROX_BYTES))
|
|
1978
|
+
maxNodeCount >= FULL_SNAPSHOT_SERIALIZATION_MAX_NODE_COUNT))
|
|
1981
1979
|
}
|
|
1982
1980
|
}
|
|
1983
1981
|
|
|
@@ -2021,7 +2019,6 @@ export function record(options) {
|
|
|
2021
2019
|
// result from an earlier record: only the segment/encoder result for this
|
|
2022
2020
|
// exact baseline may classify its rejection as transient backpressure.
|
|
2023
2021
|
lastEmitWasLocallyBackpressured = false
|
|
2024
|
-
var timestamp = baselineRecords[0].timestamp
|
|
2025
2022
|
var fullSnapshotAccepted
|
|
2026
2023
|
if (rawEmitBaseline) {
|
|
2027
2024
|
fullSnapshotAccepted = rawEmitBaseline(baselineRecords) !== false
|
|
@@ -2037,13 +2034,6 @@ export function record(options) {
|
|
|
2037
2034
|
fullSnapshotWasPublished = true
|
|
2038
2035
|
currentFullSnapshotPublicationToken.$rPublished = true
|
|
2039
2036
|
|
|
2040
|
-
if (window.visualViewport) {
|
|
2041
|
-
rawEmit({
|
|
2042
|
-
data: getVisualViewport(),
|
|
2043
|
-
type: RecordType.VisualViewport,
|
|
2044
|
-
timestamp: timestamp
|
|
2045
|
-
})
|
|
2046
|
-
}
|
|
2047
2037
|
if (__BUILD_ENV__REPLAY_DEBUG_ENABLED__) {
|
|
2048
2038
|
updateReplayPerformanceStats({
|
|
2049
2039
|
fullSnapshotCount: 1,
|
|
@@ -2053,6 +2043,18 @@ export function record(options) {
|
|
|
2053
2043
|
return true
|
|
2054
2044
|
}
|
|
2055
2045
|
|
|
2046
|
+
function emitFullSnapshotViewport(timestamp) {
|
|
2047
|
+
if (window.visualViewport) {
|
|
2048
|
+
// Call after leaving the previous replay tree so encoder backpressure
|
|
2049
|
+
// retains this record on the new baseline's normal retry queue.
|
|
2050
|
+
emit({
|
|
2051
|
+
data: getVisualViewport(),
|
|
2052
|
+
type: RecordType.VisualViewport,
|
|
2053
|
+
timestamp: timestamp
|
|
2054
|
+
})
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2056
2058
|
function invalidateFullSnapshotCanvasBaseline() {
|
|
2057
2059
|
fullSnapshotCanvasBaselineGeneration += 1
|
|
2058
2060
|
}
|
|
@@ -2230,6 +2232,7 @@ export function record(options) {
|
|
|
2230
2232
|
serializerTask.serializedNode
|
|
2231
2233
|
)
|
|
2232
2234
|
if (emitFullSnapshot(baselineRecords, fullSnapshotStartedAt)) {
|
|
2235
|
+
emitFullSnapshotViewport(timestamp)
|
|
2233
2236
|
return { status: 'completed' }
|
|
2234
2237
|
}
|
|
2235
2238
|
if (wasLastEmitBackpressured()) {
|
|
@@ -3312,6 +3315,7 @@ export function record(options) {
|
|
|
3312
3315
|
resetPreviousReplayTreeRecords()
|
|
3313
3316
|
previousReplayTreeAdmissionActive = false
|
|
3314
3317
|
captureRecordsAgainstPreviousReplayTree = false
|
|
3318
|
+
emitFullSnapshotViewport(baselineRecords[0].timestamp)
|
|
3315
3319
|
flushDeferredRecords()
|
|
3316
3320
|
if (!suppressRecordsUntilFullSnapshot && !recordStopped) {
|
|
3317
3321
|
takeFullSnapshotCanvasBaseline()
|
|
@@ -3801,12 +3805,12 @@ function createEmptyMutationPayload() {
|
|
|
3801
3805
|
textsApproxBytes: 0,
|
|
3802
3806
|
attributesApproxBytes: 0,
|
|
3803
3807
|
addApproxBytes: [],
|
|
3804
|
-
removesByKey: new
|
|
3805
|
-
removeApproxBytesByKey: new
|
|
3806
|
-
textsById: new
|
|
3807
|
-
textApproxBytesById: new
|
|
3808
|
-
attributesById: new
|
|
3809
|
-
attributeApproxBytesById: new
|
|
3808
|
+
removesByKey: new SDKMap(),
|
|
3809
|
+
removeApproxBytesByKey: new SDKMap(),
|
|
3810
|
+
textsById: new SDKMap(),
|
|
3811
|
+
textApproxBytesById: new SDKMap(),
|
|
3812
|
+
attributesById: new SDKMap(),
|
|
3813
|
+
attributeApproxBytesById: new SDKMap()
|
|
3810
3814
|
}
|
|
3811
3815
|
}
|
|
3812
3816
|
|
|
@@ -3998,7 +4002,7 @@ function hasRemoveToAddDependency(
|
|
|
3998
4002
|
// A later remove is a new transition when the same node (or an ancestor in
|
|
3999
4003
|
// the staged add tree) was already paired with this add. Keep sibling removes
|
|
4000
4004
|
// eligible: one add token can contain nodes moved from several observers.
|
|
4001
|
-
var pairedRemovedNodesByPublicationToken = new
|
|
4005
|
+
var pairedRemovedNodesByPublicationToken = new SDKMap()
|
|
4002
4006
|
removesAlreadyPairedWithAdds.forEach(function (remove) {
|
|
4003
4007
|
var removedNode = getMutationRemoveSourceNode(remove)
|
|
4004
4008
|
if (
|
|
@@ -4181,8 +4185,8 @@ function createStructuralMutationComponents(
|
|
|
4181
4185
|
wasNodePublishedBeforePendingMutation
|
|
4182
4186
|
) {
|
|
4183
4187
|
var structuralEntries = []
|
|
4184
|
-
var entriesByParentId = new
|
|
4185
|
-
var addEntryIndexByPublicationToken = new
|
|
4188
|
+
var entriesByParentId = new SDKMap()
|
|
4189
|
+
var addEntryIndexByPublicationToken = new SDKMap()
|
|
4186
4190
|
|
|
4187
4191
|
function appendStructuralEntry(type, entry, approxBytes) {
|
|
4188
4192
|
var entryIndex = structuralEntries.length
|
|
@@ -4284,7 +4288,7 @@ function createStructuralMutationComponents(
|
|
|
4284
4288
|
}
|
|
4285
4289
|
})
|
|
4286
4290
|
|
|
4287
|
-
var componentsByRoot = new
|
|
4291
|
+
var componentsByRoot = new SDKMap()
|
|
4288
4292
|
structuralEntries.forEach(function (structuralEntry, entryIndex) {
|
|
4289
4293
|
var root = findRoot(entryIndex)
|
|
4290
4294
|
var component = componentsByRoot.get(root)
|
|
@@ -4304,7 +4308,7 @@ function createStructuralMutationComponents(
|
|
|
4304
4308
|
})
|
|
4305
4309
|
|
|
4306
4310
|
var components = Array.from(componentsByRoot.values())
|
|
4307
|
-
var addComponentByNodeId = new
|
|
4311
|
+
var addComponentByNodeId = new SDKMap()
|
|
4308
4312
|
components.forEach(function (component) {
|
|
4309
4313
|
component.adds.forEach(function (addEntry) {
|
|
4310
4314
|
addComponentByNodeId.set(addEntry.entry.node.id, component)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKMap } from '@cloudcare/browser-core'
|
|
1
2
|
import {
|
|
2
3
|
assign,
|
|
3
4
|
startsWith,
|
|
@@ -60,13 +61,9 @@ export var SERIALIZATION_MAX_ATTRIBUTE_COUNT = 1000
|
|
|
60
61
|
export var SERIALIZATION_MAX_NODE_SOURCE_LENGTH = 200000
|
|
61
62
|
export var SERIALIZATION_MAX_MUTATION_SOURCE_LENGTH = 64 * 1024
|
|
62
63
|
export var SERIALIZATION_TRUNCATION_MARK = '…'
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
// well below the segment collection's 4 MiB backlog watermark.
|
|
64
|
+
// Bound each traversal slice. A complete snapshot may span multiple slices;
|
|
65
|
+
// this is not a size limit for the resulting DOM and CSS record.
|
|
66
66
|
export var SERIALIZATION_MAX_APPROX_BYTES = 1024 * 1024
|
|
67
|
-
// Reserve segment metadata below the existing 4 MiB pending-raw budget.
|
|
68
|
-
export var FULL_SNAPSHOT_SERIALIZATION_MAX_APPROX_BYTES =
|
|
69
|
-
SERIALIZATION_MAX_APPROX_BYTES * 4 - 64 * 1024
|
|
70
67
|
var serializedNodeApproxBytes = new WeakMap()
|
|
71
68
|
|
|
72
69
|
export function serializeDocument(
|
|
@@ -955,10 +952,7 @@ function getAttributesForPrivacyLevel(element, nodePrivacyLevel, options) {
|
|
|
955
952
|
doc,
|
|
956
953
|
element.href
|
|
957
954
|
)
|
|
958
|
-
var cssText = getCssRulesString(
|
|
959
|
-
stylesheet,
|
|
960
|
-
FULL_SNAPSHOT_SERIALIZATION_MAX_APPROX_BYTES / 2
|
|
961
|
-
)
|
|
955
|
+
var cssText = getCssRulesString(stylesheet)
|
|
962
956
|
if (cssText && stylesheet) {
|
|
963
957
|
safeAttrs._cssText = cssText
|
|
964
958
|
}
|
|
@@ -966,10 +960,7 @@ function getAttributesForPrivacyLevel(element, nodePrivacyLevel, options) {
|
|
|
966
960
|
|
|
967
961
|
// dynamic stylesheet
|
|
968
962
|
if (tagName === 'style' && element.sheet) {
|
|
969
|
-
var cssText = getCssRulesString(
|
|
970
|
-
element.sheet,
|
|
971
|
-
FULL_SNAPSHOT_SERIALIZATION_MAX_APPROX_BYTES / 2
|
|
972
|
-
)
|
|
963
|
+
var cssText = getCssRulesString(element.sheet)
|
|
973
964
|
if (cssText) {
|
|
974
965
|
safeAttrs._cssText = cssText
|
|
975
966
|
}
|
|
@@ -1054,7 +1045,7 @@ function getStyleSheetByHref(serializationContext, doc, href) {
|
|
|
1054
1045
|
|
|
1055
1046
|
var styleSheetByHref = serializationContext.styleSheetByHref
|
|
1056
1047
|
if (!styleSheetByHref) {
|
|
1057
|
-
styleSheetByHref = new
|
|
1048
|
+
styleSheetByHref = new SDKMap()
|
|
1058
1049
|
for (var i = 0; i < doc.styleSheets.length; i += 1) {
|
|
1059
1050
|
var styleSheet = doc.styleSheets[i]
|
|
1060
1051
|
if (styleSheet.href) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKMap } from '@cloudcare/browser-core'
|
|
1
2
|
import {
|
|
2
3
|
getParentNode,
|
|
3
4
|
instrumentMethod,
|
|
@@ -79,7 +80,7 @@ export var initShadowRootsController = function (configuration, data) {
|
|
|
79
80
|
|
|
80
81
|
var nextGenerationId = 0
|
|
81
82
|
var activeGeneration = createGeneration()
|
|
82
|
-
var controllerByShadowRoot = new
|
|
83
|
+
var controllerByShadowRoot = new SDKMap()
|
|
83
84
|
// Persist only the latest registration identity. This distinguishes a root
|
|
84
85
|
// retired by a baseline reset from a never-registered nested root without
|
|
85
86
|
// walking the retired generation during reset.
|
|
@@ -256,7 +257,7 @@ export var initShadowRootsController = function (configuration, data) {
|
|
|
256
257
|
|
|
257
258
|
rollbackProvisionalShadowRoots: function (owner) {
|
|
258
259
|
var shadowRoots = owner.provisionalShadowRoots || []
|
|
259
|
-
var retiredControllers = new
|
|
260
|
+
var retiredControllers = new SDKMap()
|
|
260
261
|
for (
|
|
261
262
|
var shadowRootIndex = 0;
|
|
262
263
|
shadowRootIndex < shadowRoots.length;
|
|
@@ -857,7 +858,7 @@ export var initShadowRootsController = function (configuration, data) {
|
|
|
857
858
|
mutationDependencyState.$rPublishedRoots = new WeakSet()
|
|
858
859
|
mutationDependencyState.$rLocallyDroppedRoots = new WeakSet()
|
|
859
860
|
activeGeneration = createGeneration()
|
|
860
|
-
controllerByShadowRoot = new
|
|
861
|
+
controllerByShadowRoot = new SDKMap()
|
|
861
862
|
retireControllerEntries(retiredControllers)
|
|
862
863
|
}
|
|
863
864
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKMap } from '@cloudcare/browser-core'
|
|
1
2
|
export var MAX_STATS_HISTORY = 10
|
|
2
3
|
var statsPerView
|
|
3
4
|
|
|
@@ -27,7 +28,7 @@ export function resetReplayStats() {
|
|
|
27
28
|
|
|
28
29
|
function getOrCreateReplayStats(viewId) {
|
|
29
30
|
if (!statsPerView) {
|
|
30
|
-
statsPerView = new
|
|
31
|
+
statsPerView = new SDKMap()
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
var replayStats
|
|
@@ -38,10 +38,11 @@ export function createSegment(options) {
|
|
|
38
38
|
previouslySerializedRecordData
|
|
39
39
|
) {
|
|
40
40
|
const prefix = metadata.records_count === 0 ? '{"records":[' : ','
|
|
41
|
+
const isFullSnapshot = record.type === RecordType.FullSnapshot
|
|
41
42
|
var preflightResult = preflightRecordSerialization(
|
|
42
43
|
record,
|
|
43
44
|
prefix,
|
|
44
|
-
pendingRawBytesLimit
|
|
45
|
+
isFullSnapshot ? undefined : pendingRawBytesLimit
|
|
45
46
|
)
|
|
46
47
|
if (preflightResult) {
|
|
47
48
|
return preflightResult
|
|
@@ -80,6 +81,7 @@ export function createSegment(options) {
|
|
|
80
81
|
|
|
81
82
|
if (
|
|
82
83
|
pendingRawBytesLimit !== undefined &&
|
|
84
|
+
!isFullSnapshot &&
|
|
83
85
|
rawRecordBytesCount > pendingRawBytesLimit
|
|
84
86
|
) {
|
|
85
87
|
return {
|
|
@@ -122,7 +124,9 @@ export function createSegment(options) {
|
|
|
122
124
|
: 0
|
|
123
125
|
if (
|
|
124
126
|
pendingRawBytesLimit !== undefined &&
|
|
125
|
-
|
|
127
|
+
(isFullSnapshot
|
|
128
|
+
? pendingRawBytesCount >= pendingRawBytesLimit
|
|
129
|
+
: pendingRawBytesCount + rawRecordBytesCount > pendingRawBytesLimit)
|
|
126
130
|
) {
|
|
127
131
|
return {
|
|
128
132
|
status: 'encoder_backpressure',
|
|
@@ -218,23 +222,26 @@ function preflightFullSnapshotAdmission(
|
|
|
218
222
|
if (!record || record.type !== RecordType.FullSnapshot) {
|
|
219
223
|
return
|
|
220
224
|
}
|
|
221
|
-
var knownApproxBytes = getKnownReplayRecordApproxBytes(record)
|
|
222
|
-
if (typeof knownApproxBytes !== 'number') {
|
|
223
|
-
return
|
|
224
|
-
}
|
|
225
|
-
var approximateRawBytes = prefix.length * 2 + knownApproxBytes
|
|
226
225
|
var pendingRawBytesCount = encoder.getPendingRawBytesCount
|
|
227
226
|
? encoder.getPendingRawBytesCount()
|
|
228
227
|
: 0
|
|
229
228
|
if (
|
|
230
229
|
pendingRawBytesLimit !== undefined &&
|
|
231
|
-
pendingRawBytesCount
|
|
230
|
+
pendingRawBytesCount >= pendingRawBytesLimit
|
|
232
231
|
) {
|
|
233
232
|
return {
|
|
234
233
|
status: 'encoder_backpressure',
|
|
235
|
-
estimatedBytesCount:
|
|
234
|
+
estimatedBytesCount: pendingRawBytesCount
|
|
236
235
|
}
|
|
237
236
|
}
|
|
237
|
+
// Like Datadog, admit a complete FullSnapshot into the asynchronous encoder.
|
|
238
|
+
// The watermark limits existing backlog, not the size of one atomic record.
|
|
239
|
+
// If that write exceeds the watermark, later admissions wait for it to drain.
|
|
240
|
+
var knownApproxBytes = getKnownReplayRecordApproxBytes(record)
|
|
241
|
+
if (typeof knownApproxBytes !== 'number') {
|
|
242
|
+
return
|
|
243
|
+
}
|
|
244
|
+
var approximateRawBytes = prefix.length * 2 + knownApproxBytes
|
|
238
245
|
if (
|
|
239
246
|
bytesLimit !== undefined &&
|
|
240
247
|
recordsCount > 0 &&
|
|
@@ -452,7 +452,10 @@ export function doStartSegmentCollection(
|
|
|
452
452
|
unloadingDeliveryBytesRemaining - deliveryResult.$rBytesCount,
|
|
453
453
|
0
|
|
454
454
|
)
|
|
455
|
-
if (
|
|
455
|
+
if (
|
|
456
|
+
deliveryResult.$rAllPayloadsSent === false &&
|
|
457
|
+
!deliveryResult.$rPending
|
|
458
|
+
) {
|
|
456
459
|
// Replay segments are ordered. If an older queued payload does not fit,
|
|
457
460
|
// no current tail may overtake it.
|
|
458
461
|
unloadingDeliveryBudgetExhausted = true
|
|
@@ -518,10 +521,7 @@ export function doStartSegmentCollection(
|
|
|
518
521
|
encoderResult.outputBytesCount +
|
|
519
522
|
SEGMENT_FORM_DATA_ESTIMATED_OVERHEAD
|
|
520
523
|
if (shouldUseExitTransport && unloadingTransportLatched) {
|
|
521
|
-
if (
|
|
522
|
-
unloadingDeliveryBudgetExhausted ||
|
|
523
|
-
estimatedDeliveryBytesCount > unloadingDeliveryBytesRemaining
|
|
524
|
-
) {
|
|
524
|
+
if (unloadingDeliveryBudgetExhausted) {
|
|
525
525
|
unloadingDeliveryBudgetExhausted = true
|
|
526
526
|
reportDroppedRecord(
|
|
527
527
|
'page_exit_delivery_budget',
|
|
@@ -573,7 +573,10 @@ export function doStartSegmentCollection(
|
|
|
573
573
|
exitDeliveryResult.$rBytesCount,
|
|
574
574
|
0
|
|
575
575
|
)
|
|
576
|
-
if (
|
|
576
|
+
if (
|
|
577
|
+
!exitDeliveryResult.$rCurrentPayloadSent &&
|
|
578
|
+
!exitDeliveryResult.$rPending
|
|
579
|
+
) {
|
|
577
580
|
unloadingDeliveryBudgetExhausted = true
|
|
578
581
|
reportDroppedRecord(
|
|
579
582
|
'page_exit_delivery_budget',
|
|
@@ -583,7 +586,10 @@ export function doStartSegmentCollection(
|
|
|
583
586
|
} else {
|
|
584
587
|
// Preserve compatibility with injected transports that predate the
|
|
585
588
|
// aggregate-budget result contract.
|
|
586
|
-
unloadingDeliveryBytesRemaining
|
|
589
|
+
unloadingDeliveryBytesRemaining = Math.max(
|
|
590
|
+
unloadingDeliveryBytesRemaining - estimatedDeliveryBytesCount,
|
|
591
|
+
0
|
|
592
|
+
)
|
|
587
593
|
}
|
|
588
594
|
}
|
|
589
595
|
} else {
|
|
@@ -1356,13 +1362,11 @@ export function doStartSegmentCollection(
|
|
|
1356
1362
|
} else {
|
|
1357
1363
|
flushSegment('encoder_backpressure')
|
|
1358
1364
|
}
|
|
1359
|
-
//
|
|
1360
|
-
//
|
|
1361
|
-
//
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
!isTimeAnchor
|
|
1365
|
-
) {
|
|
1365
|
+
// Later records may be waiting behind a large FullSnapshot write.
|
|
1366
|
+
// Their temporary rejection must not invalidate that already-admitted
|
|
1367
|
+
// baseline. The recorder retries them after the encoder drains;
|
|
1368
|
+
// Meta/Focus within an atomic baseline use rejectBaselineTransaction.
|
|
1369
|
+
if (record.type === RecordType.FullSnapshot) {
|
|
1366
1370
|
failBaselineGeneration(
|
|
1367
1371
|
addResult.$rGeneration,
|
|
1368
1372
|
record.type === RecordType.FullSnapshot
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKMap } from '@cloudcare/browser-core'
|
|
1
2
|
import {
|
|
2
3
|
safeTruncate,
|
|
3
4
|
isIE,
|
|
@@ -24,7 +25,7 @@ export function getActionNameFromElement(
|
|
|
24
25
|
) {
|
|
25
26
|
configuration = configuration || {}
|
|
26
27
|
var userProgrammaticAttribute = configuration.actionNameAttribute
|
|
27
|
-
var nodePrivacyLevelCache = new
|
|
28
|
+
var nodePrivacyLevelCache = new SDKMap()
|
|
28
29
|
var explicitActionName = getExplicitActionName(
|
|
29
30
|
element,
|
|
30
31
|
userProgrammaticAttribute
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { SDKMap } from '@cloudcare/browser-core'
|
|
1
2
|
import { elapsed, ONE_SECOND, relativeNow } from '@cloudcare/browser-core'
|
|
2
3
|
|
|
3
4
|
// Maximum duration for click actions
|
|
4
5
|
export const CLICK_ACTION_MAX_DURATION = 10 * ONE_SECOND
|
|
5
|
-
export const interactionSelectorCache = new
|
|
6
|
+
export const interactionSelectorCache = new SDKMap()
|
|
6
7
|
|
|
7
8
|
export function getInteractionSelector(relativeTimestamp) {
|
|
8
9
|
const selector = interactionSelectorCache.get(relativeTimestamp)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKMap } from '@cloudcare/browser-core'
|
|
1
2
|
import { UUID, assign, deepClone, addTelemetryError } from '@cloudcare/browser-core'
|
|
2
3
|
|
|
3
4
|
var RESOURCE_TRACKER_HEADER = 'x-rum-resource-id'
|
|
@@ -7,7 +8,7 @@ var RESOURCE_TRACKER_ORPHAN_TTL_MS = 5 * 60 * 1000
|
|
|
7
8
|
var DEBUG_CLONE_MAX_DEPTH = 8
|
|
8
9
|
|
|
9
10
|
export function createResourceTrackerManager() {
|
|
10
|
-
var trackers = new
|
|
11
|
+
var trackers = new SDKMap()
|
|
11
12
|
var flushTrackedResource
|
|
12
13
|
|
|
13
14
|
return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKMap } from '@cloudcare/browser-core'
|
|
1
2
|
import {
|
|
2
3
|
clocksNow,
|
|
3
4
|
elapsed,
|
|
@@ -54,7 +55,7 @@ export function trackWebSocket(
|
|
|
54
55
|
webSocketContextObservable,
|
|
55
56
|
viewContexts
|
|
56
57
|
) {
|
|
57
|
-
var registry = new
|
|
58
|
+
var registry = new SDKMap()
|
|
58
59
|
var isWaitingForSessionRenewal = false
|
|
59
60
|
var subscription = webSocketContextObservable.subscribe(function (context) {
|
|
60
61
|
var connection = registry.get(context.instance)
|
package/types/index.d.ts
CHANGED
|
@@ -247,6 +247,11 @@ export type RumPluginInitConfiguration = (
|
|
|
247
247
|
plugins?: RumPlugin[] | undefined
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
/**
|
|
251
|
+
* If SDK API construction fails, methods remain callable but collection is
|
|
252
|
+
* disabled. Context getters return empty objects, createResourceTrackerId()
|
|
253
|
+
* returns an empty string, and snapshotCanvas() resolves as not_recording.
|
|
254
|
+
*/
|
|
250
255
|
export declare const datafluxRum: {
|
|
251
256
|
init: (initConfiguration: RumPluginInitConfiguration) => void
|
|
252
257
|
startView: (options?: string | ViewOptions) => void
|