apps 0.0.1-beta.127 → 0.0.1-beta.129

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.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * One page-wide budget for keepalive request bodies.
3
+ *
4
+ * Fetch refuses a keepalive request, and `sendBeacon` refuses a beacon, once the page's keepalive
5
+ * bodies in flight would pass 64 KiB. Chromium counts every sender on the page together, the
6
+ * Sentry SDK's sandboxed fetch included, while each SDK counts only its own requests. A refused
7
+ * request never leaves the browser and its sender drops it: an error report sent while trace and
8
+ * log exports were in flight was lost this way.
9
+ *
10
+ * Counted here: the dashboard's trace and log exports, its Sentry reports and its analytics
11
+ * events, each of which goes as an ordinary request when it does not fit. Not counted: PostHog's
12
+ * own requests, which the dashboard sends without keepalive, except the beacons PostHog sends as
13
+ * the page unloads (its queued requests and the last replay chunk); and any other keepalive
14
+ * request or beacon on the page.
15
+ */
16
+ /**
17
+ * The page's own `fetch`, taken when this module first loads, before any SDK wraps it. The Sentry
18
+ * SDK wraps `window.fetch` to record each request as a breadcrumb on later reports; the page's own
19
+ * reports and analytics events go through this one, so neither becomes a breadcrumb.
20
+ */
21
+ export declare const pageFetch: typeof fetch;
22
+ /** The keepalive body bytes the page can still send before the browser refuses one. */
23
+ export declare const keepaliveRoom: () => number;
24
+ /**
25
+ * Send with keepalive, counting `keepaliveBytes`, the body's size, against the page's budget; or,
26
+ * given `false`, as an ordinary request. The browser counts a keepalive request until its whole
27
+ * response has arrived, not just its headers, so the bytes are counted until a copy of the
28
+ * response body has been read.
29
+ */
30
+ export declare const countedFetch: (send: typeof fetch, input: RequestInfo | URL, init: RequestInit, keepaliveBytes: number | false) => Promise<Response>;
31
+ /**
32
+ * `send`, with a requested keepalive kept only when the body fits what is left of the page's
33
+ * budget. Otherwise the request goes as an ordinary one, which the browser sends at once but may
34
+ * cancel if the page unloads first.
35
+ */
36
+ export declare const budgetedFetch: (send?: typeof fetch) => typeof fetch;
@@ -39,7 +39,10 @@ export declare const routeTemplates: (templates: Iterable<`/${string}`>) => {
39
39
  match: (path: string) => `/${string}` | undefined;
40
40
  record: (path: string) => Effect.Effect<void, never, never>;
41
41
  };
42
- /** Wrap whichever tracer is already in scope; provide this above the exporter. */
43
- export declare const spanAttributes: (clock?: "system" | "cloudflare-io", recordAll?: boolean) => Layer.Layer<never>;
42
+ /**
43
+ * Wrap whichever tracer is already in scope; provide this above the exporter. `ended` runs after
44
+ * each span has ended, once the exporter holds it.
45
+ */
46
+ export declare const spanAttributes: (clock?: "system" | "cloudflare-io", recordAll?: boolean, ended?: () => void) => Layer.Layer<never>;
44
47
  /** Header and URL filtering without making an unsupported claim about the runtime clock. */
45
48
  export declare const allowlistedSpans: Layer.Layer<never, never, never>;