-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update generator-langium web template #1205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One apparent bug with the generated package.json, and a few comments, but nothing else that I could find. Seems like the rest is working as intended.
packages/generator-langium/templates/web/scripts/bundleVscodeApi.js
Outdated
Show resolved
Hide resolved
packages/generator-langium/templates/web/vite.bundle.classic.config.ts
Outdated
Show resolved
Hide resolved
packages/generator-langium/templates/web/vite.bundle.vscodeApi.config.ts
Outdated
Show resolved
Hide resolved
@montymxb code is updated to final |
423d658
to
0708200
Compare
Rebased to latest main and updated to latest |
Hi @kaisalmen, It may be a silly question, but what's the difference between |
@Yokozuna59 it is basically this:
The extended mode allows all the fancy things from: monaco-vscode-api There is now another PR in the pipeline for the wrapper that makes the mode separation clearer (terminology and code): TypeFox/monaco-components#54 You can checkout the PR locally and use the generator to try it out. It generates both versions. You can navigate from the index page: |
@kaisalmen I see, thanks for illustration.
Is there an estimated time when it will be merged? After looking at the changes in that PR, it contains a lot of breaking changes, and it would be hard to reimplement the code to inline it with the next major release. |
@Yokozuna59 the changes in ... and it will remove the need for two bundles as more config is not made internally (less work for end-user) |
Hi @kaisalmen, just a simple question, is there a reason why
I asked that because when using
|
I was able to resolve some of the errors that were thrown when switching to
This change broke the editor. // vite.bundle.classic.config.ts
export default defineConfig({
build: {
...,
rollupOptions: {
external: ['vscode'],
...,
}
}
}); These changes don't have any impact when using But I don't know how to resolve other issues:
And this issue occurs for different imports all over
I also tried to install |
packages/generator-langium/templates/web/scripts/bundleClassic.js
Outdated
Show resolved
Hide resolved
@Yokozuna59 thank you very much for your feedback. I will answer your feedback soon. |
You are correct. It works with npm, because it is a transitive dependency of langium, but it should be declared here. |
@kaisalmen Thanks for your fast response. I guess the template static/bundle/
static/monaco-editor-workers/
static/worker/ |
da600ff
to
437504a
Compare
@montymxb this ready now. It is based on the final version |
@msujew this is ready. It needs approval from a core maintainer. 🙂 |
- Bundle the application, then everything can be statically served
Adjust to latest api change
… dependent libraries
39dbfff
to
ee77476
Compare
@msujew the rebase updates Important: This will only work properly with a new langium release or a locally linked version. If you just check out and build it will fail, because Langium 2.0.x references another version that breaks the compilation. |
All committers listed here are allowed to approve and merge PRs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved! Generated project is good (although until the new langium release comes out, the generator will have a small mismatch).
We need to wait for(merged)monaco-editor-wrapper@3.3.0
(PR54) before we should merge this change.This PR fixes #1163 and updates the web template to the latest
monaco-editor-wrapper
.It is now possible to use the textmate grammar definition as well as the monarch grammar definitions with
monaco-editor
. The underlying monaco-vscode-api exposes various vscode service overrides that make this possible. Therefore we now generate two HTML examples and a top-level index page.The generated output no longer requires express. vite+rollup are used to produce the bundles, so the output can be used/served as is. After the generation/template building is complete the output can be tested using vite's dev server.