tsx icon indicating copy to clipboard operation
tsx copied to clipboard

`swc` as `tsx` compile backend alternative

Open loynoir opened this issue 2 years ago • 2 comments

Feature request

swc as tsx compile backend alternative

Why?

  • https://github.com/evanw/esbuild/issues/2605 Since Oct 11, 2022. esbuild seems have low interest to fix --keep-names
  • https://github.com/esbuild-kit/tsx/issues/113#issuecomment-1519340330 ts-node support swc, and don't have same problem like esbuild
  • https://github.com/TypeStrong/ts-node/pull/1585 Since Dec 29, 2021. ts-node does't support tsconfig.paths. PR is not merged yet.

Alternatives

Additional context

No response

loynoir avatar Apr 24 '23 04:04 loynoir

Feel free to open a PR to demonstrate that the tests pass.

My main concerns are feature parity and size. swc is much bigger than esbuild: esbuild vs @swc/core

Once we know it works, tsx should detect if swc is installed and use it only if it's installed.

Locking thread to direct further dialogue in the form of PRs.

privatenumber avatar Nov 09 '23 06:11 privatenumber

currently tsx can't be used if decorators are used. esbuild doesn't support decorators nor has it a type system. only solution is either tsc or swc. supporting both would be nice. since typescript/tsc is usually already installed.

randre70 avatar Feb 23 '24 12:02 randre70