@absolutejs/beacon 0.6.53 → 0.6.54
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/README.md +7 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +31 -5
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -125,6 +125,9 @@ beacon.captureMessage("checkout started", "info");
|
|
|
125
125
|
scroll containers, and absolutely positioned escapees (badges, popovers,
|
|
126
126
|
drawers) are skipped by design; mark deliberate
|
|
127
127
|
bleeds with `data-beacon-overflow="allow"`.
|
|
128
|
+
Geometry scans pause while the mobile visual viewport is horizontally
|
|
129
|
+
shifted or zoomed, so iOS keyboard/pan coordinates are not mistaken for
|
|
130
|
+
document overflow.
|
|
128
131
|
- **Control-collision signals** — the same settled scan reports interactive
|
|
129
132
|
controls from separate layout groups whose border boxes overlap or render
|
|
130
133
|
with effectively no spacing. Same-parent rows, semantic control groups,
|
|
@@ -199,7 +202,10 @@ beacon.captureMessage("checkout started", "info");
|
|
|
199
202
|
interactions and separates input delay, handler time, and presentation delay.
|
|
200
203
|
Overlapping long animation frames include their worst script when the browser
|
|
201
204
|
exposes it; missing browser attribution is labeled explicitly. Layout
|
|
202
|
-
Instability names shifted elements.
|
|
205
|
+
Instability names shifted elements. When the browser supplies no shifted
|
|
206
|
+
node, Beacon retains startup/runtime phase plus recent interaction type,
|
|
207
|
+
target, and age; stable provenance separates issue grouping while volatile
|
|
208
|
+
age remains diagnostic-only. Successful HTTP responses can be
|
|
203
209
|
classified through the host-owned `instrument.classifyResponse` callback for
|
|
204
210
|
GraphQL-style errors. Selected HTTP 4xx/5xx responses can be promoted through
|
|
205
211
|
the opt-in `instrument.classifyErrorResponse` callback when application context
|
package/dist/index.d.ts
CHANGED
|
@@ -107,7 +107,7 @@ export declare const BEACON_ATTRIBUTE: {
|
|
|
107
107
|
/** Response header used to correlate a browser signal with its server request. */
|
|
108
108
|
export declare const BEACON_TRACE_HEADER = "x-absolute-trace-id";
|
|
109
109
|
/** Beacon package version retained with every captured event. */
|
|
110
|
-
export declare const BEACON_SDK_VERSION = "0.6.
|
|
110
|
+
export declare const BEACON_SDK_VERSION = "0.6.54";
|
|
111
111
|
/** Arbitrary event tags, with Beacon's reserved `signal` tag type-checked. */
|
|
112
112
|
export type BeaconTags = Record<string, string> & {
|
|
113
113
|
signal?: BeaconSignal;
|
package/dist/index.js
CHANGED
|
@@ -76,7 +76,7 @@ var BEACON_ATTRIBUTE = {
|
|
|
76
76
|
THEME: "data-beacon-theme"
|
|
77
77
|
};
|
|
78
78
|
var BEACON_TRACE_HEADER = "x-absolute-trace-id";
|
|
79
|
-
var BEACON_SDK_VERSION = "0.6.
|
|
79
|
+
var BEACON_SDK_VERSION = "0.6.54";
|
|
80
80
|
var inBrowser = () => typeof window !== "undefined";
|
|
81
81
|
var newId = () => {
|
|
82
82
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
@@ -494,6 +494,7 @@ var VOLATILE_SIGNAL_TAGS = new Set([
|
|
|
494
494
|
"errorCount",
|
|
495
495
|
"inputDelayMs",
|
|
496
496
|
"interactionId",
|
|
497
|
+
"interactionAgeMs",
|
|
497
498
|
"loadCount",
|
|
498
499
|
"newestRelease",
|
|
499
500
|
"obscuredPx",
|
|
@@ -799,6 +800,7 @@ var createBeacon = (options) => {
|
|
|
799
800
|
const FORM_FRUSTRATION_THRESHOLD = 3;
|
|
800
801
|
const FORM_FRUSTRATION_WINDOW_MS = 60000;
|
|
801
802
|
const LAYOUT_SHIFT_RECENT_INTERACTION_MS = 500;
|
|
803
|
+
const LAYOUT_SHIFT_INTERACTION_PROVENANCE_MS = 1e4;
|
|
802
804
|
const LAYOUT_SHIFT_VIEWPORT_RESIZE_SETTLE_MS = 500;
|
|
803
805
|
const VIEWPORT_RESIZE_HISTORY_LIMIT = 8;
|
|
804
806
|
const FORM_INVALID_BURST_GAP_MS = 100;
|
|
@@ -855,6 +857,14 @@ var createBeacon = (options) => {
|
|
|
855
857
|
const visualViewport = window.visualViewport;
|
|
856
858
|
return visualViewport !== undefined && visualViewport !== null && visualViewport.height > 0 && window.innerHeight > 0 && visualViewport.height < window.innerHeight * KEYBOARD_VIEWPORT_HEIGHT_RATIO_MAX && focusedEditable() !== null;
|
|
857
859
|
};
|
|
860
|
+
const visualViewportHorizontallyShifted = () => {
|
|
861
|
+
const visualViewport = window.visualViewport;
|
|
862
|
+
if (visualViewport === undefined || visualViewport === null)
|
|
863
|
+
return false;
|
|
864
|
+
const layoutWidth = document.documentElement.clientWidth;
|
|
865
|
+
const tolerancePx = 2;
|
|
866
|
+
return Math.abs(visualViewport.offsetLeft) > tolerancePx || visualViewport.width > 0 && visualViewport.width < layoutWidth - tolerancePx || visualViewport.scale !== undefined && Math.abs(visualViewport.scale - 1) > 0.01;
|
|
867
|
+
};
|
|
858
868
|
let overflowScanOnNavigation = null;
|
|
859
869
|
let recordRequestForStorm = null;
|
|
860
870
|
const OVERLAY_VIEWPORT_COVERAGE_MIN = 0.9;
|
|
@@ -2684,7 +2694,7 @@ var createBeacon = (options) => {
|
|
|
2684
2694
|
});
|
|
2685
2695
|
};
|
|
2686
2696
|
const runSettledScan = () => {
|
|
2687
|
-
const geometryReady = documentStylesAreReady() && !mobileKeyboardViewportActive();
|
|
2697
|
+
const geometryReady = documentStylesAreReady() && !mobileKeyboardViewportActive() && !visualViewportHorizontallyShifted();
|
|
2688
2698
|
if (detectOverflow && geometryReady)
|
|
2689
2699
|
scanForOverflow();
|
|
2690
2700
|
if (detectControlCollision && geometryReady)
|
|
@@ -2763,10 +2773,26 @@ var createBeacon = (options) => {
|
|
|
2763
2773
|
continue;
|
|
2764
2774
|
const targets = (entry.sources ?? []).map(({ node }) => node instanceof Element ? describeElement(node) : undefined).filter((target) => target !== undefined).slice(0, 5);
|
|
2765
2775
|
const key = targets.join(",") || "unknown";
|
|
2766
|
-
|
|
2776
|
+
const framePhase = entry.startTime < MAIN_THREAD_STALL_DEFAULT_WINDOW_MS ? "startup" : "runtime";
|
|
2777
|
+
const interactionProvenance = key === "unknown" && recentInteraction !== undefined && interactionAgeMs !== undefined && interactionAgeMs >= 0 && interactionAgeMs <= LAYOUT_SHIFT_INTERACTION_PROVENANCE_MS ? recentInteraction : undefined;
|
|
2778
|
+
const reportKey = key === "unknown" ? [
|
|
2779
|
+
key,
|
|
2780
|
+
framePhase,
|
|
2781
|
+
interactionProvenance?.type ?? "no-interaction",
|
|
2782
|
+
interactionProvenance?.target ?? "unknown"
|
|
2783
|
+
].join("|") : key;
|
|
2784
|
+
if (reported.has(reportKey))
|
|
2767
2785
|
continue;
|
|
2768
|
-
reported.add(
|
|
2786
|
+
reported.add(reportKey);
|
|
2769
2787
|
emitSignal(`Disruptive layout shift — ${key} — ${shortUrl(location.href)}`, {
|
|
2788
|
+
...key === "unknown" ? {
|
|
2789
|
+
framePhase,
|
|
2790
|
+
...interactionProvenance === undefined ? {} : {
|
|
2791
|
+
interactionAgeMs: String(Math.round(interactionAgeMs ?? 0)),
|
|
2792
|
+
interactionTarget: interactionProvenance.target,
|
|
2793
|
+
interactionType: interactionProvenance.type
|
|
2794
|
+
}
|
|
2795
|
+
} : {},
|
|
2770
2796
|
shiftValue: String(entry.value ?? 0),
|
|
2771
2797
|
signal: BEACON_SIGNAL.DISRUPTIVE_LAYOUT_SHIFT,
|
|
2772
2798
|
target: key
|
|
@@ -4489,5 +4515,5 @@ export {
|
|
|
4489
4515
|
BEACON_ATTRIBUTE
|
|
4490
4516
|
};
|
|
4491
4517
|
|
|
4492
|
-
//# debugId=
|
|
4518
|
+
//# debugId=AF2331F2AE3F654164756E2164756E21
|
|
4493
4519
|
//# sourceMappingURL=index.js.map
|