-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Feature] add esbuild/register #148
Comments
I could see having something like this, although if it's non-trivial it's probably better as an independent 3rd-party package. Keep in mind that esbuild doesn't do type checking, so if you want type checking you'd still have to invoke the TypeScript compiler API. Also, I assume this is somewhat blocked on #136 unless you want to run |
Update: there is now a |
Referencing https://github.com/egoist/esbuild-register which works with esbuild but still need esm.
esbuild is incredible, the speed difference is quite noticeable. |
I was looking at this too – there's one unfortunate downside to esbuild being a separate process which is that I looked into some potential ways around this – here are a couple of modules that could potentially enable synchronous communication with a persistent esbuild server process:
I haven't looked any deeper into this, but I'd be interested to see if it could be achieved without the overhead of a process invocation each time |
The sync IPC approach is interesting. FYI someone has tried a different approach here in case you want to look at that too: #248. I also wanted to say that this isn't what esbuild was designed to do, so I think it's ok that esbuild is not a perfect fit for this particular problem. |
Yeah, I wasn't trying to suggest it was esbuild's responsibility in any way – kinda surprised after all this time that Node.js doesn't have better sync primitives for communicating with processes. If |
I've just released It's a little similar to It also falls back to |
Can we not use the wasm version of esbuild for register so there is no extra process invocation penalty ? |
The WASM version should be avoided if possible due to the huge performance overhead of node's WebAssembly implementation. The native version will always be much faster than the WASM version. There is now an experimental optimized Can you try running your code with |
The text was updated successfully, but these errors were encountered: