jiti icon indicating copy to clipboard operation
jiti copied to clipboard

Try sucrase as babel alternative

Open pi0 opened this issue 2 years ago • 5 comments

  • https://github.com/unjs/jiti/issues/26#issuecomment-803286043
  • https://github.com/nuxt/vite/pull/201#issuecomment-918877146

https://github.com/alangpierce/sucrase

pi0 avatar Sep 14 '21 19:09 pi0

i think SWC would be a better choice because unlike sucrase it's extendable and part of the features already enabled in this project supported in SWC and not supported in sucrase (emitDecoratorMetadata f .ex)

And i don't belive that JS compiler might be faster than Rust's SWC or esbuild...

thekip avatar Mar 01 '23 18:03 thekip

I guess with more babel deps and it's acceptable perf won't worth focusing on this.

pi0 avatar Mar 15 '23 14:03 pi0

I strongly agree with @thekip. The SWC community is rising fast, and I'm glad Rust-based stuff gets accepted quickly. SWC should be more comfortable to use. I don't know but maybe the bundle size would decrease too. Sorry if I'm wrong. Because currently compiled dist/babel.js is about to reach 2 MB. Tailwind started using Jiti recently, released an update, and its chart on bundlephobia jumped to the skies. When it doesn't really matter for tailwind, because it's being used in devDeps anyways, it matters tools that require Jiti for production (such as @lingui/macro)

PAXANDDOS avatar Apr 29 '23 13:04 PAXANDDOS

I am open to experimenting! We could try an experimental build jiti/surcase via optional surcase peer dependency.

pi0 avatar May 03 '23 20:05 pi0

offtopic:

it matters tools that require Jiti for production (such as @lingui/macro)

I'm as an contributor of @lingui/macro could say that it also doesn't matter, because macro executed in the compile time and jiti is not going to the bundle.

thekip avatar May 08 '23 08:05 thekip