From b6dc5d22d238c1b785878b528c664187137984b3 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Thu, 10 Oct 2024 16:28:49 +0200 Subject: [PATCH] Prepare release next.2 release --- docs/versions-and-history.md | 2 +- packages/client/CHANGELOG.md | 2 +- packages/examples/CHANGELOG.md | 3 +- .../examples/src/json/client/wrapperWs.ts | 95 ++++++++++--------- packages/wrapper-react/CHANGELOG.md | 2 +- packages/wrapper/CHANGELOG.md | 2 +- verify/angular/src/app/app.component.ts | 10 +- verify/angular/src/app/app.module.ts | 25 ----- verify/angular/src/main.ts | 10 +- verify/webpack/webpack.config.js | 6 +- 10 files changed, 72 insertions(+), 85 deletions(-) delete mode 100644 verify/angular/src/app/app.module.ts diff --git a/docs/versions-and-history.md b/docs/versions-and-history.md index b25584923..05e692115 100644 --- a/docs/versions-and-history.md +++ b/docs/versions-and-history.md @@ -6,7 +6,7 @@ The following table describes which version of **monaco-languageclient** and **@ | monaco-languageclient | monaco-editor-wrapper | monaco-editor-react | monaco-vscode-api / editor-api | vscode | monaco-editor | release date | comment | | :---- | :---- | :--- | :--- | :--- | :--- | :--- | :--- | -| 9.0.0-next.2 | 6.0.0-next.2 | 6.0.0-next.2 | 10.0.1 | 1.94.1 | 0.52.0 | 2024-10-xy | | +| 9.0.0-next.2 | 6.0.0-next.2 | 6.0.0-next.2 | 10.0.1 | 1.94.1 | 0.52.0 | 2024-10-10 | | | 8.8.3 | 5.5.3 | 4.5.3 | 8.0.4 | 1.92.2 | 0.51.0 | 2024-08-26 | | | 8.8.2 | 5.5.2 | 4.5.2 | 8.0.2 | 1.92.2 | 0.50.0 | 2024-08-21 | | | 8.8.1 | 5.5.1 | 4.5.1 | 8.0.1 | 1.92.1 | 0.50.0 | 2024-08-12 | | diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 51b2f011a..aee3cacc8 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this npm module are documented in this file. -## [9.0.0-next.2] - 2024-10-xy +## [9.0.0-next.2] - 2024-10-10 - Support all arguments for monaco-vscode-api `initialize` [#756](https://github.com/TypeFox/monaco-languageclient/pull/756) - Update to monaco-vscode-api 9.0.x [#749](https://github.com/TypeFox/monaco-languageclient/pull/749) diff --git a/packages/examples/CHANGELOG.md b/packages/examples/CHANGELOG.md index 88621c0d0..5d1cb15b8 100644 --- a/packages/examples/CHANGELOG.md +++ b/packages/examples/CHANGELOG.md @@ -2,10 +2,11 @@ All notable changes to this npm module are documented in this file. -## [2024.10.1] - 20241-10-xy +## [2024.10.1] - 20241-10-10 - Aligend example config. `htmlContainer` is now a required property of `editorAppConfig` - Fixed problems with Statemachine example (two editor and react version) +- Json example exports a function for the configuration ## [2024.9.1] - 2024-09-27 diff --git a/packages/examples/src/json/client/wrapperWs.ts b/packages/examples/src/json/client/wrapperWs.ts index acf365b8a..13b69d918 100644 --- a/packages/examples/src/json/client/wrapperWs.ts +++ b/packages/examples/src/json/client/wrapperWs.ts @@ -15,52 +15,56 @@ const text = `{ "line_endings": {"value": "unix"} }`; -export const jsonClientUserConfig: WrapperConfig = { - logLevel: LogLevel.Debug, - vscodeApiConfig: { - userServices: { - ...getKeybindingsServiceOverride(), - }, - userConfiguration: { - json: JSON.stringify({ - 'workbench.colorTheme': 'Default Dark Modern', - 'editor.guides.bracketPairsHorizontal': 'active', - 'editor.lightbulb.enabled': 'On', - 'editor.wordBasedSuggestions': 'off', - 'editor.experimental.asyncTokenization': true - }) - } - }, - editorAppConfig: { - $type: 'extended', - codeResources: { - main: { - text, - fileExt: 'json' +export const buildJsonClientUserConfig = (params: { + htmlContainer: HTMLElement +}): WrapperConfig => { + return { + logLevel: LogLevel.Debug, + vscodeApiConfig: { + userServices: { + ...getKeybindingsServiceOverride(), + }, + userConfiguration: { + json: JSON.stringify({ + 'workbench.colorTheme': 'Default Dark Modern', + 'editor.guides.bracketPairsHorizontal': 'active', + 'editor.lightbulb.enabled': 'On', + 'editor.wordBasedSuggestions': 'off', + 'editor.experimental.asyncTokenization': true + }) } }, - useDiffEditor: false, - monacoWorkerFactory: configureMonacoWorkers, - htmlContainer: document.getElementById('monaco-editor-root')! - }, - languageClientConfigs: { - json: { - languageId: 'json', - connection: { - options: { - $type: 'WebSocketUrl', - url: 'ws://localhost:30000/sampleServer', - startOptions: { - onCall: () => { - console.log('Connected to socket.'); - }, - reportStatus: true - }, - stopOptions: { - onCall: () => { - console.log('Disconnected from socket.'); + editorAppConfig: { + $type: 'extended', + codeResources: { + main: { + text, + fileExt: 'json' + } + }, + useDiffEditor: false, + monacoWorkerFactory: configureMonacoWorkers, + htmlContainer: params.htmlContainer + }, + languageClientConfigs: { + json: { + languageId: 'json', + connection: { + options: { + $type: 'WebSocketUrl', + url: 'ws://localhost:30000/sampleServer', + startOptions: { + onCall: () => { + console.log('Connected to socket.'); + }, + reportStatus: true }, - reportStatus: true + stopOptions: { + onCall: () => { + console.log('Disconnected from socket.'); + }, + reportStatus: true + } } } } @@ -73,7 +77,10 @@ export const runJsonWrapper = () => { try { document.querySelector('#button-start')?.addEventListener('click', async () => { - await wrapper.initAndStart(jsonClientUserConfig); + const config = buildJsonClientUserConfig({ + htmlContainer: document.getElementById('monaco-editor-root')! + }); + await wrapper.initAndStart(config); }); document.querySelector('#button-dispose')?.addEventListener('click', async () => { await wrapper.dispose(); diff --git a/packages/wrapper-react/CHANGELOG.md b/packages/wrapper-react/CHANGELOG.md index b78b2c1ed..938e865c0 100644 --- a/packages/wrapper-react/CHANGELOG.md +++ b/packages/wrapper-react/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to npm module [@typefox/monaco-editor-react](https://www.npmjs.com/package/@typefox/monaco-editor-react) are documented in this file. -## [6.0.0-next.2] - 2024-10-xy +## [6.0.0-next.2] - 2024-10-10 - Support all arguments for monaco-vscode-api `initialize` [#756](https://github.com/TypeFox/monaco-languageclient/pull/756) - On startup the current containerRef is passed to the interal editor app/monaco-editor diff --git a/packages/wrapper/CHANGELOG.md b/packages/wrapper/CHANGELOG.md index d029451d1..fee668772 100644 --- a/packages/wrapper/CHANGELOG.md +++ b/packages/wrapper/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to npm module [monaco-editor-wrapper](https://www.npmjs.com/package/monaco-editor-wrapper) are documented in this file. -## [6.0.0-next.2] - 2024-10-xy +## [6.0.0-next.2] - 2024-10-10 - Support all arguments for monaco-vscode-api `initialize` [#756](https://github.com/TypeFox/monaco-languageclient/pull/756) - This also allows to configure editor-, view- or workspace-service. This is a preparation for further enhancements. diff --git a/verify/angular/src/app/app.component.ts b/verify/angular/src/app/app.component.ts index 9fcca10b0..77985edaf 100644 --- a/verify/angular/src/app/app.component.ts +++ b/verify/angular/src/app/app.component.ts @@ -5,12 +5,13 @@ import { AfterViewInit, Component } from '@angular/core'; import { MonacoEditorLanguageClientWrapper } from 'monaco-editor-wrapper'; -import { jsonClientUserConfig } from 'monaco-languageclient-examples/json-client'; +import { buildJsonClientUserConfig } from 'monaco-languageclient-examples/json-client'; @Component({ selector: 'app-root', templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + styleUrls: ['./app.component.css'], + standalone: true }) export class MonacoEditorComponent implements AfterViewInit { title = 'angular-client'; @@ -19,8 +20,11 @@ export class MonacoEditorComponent implements AfterViewInit { async ngAfterViewInit(): Promise { const wrapper = new MonacoEditorLanguageClientWrapper(); + const config = buildJsonClientUserConfig({ + htmlContainer: document.getElementById('monaco-editor-root')! + }); try { - await wrapper.initAndStart(jsonClientUserConfig); + await wrapper.initAndStart(config); } catch (e) { console.error(e); } diff --git a/verify/angular/src/app/app.module.ts b/verify/angular/src/app/app.module.ts deleted file mode 100644 index 0887cca9d..000000000 --- a/verify/angular/src/app/app.module.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) 2023 TypeFox and others. - * Licensed under the MIT License. See LICENSE in the package root for license information. - * ------------------------------------------------------------------------------------------ */ - -import { NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; - -import { MonacoEditorComponent } from './app.component'; - -@NgModule({ - declarations: [ - MonacoEditorComponent - ], - imports: [ - BrowserModule - ], - providers: [], - bootstrap: [ - MonacoEditorComponent - ] -}) -export class AppModule { - -} diff --git a/verify/angular/src/main.ts b/verify/angular/src/main.ts index 0365cfd40..40ed6b012 100644 --- a/verify/angular/src/main.ts +++ b/verify/angular/src/main.ts @@ -3,10 +3,6 @@ * Licensed under the MIT License. See LICENSE in the package root for license information. * ------------------------------------------------------------------------------------------ */ -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { AppModule } from './app/app.module'; - -platformBrowserDynamic().bootstrapModule(AppModule) - .catch((err: Error) => { - console.error(err); - }); +import { bootstrapApplication } from '@angular/platform-browser'; +import { MonacoEditorComponent } from './app/app.component'; +bootstrapApplication(MonacoEditorComponent); diff --git a/verify/webpack/webpack.config.js b/verify/webpack/webpack.config.js index a4243f0e0..934d91469 100644 --- a/verify/webpack/webpack.config.js +++ b/verify/webpack/webpack.config.js @@ -29,7 +29,11 @@ const config = { output: { filename: 'main.js', path: resolve(__dirname, 'dist', 'client'), - module: true + module: true, + workerChunkLoading: 'import', + environment: { + dynamicImportInWorker: true + } }, target: 'web', resolve: {