Built-in plugin registration doesn't scale: binary size + startup cost grows unconditionally with every plugin
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- bun, typescript
- Lĩnh vực
- cli, performance
Hướng nghiên cứu
Bắt đầu với loadPlugins() của cli.ts và so sánh route hiện có PluginLoader.load/loadFromNpm với loading path github: hiện mới chỉ là stub. Đo kích thước binary và thời gian khởi động --help với sáu plugin tích hợp hiện tại, sau đó đánh giá một cơ chế tránh tải hoặc nhúng các plugin không liên quan. Được xem là hoàn tất khi có một cách tiếp cận được tài liệu hóa và kiểm thử, giải quyết khoảng trống đối với các plugin chưa được công bố và bao gồm các phép đo cơ sở.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
game-ci/cli#230 registered @game-ci/bevy as a built-in plugin (a literal import() in cli.ts's loadPlugins(), traced and embedded directly into the compiled binary) because it isn't published to npm and --plugin @game-ci/<name> (which resolves via loadFromNpm) can't reach it at runtime. A follow-up does the same for five more functional-but-unpublished plugins: github-release-deploy, itch-deploy, pseudo-localization, code-signing, steam-workshop.
This pattern has a real cost that will keep growing as more plugins are added this way:
- Binary size: every built-in plugin's code is unconditionally bundled into the single compiled
game-cibinary via Bun's--compile, whether or not a given invocation ever touches it. This is unlike the genuinely-opt-in--plugin <name>path (PluginLoader.load's string-parameter/loadFromNpmroute), which is a dynamic import Bun's bundler can't trace - confirmed earlier this repo's own workspace plugins impose zero bundle cost on unrelated invocations when loaded that way. Built-in registration gives up that property. - Startup cost:
loadPlugins()callsPluginLoader.loadModule()(and therefore each plugin'sonLoad(), if it defines one) unconditionally on every CLI invocation -game-ci --help,game-ci build ./unity-project, anything - regardless of whether that plugin is relevant. Today's built-ins are presumably cheap (synchronous command-factory registration, no I/O), but nothing enforces that, and the list will only grow.
Six built-ins (soon) is probably still fine. But there's no mechanism today to keep this bounded, and "not published to npm" is currently the only trigger for going down the built-in path - which will keep happening as new plugins ship, since none of the newer ones are on npm either yet.
Ask
Investigate a real fix for the underlying gap instead of continuing to grow the built-in list:
- Publish these plugins to npm (npm) so
--plugin <name>actually works for them via the existingloadFromNpmpath - the original, genuinely-opt-in mechanism this was designed around - OR - Implement
PluginLoader'sgithub:loading path (currently a stub that throws "not yet implemented") so a plugin can be fetched/loaded from this repo without needing either npm or unconditional binary embedding, OR - Some other mechanism that keeps unrelated
game-ciinvocations from paying for plugins they don't use, as the plugin count grows.
Whichever direction, it'd help to also measure the actual current cost (binary size delta, --help startup time) with today's 6 built-ins as a baseline, so future additions have a concrete number to weigh against.
- Ngôn ngữ chính
- TypeScript
- Star
- 20
- Fork
- 11
- Merge trung bình
- 5 giờ 28 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của game-ci/cli
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 73/100
-
Forward Unity logs to consoleĐang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
open-webui/tether#52 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`void platform install --app-access public` fails when Cloudflare reports Access is disabledĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
voidzero-dev/void#835 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AykutSarac/jsoncrack.com#616 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
melgarafael/DeskcommCRM#4679 ·
Maintainer thường phản hồi trong vòng 1 ngày