4 ms·
I think esbuild is a fantastic project as well as a huge inspiration. I'll share two quick thoughts[1] I have on SWC that made it a fantastic choice for Next.js
by Rauchg 5y ago
I think esbuild is a fantastic project as well as a huge inspiration. I'll share two quick thoughts[1] I have on SWC that made it a fantastic choice for Next.js:
1. SWC is designed for extensibility
We were able to use `swc` as a crate[2], without the need to fork the project
This allowed us to effectively (no divergence) and efficiently (no loss in performance) extend it, especially to add syntax and plugin compatibility that is more common in the Next.js ecosystem. We added support for `<style jsx>`, with more React optimizations and Babel plugins coming.
2. We love the Rust ecosystem
It has a stellar, growing community. It has the best long-term performance prospects for us (e.g: absolute control over memory management) and safety. We don't want to be in a position where there's another enticing migration in just a couple years, and we think Rust is a durable non-regrettable choice.
[1] https://twitter.com/rauchg/status/1425520232202792962 https://twitter.com/rauchg/status/1425520232202792962
[2] https://github.com/padmaia/next.js/blob/cf1d081c5b2f55085cebc9509b13c67c4bf34bd1/packages/next/build/swc/src/lib.rs#L40-L46 https://github.com/padmaia/next.js/blob/cf1d081c5b2f55085ceb...
- The_rationalist 5y agoBut you could use vite/rollup/esbuild for bundling instead of Webpack and SWC for TS and other transforms.