Trim the editor bundle
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript, react, typescript, vite
- Domain
- build-system, frontend, performance
Research direction
Read ui/src/page/app/appEditor.tsx and ui/src/page/app/appPage.tsx to trace Prettier usage, then compare their imports with ui/src/page/sample/sampleEditor.tsx and the lazy route in ui/src/App.tsx. Check the chunk configuration in ui/vite.config.ts and run cd ui && npm run build to establish bundle sizes. Done means the sample viewer no longer loads Prettier, formatting and syntax checks still work, and the build shows smaller lazy chunks.
Written by the indexing model from the issue text.
Description
The lazy appPage chunk (ace + prettier) is ~1.3 MB / ~380 kB gzip. Already off the initial load; could be slimmed with a lighter editor or formatter.
Effort: S–M
Migrated from TASKS.md (Later / nice to have).
Implementation notes
Priority: low — Pure client-side bundle-size/performance polish on a lazy chunk with no correctness, security, or stability impact and no server changes.
Purpose
Shrinks the largest lazy chunk shipped to any user who opens the bot editor or even just the read-only sample viewer, cutting time-to-interactive on a slow/mobile connection. Pure client-side performance work — no behavior change, no server/API surface touched.
Implementation approach
- Confirmed via
cd ui && npm run build: the shared vendor chunk (currently emitted asAlert-*.js, ~1.24 MB / ~347 kB gzip) bundlesace-builds+react-ace+prettier/standalone+prettier/plugins/{babel,estree}together because bothui/src/page/app/appEditor.tsx(editable editor) andui/src/page/sample/sampleEditor.tsx(read-only sample viewer, added in the recent "in-app read-only sample bot viewer" work) statically import overlapping Ace modules, so Rolldown/Vite merges them into one shared chunk. ui/src/page/sample/sampleEditor.tsxnever uses Prettier at all (nocompile/doClean), yet visiting/samples/:nametoday still pays for the Prettier-bearing shared chunk — split Ace and Prettier into separate chunks (e.g.vite.config.tsbuild.rollupOptions.output.manualChunks, or Vite 8/Rolldown'sadvancedChunks.groups) sosamplePage/SamplePage(ui/src/App.tsxlazy route) no longer pulls Prettier.- In
ui/src/page/app/appEditor.tsxandui/src/page/app/appPage.tsx,prettier/standalone+babel/estreeplugins are static top-level imports used only insidecompile()(5s-debounced syntax check) anddoClean()(format-on-demand). Convert both toawait import('prettier/standalone')etc. inside those functions so Prettier's ~9.7 MB unpacked payload loads only on first actual use, not on editor mount. - No server changes; this is UI-only (
ui/vite.config.ts,appEditor.tsx,appPage.tsx,sampleEditor.tsx).ui/src/util/botApi.ts(completions model) is untouched.
Key details to plan
- No DB/service/REST/MCP/bot-API contract changes —
server/src/util/compiler.tsand bot-facing surface are unaffected; no coupling to issue #142 (migrations). - No sandbox/security implications (
isolated-vmuntouched) and no SSE/reducer/determinism impact (arenaReducer.ts, seeded PRNG) — purely a build-output/lazy-loading change. - Testing: no existing unit test covers bundle size; verify manually with
cd ui && npm run buildand compare the reported chunk sizes/gzip before/after (already captured a baseline above). ConfirmSampleEditorstill renders read-only samples andAppEditor's Ctrl+R clean/5s syntax-check still work after switching to dynamicimport()(manual smoke test via/run, since there's no Vitest bundle-size assertion to extend). - Watch for a UX regression: dynamic-importing Prettier means the first
doClean()/typo-check after page load has a brief extra network/parse delay — acceptable trade-off, but worth a quick loading-state check inappEditorToolbar. - Effort: S–M as filed. Risk: low — additive build config + moving existing imports from top-level to on-demand, no logic changes.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 8m
- Merged PRs (30d)
- 8
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LeeAdcock/robocodeJs.com
-
priority: medium tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
LeeAdcock/robocodeJs.com#411 ·
Maintainers usually reply within 1 day
-
enhancement priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LeeAdcock/robocodeJs.com#254 ·
Maintainers usually reply within 1 day
-
good first issue priority: low tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
LeeAdcock/robocodeJs.com#146 ·
Maintainers usually reply within 1 day
-
dependencies priority: low tech-debt
Difficulty 1/5 Under an hour Newbie friendliness 15/100
LeeAdcock/robocodeJs.com#413 ·
Maintainers usually reply within 1 day
-
priority: low tech-debt
Difficulty 3/5 Half a day Newbie friendliness 32/100
LeeAdcock/robocodeJs.com#412 ·
Maintainers usually reply within 1 day
All issues in LeeAdcock/robocodeJs.com
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vercel/streamdown#673 · 1 reaction ·
Maintainers usually reply within 1 day
-
docs(stream-protocol): document messageMetatadata on start/finish and the message-metadata chunkOpenfactory-active task-identify-harness-labels-done task-identify-issue-type-done
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
agilepathway/label-checker#721 ·
Maintainers usually reply within 1 day
-
CLI Empathy needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
chromaui/chromatic-cli#1524 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day