fix(dashboard): bundle Monaco editor instead of fetching from CDN#4247
Open
koushik717 wants to merge 6 commits into
Open
fix(dashboard): bundle Monaco editor instead of fetching from CDN#4247koushik717 wants to merge 6 commits into
koushik717 wants to merge 6 commits into
Conversation
@monaco-editor/react defaults to loading Monaco's AMD bundle from
cdn.jsdelivr.net at runtime, which breaks the editor in air-gapped or
restricted-network self-hosted deployments.
Adds monaco-editor as a direct dependency and configures Vite's native
?worker imports for the editor/json workers plus loader.config({ monaco })
so @monaco-editor/react resolves the bundled instance instead of injecting
a CDN script tag.
Fixes hatchet-dev#3703
|
@koushik717 is attempting to deploy a commit to the Hatchet Team on Vercel. A member of the Team first needs to authorize it. |
…itor types @monaco-editor/react's Monaco type resolves through monaco-editor/esm/vs/editor/editor.api. Before monaco-editor was a real dependency, that import was unresolvable and TS silently treated downstream usages as untyped, masking an implicit-any on this filter callback. Now that monaco-editor is bundled, the real types apply and the implicit-any needs an explicit annotation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3703
@monaco-editor/reactdefaults to loading Monaco's AMD bundle fromcdn.jsdelivr.netat runtime, which breaks the editor in air-gapped or restricted-network self-hosted deployments.What changed
monaco-editoras a direct dependency.frontend/app/src/lib/monaco-environment.ts, imported once fromcode-editor.tsx, which:MonacoEnvironment.getWorkerusing Vite's native?workerimport for the editor and JSON workers (the only language currently wired up viaconfigureJsonSchema), andloader.config({ monaco })so@monaco-editor/reactresolves the bundled instance instead of injecting a CDN<script>tag.Notes for reviewers
@monaco-editor/loader's default config object, never reached onceloader.config({ monaco })runs. Confirmed via build inspection and network monitoring that this is dead code, not a live network call.monaco-editorpackage auto-registers a few language workers we don't currently use (css/html/ts) alongside json/editor — expected behavior of the package itself, not something this PR controls. Can follow up with trimming if bundle size is a concern.?workersuffix, which needs no extra plugin.Testing
pnpm run typecheck— no new errors (pre-existing failures are unrelated missing-codegen files, confirmed againstmain).vite build—editor.workerandjson.workerare emitted as separate chunks;loader.config({ monaco })runs at build time.jsdelivrandcdn.*) — zero matches. No console errors beyond standard dev-mode noise.AI disclosure (per AI_POLICY.md): I used an AI coding assistant for parts of this change and reviewed/tested everything above myself before opening this PR.