7943ef8ed8
### What? This adds a method to optionally detect disk, network, and env access access during a build and write this to a file. ### Why? This will be consumed by Turborepo to determine **if** a build can be cached, and if so, **how** it should be cached. ### How? This implements a proxy that can be selectively applied to functions to watch their access to disk, network, and env. For Turborepo, we only care about what can alter the build output, to achieve this, we trace the config load, and the static page generation. Closes https://linear.app/vercel/issue/TURBO-1904/support-build-access-tracing-in-nextjs Performance Testing: Repo - https://github.com/tknickman/nextjs-turborepo-build-trace-performance-testing ``` - - - - - - - - - - - - - - - - - Performance - - - - - - - - - - - - - - - - - pages-single-app: 44629.53301 ms (+/- 6313.82757 ms) from 5 iterations (223318.53692 ms total) local-pages-single-app-with-trace: 45684.00503 ms (+/- 6570.85083 ms) from 5 iterations (228585.01729 ms total) local-pages-single-app-without-trace: 45938.76231 ms (+/- 6816.13022 ms) from 5 iterations (229830.15925 ms total) approuter-single-app: 49517.23156 ms (+/- 7820.20687 ms) from 5 iterations (247725.16713 ms total) local-approuter-single-app-with-trace: 50019.98247 ms (+/- 9443.82537 ms) from 5 iterations (250224.62496 ms total) local-approuter-single-app-without-trace: 50124.07092 ms (+/- 9656.22047 ms) from 5 iterations (250726.35688 ms total) local-large-pages-single-app-without-trace: 51582.92992 ms (+/- 12179.09895 ms) from 5 iterations (258469.36942 ms total) local-large-pages-single-app-with-trace: 51740.25813 ms (+/- 12601.02878 ms) from 5 iterations (259329.50946 ms total) local-xlarge-pages-single-app-with-trace: 234111.66735 ms (+/- 74629.30509 ms) from 5 iterations (1191018.63608 ms total) local-xlarge-pages-single-app-without-trace: 239621.11837 ms (+/- 84629.16374 ms) from 5 iterations (1218078.41921 ms total) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ``` <details> <summary>Test case keys</summary> * `local-xlarge-pages-single-app-without-trace`: this branch, built and linked to a local project with 5000 SSG pages and trace **disabled** * `local-xlarge-pages-single-app-with-trace`: this branch, built and linked to a local project with 5000 SSG pages and trace **enabled** * `local-large-pages-single-app-with-trace`: this branch, built and linked to a local project with 100 SSG pages and trace **enabled** * `local-large-pages-single-app-without-trace`: this branch, built and linked to a local project with 100 SSG pages and trace **disabled** * `local-approuter-single-app-without-trace`: this branch, built and linked to a local default approuter starter and trace **disabled** * `local-approuter-single-app-with-trace`: this branch, built and linked to a local default approuter starter and trace **enabled** * `local-pages-single-app-with-trace`: this branch, built and linked to a local default pages starter and trace **enabled** * `local-pages-single-app-without-trace`: this branch, built and linked to a local default pages starter and trace **disabled** * `approuter-single-app`: next@latest running on the default approuter starter * `pages-single-app`: next@latest running on the default pages starter </details> TODO: - [ ] Telemetry events |
||
---|---|---|
.cargo | ||
.config | ||
.devcontainer | ||
.github | ||
.husky | ||
.vscode | ||
bench | ||
contributing | ||
docs | ||
errors | ||
examples | ||
packages | ||
scripts | ||
test | ||
turbo/generators | ||
.alexignore | ||
.alexrc | ||
.eslintignore | ||
.eslintrc.json | ||
.git-blame-ignore-revs | ||
.gitattributes | ||
.gitignore | ||
.node-version | ||
.npmrc | ||
.prettierignore | ||
.prettierignore_staged | ||
.prettierrc.json | ||
.rustfmt.toml | ||
azure-pipelines.yml | ||
Cargo.lock | ||
Cargo.toml | ||
CODE_OF_CONDUCT.md | ||
contributing.md | ||
jest.config.js | ||
jest.replay.config.js | ||
lerna.json | ||
license.md | ||
lint-staged.config.js | ||
package.json | ||
pnpm-lock.yaml | ||
pnpm-workspace.yaml | ||
readme.md | ||
release.js | ||
run-tests.js | ||
rust-toolchain | ||
socket.yaml | ||
test-file.txt | ||
tsconfig-tsec.json | ||
tsconfig.base.json | ||
tsconfig.json | ||
tsec-exemptions.json | ||
turbo.json | ||
UPGRADING.md | ||
vercel.json |
Next.js
Getting Started
Visit https://nextjs.org/learn to get started with Next.js.
Documentation
Visit https://nextjs.org/docs to view the full documentation.
Who is using Next.js?
Next.js is used by the world's leading companies. Check out the Next.js Showcase to learn more.
Community
The Next.js community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.
To chat with other community members you can join the Next.js Discord.
Our Code of Conduct applies to all Next.js community channels.
Contributing
Please see our contributing.md.
Good First Issues
We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.
Authors
- Tim Neutkens (@timneutkens)
- Naoyuki Kanezawa (@nkzawa)
- Guillermo Rauch (@rauchg)
- Arunoda Susiripala (@arunoda)
- Tony Kovanen (@tonykovanen)
- Dan Zajdband (@impronunciable)
Security
If you believe you have found a security vulnerability in Next.js, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email security@vercel.com
to disclose any security vulnerabilities.