Turbopack. Why? How? When? and the Vision...

Rate this content
Bookmark

FAQ

Tobias Cauras is a web developer from Germany who founded Webpack and maintained it for ten years. He later joined Versil, worked on Next.js and its integration with Webpack, and is currently developing TurboPack.

The mission of TurboPack is to create a successor to Webpack that aligns with Webpack's goals. The aim is to build a tool that is framework-independent and caters to the open-source community, providing flexibility and extensibility similar to Webpack.

TurboPack features include a system of mixed environments, lazy asset graphs for efficient builds, and the ability to handle incremental builds independent of application size. It offers advanced caching and invalidation techniques, using Rust for performance and reliability.

TurboPack addresses limitations in Webpack's decade-old architecture that wasn't designed for large-scale builds. It provides more granular caching, better cache invalidation, and reduced cache lookup costs, thanks to its innovative task graph approach and use of Rust for parallel processing.

Yes, while TurboPack is being developed with Next.js integration, it is designed to be framework-independent. Its plugin system will allow it to support various frameworks, making it a versatile tool for web development across different platforms.

The next steps for TurboPack include achieving feature parity with Next.js, conducting alpha and beta releases, and eventually making TurboPack the default build system. For Next.js, the plan is to transition to using TurboPack while retaining specific Next.js runtime code.

Yes, once TurboPack supports most features needed for a smooth transition, a comprehensive migration guide will be provided to help users switch from Webpack to TurboPack effectively.

TurboPack aims to solve performance issues related to JavaScript-based tooling, improve build times regardless of application size, and address challenges with cache sensitivity and invalidation. It also seeks to enhance developer experience with easier configuration and plugin development.

Tobias Koppers
Tobias Koppers
32 min
02 Dec, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

The Talk discusses TurboPack, a successor to Webpack, aiming to create a framework-independent, flexible, and extensible tool for the open-source community. It addresses performance challenges by integrating SWC into Next.js. The challenges with Next.js and Webpack include orchestration issues, backward compatibility constraints, and cache invalidation problems. TurboEngine and TurboPack provide constant performance in incremental builds, leveraging Rust's predictable performance and parallelism. The Talk also covers topics like dependency tracking, task graphs, cache invalidation, lazy asset graphs, and the integration of TurboPack with Next.js. The future plans involve reconfiguring Webpack and TurboEngine, moving computations to the cloud, providing insights into builds, and facilitating migration and integration with JavaScript projects.

1. Introduction to TurboPack

Short description:

I started with web development 10 years ago, founded and maintained Webpack for 10 years. Now working on TurboPack, the successor of Webpack, with the mission to create a tool similar to Webpack that aligns with its goals. We aim to build something framework independent, for the open source community, and as flexible and extensible as Webpack. Our goal is to create a building block for the next ten years of web development.

Thanks for having me. My name is Tobias Cauras, I'm from Germany, and I'm going to tell you something about I started with web development 10 years ago, when I started to found Webpack and maintained it for 10 years, so it's pretty old now.

And nearly 2 years ago I started to join Versil and worked with the Next.js team on Next.js and integration with Webpack and Next.js and performance stuff and stuff like that. And then now for 10 months I'm working on TurboPack and I'm going to tell you something about that.

First of all, what's our mission with TurboPack? So our mission is to create the successor of Webpack. We want to align with the goal of Webpack, we want to make some kind of tool which is really like Webpack, similar to Webpack and fulfills at least the goals of Webpack. So I know that's a really ambitious mission and it will take years or a long time to get there, but at least that's our direction we are trying to head to. And this basically motivates us for our project goals.

We don't want to build something that's only for Next.js. We want to build something that's framework independent. We do not want to build something that's only for Verzi. We want to make something that's for the open source community, which is a community effort, and we want to align with the goals and the motivation behind Webpack. We also want to make sure that we are building something that's as flexible and as extensible as Webpack. So we want to follow Webpack's footsteps in that kind of way. So we actually want to create a building block for the web development for the next ten years of web development. Ambition's goals. Yeah.

2. Creation of TorbaPack and Performance Challenges

Short description:

We wanted to solve some developer experience challenges, one of which was performance. Next.js, being mostly built on Javascript-based tooling, faced challenges in leveraging the full power of the computer. To address this, we integrated SWC into Next.js, which resulted in improved performance. However, there were trade-offs made for performance, such as assuming that module requests and Node modules don't change. The Next.js team also faced implementation challenges.

