@loggerjs/browser 0.5.2 → 0.5.3
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 +9 -2
- package/dist/index.cjs +478 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +478 -29
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-transport.cjs +366 -15
- package/dist/indexeddb-transport.cjs.map +1 -1
- package/dist/indexeddb-transport.d.ts +41 -0
- package/dist/indexeddb-transport.d.ts.map +1 -1
- package/dist/indexeddb-transport.js +367 -16
- package/dist/indexeddb-transport.js.map +1 -1
- package/dist/offline-first-transport.cjs +369 -16
- package/dist/offline-first-transport.cjs.map +1 -1
- package/dist/offline-first-transport.d.ts.map +1 -1
- package/dist/offline-first-transport.js +370 -17
- package/dist/offline-first-transport.js.map +1 -1
- package/dist/zip-export.cjs +109 -13
- package/dist/zip-export.cjs.map +1 -1
- package/dist/zip-export.d.ts +24 -0
- package/dist/zip-export.d.ts.map +1 -1
- package/dist/zip-export.js +109 -13
- package/dist/zip-export.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ Logs batch over HTTP, queue while offline, replay with backoff when the network
|
|
|
58
58
|
| Transport | Delivers to |
|
|
59
59
|
| --- | --- |
|
|
60
60
|
| `browserHttpTransport` | your collector — batching, offline queue, online replay with backoff, `sendBeacon` on page hide |
|
|
61
|
-
| `indexedDbTransport` | a local, queryable IndexedDB store (TTL, pruning, optional Storage Buckets and
|
|
61
|
+
| `indexedDbTransport` | a local, queryable IndexedDB store (session indexes, TTL, pruning, optional Storage Buckets, durability hints, and optional localStorage spill) |
|
|
62
62
|
| `browserWebSocketTransport` | a WebSocket (codec-encoded batches, queues while closed) |
|
|
63
63
|
| `browserServiceWorkerTransport` | a service worker for centralized delivery; `ready()` waits for `serviceWorker.ready` with `target: "ready"` |
|
|
64
64
|
| `browserBroadcastChannelTransport` | other tabs via `BroadcastChannel` |
|
|
@@ -68,9 +68,16 @@ Logs batch over HTTP, queue while offline, replay with backoff when the network
|
|
|
68
68
|
|
|
69
69
|
- `memoryBrowserHttpOfflineQueue()` — short-lived in-memory retry buffer.
|
|
70
70
|
- `indexedDbBrowserHttpOfflineQueue()` — survives page reloads.
|
|
71
|
-
- `exportLogsToZip()` + `downloadBlob()` — export a persisted store as a zip containing `logs.ndjson`
|
|
71
|
+
- `exportLogsToZip()` + `downloadBlob()` — export a persisted store as a zip containing `logs.ndjson` or `logs.json`, `manifest.json`, optional per-session files, and optional `recent.ndjson` or `recent.json`.
|
|
72
72
|
- Call the `indexedDbTransport()` instance's `stats()` to read flush, prune, query, drop, and buffer-depth counters.
|
|
73
73
|
|
|
74
|
+
`indexedDbTransport()` assigns a page-session id by default for browser support
|
|
75
|
+
stores. Use `query({ sessionId })`, `sessions()`, and
|
|
76
|
+
`exportLogsToZip(..., { groupBySession: true, includeRecent: true })` to build
|
|
77
|
+
support bundles around reload-sized sessions. Enable `localStorageSpill` only
|
|
78
|
+
as a bounded last-chance buffer for the still-unconfirmed memory tail during
|
|
79
|
+
ordinary reloads or tab closes; IndexedDB remains the queryable source of truth.
|
|
80
|
+
|
|
74
81
|
Browser delivery has runtime loss windows: tab close can cut off async work,
|
|
75
82
|
`sendBeacon` is size- and user-agent-limited, service worker delivery depends on
|
|
76
83
|
activation and lifetime, and IndexedDB persistence depends on quota and browser
|