-
-
Notifications
You must be signed in to change notification settings - Fork 13
Lit Component #24
Comments
Hi @ballcoach12 this is exactly the correct spot to ask your questions. 👍
We discontinued
I would wrap I guess you are aware of these Langium examples:
We build a bundle for verification with vite which uses rollup 3 under the hood for production bundling. Asset inclusions and This bundle is used here: Hopefully this already helps you to move forward. If there are more questions. don't hesitate to ask. If our READMEs are unclear, please let us know, too. We may have forgotten some things when upting them for v2 🙂 |
Many thanks, @kaisalmen, for your helpful response. We are still studying how best to attack this problem, so I'm sure I'll have additional questions. We essentially want to accomplish what is described here, but using Lit instead of React. |
It feels like I am really close to getting this working. I created a new Lit element project (I was working with a Lit app before) and Rollup is now out of the picture. Only WebDev server is involved. The only problem that I can see is that it cannot seem to find the
Note that I am using the following versions in my
|
Is there any specific reason you are using a fairly the old version of No matter which version you use, you have to use monaco-vscode-api as vscode dependency.
You have to use compatible versions, see:
Idea: start to wrap one of the simple examples into a lit component. Throw out all unnecessary stuff (HTML buttons, restart handling): |
@kaisalmen , as you suggested, I am trying to wrap one of the simple examples. But the problem seems to be dependency resolution. I am not even at the point yet where I am using Lit, and I can't build a bundle due to dependency resolution. I have created a minimal example here: https://github.com/ballcoach12/monaco-editor-ts. We are using Parcel to build our module now instead of Rollup (maybe that's a mistake), and it fails when we attempt the build:
It does not seem to know how to resolve 'vscode/service-override/configuration' even though we reference |
Also, I noticed that the |
Hi @ballcoach12 we don't use parcel, so I can't really help there. https://github.com/ballcoach12/monaco-editor-ts only contains a README. Did you forgot to push updates? Thanks for the hint regarding the package.json. I already pushed an update. |
Sorry about that! The files should be in the repo now (been a long week...:) |
I got a basic example working where I wrap an editor in Lit. I'll post it to the repo next week. Thanks for the input! |
Picking this back up after a few months... One of the reasons why we are using an earlier version of I recall seeing a comment somewhere along the way that one of the notable differences between wrapper versions is the ability to use One thing that I am a bit confused on is the difference between 'classic' mode and 'VscodeApi' mode. Can you explain that to me and advise on how I should determine which one to choose? |
@ballcoach12 there is eclipse-langium/langium#1163 Once #45 and #47 are done and a new release is available my plan is to update the template. classic mode basically supplies the configuration/capabilities you know from monaco-editor. Our documentation needs to be improved. It will come... 😅 |
@ballcoach12 the Langium Grammar example (moved over here from monaco-languageclient a couple of weeks ago): |
@kaisalmen, thanks for the information. That likely explains why I was seeing multiple errors related to missing dependencies in my experimentation to get my implementation up and running. I was probably trying to run the editor in vscode mode and had not supplied the right dependencies. At the moment, I am pursuing two approaches. The first is similar to how you guys test the The second approach is similar to the Statemachine example where the TS code is in a separate file that is referenced by a I plan to post an updated example to my repo later today. I'll add to the notes on this issue when that is done. |
I have posted a new repository at https://github.com/ballcoach12/stab-at-lang-editor. If someone has time to take a look at it, I'd greatly appreciate it. The
I don't get this error in the first case. Something tells me that it is related to module formats or else I don't have something configured correctly. |
Hi @ballcoach12 I will have the time to look at it tomorrow, I guess. |
Thanks, @kaisalmen. I greatly appreciate it. I'll buy you a beer! :) |
I have updated the example code in the repo I created. I have gotten past the error that I mentioned above, and now only have one error in the browser: I suspect that either Vite is doing something in the bundling/chunking that is breaking things, or I have somehow missed a configuration option for the editor. In any case, things seem to fail when the editor tries to make the |
@ballcoach12 found it. Don't use |
Fixed!! I just modified my project and got it to work! Thanks so much for your help! I'll push my updates in case anyone wants to see my implementation as an example in the future. |
Sounds good. |
My team would like to build a Lit component to wrap an editor for a language that we created using Langium. We have a Lit app almost working with a component that should be able to provide the editor for our language. However, we are running into problems with
rollup
when we try to build the app. It seems that themonaco-editor-wrapper
does some things that rollup doesn't like.I came across the recent announcement about the monaco-editor-wrapper Lit component being discontinued in the latest release.
My questions are:
Thanks
The text was updated successfully, but these errors were encountered: