monaco-languageclient icon indicating copy to clipboard operation
monaco-languageclient copied to clipboard

WIP-> feat(angular): add angular wrapper

Open ls-infra opened this issue 1 year ago • 3 comments

add the MonacoAngularWrapperComponent as the equivalent to packages/wrapper-react/src/index.tsx so that the Angular devs can refer this to do two ways data binding (load from API and save back to API ,which is the typical use of the editor ) aslo by passing the wrapperConfig into the wrapper to make it language agnostic to increase reusability

but need some help for this run time exception atm
image

thank you very much

ls-infra avatar Oct 10 '24 22:10 ls-infra

this wrapper enhances and relates to https://github.com/TypeFox/monaco-languageclient/pull/759 which changes the component to standalone to make it more reusable and configurable .

ls-infra avatar Oct 10 '24 23:10 ls-infra

Yes, the div element with id "monaco-editor-root" is no longer set. This causes the problem

Btw, I switched to the esbuild based system in the angular example, because the workers where no longer working with the custom webpack config. It was able to fix it in the independent webpack example, but that does not work in the angular context.

Due to esbuild/vite build currently some resources from monaco-vscode-api can't be loaded. @CGNonofr FYI, I hoped your existing vite plugin can help here, but the problem origin seems to be different or I need an asset config? I am not super familiar with Angular configuration. If someone can tell me how I can influence/change the vite config in Angular 18 I will be very happy. esbuild plugins can be used. image

kaisalmen avatar Oct 11 '24 06:10 kaisalmen

image @kaisalmen , i just finished the change , still some error , but looks like it is working , thanks

ls-infra avatar Oct 14 '24 03:10 ls-infra

@ls-infra thank you, I was away for a week. I will also try to find a solution for the above error. I will provide feedback in the upcoming days.

kaisalmen avatar Oct 21 '24 07:10 kaisalmen

@kaisalmen i think for the purpose of this PR , it is ready to merge now, the demo shows that it allows user to edit the code and save to an API. i just did the git rebase

the errors in the console may be an exiting issue that we can track in another PR.

image

thanks

ls-infra avatar Oct 22 '24 22:10 ls-infra

@kaisalmen i am thinking to send another PR to fix that console error issue and support multiple lang and theme selection in the wrapper demo like the https://microsoft.github.io/monaco-editor/.

so that it will be easy to allow the dev user to test different lang easily . (while currently is only for json , when i tried to bind it to groovy, it faces some theme.json issue again for client side syntax highlight )

image

ls-infra avatar Oct 22 '24 22:10 ls-infra

@kaisalmen the CI is passed after the git rebase , can you merge it now , we will open new PRs for the other related things. thx

ls-infra avatar Oct 23 '24 22:10 ls-infra

I squashed merged your commits. Thank you for providing this. Let's continue from here. 🎉

kaisalmen avatar Oct 24 '24 07:10 kaisalmen