Open jukzi opened 11 months ago
These files are required to run language servers. We could investigate possibility to build and embed vercel bundles: https://github.com/vercel/ncc
I don't know anything about vercel but I am a bit skeptical that it can work perfectly for the numerous modules we have; and the various entry points we consume.
Even if we bundle org.eclipse.wildwebdeveloper as a jar, we will need to expand the node_modules somewhere on filesystem at some point for the LSs to work. So it's either we have some time lost during unpack/install (which is expected to take some time usually), or we have it a jarred bundle and the time expanding the node_modules will then be spent at runtime before starting the language server, resulting in high CPU/filesystem consumption and a delay at usage that may give the impression Wild Web Developer is bogus. I think the current state is the less worse of all known possible ones.
How about esbuild? I think this allow us reduce node_modules to ~40mb in couple js files. For example vuejs languageserver can be just 5mb js file
I'm not familiar with all those technologies in general and I don't know how well they handle the case of node_modules being shared by various entry-points. But whatever can be made to work without negative impact on features or UX and with a positive impact on files/space/performance is always welcome.
In general esbuild will compile parts from node_modules that are used by entrypoints into one file, except parts that will be marked as well known external (for example typescript sdk), so after build you don't need node_modules at all. As the result of entrypoint using only one method from lodash
, only this method will be part of bundle
In similar way vscode extensions are bundled (esbuild, webpack, etc...) so they are relatively small
originally reported in https://github.com/eclipse-platform/eclipse.platform/issues/722![image](https://github.com/eclipse-wildwebdeveloper/wildwebdeveloper/assets/51790620/870146f7-77b8-4688-b663-5f8a9a103097)