How the three loading modes work
mainmodern-monaco offers three distinct modes for integrating the editor depending on your requirements:
- Lazy Mode: Best for reducing initial load times. It uses Shiki to pre-highlight code while loading the heavy
editor-core.jsin the background. Requires a<monaco-editor>custom element in your HTML. - SSR Mode: Best for SEO and perceived performance. It renders a mock editor on the server and hydrates it on the client side using
renderToWebComponentandhydrate. - Manual Mode: Best for full control. You manually initialize the core and create editor instances using
init().