swagger-api / swagger-editor

Swagger Editor
https://editor.swagger.io
Apache License 2.0
8.89k stars 2.25k forks source link

SwaggerEditor@next: Integrate latest VSCode + Monaco Editor versions #4848

Closed char0n closed 6 months ago

char0n commented 6 months ago

The goal of this issue is to replace monaco-editor dep with @codingame/monaco-vscode-editor-api. I've tried the following combo, but I've bumped in to https://github.com/CodinGame/monaco-vscode-api/issues/377. Everything else worked.

The goal of this issue is to find a version of @codingame/monaco-vscode-editor-api that doesn't suffer with the issue described above.

The only breaking change within our code is that we need to use ModesRegistry from the vscode package and not the monaco-editor package:

import { ModesRegistry } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';

Affected version combo:

    "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@=3.2.2",
    "vscode": "npm:@codingame/monaco-vscode-api@=3.2.2",
char0n commented 6 months ago

The get around the issue described above, imports-loader needed to be utilized, and import for process library is now fully scoped to json-schema-ref-parser@9.

When json-schema-ref-parser is used in its v11 version, we can remove the special scoping.

Refs https://github.com/swagger-api/swagger-editor-cra/commit/7efdb9939a5a5a6ee95a01a5219a23a879ea5ab9

char0n commented 6 months ago

Addressed in https://github.com/swagger-api/swagger-editor/pull/4860