sucrase
fork-ts-checker-webpack-plugin
Our great sponsors
sucrase | fork-ts-checker-webpack-plugin | |
---|---|---|
26 | 8 | |
5,560 | 1,910 | |
- | 0.6% | |
6.1 | 5.6 | |
about 1 month ago | 18 days ago | |
TypeScript | TypeScript | |
MIT License | 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.
sucrase
-
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.
Sucrase is faster or really close to SWC (see rhe benchmarks https://github.com/alangpierce/sucrase). Everyone still uses Babel because of the transforms.
And yes, Babel can also be made faster if enough effort is dedicated into it. it's not an impossible feat.
-
š 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.
- GitHub - alangpierce/sucrase: Super-fast alternative to Babel for when you can target modern JS runtimes
-
š10 Trending projects on GitHub for web developers - 29th October 2021
Try it out
View on GitHub
fork-ts-checker-webpack-plugin
-
Converting to Typescript
Okay. The normal setup is that you use https://github.com/TypeStrong/ts-loader or https://github.com/TypeStrong/fork-ts-checker-webpack-plugin as part of your Webpack config. Those will run the TS compilation step as part of the Webpack processing sequence.
-
Announcing Parcel CSS: A new CSS parser, compiler, and minifier written in Rust!
I work on a TypeScript project of similar size and complexity, and ours does not take even nearly that long to compile on save. Have you tried fork-ts-checker-webpack-plugin? We had compile times similar to yours until we started using it. Went from >60s to <1s builds in development. It's very simple to set up.
-
Do you guys compile with ts-loader or babel-loader?
Yeah, I mean less loaders = less time. Did you try fork ts checker and compileOnly? https://github.com/TypeStrong/fork-ts-checker-webpack-plugin
-
Hey when I want to run a vue frontend I need to increase my memory size, because js jumps out of memory.
That worker/memory limit is for the type checking only (rather than runtime memory), I believe this is done using https://github.com/TypeStrong/fork-ts-checker-webpack-plugin
-
Adding Typescript to your Existing Rails App
There are many ways to integrate TypeScript with an existing Webpack configuration. If you use the babel-loader package to transpile JavaScript files, you can add the @babel/preset-typescript preset to generate JavaScript files and the Fork TS Checker Webpack Plugin package to run the TypeScript type checker so that the build fails if there are type errors.
-
Blazing fast TypeScript with Webpack and ESBuild
esbuild-loader (secret sauce!) fork-ts-checker-webpack-plugin (helps us with typechecking) nodemon-webpack-plugin (We can also use webpack-dev-server)
-
Why Is Esbuild Fast?
You may want to check out this webpack plugin [1], though I'm not sure how much it could get you there.
[1] https://github.com/TypeStrong/fork-ts-checker-webpack-plugin...
What are some alternatives?
swc - Rust-based platform for the Web
ts-node - TypeScript execution and REPL for node.js
esbuild - An extremely fast bundler for the web
babel-loader - š¦ Babel loader for webpack
webpack-dev-server - Serves a webpack app. Updates the browser on changes. Documentation https://webpack.js.org/configuration/dev-server/.
esbuild
vite-ts-tailwind-starter - Opinionated Vite + Vue 3 + TypeScript + Tailwind CSS starter template w/ tests and CI.
swc-node - Faster ts-node without typecheck
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
esbuild-register - Transpile JSX, TypeScript and esnext features on the fly with esbuild