Skip to content
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

simplify checking monaco typings #7261

Open
akosyakov opened this issue Mar 3, 2020 · 3 comments
Open

simplify checking monaco typings #7261

akosyakov opened this issue Mar 3, 2020 · 3 comments
Labels
enhancement issues that are enhancements to current functionality - nice to haves help wanted issues meant to be picked up, require help monaco issues related to monaco

Comments

@akosyakov
Copy link
Member

akosyakov commented Mar 3, 2020

Currently we expose internals of Monaco manually which is quite troublesome to check on each update, since we expose more and more Monaco APIs. I believe @RomanNikitenko can second it after doing #7149.

Even if we do #7100 and can start upgrading to latest Monaco immediately and have more tests, it would still require quite some manual effort.

I'm not sure how it can be done but it would be good automate as well. I had 2 ideas in mind:

  • try to use Monaco via esm, not amd, in this case there are esm js files in monaco distribution and we could try to generate d.ts files from them. Not sure whether it is feasible, there seem to be some tool which can derive typings: https://github.com/Microsoft/dts-gen. It will increase build time but maybe reduce final output since monaco will be part of bundle.js also we don't need hack Monaco amd loading as now.
  • don't use Monaco, but have own distribution of editor layer from VS Code, basically grab ts files and put them in npm package, then compile them via webpack in Theia. Drawbacks that these APIs are not stable at all compare to published monaco.d.ts.
@akosyakov akosyakov added enhancement issues that are enhancements to current functionality - nice to haves monaco issues related to monaco help wanted issues meant to be picked up, require help labels Mar 3, 2020
@akosyakov
Copy link
Member Author

Maybe someone will have another idea.

@akosyakov
Copy link
Member Author

There is also dev distribution for amd, maybe we could use tsc or TS compiler API to generate d.ts files from it. It would be then very close to our manual approach and less breaking when switching to esm.

@akosyakov
Copy link
Member Author

Also thought today that we could have a look at how monaco.d.ts is generated in VS Code repo, maybe we can add a bit of changes there to generate typings for internal things from source code and packaging with our custom distribution, instead of deriving typings in this repo from bundled js code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement issues that are enhancements to current functionality - nice to haves help wanted issues meant to be picked up, require help monaco issues related to monaco
Projects
None yet
Development

No branches or pull requests

1 participant