evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
37.78k stars 1.12k forks source link

Allowing other platforms to communicate with esbuild (Like nodejs does) #3327

Closed ia3andy closed 1 month ago

ia3andy commented 11 months ago

Hello @evanw,

I am one of the maintainers of the new https://github.com/mvnpm/esbuild-java, which is key to the https://github.com/quarkiverse/quarkus-web-bundler.

Currently we are using the esbuild CLI binary under the hood, it is already very fast and reliable, but:

This is why I am looking at ways we could do something similar as the NodeJs implementation to communicate, so I had a look at the sources to find out how the communication is done from the nodejs to the process through IPC (and also found this issue https://github.com/evanw/esbuild/issues/306).

What's your opinion on this? is this something you considered (allowing to communicate with the process from external clients/platforms)? is there plan to document the communication protocol?

ia3andy commented 10 months ago

@evanw any udpate on this?

evanw commented 1 month ago

You are welcome to build on esbuild's internal implementation details to make something like this work. The protocol is pretty simple (see this and this) and hasn't changed for quite some time. Just keep in mind that it's an internal implementation detail of esbuild and could hypothetically be changed at some point in the future. In any case, I'm closing this issue because I consider this to be an internal implementation detail of esbuild, and not a public API to be documented.