Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Thank you for following the naming conventions! 🙏 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds first-class browser-to-server log transport support to evlog with a new framework-agnostic "browser drain" module. The implementation provides both high-level and low-level APIs for sending structured browser logs to HTTP endpoints using fetch or sendBeacon, with built-in batching, retry logic, and automatic flushing on page visibility changes.
Changes:
- Added
evlog/browsermodule withcreateBrowserDrainandcreateBrowserLogDrainfunctions for client-side logging - Comprehensive test suite covering fetch, sendBeacon, timeouts, batching, and pipeline integration
- Complete documentation with examples for Express and Hono server endpoints
- Fully functional browser example app demonstrating the end-to-end flow
- Playground integration with three test scenarios (quick setup, batch events, sendBeacon)
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/evlog/src/browser.ts | Core implementation of browser drain with fetch/sendBeacon transport |
| packages/evlog/test/browser.test.ts | Comprehensive test coverage for both drain functions |
| packages/evlog/tsdown.config.ts | Added browser module to build configuration |
| packages/evlog/package.json | Exported browser module with TypeScript definitions |
| examples/browser/src/client.ts | Demo client showing log.info/log.error usage with browser drain |
| examples/browser/src/server.ts | Hono server with ingest endpoint and demo UI |
| examples/browser/package.json | Example dependencies (Hono, esbuild, tsx) |
| examples/browser/tsconfig.json | TypeScript configuration for the example |
| examples/browser/README.md | Setup and usage instructions for the example |
| apps/playground/app/pages/index.vue | Playground integration with three browser drain test handlers |
| apps/playground/app/config/tests.config.ts | Test configuration for browser drain section |
| apps/playground/server/api/test/browser-ingest.post.ts | API endpoint for playground testing |
| apps/docs/content/3.adapters/9.browser.md | Comprehensive documentation for the browser drain |
| apps/docs/content/3.adapters/1.overview.md | Added browser drain to adapters overview |
| bun.lock | Lockfile updates for new example workspace |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces first-class support for browser log ingestion with a new framework-agnostic "browser drain" for client-side logging. It adds comprehensive documentation, playground integration, and a complete example app, making it easy to send structured browser logs to any HTTP endpoint using fetch or sendBeacon. The changes include new APIs, documentation, playground tests, and a runnable demo.