Open remcohaszing opened 3 years ago
@remcohaszing I'm not clear, what language service do you want to extract? Do you mean languageservice
folder?
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
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-server
is "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
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).
@elvin-hwang The language service part uses Prettier. This issue isn’t related to what you describe. See #933 instead.
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.
, but I noticed the latest version of the language service also uses some imports from the language server.monaco-yaml
still depends on an older version ofyaml-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.