-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[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
base: canary
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
||
## 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. |
There was a problem hiding this comment.
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
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. |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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....
f0df7d9
to
120178e
Compare
All broken links are now fixed, thank you! |
docs/01-app/03-api-reference/05-config/01-next-config-js/turbopackPersistentCaching.mdx
Outdated
Show resolved
Hide resolved
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:  Compared to the old notice:  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
7f3a5a2
to
938730a
Compare
## 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 |
There was a problem hiding this comment.
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)?
innerGraph
optimizationWill wait to submit this until the when we publish the release.