Built-in plugin registration doesn't scale: binary size + startup cost grows unconditionally with every plugin
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- bun, typescript
- Ambito
- cli, performance
Direzione di ricerca
Inizia da loadPlugins() di cli.ts e confronta il percorso esistente PluginLoader.load/loadFromNpm con il percorso di caricamento github: attualmente fornito solo come stub. Misura la dimensione del binario e il tempo di avvio di --help con gli attuali sei plugin integrati, quindi valuta un meccanismo che eviti di caricare o incorporare plugin non pertinenti. Il lavoro è completato quando è disponibile un approccio documentato e testato che affronta il problema dei plugin non pubblicati e include le misurazioni di riferimento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 20
- Fork
- 11
- Merge medio
- 5h 28m
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di game-ci/cli
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 73/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 32/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Issue simili
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument pageApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AOSSIE-Org/DebateAI#801 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
ci: repo has no GitHub Actions workflow, so pushes and pull requests are never built or testedApertaagents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Add: BOM CineApertaapproved check:passed streams:add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno