After experimenting with esbuild in #149, I wanted to try out the other new "transpiler" swc. That's the one used by Deno and Parcel. Note that this PR does not replace rollup, it uses swc for transpilation ('esnext', TypeScript & JSX) and minification. swc bundling is still under development, and I think it is too early for us.
My impression is very positive. The generated code is very similar to what we have right now, but in the places where it is different, I prefer the output to the one from Babel (for example the way it compiles class).
Notes:
This introduces one breaking change: The TypeScript code is no longer type checked.
Compiling should be significantly faster (Rust over JS, but also: all the steps that were done by different tools are now done in one big step), I'll try to do some benchmarks.
The dependencies of our 'extension packages' are now all identical (but you only will install swc if you choose one of the extensions), and we reduce the dependencies drastically.
Minification is a bit less efficient, as we minify each file separately, and not the result of the entire thing.
We keep rollup-plugin-cleanup for compact=true and compact="compact".
The biggest advantage I see compared to esbuild is that it fully supports browserslist, without any hacks.
Drops support for the module format cjs, we deprecated it, as we use commonjs instead.
After experimenting with esbuild in #149, I wanted to try out the other new "transpiler" swc. That's the one used by Deno and Parcel. Note that this PR does not replace rollup, it uses swc for transpilation ('esnext', TypeScript & JSX) and minification. swc bundling is still under development, and I think it is too early for us.
My impression is very positive. The generated code is very similar to what we have right now, but in the places where it is different, I prefer the output to the one from Babel (for example the way it compiles
class
).Notes:
rollup-plugin-cleanup
forcompact=true
andcompact="compact"
.cjs
, we deprecated it, as we usecommonjs
instead.