@absolutejs/beacon 0.6.6 → 0.6.7

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/dist/index.d.ts CHANGED
@@ -359,6 +359,11 @@ export type BeaconSignals = {
359
359
  /** Quiet period before an open, visible EventSource counts as stalled.
360
360
  * Default 60000ms. */
361
361
  stalledStreamMs?: number;
362
+ /** Endpoints that are quiet by design — push topics that only emit when
363
+ * something changes, so silence is health, not failure. Streams whose URL
364
+ * matches a string prefix or RegExp here are exempt from the
365
+ * stalled-stream signal (flap detection still applies). */
366
+ quietStreams?: Array<RegExp | string>;
362
367
  /** An `aria-busy`/`role="status"`/`role="progressbar"` element still
363
368
  * visible after `stuckLoadingMs` — a load that silently hung.
364
369
  * Default true. */
package/dist/index.js CHANGED
@@ -2967,7 +2967,8 @@ var createBeacon = (options) => {
2967
2967
  const reportedStreams = new Set;
2968
2968
  const errorsByEndpoint = new Map;
2969
2969
  const reportedFlappingStreams = new Set;
2970
- const instrumentSource = (source, endpointLabel) => {
2970
+ const quietStream = (url) => (signals.quietStreams ?? []).some((pattern) => typeof pattern === "string" ? url.startsWith(pattern) || shortUrl(url).startsWith(pattern) : pattern.test(url));
2971
+ const instrumentSource = (source, endpointLabel, sourceUrl) => {
2971
2972
  let stallTimer;
2972
2973
  const disarm = () => {
2973
2974
  if (stallTimer !== undefined)
@@ -2976,6 +2977,8 @@ var createBeacon = (options) => {
2976
2977
  const check = () => {
2977
2978
  if (signals.stalledStreams === false)
2978
2979
  return;
2980
+ if (quietStream(sourceUrl))
2981
+ return;
2979
2982
  if (source.readyState !== OriginalEventSource.OPEN)
2980
2983
  return;
2981
2984
  if (document.visibilityState === "hidden") {
@@ -3041,7 +3044,7 @@ var createBeacon = (options) => {
3041
3044
  const wrappedEventSource = new Proxy(OriginalEventSource, {
3042
3045
  construct(target, args) {
3043
3046
  const source = Reflect.construct(target, args);
3044
- instrumentSource(source, shortUrl(String(args[0])));
3047
+ instrumentSource(source, shortUrl(String(args[0])), String(args[0]));
3045
3048
  return source;
3046
3049
  }
3047
3050
  });
@@ -3580,5 +3583,5 @@ export {
3580
3583
  BEACON_ATTRIBUTE
3581
3584
  };
3582
3585
 
3583
- //# debugId=89339955D8F62E0E64756E2164756E21
3586
+ //# debugId=1C509449025A90CB64756E2164756E21
3584
3587
  //# sourceMappingURL=index.js.map