kt3k / packup

📦 Zero-config web application packager for Deno
https://packup.deno.dev/
MIT License
328 stars 18 forks source link

chore: updated esbuild to v0.14.51 #49

Closed karelklima closed 2 years ago

karelklima commented 2 years ago

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 by esbuild_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:

import { type SomeType, someVar } from "./mod.ts"

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:

What may be possibly removed further (legacy code that I have not dared to delete):

kt3k commented 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.

karelklima commented 2 years ago

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.

kt3k commented 2 years ago

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!