getsentry / getsentry/sentry-javascript

Combined CDN bundle including core SDK, multiplexed transport and module-metadata integration

Đang mở
#17,309 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
Browser Dev: Build Feature Package-Meta: CDN
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
523

Mô tả

### Problem Statement

Currently, we integrate Sentry into our web application solely through CDN scripts (not through NPM installation), loading the _bundle.min.js_ (core SDK).
We want to enable **error routing** for the microfrontend, but there is no bundle to do so, and that forces us to load two additional files:
1. multiplexedtransport.min.js
2. modulemetadata.min.js

This approach works, but introduces:
• Performance concerns: three HTTP requests
• Version-management overhead
• HTML verbosity: extra tags in every page template

### Solution Brainstorm

Publish an additional CDN artifact that internally includes:

- the core bundle.min.js
- transports/multiplexedtransport.js
- integrations/modulemetadataintegration.js

All in one file, exposing Sentry.makeMultiplexedTransport() and Sentry.moduleMetadataIntegration() on the global Sentry object.

Benefits:

- Single download: one small script to fetch in parallel, reducing latency and round-trips.
- Slim footprint: the bundle should include only the core SDK plus the two micro-frontend features, keeping its gzipped size as small as possible so as not to impact page performance.
- Simplified integration: customers can add a single and call Sentry.init({ ..., integrations: [Sentry.moduleMetadataIntegration()], transport: Sentry.makeMultiplexedTransport(...) }) without worrying about additional URLs.
- Cache efficiency: one bundle means better long-term caching and fewer cache invalidations.
- Lower maintenance: teams relying purely on CDN loads (no npm) avoid manual sync of multiple file versions.
- The multiplexed transport and module metadata features could be lazy-loaded, so that they are available in the Sentry Object only once an error occurs.

### Product Area

Performance

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.