amplitude / amplitude/Amplitude-TypeScript

Provide a modular build of the browser SDK that does not bundle the plugins

オープン
#1,268 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
TypeScript
スター
180
フォーク
68
平均マージ
3日 1時間
マージ済み PR(30日)
29

説明

## Summary

BrowserClient currently defines an API allowing to enable or disable autocapture features through boolean options. This implies that it has to bundle the associated plugins even if the options will disable them.

A modular API should be provided, supporting the code features for the browser, but without any bundled plugins. This will give choices to projects:

1. use the modular core and register wanted plugins explicitly
2. use the existing BrowserClient that would use that modular core and keep bundling the plugins for ease of use (maybe excluding experimental plugins from the bundle plugins, requiring them to be registered directly).

See https://github.com/amplitude/Amplitude-TypeScript/issues/325#issuecomment-3206610944 for a comment (by me) proposing this solution to the bundle size bloat issue.
This modular core would at least solve this partially (it won't help much projects using autocapture).

## Motivations

The bundle size of `@amplitude/analytics-browser` is quite big, and tends to grow bigger when adding new autocapture plugins.
When not using autocapture (which is my case), half of that bundle size is wasted by autocapture-related plugins

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。