question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reconsider about using swc as JS/TS transformer

See original GitHub issue

In 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 using swc in --no-type-check mode).

/cc @yyx990803 @kdy1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:12
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
kdy1commented, Sep 7, 2020

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)

4reactions
evanwcommented, Oct 28, 2020

Support @jsx pragma.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found