Updates changelog

This commit is contained in:
Henning Dieterichs 2025-11-07 11:08:32 +01:00
parent d89eb54d17
commit 39b6dbe8b0
11 changed files with 1772 additions and 3 deletions

View file

@ -1,5 +1,13 @@
# Monaco Editor Changelog # Monaco Editor Changelog
## [0.55.0] (unreleased)
### Breaking Changes
- Moves nested namespaces (`languages.css`, `languages.html`, `languages.json`, `languages.typescript`) to top level namespaces (`css`, `html`, `json`, `typescript`) to simplify the build process.
### New Features
- Adds native LSP support (see new `lsp` namespace).
## [0.54.0] ## [0.54.0]
- Adds option `editor.mouseMiddleClickAction` - Adds option `editor.mouseMiddleClickAction`

2
samples/browser-esm-vite/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
dist
src/**/*.js

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>browser-esm-vite</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/main.ts"></script>
</body>
</html>

View file

@ -0,0 +1,13 @@
import './style.css';
import * as monaco from '../../src/editor/editor.main';
monaco.languages.register({ id: 'typescript' });
const tm = monaco.editor.createModel(`class Test {}`, 'typescript',
monaco.Uri.parse('file:///main.ts'));
const editor = monaco.editor.create(document.getElementById('root')!, {
model: tm,
language: 'typescript',
theme: 'vs-dark',
});

1664
samples/browser-esm-vite/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,14 @@
{
"name": "browser-esm-vite",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"serve": "vite preview"
},
"dependencies": {},
"devDependencies": {
"monaco-editor": "^0.54.0",
"typescript": "^5.9.3",
"vite": "^7.1.9"
}
}

View file

@ -0,0 +1,8 @@
html,
body,
#root {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}

View file

@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "ESNext",
"strict": true,
"module": "ESNext",
"jsx": "react-jsx",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
},
"include": ["./"]
}

View file

@ -0,0 +1,19 @@
import { defineConfig } from 'vite';
import { join } from 'path';
export default defineConfig({
server: {
fs: {
allow: ['../../', '../../../vscode']
}
},
resolve: {
alias: [{
find: 'monaco-editor-core/esm/vs',
replacement: join(__dirname, '../../../vscode/src/vs')
}, {
find: 'monaco-editor-core',
replacement: join(__dirname, '../../../vscode/src/vs/editor/editor.main.ts')
}],
}
});

View file

@ -14,13 +14,20 @@ export function getMonaco(): typeof monaco | undefined {
return (window as any).monaco; return (window as any).monaco;
} }
export interface IMonacoSetup { export type IAMDMonacoSetup = {
loaderUrl: string; loaderUrl: string;
loaderConfigPaths: Record<string, string>; loaderConfigPaths: Record<string, string>;
codiconUrl: string; codiconUrl: string;
monacoTypesUrl: string | undefined; monacoTypesUrl: string | undefined;
language?: string; language?: string;
} };
export type IESMMonacoSetup = {
esmUrl: string;
monacoTypesUrl: string | undefined;
};
export type IMonacoSetup = IAMDMonacoSetup | IESMMonacoSetup;
let loading = false; let loading = false;
let resolve: (value: typeof monaco) => void; let resolve: (value: typeof monaco) => void;
@ -47,6 +54,10 @@ export async function loadMonaco(
async function _loadMonaco(setup: IMonacoSetup): Promise<typeof monaco> { async function _loadMonaco(setup: IMonacoSetup): Promise<typeof monaco> {
const global = self as any; const global = self as any;
if ('esmUrl' in setup) {
return await import(/* webpackIgnore: true */setup.esmUrl); // CodeQL [SM01507] This is safe because the runner (that allows for dynamic paths) runs in an isolated iframe. The hosting website uses a static path configuration. // CodeQL [SM03712] This is safe because the runner (that allows for dynamic paths) runs in an isolated iframe. The hosting website uses a static path configuration.
}
if (!(global as any).require) { if (!(global as any).require) {
await loadScript(setup.loaderUrl); await loadScript(setup.loaderUrl);
} }
@ -112,7 +123,7 @@ export const prodMonacoSetup = getMonacoSetup(
export function getMonacoSetup( export function getMonacoSetup(
corePath: string, corePath: string,
language?: string language?: string
): IMonacoSetup { ): IAMDMonacoSetup {
const loaderConfigPaths = { const loaderConfigPaths = {
vs: `${corePath}`, vs: `${corePath}`,
}; };

View file

@ -136,6 +136,13 @@ export function toLoaderConfig(settings: Settings): IMonacoSetup {
break; break;
} }
if (coreUrl.endsWith('?esm')) {
return {
esmUrl: coreUrl,
monacoTypesUrl: undefined,
}
}
let languagesUrl: string; let languagesUrl: string;
switch (settings.languagesSource) { switch (settings.languagesSource) {
case "latest": case "latest":