swc
sucrase
Our great sponsors
swc | sucrase | |
---|---|---|
139 | 26 | |
29,952 | 5,578 | |
1.1% | - | |
9.9 | 6.1 | |
about 13 hours ago | about 2 months ago | |
Rust | TypeScript | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
swc
-
Storybook 8 Beta
First, we switched the default compiler for new projects from Babel to SWC (Speedy Web Compiler). SWC is dramatically faster than Babel and requires zero configuration. We’ll continue to support Babel in any project currently using it.
-
What is JSDoc and why you may not need typescript for your next project?
SWC
-
Implementing auth flow as fast as possible using NestJS
As the reference explains “**SWC** (Speedy Web Compiler) is an extensible Rust-based platform that can be used for both compilation and bundling. Using SWC with Nest CLI is a great and simple way to significantly speed up your development process.”
-
Ruby Outperforms C: Breaking the Catch-22
This is specifically about breaking the myth that performing expensive self-contained operations (e.g, parsing GraphQL) in a native extension (C, Rust, etc.) is always faster than the interpreted language.
The JS ecosystem has the same problem, people think rewriting everything in Rust will be a magic fix. In practice, there's always the problem highlighted in the post (transitioning is expensive, causes optimization bailouts), as well as the cost of actually getting the results back into Node-land. This is why SWC abandoned the JS API for writing plugins - constantly bouncing back and forth while traversing AST nodes was even slower than Babel (e.g https://github.com/swc-project/swc/issues/1392#issuecomment-...)
-
Building a Minimalist Docker Image with Node, TypeScript
Why Speedy Web Compiler ?
- TypeScript Is Surprisingly OK for Compilers
- Speedy Web Compiler: Rust-Based Platform for the Web
-
FTA: Fast TypeScript Analyzer
FTA is a TypeScript static analysis tool built on the speedy foundations of swc. FTA is fast; capable of analyzing more than 150 files per second on typical hardware, it offers a powerful addition to your code quality toolkit.
-
Show HN: Ezno, a TypeScript checker written in Rust, is now open source
Very cool! I'm curious, is this intended for dev tooling?
For example, I could see this (or something similar) being useful as the engine for a typescript language server that would be faster than the standard one
But if it's not aimed at 1:1 with tsc, would it be intended more for something like swc[1]?
Or what would you expect people to use this for, besides just being a cool project to learn from?
-
TypeScript team released an explorer for performance tuning
This is... good news, but I still cannot fathom using the default Typescript compiler for regular development. Seriously, leave the type-checking to your IDE and CICD chain, and switch to using tsx (https://www.npmjs.com/package/tsx) or swc (https://swc.rs/) and you will _immediately_ notice the difference in speed and productivity.
sucrase
-
Show HN: JSX in Browser with Sucrase
Thanks. As for the code compilation, that can be tested and seen in https://sucrase.io/
The demo page is only to show how we can transpile JSX in browsers.
-
Created a simple online JavaScript Playground, it's a place for you to try out your code and ideas.
Thanks u/OutlandishnessKey953, the playground built with React, Docusaurus(https://docusaurus.io/), CodeMirror(https://codemirror.net/), Sucrase(https://sucrase.io/), etc.
-
The TypeScript compiler is now implemented internally with modules
Hi, Sucrase author here.
To be clear, the benchmark in the README does not allow JIT warm-up. The Sucrase numbers would be better if it did. From testing just now (add `warmUp: true` to `benchmarkJest`), Sucrase is a little over 3x faster than swc if you allow warm-up, but it seemed unfair to disregard warm-up for the comparison in the README.
It's certainly fair to debate whether 360k lines of code is a realistic codebase size for the benchmark; the higher-scale the test case, the better Sucrase looks.
> worse it disables esbuild and swc's multi-threading
At some point I'm hoping to update the README benchmark to run all tools in parallel, which should be more convincing despite the added variability: https://github.com/alangpierce/sucrase/issues/730 . In an ideal environment, the results are pretty much the same as a per-core benchmark, but I do expect that Node's parallelism overhead and the JIT warm-up cost across many cores would make Sucrase less competitive than the current numbers.
-
Should i switch to Typescript?
First, npm i -D sucrase to install sucrase. Now you can do node -r sucrase/register ./index.ts to run TypeScript code directly with Node.
-
🚀 Building your own Javascript Library with bare minimum
As you might know there are a lot of Javascript bundlers out there, such as webpack, sucrase, parcel, rollup and etc. Bear in mind, not because they have thousands of stars on Github that means they're the best. sometimes new libs are as good as the popular ones but they're still building up their image/popularity in the community. what I bring today is a not sooooo, popular JS bundler called esbuild.
-
Five coding interview questions I hate
Sucrase JS was 2x the speed of esBuild and 50% faster than SWC last I checked.
-
I’m Porting the TypeScript Type Checker Tsc to Go
Webpack does way more than esbuild, including running a typechecking compiler instead of just transpiling, running compilers able to downlevel emit to ES5 and providing a deep plugin architecture allowing you to hook into any bit you like. But yes, it hasn't been designed with speed in mind - it has been designed with maximum extensibility instead. Its the same reason why Babel is slow compared to sucrase (written in JS, currently faster than SWC and esbuild but doing somewhat less - https://github.com/alangpierce/sucrase)
tsc has in fact been designed with speed in mind (I've been following the project since before it ended up on GitHub). Going beyond 1 order of magnitude performance improvement is highly unlikely.
- Sucrase: A fast, pure-JavaScript transpiler for JavaScript/TypeScript
- GitHub - alangpierce/sucrase: Super-fast alternative to Babel for when you can target modern JS runtimes
- Sucrase: A fast JavaScript/TypeScript transpiler written in JavaScript
What are some alternatives?
esbuild - An extremely fast bundler for the web
ts-node - TypeScript execution and REPL for node.js
vite - Next generation frontend tooling. It's fast!
ts-loader - TypeScript loader for webpack
fork-ts-checker-webpack-plugin - Webpack plugin that runs typescript type checker on a separate process.
tsup - The simplest and fastest way to bundle your TypeScript libraries.
swc-node - Faster ts-node without typecheck
vitest - Next generation testing framework powered by Vite.
TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
nextjs-tailwind-ionic-capacitor-starter - A starting point for building an iOS, Android, and Progressive Web App with Tailwind CSS, React w/ Next.js, Ionic Framework, and Capacitor