Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

fix(console): self-host monaco and brand icons instead of CDN - #23

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
fix/yaml-editor-self-host-monaco
Jun 1, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
fix/yaml-editor-self-host-monaco

Conversation

@lexfrei

Copy link
Copy Markdown
Contributor

Problem

The YAML view on deploy/edit forms intermittently hung on a Loading… placeholder and never rendered. @monaco-editor/react, with no loader configured and no bundled monaco, falls back to fetching the entire editor from jsDelivr at runtime; on a slow, proxied, or air-gapped network the multi-megabyte editor.main.js stalls in pending and the fallback never clears. The sidebar brand icons (simple-icons) were pulled from the same CDN, so neither subsystem worked without reliable egress to cdn.jsdelivr.net.

Fix

Bundle both so nothing is fetched from a CDN at runtime:

  • monaco — added as a direct dependency and wired through loader.config({ monaco }) with the language workers pointed at the bundled copies. The loader resolves on the provided instance and never injects the jsDelivr script.
  • Code-splitting — YamlEditor is now lazy-loaded, so monaco and its workers land in their own chunk fetched from the app's own origin only when the YAML view opens. The initial bundle is unaffected.
  • icons — simple-icons SVGs are inlined as data: URIs from the bundled package (tree-shaken to the ~17 icons actually used). Amazon S3 was removed upstream from simple-icons, so the Bucket kind now falls back to a generic Lucide storage glyph.

Verification

  • A production build shows simple-icons fully inlined and monaco code-split out of the entry bundle.
  • The only remaining cdn.jsdelivr.net string in the build is the unreachable default paths.vs inside the third-party loader — init() returns on the bundled monaco before it could ever be used. Confirmed against the loader source.
  • New tests pin the no-CDN invariant: monaco-setup is configured with the bundled instance and routes workers; the rendered brand icon uses a data: URI and never a CDN host.
  • pnpm typecheck and pnpm test (217 passing) are green.

The YAML view on deploy/edit forms intermittently hung on a "Loading…"
placeholder forever. @monaco-editor/react, with no loader configured and
no bundled monaco, falls back to fetching the whole editor from jsDelivr
at runtime; on a slow, proxied, or air-gapped network the multi-megabyte
editor.main.js stalls and the fallback never clears. The sidebar brand
icons (simple-icons) were pulled from the same CDN, so neither subsystem
worked without reliable egress to cdn.jsdelivr.net.

Bundle both instead so nothing is fetched from a CDN at runtime:

- Add monaco-editor as a direct dep and configure @monaco-editor/react
  via loader.config({ monaco }) with the language workers wired to the
  bundled copies (monaco-setup.ts). loader.init() short-circuits on the
  provided instance before it would ever inject the jsDelivr script.
- Lazy-load YamlEditor so monaco and its workers are code-split into
  their own chunk, fetched from the app's own origin only when the YAML
  view is opened — the initial bundle is unaffected.
- Inline simple-icons SVGs as data URIs from the bundled package. Amazon
  S3 was removed upstream from simple-icons, so the Bucket kind now falls
  back to a generic Lucide storage glyph.

A production build shows simple-icons fully inlined and the only
remaining jsDelivr string is the unreachable default paths.vs inside the
third-party loader, which loader.init() never reaches once monaco is
provided.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@coderabbitai

coderabbitai Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@lexfrei, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 14 minutes. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9cb4d0c3-9c67-42a2-9b0c-642e217967c7

📥 Commits

Reviewing files that changed from the base of the PR and between 4570d44 and c6f96d9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • apps/console/package.json
  • apps/console/src/components/YamlEditor.tsx
  • apps/console/src/lib/monaco-setup.test.ts
  • apps/console/src/lib/monaco-setup.ts
  • apps/console/src/lib/sidebar-icons.test.tsx
  • apps/console/src/lib/sidebar-icons.tsx
  • apps/console/src/routes/ApplicationOrderPage.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/yaml-editor-self-host-monaco

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added area/console Issues or PRs related to apps/console — routes, detail pages, marketplace, command palette kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files labels Jun 1, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request self-hosts the Monaco Editor and bundles its language workers to prevent external CDN fetches, improving reliability in air-gapped environments. It also lazy-loads the YamlEditor component to optimize initial bundle size and page load performance. Additionally, sidebar icons are refactored to import brand logos directly from the simple-icons package and inline them as data URIs, eliminating external CDN dependencies, and a fallback is added for the Bucket kind. I have no feedback to provide as there are no review comments.

@lexfrei
Aleksei Sviridkin (lexfrei) marked this pull request as ready for review June 1, 2026 12:50
@lexfrei
Aleksei Sviridkin (lexfrei) merged commit cfc690d into main Jun 1, 2026
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/console Issues or PRs related to apps/console — routes, detail pages, marketplace, command palette kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants