Closed karelklima closed 2 years ago
I used to have a plan to run packup build process in edge runtime like Deno Deploy, but I think that can be done in a more better way. This change just makes sense to reduce the complexity.
Thanks for accepting this PR. Regarding the wasm / native esbuild - that can be improved, I found out that Fresh has this implemented in a way that it uses native esbuild if available, or wasm otherwise. So you can build on the edge, but also build with the best performance during development.
that can be improved, I found out that Fresh has this implemented in a way that it uses native esbuild if available, or wasm otherwise. So you can build on the edge, but also build with the best performance during development.
That sounds perfect!
I have attempted to update packup with newer version of
esbuild
, using the official Deno module. The included version is the same one as supported byesbuild_deno_loader
(the newest version of esbuild does not work because of a change in interface).One big feature that is enabled by this PR is support for TypeScript type-only specifiers (see https://esbuild.github.io/content-types/#typescript) so you can write code like:
The code uses native build of esbuild instead of WASM because of performance. According to my testing the WASM version is cca 3 - 5 times slower than native version.
In this PR:
esbuild_loader
is replaced withhttps://deno.land/x/esbuild@v0.14.51
esbuild_deno_loader
replaced withhttps://deno.land/x/esbuild_deno_loader@0.5.2
.What may be possibly removed further (legacy code that I have not dared to delete):
install_utils.ts
andinstall_util_test.ts
vendor/esbuild_deno_loader
ensure_esbuild_wasm.ts
and references from Makefile