Okay. So let's look into what's led to the creation of TorbaPack into the past and also how it works, and what's exactly our vision with TorbaPack. So I started when I was joining Versa and worked with the Next.js team, and basically we wanted to solve some developer experience challenges, and one of these challenges was performance. It's kind of working well, but there are some kind of challenges with performance, especially as Next.js is mostly built on top of Javascript-based tooling, and Javascript-based tooling for compute-heavy work has a really hard time leveraging all the power of your computer, so leveraging multiple CPUs and really Javascript might not be the best language for compute-heavy work, or for build kind of things. The Next.js team and I started to work on porting some part of Next.js or of the compiler infrastructure of web development into Rust world, so SWC was integrated into Next.js, and it really has a lot of benefits performance-wise. But there are also some changes integration-wise. There's always a boundary between JavaScript world and the Rust world, and you have the serialization problems. So, still, there's challenges while working on that. There are also some kind of trade-offs we had to do in Next.js for performance. One example was that we are resolving module requests in Webpack, and we had to be really optimistic about this to make it performance-like. Once we successfully resolved something, we just assumed that this is not changed. We also assumed that Node modules usually don't change, and this is kind of working well for the 99 per cent of cases, but it's kind of a trade-off, and we don't want to be forced to choose that. But there are also some implementation challenges in the Next.js team.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Vite: Rethinking Frontend Tooling
JSNation Live 2021JSNation Live 2021
31 min
Vite: Rethinking Frontend Tooling
Top Content
Vite is a new build tool that intends to provide a leaner, faster, and more friction-less workflow for building modern web apps. This talk will dive into the project's background, rationale, technical details and design decisions: what problem does it solve, what makes it fast, and how does it fit into the JS tooling landscape.
React Compiler - Understanding Idiomatic React (React Forget)
React Advanced Conference 2023React Advanced Conference 2023
33 min
React Compiler - Understanding Idiomatic React (React Forget)
Top Content
React provides a contract to developers- uphold certain rules, and React can efficiently and correctly update the UI. In this talk we'll explore these rules in depth, understanding the reasoning behind them and how they unlock new directions such as automatic memoization. 
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Too much JavaScript is getting you down? New frameworks promising no JavaScript look interesting, but you have an existing React application to maintain. What if Qwik React is your answer for faster applications startup and better user experience? Qwik React allows you to easily turn your React application into a collection of islands, which can be SSRed and delayed hydrated, and in some instances, hydration skipped altogether. And all of this in an incremental way without a rewrite.
SolidJS: Why All the Suspense?
JSNation 2023JSNation 2023
28 min
SolidJS: Why All the Suspense?
Top Content
Solid caught the eye of the frontend community by re-popularizing reactive programming with its compelling use of Signals to render without re-renders. We've seen them adopted in the past year in everything from Preact to Angular. Signals offer a powerful set of primitives that ensure that your UI is in sync with your state independent of components. A universal language for the frontend user interface.
But what about Async? How do we manage to orchestrate data loading and mutation, server rendering, and streaming? Ryan Carniato, creator of SolidJS, takes a look at a different primitive. One that is often misunderstood but is as powerful in its use. Join him as he shows what all the Suspense is about.
From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
We all love GraphQL, but it can be daunting to get a server up and running and keep your code organized, maintainable, and testable over the long term. No more! Come watch as I go from an empty directory to a fully fledged GraphQL API in minutes flat. Plus, see how easy it is to use and create directives to clean up your code even more. You're gonna love GraphQL even more once you make things Redwood Easy!
Jotai Atoms Are Just Functions
React Day Berlin 2022React Day Berlin 2022
22 min
Jotai Atoms Are Just Functions
Top Content
Jotai is a state management library. We have been developing it primarily for React, but it's conceptually not tied to React. It this talk, we will see how Jotai atoms work and learn about the mental model we should have. Atoms are framework-agnostic abstraction to represent states, and they are basically just functions. Understanding the atom abstraction will help designing and implementing states in your applications with Jotai

Workshops on related topic

Using CodeMirror to Build a JavaScript Editor with Linting and AutoComplete
React Day Berlin 2022React Day Berlin 2022
86 min
Using CodeMirror to Build a JavaScript Editor with Linting and AutoComplete
Top Content
WorkshopFree
Hussien Khayoon
Kahvi Patel
2 authors
Using a library might seem easy at first glance, but how do you choose the right library? How do you upgrade an existing one? And how do you wade through the documentation to find what you want?
In this workshop, we’ll discuss all these finer points while going through a general example of building a code editor using CodeMirror in React. All while sharing some of the nuances our team learned about using this library and some problems we encountered.