Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Update to monaco-languageclient 6.0.0-next.0 and monaco-vscode-api 1.…
Browse files Browse the repository at this point in the history
…78.5

- Fixed root compenent assignment in react wrapper
  • Loading branch information
kaisalmen committed May 3, 2023
1 parent c54db20 commit deb0731
Show file tree
Hide file tree
Showing 14 changed files with 159 additions and 128 deletions.
218 changes: 112 additions & 106 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
"@types/node": "~18.15.11",
"@types/shelljs": "~0.8.12",
"@types/vscode": "~1.77.0",
"@typescript-eslint/eslint-plugin": "~5.59.0",
"@typescript-eslint/parser": "~5.59.0",
"@typescript-eslint/eslint-plugin": "~5.59.2",
"@typescript-eslint/parser": "~5.59.2",
"@vitest/coverage-c8": "~0.30.1",
"@vitest/ui": "~0.30.1",
"eslint": "~8.38.0",
"eslint": "~8.39.0",
"editorconfig": "~1.0.2",
"path-browserify": "~1.0.1",
"shx": "~0.3.4",
"shelljs": "~0.8.5",
"tslib": "~2.5.0",
"typescript": "~5.0.4",
"vite": "~4.3.1",
"vite": "~4.3.4",
"vite-node": "~0.30.1",
"vitest": "~0.30.1"
},
Expand Down
14 changes: 7 additions & 7 deletions packages/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
"private": true,
"type": "module",
"dependencies": {
"@typefox/monaco-editor-react": "1.0.0-next.9",
"@typefox/monaco-editor-react": "1.0.0-next.10",
"http-server": "~14.1.1",
"langium": "~1.1.0",
"langium-statemachine-dsl": "~1.1.0",
"monaco-editor-wrapper": "2.0.0-next.2",
"langium": "~1.2.0",
"langium-statemachine-dsl": "~1.2.0",
"monaco-editor-wrapper": "2.0.0-next.3",
"monaco-editor-workers": "0.37.0",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"request-light": "~0.7.0",
"vscode-uri": "~3.0.7",
"vscode-languageclient": "~8.1.0",
"vscode-languageserver": "~8.1.0",
"vscode-json-languageservice": "~5.3.2"
"vscode-json-languageservice": "~5.3.4"
},
"devDependencies": {
"@types/react": "~18.0.37",
"@types/react-dom": "~18.0.11"
"@types/react": "~18.2.0",
"@types/react-dom": "~18.2.1"
},
"volta": {
"node": "18.16.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/react_langium.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>

<body>
<div id="root" style="height: 50vh;"></div>
<div id="root"></div>
<script type="module" src="./src/langium/reactLangium.tsx"></script>
</body>

Expand Down
2 changes: 1 addition & 1 deletion packages/examples/react_ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>

<body>
<div id="root" style="height: 50vh;"></div>
<div id="root"></div>
<script type="module" src="./src/reactTs.tsx"></script>
</body>

Expand Down
1 change: 1 addition & 0 deletions packages/examples/src/langium/reactLangium.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const startEditor = async () => {
userConfig={langiumGlobalConfig}
style={{
'paddingTop': '5px',
'height': '80vh'
}}
/>;

Expand Down
6 changes: 4 additions & 2 deletions packages/examples/src/reactTs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import ReactDOM from 'react-dom/client';
import { MonacoEditorReactComp } from '@typefox/monaco-editor-react/allLanguages';
import { UserConfig } from 'monaco-editor-wrapper';

const rootElem = document.getElementById('root')!;
const userConfig: UserConfig = {
htmlElement: document.getElementById('root')!,
htmlElement: rootElem,
wrapperConfig: {
useVscodeConfig: false,
monacoEditorConfig: {
Expand Down Expand Up @@ -35,9 +36,10 @@ const comp = <MonacoEditorReactComp
userConfig={userConfig}
style={{
'paddingTop': '5px',
'height': '80vh',
}}
onTextChanged={onTextChanged}
/>;

const root = ReactDOM.createRoot(document.getElementById('root')!);
const root = ReactDOM.createRoot(rootElem);
root.render(comp);
8 changes: 4 additions & 4 deletions packages/monaco-editor-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typefox/monaco-editor-react",
"version": "1.0.0-next.9",
"version": "1.0.0-next.10",
"license": "MIT",
"description": "React component for Monaco-Editor and Monaco Languageclient",
"keywords": [
Expand Down Expand Up @@ -67,13 +67,13 @@
"npm": "9.6.5"
},
"peerDependencies": {
"monaco-editor-wrapper": "2.0.0-next.2",
"monaco-editor-wrapper": "2.0.0-next.3",
"react": "~18.2.0",
"react-dom": "~18.2.0"
},
"devDependencies": {
"@types/react": "~18.0.37",
"@types/react-dom": "~18.0.11"
"@types/react": "~18.2.0",
"@types/react-dom": "~18.2.1"
},
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion packages/monaco-editor-react/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ export class MonacoEditorReactComp extends React.Component<MonacoEditorProps> {
if (this.containerElement) {
this.containerElement.className = className ?? '';

userConfig.htmlElement = this.containerElement;
this.isStarting = this.wrapper.start(userConfig);
await this.isStarting;

onLoading && onLoading();
onLoad && this.isStarting.then(() => onLoad());
onLoad && this.isStarting?.then(() => onLoad());

if (onTextChanged) {
const model = this.wrapper.getModel();
Expand Down
5 changes: 5 additions & 0 deletions packages/monaco-editor-react/vite.bundle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@ export default defineConfig({
}
}
},
resolve: {
alias: {
path: 'path-browserify'
}
},
assetsInclude: ['**/*.wasm']
});
5 changes: 5 additions & 0 deletions packages/monaco-editor-react/vite.languages.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@ export default defineConfig({
}
}
},
resolve: {
alias: {
path: 'path-browserify'
}
},
assetsInclude: ['**/*.wasm']
});
5 changes: 3 additions & 2 deletions packages/monaco-editor-wrapper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monaco-editor-wrapper",
"version": "2.0.0-next.2",
"version": "2.0.0-next.3",
"license": "MIT",
"description": "Monaco-Editor and Monaco Languageclient Wrapper",
"keywords": [
Expand Down Expand Up @@ -67,6 +67,7 @@
"README.md"
],
"scripts": {
"postinstall": "monaco-treemending",
"clean": "npx shx rm -rf ./dist ./bundle ./src/generated ./resources *.tsbuildinfo",
"handle:assets": "vite-node ./build/src/buildAssets.mts",
"compile": "npm run handle:assets && tsc --build tsconfig.src.json",
Expand All @@ -83,7 +84,7 @@
"normalize-url": "~8.0.0"
},
"peerDependencies": {
"monaco-languageclient": "5.1.0-next.4",
"monaco-languageclient": "6.0.0-next.0",
"vscode-ws-jsonrpc": "3.0.0"
},
"repository": {
Expand Down
5 changes: 5 additions & 0 deletions packages/monaco-editor-wrapper/vite.bundle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@ export default defineConfig({
}
}
},
resolve: {
alias: {
path: 'path-browserify'
}
},
assetsInclude: ['**/*.wasm']
});
5 changes: 5 additions & 0 deletions packages/monaco-editor-wrapper/vite.languages.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@ export default defineConfig({
}
}
},
resolve: {
alias: {
path: 'path-browserify'
}
},
assetsInclude: ['**/*.wasm']
});

0 comments on commit deb0731

Please sign in to comment.