denoland / deno_emit

Transpile and bundle JavaScript and TypeScript under Deno and Deno Deploy
https://jsr.io/@deno/emit
MIT License
223 stars 23 forks source link

Cancellable API #144

Closed yacinehmito closed 1 year ago

yacinehmito commented 1 year ago

I am building a live bundler which watches file event systems and bundle in reaction to them. The project this bundler runs has a lot of code; so much so that bundling takes several seconds. I could improve the throughput of the live bundler — in reaction of a large amount of watch events — if there was a possibility to cancel an ongoing bundling promise.

yacinehmito commented 1 year ago

I just realized that this feature request makes no sense. WebAssembly runs synchronously in the same thread that calls it. To achieve what I am asking, it is sufficient to run deno_emit in a Web Worker and call .terminate() on it to cancel the operation.