Skip to content

Commit

Permalink
Merge pull request #189 from CodinGame/vscode-1.82.0-monaco-0.43.0
Browse files Browse the repository at this point in the history
Update to vscode v1.82.0 monaco-editor v0.43.0
  • Loading branch information
CGNonofr authored Sep 27, 2023
2 parents cd2f5b4 + af57cb2 commit c93fd65
Show file tree
Hide file tree
Showing 15 changed files with 756 additions and 591 deletions.
153 changes: 77 additions & 76 deletions demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@types/wicg-file-system-access": "^2020.9.6",
"@types/ws": "^8.5.5",
"ts-node": "^10.9.1",
"typescript": "~5.1.6",
"typescript": "~5.2.2",
"vite": "~4.4.9"
},
"enabledApiProposals": [
Expand All @@ -30,20 +30,20 @@
"ansi-colors": "^4.1.3",
"dockerode": "^3.3.5",
"express": "^4.18.2",
"monaco-editor": "^0.41.0",
"monaco-editor": "^0.43.0",
"vscode": "file:../",
"vscode-oniguruma": "~1.7.0",
"ws": "^8.13.0",
"xterm": "5.2.1",
"xterm-addon-canvas": "0.4.0",
"xterm-addon-image": "0.4.2",
"xterm-addon-search": "0.12.0",
"xterm-addon-serialize": "0.10.0",
"xterm-addon-unicode11": "0.5.0",
"xterm-addon-webgl": "0.15.0"
"vscode-oniguruma": "~2.0.0",
"ws": "^8.14.1",
"xterm": "5.3.0",
"xterm-addon-canvas": "0.5.0",
"xterm-addon-image": "0.5.0",
"xterm-addon-search": "0.13.0",
"xterm-addon-serialize": "0.11.0",
"xterm-addon-unicode11": "0.6.0",
"xterm-addon-webgl": "0.16.0"
},
"volta": {
"node": "18.14.2",
"npm": "9.5.1"
"node": "18.18.0",
"npm": "9.8.1"
}
}
17 changes: 3 additions & 14 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ export default defineConfig({
next()
})
}
},
{
// prevent vite from trying to inject code into an extension file du to an `import()` in that file
name: 'hack-prevent-transform-javascript',
apply: 'serve',
load (source) {
if (source.includes('tsserver.web.js')) {
return `eval(${JSON.stringify(fs.readFileSync(source).toString('utf-8'))})`
}
}
}
],
optimizeDeps: {
Expand All @@ -50,10 +40,9 @@ export default defineConfig({
'vscode/default-extensions/objective-c', 'vscode/default-extensions/perl', 'vscode/default-extensions/php', 'vscode/default-extensions/powershell',
'vscode/default-extensions/python', 'vscode/default-extensions/r', 'vscode/default-extensions/ruby', 'vscode/default-extensions/rust',
'vscode/default-extensions/scss', 'vscode/default-extensions/shellscript', 'vscode/default-extensions/sql', 'vscode/default-extensions/swift',
'vscode/default-extensions/typescript-basics', 'vscode/default-extensions/vb', 'vscode/default-extensions/xml', 'vscode/default-extensions/yaml',
'vscode/default-extensions/theme-defaults', 'vscode/default-extensions/theme-seti',
'vscode/default-extensions/references-view', 'vscode/default-extensions/typescript-basics', 'vscode/default-extensions/search-result',
'vscode/default-extensions/typescript-language-features', 'vscode/default-extensions/markdown-language-features',
'vscode/default-extensions/typescript-basics', 'vscode/default-extensions/typescript-language-features', 'vscode/default-extensions/vb',
'vscode/default-extensions/xml', 'vscode/default-extensions/yaml', 'vscode/default-extensions/theme-defaults', 'vscode/default-extensions/theme-seti',
'vscode/default-extensions/references-view', 'vscode/default-extensions/search-result', 'vscode/default-extensions/markdown-language-features',
'vscode/default-extensions/json-language-features', 'vscode/default-extensions/css-language-features',
'vscode/default-extensions/npm', 'vscode/default-extensions/css', 'vscode/default-extensions/markdown-basics', 'vscode/default-extensions/html',
'vscode/default-extensions/html-language-features', 'vscode/default-extensions/configuration-editing', 'vscode/default-extensions/media-preview', 'vscode/default-extensions/markdown-math',
Expand Down
32 changes: 32 additions & 0 deletions docs/vscode_monaco_upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# How to upgrade to next vscode and monaco-editor versions

## Preparation

- It is assumed `monaco-vscode-api`, `vscode` and `monaco-editor` repos are cloned locally on the same directory level. `monaco-editor` is not required, but helpful

## vscode repository

- Get the new vscode commit from the new monaco-editor release version (in the package.json there is a `vscodeRef` field)
- Go to the vscode repo directory, reset to the previous vscodeRef commit
- Apply the current patch: `patch -p1 < ../monaco-vscode-api/scripts/vscode.patch`
- `git stash`
- Checkout new vscodeRef commit
- `git stash pop`
- Resolve conflicts / update code (e.g. broken imports)
- Generate new patch: `git diff --staged > ../monaco-vscode-api/scripts/vscode.patch`

## monaco-vscode-api repository

- Update `monaco-editor` and other dependencies and update to the new `vscodeRef` from above
- Run `npx @vscode/dts dev` afterwards to update the `vscode.proposed.xxx.d.ts` files. It fixes potential errors in `api.ts`
- Wait for the new vscode version to be downloaded and built
- Fix errors, adapt code, build, include the `vscode.patch` into this commit
- Do not hesitate to run the eslint autofix, it gets rid of the majority of your errors
- Implement missing services. This is easily observable seem when running the demo (see next point)
- Update demo
- Update dependencies
- Implement improvements dependening on the new features available from vscode (optional)

## Hints

Use repo log viewers and check the last update branch when in doubt
Loading

0 comments on commit c93fd65

Please sign in to comment.