Reconsider about using swc as JS/TS transformer
See original GitHub issueIn early days, the performance of swc
is much worse than esbuild
(around 2 ~ 5x slower).
But recently, the author of swc
landed many performance enhancements in swc
project.
Now the performance of transform
API is very close between @swc/core
and esbuild
: transform parallel benchmark results
Besides, swc
have some advantages over esbuild
:
- Support
experimentalDecorators
in TypeScript. Support@jsx pragma
.- Exposed transformer API, so community can customize
transform plugin
top on it jest-hoist-plugin. - (Maybe) more users, deno is strongly dependent on
swc
(They are usingswc
in --no-type-check mode).
/cc @yyx990803 @kdy1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Why you should use SWC (and not Babel) - LogRocket Blog
In this post, we'll cover the basics of transpilers and we'll compare Babel and SWC based on setup, execution, and speed.
Read more >Compilation - SWC
Compilation works out of the box with SWC and does not require customization. Optionally, you can override the configuration. Here are the defaults:...
Read more >Untitled
Roda tsuya 20, Back draft in casting process, Drums with one arm, ... Atalaya south carolina weddings, Pokemon ep 342, Swc protein skimmer...
Read more >2006 Peer Review Report - OSTI.gov
world, the new facility at NREL will test wind turbine drivetrains with ... voltage transformers instead of using the generic term Power Transformer....
Read more >Benchmarking esbuild, swc, tsc, and babel for React/JSX ...
Transformers need to parse and translate JavaScript (and/or TypeScript). Bundlers typically use a transformer under the hood and handle turning ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As a side note, swc supports some typescript specific features like
emitDecoratorMetadata
which is important for some libraries and swc tries to be spec-compilant as much it can.Also, starting from v1.2.23, which will be released within a week, swc will support
@jsx
pragma. (It’s already implemented, but not published yet)FWIW esbuild has already supported this for a long time (since July, so before the original post).
@jsxFrag
is also supported to control what’s used for the<>...</>
syntax.