Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Turbopack, custom runtime infrastructure on top of AWS Lambda.


Turbopack does not work for every app, I think they skip some build steps when building like typescript validation etc and aggressively cache node modules.


> skip some build steps

There was a change in Next 16, not Turbopack, that removed `ESLint` during `next build`: https://nextjs.org/blog/next-16#breaking-changes-and-other-u...

This behavior is the same whether you use Turbopack or webpack. It doesn't make sense for us to couple ourselves with ESLint when there are many viable alternatives. No other popular frameworks run ESLint automatically during builds. This change in Next 16 brought up closer to parity with other frameworks and bundlers.

> typescript validation

There's no change here with Turbopack. We do still run `tsc` automatically to check your types. That's part of `next build` and not Turbopack. However, we may remove this in the future for similar reasons.

There's no good reason for the bundler to call the typechecker. Bundlers strip types. Historically this was done with Babel in webpack. Modern versions of Next.js use SWC for type stripping in both webpack and Turbopack.

> aggressively cache node modules

We aggressively cache everything. We don't have special-casing for `node_modules`. See our blog post about our caching system: https://nextjs.org/blog/turbopack-incremental-computation

Interestingly vite does actually special-case and cache `node_modules`: https://vite.dev/guide/dep-pre-bundling

There are tradeoffs to both approaches, and I think Vite's choice makes sense in the context of their broader minimal-bundling-in-dev design, but it makes less sense for Turbopack (as well as webpack and Rspack) where we produce bundles in dev.


Unfortunately turbopack have some bugs in bundling. Does not work on some of my projects. Can't reproduce outside of whole codebase, so no ticket.


The biggest issue is missing plugins, but they have an extension point to add them.

Naturally they expect them to be written in Rust, which might be an issue for some then again Vite folks are also going into RIR.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: