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

Consider extracting yaml-language-service from yaml-language-server #524

Open
remcohaszing opened this issue Aug 19, 2021 · 5 comments
Open

Comments

@remcohaszing
Copy link
Contributor

remcohaszing commented Aug 19, 2021

Summary

I would like to be able to depend on the language service part without pulling in the language server part and all of its dependencies.

Relevant information

I’m working on monaco-yaml. monaco-yaml depends on the YAML language service part in this package, but not on the language server. Currently a build process is needed to include the language service, but ideally I would like to be able to simply add it as a dependency without pulling in the language server part and its dependencies.

I believe extracting the language service also helps to better separate the two parts. monaco-yaml still depends on an older version of yaml-language-server, but I noticed the latest version of the language service also uses some imports from the language server.

I understand if this gets rejected, because it adds an additional maintenance burden, but I wanted to ask anyway to see what you think of it. I think using a yarn mono repository reduces the additional maintenance a lot.

@evidolob
Copy link
Collaborator

@remcohaszing I'm not clear, what language service do you want to extract? Do you mean languageservice folder?

@remcohaszing
Copy link
Contributor Author

Yes. I would like the languageservice folder to be published as a separate package. I imagine it would be called yaml-language-service. The yaml-language-server package would then depend on yaml-language-service.

This is similar to vscode-json-languageserver which depends on vscode-json-languageservice

@fantonangeli
Copy link

fantonangeli commented Nov 16, 2022

Hi all,
We also have a similar issue in KIE-Tools.
Our package Serverless Logic Web Tools, which is a web-app, we needed to validate a YAML using a schema.
Using yaml-language-server from the Jest everything works, but Webpack cannot compile and we have errors with importing libraries, mainly prettier.
I tried importing yaml-language-server using CJS, ESM or UMD formats but it didn't work.

To solve the issue I bundled yaml-language-server with Esbuild, like @remcohaszing in monaco-yaml, in a different package and used that package in Webpack.
https://github.com/kiegroup/kie-tools/tree/main/packages/yaml-language-server
I tried also to create a bundle with Webpack, but I had issues with some dependencies, mostly vscode-json-languageservice and ajv.

The idea of @remcohaszing of the monorepo with 2 packages (yaml-language-server and yaml-language-service) should give us the possibility to use the language service part without other dependencies.

What do you think?
Please, let me know if there is anything I can do.

Other information

The version of yaml-language-serveris "1.11.1-7853bfd.0"

Logs file: webpack.log

In my fork there is the code giving the error:
https://github.com/fantonangeli/kie-tools/tree/yaml-language-server-no-bundle-prettier-error

@elvin-hwang
Copy link

elvin-hwang commented Oct 27, 2023

Hi, any update on this issue? We would also like to request the same feature due to the size of the bundle being increased by ~11MB due to the prettier dependency, although listed as optionalDependency (using npm ci --no-optional is not an option for our build).

@remcohaszing
Copy link
Contributor Author

@elvin-hwang The language service part uses Prettier. This issue isn’t related to what you describe. See #933 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants