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 next-generation build tool that leverages native ES modules for improved performance. It eliminates the need for bundling and improves hot module replacement. Vite provides an opinionated default configuration while still allowing advanced customization through plugins. It is framework agnostic and can be used for React and other applications. Vite is being adopted by Next.js and Create React App, and integration with Nuxt 3 offers significant speed improvements.
React Compiler - Understanding Idiomatic React (React Forget)
React Advanced 2023React Advanced 2023
33 min
React Compiler - Understanding Idiomatic React (React Forget)
Top Content
Watch video: React Compiler - Understanding Idiomatic React (React Forget)
Joe Savona
Mofei Zhang
2 authors
The Talk discusses React Forget, a compiler built at Meta that aims to optimize client-side React development. It explores the use of memoization to improve performance and the vision of Forget to automatically determine dependencies at build time. Forget is named with an F-word pun and has the potential to optimize server builds and enable dead code elimination. The team plans to make Forget open-source and is focused on ensuring its quality before release.
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
Watch video: Speeding Up Your React App With Less JavaScript
Mishko, the creator of Angular and AngularJS, discusses the challenges of website performance and JavaScript hydration. He explains the differences between client-side and server-side rendering and introduces Quik as a solution for efficient component hydration. Mishko demonstrates examples of state management and intercommunication using Quik. He highlights the performance benefits of using Quik with React and emphasizes the importance of reducing JavaScript size for better performance. Finally, he mentions the use of QUIC in both MPA and SPA applications for improved startup performance.
SolidJS: Why All the Suspense?
JSNation 2023JSNation 2023
28 min
SolidJS: Why All the Suspense?
Top Content
Suspense is a mechanism for orchestrating asynchronous state changes in JavaScript frameworks. It ensures async consistency in UIs and helps avoid trust erosion and inconsistencies. Suspense boundaries are used to hoist data fetching and create consistency zones based on the user interface. They can handle loading states of multiple resources and control state loading in applications. Suspense can be used for transitions, providing a smoother user experience and allowing prioritization of important content.
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
Tom Pressenwurter introduces Redwood.js, a full stack app framework for building GraphQL APIs easily and maintainably. He demonstrates a Redwood.js application with a React-based front end and a Node.js API. Redwood.js offers a simplified folder structure and schema for organizing the application. It provides easy data manipulation and CRUD operations through GraphQL functions. Redwood.js allows for easy implementation of new queries and directives, including authentication and limiting access to data. It is a stable and production-ready framework that integrates well with other front-end technologies.
Jotai Atoms Are Just Functions
React Day Berlin 2022React Day Berlin 2022
22 min
Jotai Atoms Are Just Functions
Top Content
State management in React is a highly discussed topic with many libraries and solutions. Jotai is a new library based on atoms, which represent pieces of state. Atoms in Jotai are used to define state without holding values and can be used for global, semi-global, or local states. Jotai atoms are reusable definitions that are independent from React and can be used without React in an experimental library called Jotajsx.

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.