Skip to content

[turbopack] Update next docs with information about turbopack known adoption issues #82560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: canary
Choose a base branch
from

Conversation

lukesandberg
Copy link
Contributor

@lukesandberg lukesandberg commented Aug 12, 2025

  • Document the experimental persistent caching flag
  • Document the gap with the innerGraph optimization
  • Document the css module ordering issue
  • Document the persistent caching gap

Will wait to submit this until the when we publish the release.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@lukesandberg lukesandberg changed the title Update next docs with information about turbopack known adoption issues [turbopack] Update next docs with information about turbopack known adoption issues Aug 12, 2025
@lukesandberg lukesandberg marked this pull request as ready for review August 12, 2025 08:06

## Usage

Turbopack Persistent Caching enables turbopack to share state across multiple `next dev` or `next build` commands. When enabled, Turbopack will save and restore data to the `.next` folder between builds, which can greatly speed up builds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asking for my own clarity here first

  • A sequence of next dev -> next dev hits the Persistent Cache
  • A sequence of next dev -> next build, wouldn't hit the cache for the build step, right? Or I guess, it'd miss it because it wouldn't hit production assets?
  • A sequence next build -> next dev -> next build for the 3rd command, would hit cached elements from the 1st, or?

If so, maybe we can reword

Suggested change
Turbopack Persistent Caching enables turbopack to share state across multiple `next dev` or `next build` commands. When enabled, Turbopack will save and restore data to the `.next` folder between builds, which can greatly speed up builds.
Turbopack Persistent Caching lets multiple `next dev` runs share state, and likewise for `next build` runs. When enabled, Turbopack stores data in the `.next` folder and reuses it between matching command runs, greatly speeding them up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next dev and next build can share the cache. The cache hit rates won't always be super high between these two but they aren't nothing. (e.g. most resolve results and many basic parsing tasks are identical)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about that to be honest.
For resolving, the exports conditions are different.
For parsing, the environment variables are part of the cache key and the JSX AST transform is different in dev/prod.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well i guess we can at least share the file reads 😭 and i suppose since the keys are different a next build won't destroy the next dev cache, they just aren't sharing much....

@ijjk ijjk added created-by: Turbopack team PRs by the Turbopack team. Documentation Related to Next.js' official documentation. labels Aug 12, 2025
Copy link
Contributor

github-actions bot commented Aug 12, 2025

All broken links are now fixed, thank you!

lukesandberg added a commit that referenced this pull request Aug 13, 2025
Drop the scare text about not running turbopack in production.  Instead clarify that builds are beta and direct people to our documentation site.

For example:
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/AwJ29EfoPcPdLSwCZxAz/a50ca03c-7065-4fc4-ad3a-2232e14984d3.png)

Compared to the old notice:

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/AwJ29EfoPcPdLSwCZxAz/c802c577-39d6-4408-bd9e-144d3f9c23dd.png)


Notably

* mission critical applications are a good idea! just be careful with compatibility issues
* the source maps issues is fixed! no need to talk about it at all
* A discussion of bundle size issues and build caches is being added in #82560

Closes PACK-5237
Comment on lines +7 to +31
## Usage

Turbopack Persistent Caching enables Turbopack to share state across multiple `next dev` or `next build` commands. When enabled, Turbopack will save and restore data to the `.next` folder between builds, which can greatly speed up subsequent builds and dev sessions.

```ts filename="next.config.ts" switcher
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
experimental: {
turbopackPersistentCaching: true,
},
}

export default nextConfig
```

```js filename="next.config.js" switcher
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
turbopackPersistentCaching: true,
},
}

module.exports = nextConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this contain a warning that this really really isn't stable yet (though there's experimental already in there of course)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Turbopack team PRs by the Turbopack team. Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants