Skip to content

fix: bundle Monaco workers locally and fix JSX/TSX language detection#69

Merged
AmethystLiang merged 1 commit intomainfrom
AmethystLiang/fileTextGrayedOut
Mar 23, 2026
Merged

fix: bundle Monaco workers locally and fix JSX/TSX language detection#69
AmethystLiang merged 1 commit intomainfrom
AmethystLiang/fileTextGrayedOut

Conversation

@AmethystLiang
Copy link
Copy Markdown
Contributor

Summary

  • Bundle Monaco web workers locally using Vite ?worker imports instead of relying on CDN
  • Fix .tsx/.jsx language IDs to use typescriptreact/javascriptreact (correct Monaco language IDs)
  • Use detectLanguage() from file path in EditorPanel for proper language resolution
  • Add global MonacoEnvironment type declaration

Test plan

  • Verify Monaco editor loads without CDN requests (check Network tab)
  • Open a .tsx file and confirm syntax highlighting works correctly
  • Open a .jsx file and confirm syntax highlighting works correctly
  • Verify diff viewer also uses correct language highlighting

🤖 Generated with Claude Code

Use Vite worker imports to bundle Monaco web workers instead of relying on CDN,
and correct language IDs for .tsx/.jsx files to typescriptreact/javascriptreact.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AmethystLiang AmethystLiang merged commit e0fc58c into main Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant