-
Notifications
You must be signed in to change notification settings - Fork 0
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
[pull] canary from vercel:canary #188
base: canary
Are you sure you want to change the base?
Commits on Nov 13, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 171970d - Browse repository at this point
Copy the full SHA 171970dView commit details -
[Turbopack] migrate benchmark to new backend (#72457)
### What? Copy the benchmark to the new backend Closes PACK-3417
Configuration menu - View commit details
-
Copy full SHA for 106494d - Browse repository at this point
Copy the full SHA 106494dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a1b0d9c - Browse repository at this point
Copy the full SHA a1b0d9cView commit details -
Bump
@capsizecss/metrics
to 3.4.0 for Geist Google Font (#72746)### Why? `next/font` depends on the Google Fonts metrics from the `@capsizecss/metrics`. Added support for Geist at seek-oss/capsize#217, so we update version. ### How? - Bump `@capsizecss/metrics` to 3.4.0 - Update the test to match the metrics. #### Bonus - Modified the test to use `.toMatchInlineSnapshot` to identify and update future changes more easily. ### RFC The `@capsizecss` team is planning to [automate the updating process](seek-oss/capsize#217 (review)). Should we continue to depend on them or replace them with our custom script to fetch Google Font API (requires API key)? x-ref: #47115 x-ref: [Twitter Feedback](https://x.com/illyism/status/1855500917589602706)
Configuration menu - View commit details
-
Copy full SHA for 6357b54 - Browse repository at this point
Copy the full SHA 6357b54View commit details -
Configuration menu - View commit details
-
Copy full SHA for b96772a - Browse repository at this point
Copy the full SHA b96772aView commit details -
Remove unused
enabled
config from server actions transforms (#72755)The option was always set to `true` so we can safely remove it. The experimental `serverActions` flag was removed a long time ago in #57145.
Configuration menu - View commit details
-
Copy full SHA for c3467c7 - Browse repository at this point
Copy the full SHA c3467c7View commit details -
Ensure Next.js is ignore-listed when used as external (#72498)
Observable in `pnpm next dev test/development/app-dir/dynamic-io-dev-errors/` and `/no-accessed-data`. It only affects the bottom stacks in that particular stack so assertions are not viable yet until the full stack is properly sourcemapped.
Configuration menu - View commit details
-
Copy full SHA for 776cd68 - Browse repository at this point
Copy the full SHA 776cd68View commit details -
Bump
eslint-plugin-react
to 7.37.0 (#72759)### Why? Following up on #72752, the ESLint fix suggestion for `react/no-unescaped-entities` rule was added at jsx-eslint/eslint-plugin-react#3831, released on [v7.37.0](https://github.com/jsx-eslint/eslint-plugin-react/releases/tag/v7.37.0). Therefore, we bump the `eslint-plugin-react` version to `^7.37.0`.
Configuration menu - View commit details
-
Copy full SHA for 85017bb - Browse repository at this point
Copy the full SHA 85017bbView commit details -
upgrade amphtml-validator to 1.0.38 (#72645)
Tests have been inconsistent due to flaky build-time failures caused by AMP validation errors: https://github.com/vercel/next.js/actions/runs/11807856104/attempts/1. We’re updating the library version with the expectation that this will resolve the issue. ``` info: undefined Generating static pages (9/37) Generating static pages (18/37) Generating static pages (27/37) Error occurred prerendering page "/amp-hybrid". Read more: https://nextjs.org/docs/messages/prerender-error AssertionError: Assertion failed: WebAssembly is uninitialized at new module$contents$goog$asserts_AssertionError (evalmachine.<anonymous>:102:1441) at module$contents$goog$asserts_doAssertFailure (evalmachine.<anonymous>:103:354) at goog.asserts.assertExists (evalmachine.<anonymous>:104:374) at Object.module$contents$amp$validator_validateString [as validateString] (evalmachine.<anonymous>:2238:108) at Validator.validateString (/tmp/next-install-89c7ccfd9a04886e2e88ccffb9ad709b236d4b8c8398fcdbb34c9c897118b9e9/node_modules/.pnpm/next@file+..+next-repo-99a8e0af0510a7a2958e71c9affe3d5d83d452a304c40ea8b352506d74651d57+packa_6sb2ai4rhstsynpbl53dxgpt7e/node_modules/next/dist/compiled/amphtml-validator/index.js:17:2057) at validateAmp (/tmp/next-install-89c7ccfd9a04886e2e88ccffb9ad709b236d4b8c8398fcdbb34c9c897118b9e9/node_modules/.pnpm/next@file+..+next-repo-99a8e0af0510a7a2958e71c9affe3d5d83d452a304c40ea8b352506d74651d57+packa_6sb2ai4rhstsynpbl53dxgpt7e/node_modules/next/dist/export/routes/pages.js:100:34) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async exportPagesPage (/tmp/next-install-89c7ccfd9a04886e2e88ccffb9ad709b236d4b8c8398fcdbb34c9c897118b9e9/node_modules/.pnpm/next@file+..+next-repo-99a8e0af0510a7a2958e71c9affe3d5d83d452a304c40ea8b352506d74651d57+packa_6sb2ai4rhstsynpbl53dxgpt7e/node_modules/next/dist/export/routes/pages.js:134:17) at async Span.traceAsyncFn (/tmp/next-install-89c7ccfd9a04886e2e88ccffb9ad709b236d4b8c8398fcdbb34c9c897118b9e9/node_modules/.pnpm/next@file+..+next-repo-99a8e0af0510a7a2958e71c9affe3d5d83d452a304c40ea8b352506d74651d57+packa_6sb2ai4rhstsynpbl53dxgpt7e/node_modules/next/dist/trace/trace.js:153:20) at async exportPage (/tmp/next-install-89c7ccfd9a04886e2e88ccffb9ad709b236d4b8c8398fcdbb34c9c897118b9e9/node_modules/.pnpm/next@file+..+next-repo-99a8e0af0510a7a2958e71c9affe3d5d83d452a304c40ea8b352506d74651d57+packa_6sb2ai4rhstsynpbl53dxgpt7e/node_modules/next/dist/export/worker.js:336:18) ``` Note that this failure breaks the production integration test almost 10% of times. ![CleanShot 2024-11-12 at 23 15 11@2x](https://github.com/user-attachments/assets/89ad041c-22b1-47ad-aa56-58ea3a269811)
Configuration menu - View commit details
-
Copy full SHA for 6ade559 - Browse repository at this point
Copy the full SHA 6ade559View commit details -
Configuration menu - View commit details
-
Copy full SHA for d5e2701 - Browse repository at this point
Copy the full SHA d5e2701View commit details -
### Why? ESLint v8 is deprecated. Also, it's deprecated dependencies spam npm warning. ![image](https://github.com/user-attachments/assets/856a70a5-3185-44d6-9fa9-c773f898dc25) Closes NDX-208
Configuration menu - View commit details
-
Copy full SHA for e795e57 - Browse repository at this point
Copy the full SHA e795e57View commit details -
chore(example): add example for image optimization with secure compute (
#72641) This PR adds a new example that shows a more complex use case where you don't want browser to know about the upstream image server so instead you can proxy through a serverless function. Some use cases might be checking for an IP address, user agent, etc.
Configuration menu - View commit details
-
Copy full SHA for aaf28ab - Browse repository at this point
Copy the full SHA aaf28abView commit details -
CNA: replace geist font from local to google (#72618)
### Why? As Google Font added Geist, replace the CNA local font with`next/font/google`. Added `subsets` value as the font will be preloaded. Removed`weight` value as: > An array of weight values if the font is not a [variable google font](https://fonts.google.com/variablefonts). It applies to next/font/google only. x-ref: https://nextjs.org/docs/app/api-reference/components/font#subsets x-ref: https://nextjs.org/docs/app/api-reference/components/font#weight Closes NDX-462
Configuration menu - View commit details
-
Copy full SHA for 9f6f631 - Browse repository at this point
Copy the full SHA 9f6f631View commit details -
fix(turbopack): Depend on side effect from import binding (#72601)
### What? Use proper logic to depend on the side-effect-import node from the import-binding nodes in **graph construction phase**. ### Why? We previously used a workaround based on a hash map with the module specifier as the key, but as I'm going to optimize the graph, we need to store every dependency information in the graph so that the optimizer can use information. ### How? Closes PACK-3444
Configuration menu - View commit details
-
Copy full SHA for dad64a3 - Browse repository at this point
Copy the full SHA dad64a3View commit details -
fix multi-level redirect in server actions (#72770)
`redirect` in server actions has handling to support relative redirects (eg `redirect('./foo')`) but it doesn't handle a multi-level relative path, eg `redirect('../foo')`. This used to work by accident because the invalid URL would be handled as an error and then would trigger an MPA navigation. In Next 15, it surfaces an actual error because we are less tolerant to them. Fixes #72765 Closes NDX-479
Configuration menu - View commit details
-
Copy full SHA for 6d8095d - Browse repository at this point
Copy the full SHA 6d8095dView commit details -
chore: keep create-next-app messages and docs the same (#72444)
## What does this PR do? According to [Installation docs](https://nextjs.org/docs/getting-started/installation#automatic-installation), [create-next-app](https://nextjs.org/docs/app/api-reference/cli/create-next-app) messages are below ![image](https://github.com/user-attachments/assets/bb20d031-a8f0-4306-8c41-d3341fa8c899) However, the real messages are ![image](https://github.com/user-attachments/assets/828f7e15-8284-4b97-a62f-d99867aede09) Unlike the `src/`, `next dev` and `@/*` don't have single quotation. So I add apostrophes to create-next-app message. ## How did you verify your code works? I have tested local build package. ![image](https://github.com/user-attachments/assets/f358cf89-8bf1-48aa-97f9-2f097e4ef753) Co-authored-by: JJ Kasper <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a904743 - Browse repository at this point
Copy the full SHA a904743View commit details -
ci: flake detection should run in both bundlers (#72773)
We run flake detection on PRs to help catch flaky tests before they hit canary, but we currently only run flaky test detection in Webpack and not Turbopack. This is problematic because there's sufficient forking logic in tests for the different bundlers & we've seen a high likelihood of a test to flake more frequently in one bundler vs another due to things like differing compilation speeds and differing implementation of core features. This will add some additional time to this CI job to account for needing to run the tests 6 times, but will hopefully catch things before they become a problem later. I think we could also consider reducing the number of times per bundler to be 2 if it turns out to be adding too much time. This updates the flake detection job to run the tests multiple times in Turbopack as well. CI run: https://github.com/vercel/next.js/actions/runs/11822662639/job/32940264160?pr=72773
Configuration menu - View commit details
-
Copy full SHA for 6f10926 - Browse repository at this point
Copy the full SHA 6f10926View commit details -
examples: update app-dir-i18n-routing to v15 (#72642)
## Summary Follow up #72636. Bump 13 → 15 version in the description. ### Adding or Updating Examples - [x] The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - [x] Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md --------- Co-authored-by: samcx <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f3e2f87 - Browse repository at this point
Copy the full SHA f3e2f87View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b3bdd8 - Browse repository at this point
Copy the full SHA 6b3bdd8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 35b47d5 - Browse repository at this point
Copy the full SHA 35b47d5View commit details -
examples: polish some README.md (#72117)
## Description I have corrected some mistakes according to the [contribution guide](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md). 1. Update `create-next-app` script 2. Remove redundant new line, space and double colon 3. `readme.md` → `README.md` ### Adding or Updating Examples - [x] The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - [x] Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md --------- Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 49cba42 - Browse repository at this point
Copy the full SHA 49cba42View commit details -
[Turbopack] reduce nesting (#72747)
### What? Follow-up from review comments
Configuration menu - View commit details
-
Copy full SHA for a0291cf - Browse repository at this point
Copy the full SHA a0291cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 88d0832 - Browse repository at this point
Copy the full SHA 88d0832View commit details -
docs: update file structure (#72748)
## Summary Sync [`04-functions`](https://github.com/vercel/next.js/tree/canary/docs/01-app/03-api-reference/04-functions) file convention. ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 34c9122 - Browse repository at this point
Copy the full SHA 34c9122View commit details -
chore(cna): switch to .mjs tailwind config (#72124)
### What? Tailwind CSS [supports an ESM config](https://tailwindcss.com/docs/configuration#using-esm-or-type-script) file. This PR changes `tailwind.config.js` to `tailwind.config.mjs`. ### Why? 1. To convert one more file to ESM 2. To use the modern format 3. To follow other similar migrations that have taken place in the Next.js codebase (e.g. `next.config.mjs`) ### How? 1. Change file extensions from `.js` to `.mjs` 2. Change module format from CommonJS to ESM Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4ac3b54 - Browse repository at this point
Copy the full SHA 4ac3b54View commit details -
[Turbopack] fix collectibles counting and aggregation (#72609)
### What? fix some bugs when counting collectibles
Configuration menu - View commit details
-
Copy full SHA for 08d771a - Browse repository at this point
Copy the full SHA 08d771aView commit details -
Re-use randomly selected dev server port for automatic restarts (#72771)
When `next dev` is started with `-p 0` or `PORT=0` – which is probably unusual in userland, but is the default for our tests – a random port is selected for the dev server. If the user, after starting the dev server, then changes the `next.config.js` file, the dev server detects that and automatically restarts. For the restart, the original port config is used, resulting in a random port being selected again. This will most likely be a different port than was selected before, and so reloads in the browser won't work. It also results in `ERR_CONNECTION_REFUSED` errors in our tests that use `patchFile` to change the `next.config.js` content. To fix that issue, we're now storing the automatically selected port when the dev server has started initially, and are re-using it for any subsequent automatic restarts.
Configuration menu - View commit details
-
Copy full SHA for 5c45d58 - Browse repository at this point
Copy the full SHA 5c45d58View commit details -
Emit build error when
"use cache"
is used withoutdynamicIO
enabl……ed (#72781) Using a build error instead of a runtime error allows us to fail early, and show a proper error source in the terminal and in the dev overlay. <img width="777" alt="Screenshot 2024-11-13 at 22 19 45" src="https://github.com/user-attachments/assets/d0ee3c69-71f5-4aa6-8c0a-879217f66930">
Configuration menu - View commit details
-
Copy full SHA for 2c6b09d - Browse repository at this point
Copy the full SHA 2c6b09dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2cd75cc - Browse repository at this point
Copy the full SHA 2cd75ccView commit details -
examples(with-supabase): fix action type error (#72783)
## Why? There is a type issue with one of the form actions. ``` app/(auth-pages)/sign-up/page.tsx:42:25 - error TS2322: Type '(formData: FormData) => Promise<{ error: string; }>' is not assignable to type 'string | ((formData: FormData) => void | Promise<void>) | undefined'. Type '(formData: FormData) => Promise<{ error: string; }>' is not assignable to type '(formData: FormData) => void | Promise<void>'. Type 'Promise<{ error: string; }>' is not assignable to type 'void | Promise<void>'. Type 'Promise<{ error: string; }>' is not assignable to type 'Promise<void>'. Type '{ error: string; }' is not assignable to type 'void'. 42 <SubmitButton formAction={signUpAction} pendingText="Signing up..."> ``` - x-ref: #72778
Configuration menu - View commit details
-
Copy full SHA for 90cd4e0 - Browse repository at this point
Copy the full SHA 90cd4e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for dbcadf5 - Browse repository at this point
Copy the full SHA dbcadf5View commit details
Commits on Nov 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 37fc876 - Browse repository at this point
Copy the full SHA 37fc876View commit details -
[Turbopack] implement dispose root task (#72611)
### What? When a root task is disposed we need to flag it as inactive. This is e.g. the case when closing a WebSocket, which closes the subscriptions. Not disposing causes unnecessary work which we want to avoid.
Configuration menu - View commit details
-
Copy full SHA for 35c7355 - Browse repository at this point
Copy the full SHA 35c7355View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0cbc079 - Browse repository at this point
Copy the full SHA 0cbc079View commit details -
use explicit resource management for sandbox (#72780)
Migrated every instance of `sandbox` to use the `using` keyword so that the `cleanup` will be automatically performed when the execution leaves the scope.
Configuration menu - View commit details
-
Copy full SHA for 2e97a73 - Browse repository at this point
Copy the full SHA 2e97a73View commit details -
feat(turbopack): Merge single-pointer nodes in reverse direction (#72571
) ### What? Merge a dependency into the chunk if the current node is the only dependant of the dependency. i.e. Optimize for cases where only one **dependant** exists for a specific node. ### Why? If a node has a single incoming node (let's call it `source`), it means that it will always be included if the source node is included and not if the source node is not included. So the source and node act as a group, and this PR makes them a real group to reduce number of module fragments. Before: <img width="1039" alt="image" src="https://github.com/user-attachments/assets/24321064-fe34-45c6-bf02-81e482816741"> After: <img width="1039" alt="image" src="https://github.com/user-attachments/assets/4709a1f9-097c-4771-b554-043c01c980db"> ### benches/heavy-npm-deps - 14862 modules => 9263 modules - With tree shaking on canary: `144.13s user 14.13s system 910% cpu 17.373 total` - With tree shaking and this PR: `124.60s user 12.41s system 878% cpu 15.601 total` - Without tree shaking: `47.41s user 4.75s system 553% cpu 9.416 total` ### How? Closes PACK-3441
Configuration menu - View commit details
-
Copy full SHA for a56aca7 - Browse repository at this point
Copy the full SHA a56aca7View commit details -
[Segment Prefetch] Move access token to route tree (#72775)
Since prefetches include only static data, and are generated during the server prerender, we can actually lift all the tokens to the route tree prefetch. It's only once we start supporting dynamic conditional routes that the tokens will need to provided by the layout. This is nice because it means we can parallelize the segment prefetches after all.
Configuration menu - View commit details
-
Copy full SHA for aef9154 - Browse repository at this point
Copy the full SHA aef9154View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb76597 - Browse repository at this point
Copy the full SHA fb76597View commit details -
Configuration menu - View commit details
-
Copy full SHA for c527101 - Browse repository at this point
Copy the full SHA c527101View commit details -
docs(turbo-tasks): Improve RcStr docs (#72825)
Discussion with @unstubbable was that he didn't know if he should use `String` or `RcStr`. This should clarify what people should use, why, and how to construct the `RcStr`. ![Screenshot 2024-11-14 at 15-14-48 RcStr in turbo_tasks - Rust.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/ad9aeb14-16f5-49d4-8433-fb25d4d1214c.png)
Configuration menu - View commit details
-
Copy full SHA for 0bacb05 - Browse repository at this point
Copy the full SHA 0bacb05View commit details -
chore(turbopack): Centralize reqwest TLS feature configs in turbo-tas…
…ks-fetch (#72526) Noticed this mess while working with @samcx on #72442 where we had to run: ``` cargo nextest r --features next-core/native-tls -p next-core ``` This PR makes `turbo-tasks-fetch` responsible for setting the `reqwest` TLS features, rather than trying to pass that feature flag down. After this PR, running tests on `next-core` works with just: ``` cargo nextest r -p next-core ``` ## Why? - The feature flag logic was getting duplicated in multiple top-level targets. - Packages that depended on `turbo-tasks-fetch` (directly *or transitively*) had to specify a default feature and make sure that default feature was disabled in the workspace's dependency list so that `cargo test -p package-name` would work - ... or you had to specify a flag when compiling, like `--features next-core/native-tls`. Technically this change gives us less flexibility. We can't produce multiple binaries for the same platform target with different TLS stacks. But I don't think we would've ever used that flexibility anyways.
Configuration menu - View commit details
-
Copy full SHA for 57e732f - Browse repository at this point
Copy the full SHA 57e732fView commit details -
fix(turbopack): type error when "dynamic_embed_contents" is on (#72828)
`dynamic_embed_contents` is off by default, so i guess we missed some type errors when refactoring stuff to `RcStr`
Configuration menu - View commit details
-
Copy full SHA for a49efe2 - Browse repository at this point
Copy the full SHA a49efe2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d39f22 - Browse repository at this point
Copy the full SHA 6d39f22View commit details -
[Turbopack] make issue ordering stable (#72751)
### What? Currently when there are multiple instances of the same error on different lines of the same source file it shows a random one of these errors. This fixes that by sorting the issues also based on the source.
Configuration menu - View commit details
-
Copy full SHA for 8c1a880 - Browse repository at this point
Copy the full SHA 8c1a880View commit details -
Configuration menu - View commit details
-
Copy full SHA for cc1b808 - Browse repository at this point
Copy the full SHA cc1b808View commit details -
refactor(turbopack): Use
ResolvedVc
forturbopack
crate (#72791)### What? Follow-up for #72564 ### Why? We need to refactor this for future works. ### How? --------- Co-authored-by: Benjamin Woodruff <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7b89b02 - Browse repository at this point
Copy the full SHA 7b89b02View commit details -
Configuration menu - View commit details
-
Copy full SHA for 491adda - Browse repository at this point
Copy the full SHA 491addaView commit details
Commits on Nov 15, 2024
-
refactor(turbo-tasks): Simplify most type bounds on Vc<T> and related…
… types (#72823) `Vc<T>` had a type bound that `T: Send + ?Sized`. The general recommendation is to remove all type bounds from the struct that aren't necessary: - https://rust-lang.github.io/api-guidelines/future-proofing.html#c-struct-bounds - rust-lang/api-guidelines#6 - rust-lang/rust-clippy#1689 The reasoning is that type bounds on structs are "infectious". Any generic function, trait, or struct referring to `Vc<T>` was required to add `T: Send` bounds. *Sidenote: The [`implied_bounds` feature](https://rust-lang.github.io/rfcs/2089-implied-bounds.html) might mitigate some of this if ever stabilized.* Removing the `T: Send` type bound from `Vc<T>` means that there's less places where we need to specify it. This pattern can be seen in many parts of the stdlib. For example, `Arc<T>` doesn't require that `T: Send + Sync`, though in reality to do anything useful with it, you need `T: Send + Sync`. ## Is this safe? Yes, bounds are checked during cell construction, and the lower-level APIs used for creating cells require `Send + Sync`, so this would be hard to mess up without explicitly unsafe code. Also, `Vc<T>` also technically requires that `T: Sync`, but that wasn't enforced in the struct definition (only during cell construction). We did just fine without that bound on the struct. ## Why are you leaving `?Sized`? There's an implicit `Sized` bound on type parameters in struct definitions unless explicitly specified otherwise with `?Sized`. Right now this bound isn't used. We use a box, e.g. `Vc<Box<dyn Foo>>`, but in the future we might be able to drop that intermediate box from the type signature. I'm leaving the `?Sized` bound in place (and adding it in a few places where it was missing) in hopes of that.
Configuration menu - View commit details
-
Copy full SHA for e487b9f - Browse repository at this point
Copy the full SHA e487b9fView commit details -
fix(turbopack): Fix CSS Module renaming behavior for
@container
(#7……2607) ### What? Disable CSS Modules renaming for containers. ### Why? We should match the behavior of webpack mode. See: parcel-bundler/lightningcss#835 ### How? - Closes PACK-3315 - Closes #71233
Configuration menu - View commit details
-
Copy full SHA for 4740839 - Browse repository at this point
Copy the full SHA 4740839View commit details -
refactor(turbopack): Cleanup tree shaking graph logic (#72836)
### What? Cleanup logic. - Remove duplicate imports. - Rename `exports` to `outputs` as it's more intuitive. - Do not track the `ix` of each exports, as it's not used. ### Why? ### How?
Configuration menu - View commit details
-
Copy full SHA for 55f9fd1 - Browse repository at this point
Copy the full SHA 55f9fd1View commit details -
[Turbopack] fix hanging waiting on in progress cells (#72758)
### What? We need to notify the in progress cells when task has finished or cells are updated Also fixes a off-by-one bug with max cell indicies when reading
Configuration menu - View commit details
-
Copy full SHA for 9538347 - Browse repository at this point
Copy the full SHA 9538347View commit details -
[Turbopack] avoid writing manifests in data/rsc variant of page (#72767)
### What? The `data` variant for pages and the `rsc` variant for app router (for change notification purposes) causes some conflicting writes in the next-rs test case. This causes some instability since we are invalidating in a loop.
Configuration menu - View commit details
-
Copy full SHA for 086f715 - Browse repository at this point
Copy the full SHA 086f715View commit details -
Consolidate server actions transform errors into
emit_error
function (#72811) This improves maintainability and readability by decluttering the server actions transforms implementation, dedupes a few error messages, and consistently uses periods and trailing newlines for all error messages. The same approach is already used for the React Server Components transforms.
Configuration menu - View commit details
-
Copy full SHA for 0f9f442 - Browse repository at this point
Copy the full SHA 0f9f442View commit details -
codemod: replace
revalidate(Tag|Path)
toexpire(Tag|Path)
(#72826)### Why? We are renaming `revalidate(Tag|Path)` to `expire(Tag|Path)`. Closes NDX-482 --------- Co-authored-by: Zack Tanner <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2d063a7 - Browse repository at this point
Copy the full SHA 2d063a7View commit details -
"Fix": Lift type check out of loop (#72840)
Hehe. `flightData` is either an array or a string. There's a loop that's meant to iterate over `flightData` in the case where it's an array, but we neglected to check whether it was an array or a string, and since strings are iterable types, the type system did not complain. The check that should have been before the loop was instead inside the loop... and it happened to work anyway, because when you iterate over a string, each item is a character, and characters have the type "string". So the code works despite being nonsensical. In conclusion, lmfao.
Configuration menu - View commit details
-
Copy full SHA for a72d79c - Browse repository at this point
Copy the full SHA a72d79cView commit details -
hide stack trace in CanaryOnlyError (#72859)
This error doesn't point to any particularly meaningful line of code to the user, we just use it to have a well-known error message for when a feature should only be used in canary. This hides the stack trace so the error is surfaced more clearly.
Configuration menu - View commit details
-
Copy full SHA for b5f5495 - Browse repository at this point
Copy the full SHA b5f5495View commit details -
Allow missing CacheNodeSeedData during prefetch (#72857)
Updates the client PPR implementation to gracefully handle missing CacheNodeSeedData when constructing a prerender tree. Currently this never happens because we always block until we receive a server response. However, in the new Segment Cache, we will not bother to wait if a URL has not already been prefetched, since it's usually faster to go straight to the dynamic request.
Configuration menu - View commit details
-
Copy full SHA for c3bc7d0 - Browse repository at this point
Copy the full SHA c3bc7d0View commit details -
Add Segment Cache feature check to
prefetch
API (#72861)Wraps the `prefetch` API in a feature check for the Segment Cache, and forwards the call to a stub for the new implementation. Unlike the old implementation, the Segment Cache doesn't store its data in the router reducer state; it writes into a global mutable cache. So we don't need to dispatch a router action. Since the Segment Cache isn't actually implemented yet, this effectively disables prefetching when the experimental flag is enabled. There's some validation that we do for prefetch URLs that I extracted into a shared function. (For example, we only prefetch same-origin URLs, and we don't prefetch anything in development.)
Configuration menu - View commit details
-
Copy full SHA for 65e39a3 - Browse repository at this point
Copy the full SHA 65e39a3View commit details -
Extract shared fetchFromServerResponse logic to separate functions (#…
…72865) In the Segment Cache implementation, I won't be using the main fetchFromServerResponse function because the protocol for per-segment prefetches is different. But there's a lot of logic (e.g. setting headers, decoding the Flight stream, validating the response) that can be shared. So I've extracted the shared bits into separate functions. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
Configuration menu - View commit details
-
Copy full SHA for 560d95b - Browse repository at this point
Copy the full SHA 560d95bView commit details -
refactor(turbo-rcstr): Move turbo_tasks::RcStr into it's own crate (#…
…72858) The `RcStr` type doesn't use anything in `turbo-tasks`, so there's no reason it can't be a separate crate that doesn't depend on `turbo-tasks`. This will let it be used in wasm swc plugins, where turbo-tasks does not currently compile. Imports were automatically rewritten with: ``` # Fix imports: sg run --lang rust --pattern 'use $CRATE::{$$$PRE, RcStr};' --rewrite 'use $CRATE::{$$$PRE}; use turbo_rcstr::RcStr;' --update-all sg run --lang rust --pattern 'use $CRATE::{RcStr, $$$POST};' --rewrite 'use $CRATE::{$$$POST}; use turbo_rcstr::RcStr;' --update-all sg run --lang rust --pattern 'use $CRATE::{$$$PRE, RcStr, $$$POST};' --rewrite 'use $CRATE::{$$$PRE, $$$POST}; use turbo_rcstr::RcStr;' --update-all sg run --lang rust --pattern 'use $CRATE::RcStr;' --rewrite 'use turbo_rcstr::RcStr;' --update-all cargo fmt # Fix strings in comments: fastmod crate::RcStr turbo_rcstr::RcStr fastmod turbo_tasks::RcStr turbo_rcstr::RcStr ``` I had to manually fix the `Cargo.toml` files based on the compilation errors.
Configuration menu - View commit details
-
Copy full SHA for 3fbe729 - Browse repository at this point
Copy the full SHA 3fbe729View commit details -
[Segment Cache] Implement behavior on cache miss (#72841)
In the current navigation implementation, a partially dynamic navigation always does two separate requests: one for the static data, and one for the dynamic data. Typically the static data is prefetched before the navigation begins, but even in the case where it is not, the current implementation will still fetch it first. It then wait to send a dynamic request until the first chunk is received from the prefetch response, leading to an unfortunate request waterfall. In the Segment Cache implementation, our plan is to never block a navigation on prefetch data that isn't already populated in the cache. Instead, in the case of a cache miss, we'll immediately start a dynamic navigation and rely on the fact that the first thing the dynamic response sends is the static PPR shell of the target page. Because we'll always have this as a fallback behavior for cache misses, it's a good starting point for the Segment Cache implementation. Then we can start incrementally adding more and more features until we've eventually reached/surpassed parity with the current implementation. --- To avoid duplication of logic, I've chosen to model cache misses as a special case of the normal static + dynamic flow. We can pretend that the route tree returned by the dynamic request is, in fact, the result of a prefetch. Then we use that same server response to write data into the CacheNode tree. So it's the same flow as the "happy path", except we use a single server response for both stages.
Configuration menu - View commit details
-
Copy full SHA for 0402ced - Browse repository at this point
Copy the full SHA 0402cedView commit details -
Add explicit section about type overriding for v15 (#72866)
This breaks out the type overriding note from a small good to know section to it's own section as it's fairly important and easy to miss currently. Also the minimal note isn't getting picked up in our search currently. x-ref: [slack thread](https://vercel.slack.com/archives/C0676QZBWKS/p1731602395153929)
Configuration menu - View commit details
-
Copy full SHA for a2bd33f - Browse repository at this point
Copy the full SHA a2bd33fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 16bee25 - Browse repository at this point
Copy the full SHA 16bee25View commit details
Commits on Nov 16, 2024
-
refactor(turbopack): Use
ResolvedVc
forturbopack-ecmascript
(#72564) ### What? Use `ResolvedVc` for struct fields in `turbopack-ecmascript` crate ### Why? Follow-up of #72200, #72382, #72320 ### How? Closes PACK-3438 --------- Co-authored-by: Benjamin Woodruff <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bcabce7 - Browse repository at this point
Copy the full SHA bcabce7View commit details -
refactor(turbopack): Use graph for server action workaround (#72812)
### What? Previously, we had a workaround while consuming the graph and converting them to `Module`s. ### Why? Everything should be stored in the dependency graph because we are going to optimize it using graph node traversal. ### How?
Configuration menu - View commit details
-
Copy full SHA for 7c37374 - Browse repository at this point
Copy the full SHA 7c37374View commit details -
Configuration menu - View commit details
-
Copy full SHA for ef9d096 - Browse repository at this point
Copy the full SHA ef9d096View commit details
Commits on Nov 17, 2024
-
Emit build error for unknown cache kinds (#72832)
When a `"use cache"` directive with a custom cache kind is used, e.g. `"use cache: custom"`, a cache handler with the same name must be specified in the Next.js config: ```js /** * @type {import('next').NextConfig} */ const nextConfig = { experimental: { dynamicIO: true, cacheHandlers: { custom: require.resolve('path/to/custom/cache/handler'), }, }, } module.exports = nextConfig ``` If this is not the case, we emit a build error with an error message that explains this requirement. <img width="795" alt="Screenshot 2024-11-14 at 23 30 01" src="https://github.com/user-attachments/assets/bd138c97-608f-42ce-abb2-edb3e44edc3f"> When we'll get a docs page for this experimental config, we will add the usual "Read more: ..." hint as well. --------- Co-authored-by: Benjamin Woodruff <[email protected]> Co-authored-by: Janka Uryga <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d54122a - Browse repository at this point
Copy the full SHA d54122aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2186f7e - Browse repository at this point
Copy the full SHA 2186f7eView commit details
Commits on Nov 18, 2024
-
[Turbopack] refactor filesystem writes to an effect based system (#72847
) ### Why? Before we just wrote the files in `FileSystem::write()`, but that caused some issues when two `FileSystem::write()` tasks are active (or even temporarily active) at the same time. They invalidate each other and basically caused a loop of writes. For a long time we wanted to have a better solution for that, since that problem causes compilation to hang with 100% cpu load, which is quite annoying. Also the eventual consistency can cause some unexpected writes to be done when the content or filename are on a temporary value that has not stabilised yet. The problem applies to every side effect in tasks. ### What? To solve that this refactoring changes the way side effects in tasks are handled. Side effects in tasks should not be directly executed anymore. Instead one should emit an "effect" (`effect(async { ... })` helper method) to declare a side effect that should be executed. Top level execution is usually wrapped in a strongly consistent read of the top level task. Here one need to apply the "effects" (`apply_effects(operation).await?` helper method). Since this happens after the strongly consistent read, only effects that have been stabilised are executed. It's also possible to call `apply_effects` somewhere nested in the execution (after a strongly consistent read) if side effects are necessary for further execution. e. g. we do that to emit the files for the node.js pool before executing the pool. Internally effects are collectibles that are propagated through the call graph. Each effect can only be executed once, so updates to the graph will only apply new effects while existing effects are skipped as they were already executed. The actual change is pretty simple, but `FileSystem::write` no longer returns a `Vc<Completion>` but nothing instead. This makes the change needed a bit bigger. Good news: To emit a whole (potential circular) graph we could use recursion now instead of needing to walk the graph while avoiding cycles. This might allow some performance improvements for incremental builds.
Configuration menu - View commit details
-
Copy full SHA for be9b2dd - Browse repository at this point
Copy the full SHA be9b2ddView commit details -
Resolve mdx plugins string format (#72802)
Implements support for passing MDX related plugins as strings instead of as JS functions, this makes sure you can use MDX plugins with Turbopack. This still means that e.g. the options have to be serializable, in testing a few plugins these plugins usually have serializable options though. Fixes #71819 Fixes PACK-3345 <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
Configuration menu - View commit details
-
Copy full SHA for b399f55 - Browse repository at this point
Copy the full SHA b399f55View commit details -
Configuration menu - View commit details
-
Copy full SHA for dafe819 - Browse repository at this point
Copy the full SHA dafe819View commit details -
MDX: Only set experimental.turbo if enabled (#72856)
To prevent this warning when only using Webpack ``` ▲ Next.js 15.0.2 - Experiments (use with caution): · turbo ``` cc @ztanner https://vercel.slack.com/archives/C03S8ED1DKM/p1731604512615979?thread_ts=1731602213.367809&cid=C03S8ED1DKM
Configuration menu - View commit details
-
Copy full SHA for 560bb26 - Browse repository at this point
Copy the full SHA 560bb26View commit details -
[Turbopack] change persistent caching option to a boolean (#72458)
### What? Change the option to a boolean, the number version is weird and unexpected. Closes PACK-3418
Configuration menu - View commit details
-
Copy full SHA for c50109b - Browse repository at this point
Copy the full SHA c50109bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e3e3461 - Browse repository at this point
Copy the full SHA e3e3461View commit details -
Configuration menu - View commit details
-
Copy full SHA for 997105d - Browse repository at this point
Copy the full SHA 997105dView commit details -
Fix sourcemaps for async Turbopack chunks (#72827)
Works around nodejs/node#52102 Webpack will be harder to patch and I don't know yet where the Webpack runtime is using `vm.runInThisContext`. Best way to observe change is in #71909 and `pnpm test-dev-turbo test/development/app-dir/dynamic-io-dev-errors/ -t "should display error when component accessed data without suspense boundary"`. Before: ``` Error: [...] at Page [Server] (<anonymous>) at InnerLayoutRouter (.next/server/chunks/ssr/[root of the server]__088b8c._.js) ``` After: ``` Error: [...] at Page [Server] (<anonymous>) at InnerLayoutRouter (node_modules/.pnpm/file+..+next-repo-2186278d37ae48e2b1397aa86060054592669ed9909b91e96c5af049d12c04c3+packages+n_vk62popbath6ofshgazcbhzdoe/node_modules/next/dist/src/client/components/layout-router.tsx:324:2) ``` Next step is figuring out why the now sourcemapped frames aren't ignore-listed.
Configuration menu - View commit details
-
Copy full SHA for 6427135 - Browse repository at this point
Copy the full SHA 6427135View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d3ffea - Browse repository at this point
Copy the full SHA 1d3ffeaView commit details -
refactor: types for collected cache info in route modules (#71434)
adds types for `renderOpts.collectedRevalidate` & friends (only used in route modules). nicer than doing `(context.renderOpts as any)` everywhere
Configuration menu - View commit details
-
Copy full SHA for f72dc6a - Browse repository at this point
Copy the full SHA f72dc6aView commit details -
docs(turbopack): Document build dependency on clang for rocksdb (#72493)
Noticed this after rebuilding on top of #71688 Most Linux distributions default to `gcc` for their default `cc` implementation (e.g. via Debian's `build-essential` meta-package, which we can probably implicitly assume is installed), which means that they won't typically have `clang` installed. `librocksdb-sys` seems to always depend on `clang` on Linux. It looks like this might be a consequence of using [rust-bindgen](https://github.com/rust-lang/rust-bindgen) (though I'm confused why this didn't come up earlier), as it looks like rocksdb can otherwise build with gcc. This shouldn't be an issue for macos, since `clang` is the default `cc` on that platform.
Configuration menu - View commit details
-
Copy full SHA for 7e9e18b - Browse repository at this point
Copy the full SHA 7e9e18bView commit details -
feat(turbopack): Enable tree shaking for modules with dynamic imports (…
Configuration menu - View commit details
-
Copy full SHA for 7fdbabc - Browse repository at this point
Copy the full SHA 7fdbabcView commit details -
Fix unhandled rejection in proxy-request (#72530)
Trying to fix : #72522 ### What? The finally method actually creates a new promise. You have to listen to this new promise instead of the original one or you might end up with unhandled rejection. Taken from the documentation : > The finally() method of [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) instances schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns another [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) object, allowing you to [chain](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. ### Why? see : #72522 ### How? Fixes : #72522 Co-authored-by: Wyatt Johnson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fc3c96d - Browse repository at this point
Copy the full SHA fc3c96dView commit details -
update: remove unnecessary in Dockerfile (#72534)
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> ### Updating Examples - Remove unnecessary in Dockerfile <img width="398" alt="image" src="https://github.com/user-attachments/assets/63e6df3a-e9b8-42ed-bdd9-dd736131abbe"> Signed-off-by: ductnn <[email protected]> Co-authored-by: JJ Kasper <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7e73a3e - Browse repository at this point
Copy the full SHA 7e73a3eView commit details -
Clarify how MDX plugins are supported in Turbopack (#72917)
Followup to #72241 and #72467 Documenting the new Turbopack support for MDX plugins (remark, rehype, recma plugins): - #71819 (comment) <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> ### What? Clarify that MDX-related plugins (remark and rehype plugins) are supported when options are serializable, by using the new string name config format ### Why? Support was added in 72802 - #72802 ### How? Add a new section about using plugins with Turbopack
Configuration menu - View commit details
-
Copy full SHA for a6c1005 - Browse repository at this point
Copy the full SHA a6c1005View commit details -
chore(build): remove injecting fast refresh to custom loader logs (#7…
…2870) ## Why? Removing a log that holds very little meaning these days. ![cleanshot_2024-11-03_at_09.13.12_2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/FEMDaE9e61ZMCiJM0S0I/ef9c17a7-4fd1-4c70-94c3-c2b31f10c357.png) Co-authored-by: JJ Kasper <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9a591a0 - Browse repository at this point
Copy the full SHA 9a591a0View commit details -
Turbopack: Don't replace constant conditions with sideeffects (#72608)
Configuration menu - View commit details
-
Copy full SHA for dacf6d8 - Browse repository at this point
Copy the full SHA dacf6d8View commit details -
ensure webpack worker exits bubble to parent process (#72921)
This matches the handling added in #70997 but for the Webpack build worker. This unifies the worker code to be the same as the one for the static export worker which already handles this case. When the worker exits ungracefully, we need to propagate an error signal to the parent process so that it doesn't hang. Fixes #67097 Closes NDX-485 Closes #67154
Configuration menu - View commit details
-
Copy full SHA for df2c4a3 - Browse repository at this point
Copy the full SHA df2c4a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a23d2f - Browse repository at this point
Copy the full SHA 2a23d2fView commit details -
Fix Mongoose example failed build due to env variable not found (#72918)
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Fixes #72915 Fix the `MONGODB_URI` env variable not found during `npm run build` by moving the variable assignment to `dbConnect` function Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 74f425c - Browse repository at this point
Copy the full SHA 74f425cView commit details -
Configuration menu - View commit details
-
Copy full SHA for fe5ef9b - Browse repository at this point
Copy the full SHA fe5ef9bView commit details
Commits on Nov 19, 2024
-
[Turbopack] fix effects tracing (#72928)
### What? small follow-up to fix the tracing of Effects::apply
Configuration menu - View commit details
-
Copy full SHA for 0714c45 - Browse repository at this point
Copy the full SHA 0714c45View commit details -
docs: fix code block language in redirecting docs (#72944)
## Summary Update incorrect code block languages at [redirecting document](https://github.com/vercel/next.js/blob/canary/docs/01-app/02-building-your-application/01-routing/07-redirecting.mdx). ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0a7d97e - Browse repository at this point
Copy the full SHA 0a7d97eView commit details -
docs: fix code block language in error pages (#72943)
## Summary Update code block language in [error pages](https://github.com/vercel/next.js/tree/canary/errors). ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 20dc573 - Browse repository at this point
Copy the full SHA 20dc573View commit details -
docs: update "Migrate to async Dynamic APIs" docs (#72852)
### What? Update the example code with Codemods applied in [Migrate to async Dynamic APIs](https://nextjs.org/docs/app/building-your-application/upgrading/codemods#migrate-to-async-dynamic-apis) docs Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 172f3e3 - Browse repository at this point
Copy the full SHA 172f3e3View commit details -
Fix broken link to the
rootDir
doc (#72893)### What? Fix broken link to the `rootDir` doc at https://nextjs.org/docs/messages/no-html-link-for-pages#options ### Why? This is because there is an extra space between a path and an anchor. ### How? This PR removes it to fix the format. Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 016b033 - Browse repository at this point
Copy the full SHA 016b033View commit details -
docs: use relative urls (#72941)
## Description Follow up #52038. Remove `https://nextjs.org` from URL in [error pages](https://github.com/vercel/next.js/tree/canary/errors). ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide --------- Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e5ce54d - Browse repository at this point
Copy the full SHA e5ce54dView commit details -
docs: add the section titles to error page (#72942)
## Summary Add the paragraph name to [next-prerender-crypto](https://github.com/vercel/next.js/blob/canary/errors/next-prerender-crypto.mdx) error page like [other next-prerender pages](https://github.com/vercel/next.js/blob/canary/errors/next-prerender-current-time.mdx). ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f5ead56 - Browse repository at this point
Copy the full SHA f5ead56View commit details -
simplify vapid key generation docs (#72916)
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> ### What? Simplify Vapid key generation docs ### Why? Creating a script is tedious. The CLI can be used across projects without needing to reference and recreate this script. ### How? Added instructions to install `web-push` globally and how to run it. --------- Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 720fe35 - Browse repository at this point
Copy the full SHA 720fe35View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a53d56 - Browse repository at this point
Copy the full SHA 8a53d56View commit details -
docs: add and unify notes to error pages (#72838)
## Description Unify the note format according to the [contribution guide](https://nextjs.org/docs/community/contribution-guide#notes). In addition, add missing bullet points to useful links. ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide --------- Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6f43529 - Browse repository at this point
Copy the full SHA 6f43529View commit details -
feat(turbopack): Implement module walking for side effect optimization (
#71241) ### What? Implement side effect optimization without creating a new `ModulePart`. This PR is `partial` because this PR does not handle the exclusion of a non-existent module perfectly. #72947 will do it. ### Why? #70336 (comment)
Configuration menu - View commit details
-
Copy full SHA for a8f1c70 - Browse repository at this point
Copy the full SHA a8f1c70View commit details -
docs: remove deprecated
frameborder
, adjustallowFullScreen
and u……pdate the demo (#72644) <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change --> ### What? Removed the deprecated `iframe` attribute `frameborder`, adjusted `allowfullscreen` to be `allowFullScreen` and updated the demo video. ### Why? - `frameborder` is marked as deprecated ([MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#frameborder), [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L3231-L3232)) - `allowfullscreen` should be `allowFullScreen` ([DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a5dd14a91255869c8a929284c2531bd0e96d28ff/types/react/index.d.ts#L3229)) - The YouTube `iframe` demo has an invalid embedded URL, fixed and updated to the latest Next.js Conf as well. --------- Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 55834d9 - Browse repository at this point
Copy the full SHA 55834d9View commit details -
docs: fix code block language (#72839)
## Summary Change `jsx` to `diff` in [next-dynamic-api-wrong-context](https://github.com/vercel/next.js/blob/canary/errors/next-dynamic-api-wrong-context.mdx) error page. ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2a4bdbd - Browse repository at this point
Copy the full SHA 2a4bdbdView commit details -
Docs: Changing information about data fetching cache (#72301)
What is the documentation issue? There is incorrect information about how fetch works in the new Next.js version (^15.0.0). The documentation says that fetch is automatically cached in the said version but now by default fetchs are no longer being cached Is there any context that might help us understand? [Link of the section](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionscache) Does the docs page already exist? Please link to it. https://nextjs.org/docs/app/building-your-application/caching#fetch-optionscache --------- Co-authored-by: Delba de Oliveira <[email protected]> Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8856f49 - Browse repository at this point
Copy the full SHA 8856f49View commit details -
Configuration menu - View commit details
-
Copy full SHA for b6b5ab8 - Browse repository at this point
Copy the full SHA b6b5ab8View commit details -
Turbopack: thread tracing through to resolve results (#72314)
The bread and butter of NFT. The next two PRs split the work into two halves, one half plumbs as far as ResolveResultItem, and the next one fills in the remaining (and fixes some bugs). Closes PACK-3379
Configuration menu - View commit details
-
Copy full SHA for 6f93668 - Browse repository at this point
Copy the full SHA 6f93668View commit details -
Configuration menu - View commit details
-
Copy full SHA for e235baf - Browse repository at this point
Copy the full SHA e235bafView commit details -
Turbopack NFT: trace manifests and externals (#72316)
- Change the Next manifest output assets to also track references to output assets there. That way, `page.js.nft.json` lists the referenced output assets of `page.js` and e.g. `page_client-reference-manifest.js` and all the chunks references in the manifest as well. - For `ResolveResultItem::External`, continue resolving with a fresh `ModuleAssetContext` that doesn't have any of the build-time settings (because the Node environment when running the server won't have these settings either). Closes PACK-3380
Configuration menu - View commit details
-
Copy full SHA for 60dd201 - Browse repository at this point
Copy the full SHA 60dd201View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc49287 - Browse repository at this point
Copy the full SHA bc49287View commit details -
Turbopack: NFT followups (#72517)
Closes PACK-3421 Address PR feedback from #72305 When working on this, I uncovered another bug which will be handled in a different PR. Changes: - Don't rely on `DiskFileSystem` but only via file paths and `is_inside()` - Put the `RebasedAsset` for externals on the `[project]/` fs (this way, they aren't emitted either), i.e. don't perform any rebasing at all and just reference the files where they are --------- Co-authored-by: Niklas Mischkulnig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c8ba12f - Browse repository at this point
Copy the full SHA c8ba12fView commit details -
codemod(turbopack): Some more script-generated migrations to Resolved…
…Vc (#72889) These changes are generated using https://github.com/vercel/turbopack-resolved-vc-codemod, using the fix to the logic that finds `Vc` field: vercel/turbopack-resolved-vc-codemod@5c277f8 This is a combination of applying compiler hints and an LLM to fix some easy cases.
Configuration menu - View commit details
-
Copy full SHA for e06bdce - Browse repository at this point
Copy the full SHA e06bdceView commit details -
Support custom servers with minimal node modules (#72966)
## Fixing a bug ### Related issues fixes #64031 ### Why is this change needed Per the Next.js [docs](https://nextjs.org/docs/pages/api-reference/next-config-js/output) > Next.js' production server is also traced for its needed files and output at .next/next-server.js.nft.json which can be leveraged in production. When I tried doing this my [custom server](https://nextjs.org/docs/pages/building-your-application/configuring/custom-server) would crash on startup because of this codepath https://github.com/vercel/next.js/blob/canary/packages/next/src/server/config.ts#L1022 My first attempt at fixing this involved changing ``` if (!process.env.__NEXT_PRIVATE_STANDALONE_CONFIG) { ``` to ``` if (phase === PHASE_PRODUCTION_SERVER) { ``` but this is not guaranteed to work because the next.config.js and it's required dependencies may not be present causing the server to use the default config The best solution is to mimic standalone mode as closely as possible ### What does this change do This change allows a custom server running in production with only required files to pass in a preloaded next config (most likely from `required-server-files.json`) This is very similar to how the [standalone server works](https://github.com/vercel/next.js/blob/bc49287063d6afd50a7361566b14f1ab6c26b136/packages/next/src/build/utils.ts#L2142) ### Testing I'd like to get an initial round of feedback from the next team before I dive into writing an integration test. I patched nextjs in my repo and this solution worked
Configuration menu - View commit details
-
Copy full SHA for 1bf0266 - Browse repository at this point
Copy the full SHA 1bf0266View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac0d72d - Browse repository at this point
Copy the full SHA ac0d72dView commit details
Commits on Nov 20, 2024
-
Consolidate
FnExpr
andFnDecl
server function transforms (#72960)By adding `visit_mut_function` we can deduplicate the code that's common between `visit_mut_fn_expr` and `visit_mut_fn_decl`. And more importantly, this prepares us for handling the transform of method props, which will also use `visit_mut_function`. As a positive side effect this brings two small improvements with it: - always highlight the whole function when `async` is missing, not only the identifier - assign a function name to an anonymous arrow function expression in a variable declaration
Configuration menu - View commit details
-
Copy full SHA for 44cb7dd - Browse repository at this point
Copy the full SHA 44cb7ddView commit details -
Allow method properties to be server functions (#72969)
With this PR, we are now allowing `"use server"` and `"use cache"` to be used in method properties, e.g.: ```js export const obj = { async foo() { 'use cache' return Math.random() }, async bar() { 'use server' console.log(42) }, } ``` Or, more realistically, something like this: ```js export const api = { product: { async fetch() { 'use cache' return fetch('https://example.com').then((res) => res.json()) }, }, } ``` Supporting this pattern is mostly done for convenience; it allows users to group server functions into a common object, using method properties. Notably, we will not support the usage of `this` and `super`, for which we will add build errors in a follow-up PR.
Configuration menu - View commit details
-
Copy full SHA for 8c6ac89 - Browse repository at this point
Copy the full SHA 8c6ac89View commit details -
Add support for ignore-listing sources in index maps (#72913)
We now look through each section for the source and use that section to determine if a frame is ignore-listed. Previously, stacks from Turbopack sourcemaps were not ignore-listed since they were index maps.
Configuration menu - View commit details
-
Copy full SHA for b5666ce - Browse repository at this point
Copy the full SHA b5666ceView commit details -
Include
debug
script in test directories (#72992)I commonly add a `debug` script that allows me to attach a debugger when running Next.js in the isolated test dirs. Now we always add it and make it work just like `debug` from the monorepo. So after the test you can `cd` into the created test directory and run `pnpm debug dev`. `debug` is just an alias for `next` with some additional configurations: - tracing deprecations - no telemetry - no canary checks - debugger attachable - source maps `debug` also ensures the SWC version that was used during the test is used. Previously it used the cached version which isn't necessarily the one built in this specific worktree.
Configuration menu - View commit details
-
Copy full SHA for 2a603e7 - Browse repository at this point
Copy the full SHA 2a603e7View commit details -
Turbopack: fix loading of externals on Edge (#72349)
- `__turbopack_external_require__("node:buffer")` becomes `__turbopack_external_require__("node:buffer", () => require("node:buffer"))`. - This way, running esbuild on the Turbopack output will correctly detect usage of Node builtins and is able to polyfill them - To make that `require` the global (non-shadowed) one, change the previous `t: require` item from `__turbopack_context__` to `t: __turbopack_require_real__` and the fake require added in #70255 to `__turbopack_stub_require_` Closes PACK-3389 --------- Co-authored-by: Niklas Mischkulnig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fe98a84 - Browse repository at this point
Copy the full SHA fe98a84View commit details -
Bump SWC used for transpiling Next.js sources (#72993)
No significant changes to runtime detected.
Configuration menu - View commit details
-
Copy full SHA for 065f250 - Browse repository at this point
Copy the full SHA 065f250View commit details -
fix: ensure HTML validity for the
next-size-adjust
meta tag (#72994)Co-authored-by: Jiachi Liu <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for aafe715 - Browse repository at this point
Copy the full SHA aafe715View commit details -
Configuration menu - View commit details
-
Copy full SHA for f803a95 - Browse repository at this point
Copy the full SHA f803a95View commit details -
Allow CacheNode.loading to be a promise (#72872)
In the Segment Cache implementation of prefetching, during a navigation, it's possible that the prefetch for a segment may already be in-progress, but we haven't received its data yet. In that case, since the prefetch is very likely to load faster than the dynamic request, we might as well use the result, if we can. This updates type CacheNode.loading to accept a promise for the loading module data, and updates the LayoutRouter to conditionally unwrap it if needed. We already use this same strategy in other places, like for streaming in the main segment data.
Configuration menu - View commit details
-
Copy full SHA for 39cd2f6 - Browse repository at this point
Copy the full SHA 39cd2f6View commit details -
Properly encode dynamic access in segment prefetch (#72874)
When generating the segment responses, we should use the `prerender` API instead of the `renderToReadableStream` API to ensure that when we abort the stream, dynamic access is encoded as a hanging reference, rather than as an error. I didn't notice this was wrong until I managed to get an initial version of the client Segment Cache running locally and the errors were surfaced in the app. No tests yet since it's not really possible to test until the client is implemented, which I'm working on now. But you can look at the build output and notice that the errors are no longer present.
Configuration menu - View commit details
-
Copy full SHA for 90d0c78 - Browse repository at this point
Copy the full SHA 90d0c78View commit details -
[Segment Cache] Send <head> during route prefetch (#72890)
Based on: - #72874 --- The <head> does not belong to any particular segment; it represents the entire page. Except in the case where two URLs rewrite to the same result, it's very unlikely to benefit from deduplication, so there's no benefit to caching it separately from the route tree. So we'll send it in the same response. Since the head may contain dynamic data, the route tree response may now contain hanging promises, so we'll need to use the same AbortController trick that we use for the segments.
Configuration menu - View commit details
-
Copy full SHA for 9db3c0e - Browse repository at this point
Copy the full SHA 9db3c0eView commit details -
fix(next/image): improve svg heuristic for unoptimized (#72970)
The `<Image>` component doesn't optimize SVG images since they are vector images and can already scale up and down to any width. Therefore, the component will try to detect SVG images based on the file name to avoid sending them to the Image Optimization API at all. This is because the default behavior of the Image Optimization API is to error for SVG images due to the security implications of `<svg>` with nested `<script>`, etc (unless `dangerouslyAllowSVG` is enabled. However, we don't want users to reach for `dangerouslyAllowSVG` because it is not usually what they intended. So instead, we can improve the heuristic for detecting SVG in the `<Image>` component by ignoring the query string. Related to nodejs/nodejs.org#7244
Configuration menu - View commit details
-
Copy full SHA for 7e22452 - Browse repository at this point
Copy the full SHA 7e22452View commit details -
[Segment Cache] Initial implementation (#72875)
Based on: - #72874 - #72890 - #72872 --- This adds an initial implementation of the client Segment Cache, behind the experimental `clientSegmentCache` flag. (Note: It is not anywhere close to being ready for production use. It will take a while for it to reach parity with the existing implementation.) I've discussed the motivation in previous PRs, but I'll share a brief summary here again: The client Segment Cache is a rewrite of App Router's client caching implementation, designed with PPR and "use cache" in mind. Its main distinguishing feature from the current implementation is that it fetches/caches/expires data per route segment, rather than per full URL. An example of what this means in practical terms is that shared layouts are deduplicated in the cache, resulting in less bandwidth. There are other benefits we have in mind but that's the starting point. I've tried to extract the work here into reasonably-sized commits (many of which have already landed) but this one here is sorta unavoidably large. Here are the main pieces: - [segment-cache/cache.ts](https://github.com/acdlite/next.js/blob/initial-implementation-client-segment-cache/packages/next/src/client/components/segment-cache/cache.ts): This module is where the cache entries are maintained in memory. An important design principle is that you must be able to read from the cache synchronously without awaiting any promises. We avoid the use of async/await wherever possible; instead, async tasks write their results directly into the cache. This also helps to avoid race conditions. Currently there's no eviction policy other than stale time, but eventually we'll use an LRU for memory management. - [segment-cache/scheduler.ts](https://github.com/acdlite/next.js/blob/initial-implementation-client-segment-cache/packages/next/src/client/components/segment-cache/scheduler.ts): This module is primarily a task scheduler. It's also used to manage network bandwidth. The design is inspired by React Suspense and Rust Futures — tasks are pull-based, not push-based. The backing data structure is a MinHeap/PriorityQueue, to support efficient reprioritization of tasks. - [segment-cache/navigation.ts](https://github.com/acdlite/next.js/blob/initial-implementation-client-segment-cache/packages/next/src/client/components/segment-cache/navigation.ts): This module is responsible for creating a snapshot of the cache at the time of a navigation. Right now it's mostly a bunch of glue code to interop with the data structures used by the rest of the App Router, like CacheNodeSeedData and FlightRouterState. The long term plan is to move everything to using the Segment Cache and refactoring those data structures. Additional explanations are provided inline.
Configuration menu - View commit details
-
Copy full SHA for 0344392 - Browse repository at this point
Copy the full SHA 0344392View commit details -
Turbopack: Change edge wrapper to proxy exports (#72502)
The edge runtime does `await self._ENTRIES["middleware_..."].default.call(...)`, so instead export a Proxy that hides that the module object itself is a promise. Partial revert of #62141
Configuration menu - View commit details
-
Copy full SHA for 2792c3a - Browse repository at this point
Copy the full SHA 2792c3aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d76f98 - Browse repository at this point
Copy the full SHA 4d76f98View commit details -
docs(sitemap): remove extra 's' (#73023)
## Why? There's a typo in the note—Route Handler should be singular.
Configuration menu - View commit details
-
Copy full SHA for a3960c2 - Browse repository at this point
Copy the full SHA a3960c2View commit details -
chore(turbopack-core): Delete dead `all_modules_and_affecting_sources…
…` helper function (#73016) Dead code strikes again. https://github.com/est31/warnalyzer has been updated for recent rust toolchains, so I might give that a shot soon to see if I can clean up all of our dead functions.
Configuration menu - View commit details
-
Copy full SHA for d80102c - Browse repository at this point
Copy the full SHA d80102cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 697aff9 - Browse repository at this point
Copy the full SHA 697aff9View commit details
Commits on Nov 21, 2024
-
[Turbopack] concurrent write batches and little endian encoding (#72929)
### What? Allow KeyValueDatabase to implement to variants of WriteBatches * Serial: It's not Send+Sync and writing takes a `&mut self` * Concurrent: It's Send+Sync and writing takes a `&self` When using the concurrent variant we can avoid buffering the intermediate results and write that directly to the write batch. But the database need to take care of handling concurrency.
Configuration menu - View commit details
-
Copy full SHA for d9c460a - Browse repository at this point
Copy the full SHA d9c460aView commit details -
Configuration menu - View commit details
-
Copy full SHA for d936cfb - Browse repository at this point
Copy the full SHA d936cfbView commit details -
[Turbopack] Invalidation and Persisting fixes (#72950)
### What? * make invalidation more granular * fix untagged enum serialization * fixes ppr config option serialization * fix typo * improve tracing * less aggressive persisting * fix verify_serialization feature
Configuration menu - View commit details
-
Copy full SHA for 7885f88 - Browse repository at this point
Copy the full SHA 7885f88View commit details -
Display where the env was loaded from when enabled
typedEnv
(#70951)### Why? This PR added an indication of where the env was loaded from when `experimental.typedEnv` was enabled. Also, it allows the user to set `NODE_ENV=production` to enable the `typedEnv` feature for `.env.production*` files. ![CleanShot 2024-11-21 at 19 48 20](https://github.com/user-attachments/assets/ce3c7180-f26a-4378-a74f-a5998a363211) ### How? Modified `@next/env` to pass parsed envs along with the `loadedEnvFiles` value and used the location to indicate via JSDoc.
Configuration menu - View commit details
-
Copy full SHA for 73f547a - Browse repository at this point
Copy the full SHA 73f547aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a4de4c - Browse repository at this point
Copy the full SHA 5a4de4cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 58b993c - Browse repository at this point
Copy the full SHA 58b993cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c9aa992 - Browse repository at this point
Copy the full SHA c9aa992View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2113aac - Browse repository at this point
Copy the full SHA 2113aacView commit details -
perf(turbopack): Enable merging of export fragments (#72813)
### What? Enable single-incoming-edge optimization for module fragments with `ModulePart::Export`. ### Why? It will reduce the number of modules greatly. ### How? Closes PACK-3481
Configuration menu - View commit details
-
Copy full SHA for c8f96d5 - Browse repository at this point
Copy the full SHA c8f96d5View commit details -
create forked impl for Link component (#73019)
There's significant drift between how Link is implemented in pages vs app dir, and we're planning to make even more changes. (For example, we want to change the intersection observer prefetch behavior, but only in app router) To simplify this drift in behavior, this will alias `next/link` to `client/app-dir/link.tsx` in app dir bundles. There is no change in behavior to the `link` component in this PR. The next PR in the stack will remove the current forked handling to remove things that are irrelevant to the router it's rendered in.
Configuration menu - View commit details
-
Copy full SHA for 26cdaa8 - Browse repository at this point
Copy the full SHA 26cdaa8View commit details -
Turbopack build: Add bench for Turbopack cache (#73040)
Adds a separate bench for Turbopack build enabled. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
Configuration menu - View commit details
-
Copy full SHA for 35c755a - Browse repository at this point
Copy the full SHA 35c755aView commit details -
remove unnecessary handling in forked Link components (#73020)
This follows up the work from #73019 to update the implementations for the forked Link components to remove Pages specific handling in the App link, and App specific handling in the Pages link.
Configuration menu - View commit details
-
Copy full SHA for 80bbc75 - Browse repository at this point
Copy the full SHA 80bbc75View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f4899f - Browse repository at this point
Copy the full SHA 3f4899fView commit details -
🍪 Understanding Cookie Behavior in Server Components (#73001)
This is meant to add a bit more clarity of why we can't set cookies to the browser in a server component even if it's through a server action or route handler. Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8a69b95 - Browse repository at this point
Copy the full SHA 8a69b95View commit details -
docs: add Fleek's Next.js template (#72988)
This pull request adds the Next.js template for Fleek. Users can use it to get started using full-stack Next.js on Fleek. This template is directly from the official Fleek community templates' collection. ### What? This adds to the templates references within the docs to get Fleek on the Next.js documentation. ### Why? Community templates of Next.js are great to help spread the word that Next.js can be deployed anywhere. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 71978f9 - Browse repository at this point
Copy the full SHA 71978f9View commit details -
docs(fetch): clarify default fetch behavior (#72982)
## Why? The default fetch behavior, which is shown as `auto no cache` when you set the config [logging](https://nextjs.org/docs/app/api-reference/next-config-js/logging) to `true`, essentially means fetch once on `next build` to prerender the page. But, when a [Dynamic API](https://nextjs.org/docs/app/building-your-application/rendering/server-components#dynamic-rendering) is used, it will fetch from the resource on every request. This is different from `{ cache: 'no-store' }`, which regardless of whether Dynamic APIs are used, will de-op the page from prerendering.
Configuration menu - View commit details
-
Copy full SHA for 2fcb741 - Browse repository at this point
Copy the full SHA 2fcb741View commit details -
docs: update staleTimes.mdx (#72967)
Fix mdx formatting. Previously MDX was not formatted correctly. (see image - `prefetch=`) https://nextjs.org/docs/app/api-reference/next-config-js/staleTimes <img width="659" alt="Screenshot 2024-11-19 at 15 11 57" src="https://github.com/user-attachments/assets/44f77fd4-657e-409a-9190-9430fd96d5f8"> --------- Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4d652f7 - Browse repository at this point
Copy the full SHA 4d652f7View commit details -
docs:
Redirecting
fix route handler path (#72617)Hi, Team. The path of route handler seems to be missing `api` and I'd like to fix it. (`middleware.ts` above the route handler file, it requests to `/api/redirects..`) <img width="650" alt="image" src="https://github.com/user-attachments/assets/f9ff3034-de36-42ec-8d85-a4a923005fdf"> Thank you :) ### Improving Documentation - correct route handler path --------- Co-authored-by: hyungji <[email protected]> Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4875c58 - Browse repository at this point
Copy the full SHA 4875c58View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ea2830 - Browse repository at this point
Copy the full SHA 8ea2830View commit details -
remove locale from app link (#73052)
This prop is a no-op in app router. This removes the code that handled it for the App Router link, and adds a warning for apps that are attempting to use it in an app router context.
Configuration menu - View commit details
-
Copy full SHA for 9c69c83 - Browse repository at this point
Copy the full SHA 9c69c83View commit details -
Revert "docs: add Fleek's Next.js template" (#73054)
Reverts #72988 Right now, we're focused on making sure the examples linked are guaranteed to work and placed inside the Next.js community GitHub organization.
Configuration menu - View commit details
-
Copy full SHA for d434b4c - Browse repository at this point
Copy the full SHA d434b4cView commit details -
fix benchmark directory (#73057)
### What? The bench need to run in the correct directory
Configuration menu - View commit details
-
Copy full SHA for eb86d82 - Browse repository at this point
Copy the full SHA eb86d82View commit details -
fix: server action redirects between multiple root layouts (#73063)
When handling a redirect through a server action, we pass in the current href rather than the destination href to `handleExternalUrl`, which is incorrect since that won't reflect the updated URL from a server action's redirect response. While looking into this, I noticed a handful of server action branches that weren't properly rejecting or resolving the action promises. This would cause the transitions to stall until they were fulfilled, so I updated all of the existing branches where we early return to also resolve the promise. Fixes #72842
Configuration menu - View commit details
-
Copy full SHA for b42f73a - Browse repository at this point
Copy the full SHA b42f73aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 37f26ac - Browse repository at this point
Copy the full SHA 37f26acView commit details -
hmr-test waits for compile signal (#73064)
- The waitFor function now supports a predicate. Unlike retry, waitFor does not include a timeout. Use it only when the predicate is guaranteed to evaluate to true before proceeding to the next test. If it runs indefinitely, Jest enforces a 120-second timeout per test. - The getCliOutputFromHere utility provides a convenient string getter that captures CLI output in between.
Configuration menu - View commit details
-
Copy full SHA for 9ab8434 - Browse repository at this point
Copy the full SHA 9ab8434View commit details -
Configuration menu - View commit details
-
Copy full SHA for 09b3944 - Browse repository at this point
Copy the full SHA 09b3944View commit details -
docs(next-config): add experimental inline css docs (#73070)
## Why? Add documentation for experimental `inlineCss`. ``` import type { NextConfig } from 'next' const nextConfig: NextConfig = { experimental: { inlineCss: true, }, } ``` - x-ref: #72195
Configuration menu - View commit details
-
Copy full SHA for a40dd63 - Browse repository at this point
Copy the full SHA a40dd63View commit details -
docs: update tags when upgrading from 13 to 14 (#73071)
## Why? The `latest` tag currently points to v15, so we need to update the tag to `next-14`.
Configuration menu - View commit details
-
Copy full SHA for 3ba49c7 - Browse repository at this point
Copy the full SHA 3ba49c7View commit details
Commits on Nov 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d07422f - Browse repository at this point
Copy the full SHA d07422fView commit details -
fix(next/image): reduce avif sharp effort from 4 to 3 for faster enco…
…ding (#73030) ## History In a previous PR #65846 the chroma subsampling setting was removed for AVIF images. This caused the default of `4:4:4` to be used which increased the image size and CPU a lot. I considered switching back to `4:2:0` but found that reducing the `effort: 3` actually yielded significantly better performance with only a slight difference in size. ## Benchmark For example, take this PNG that has a width of 1805. ``` curl -JO https://images.bookroo.com/site/landing/homepage/book-collection.png ``` Using `w=1850` and `q=75`: ``` Current: 2_778ms and 153_364 bytes Chroma: 2_214ms and 132_927 bytes This PR: 1_265ms and 158_862 bytes ``` Using `w=1500` and `q=75`: ``` Current: 625ms and 95_810 bytes Chroma: 524ms and 89_500 bytes This PR: 185ms and 99_127 bytes ``` Using `w=1200` and `q=75`: ``` Current: 506ms and 74_738 bytes Chroma: 407ms and 68_998 bytes This PR: 144ms and 77_955 bytes ``` For this particular image, the size will increase a bit but there are other images I tested where the size was actually smaller. So its a big improve in CPU usage compared to reverting to the chroma subsampling setting. We also are keeping AVIF smaller than WebP which is the expected behavior. ## Learn More [Chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling) is the practice of encoding images by implementing less resolution for [chroma](https://en.wikipedia.org/wiki/Chrominance) [information](https://en.wikipedia.org/wiki/Information) than for [luma](https://en.wikipedia.org/wiki/Luma_(video)) information, taking advantage of the human visual system's lower acuity for color differences than for luminance Image compression deep-dive video: https://www.youtube.com/watch?v=F1kYBnY6mwg Sharp Options: https://sharp.pixelplumbing.com/api-output#avif
Configuration menu - View commit details
-
Copy full SHA for d27182c - Browse repository at this point
Copy the full SHA d27182cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b7833e - Browse repository at this point
Copy the full SHA 5b7833eView commit details -
(E2E) Log which config file is used for
next start
(#73105)# Context [Test run](https://github.com/vercel/next.js/actions/runs/11962411287/job/33382985253?pr=73030#step:29:421) fails due to ``` ▲ Next.js 15.0.4-canary.22 - Local: http://[::1]:35903 - Network: http://[::]:35903 ✓ Starting... Error: "next start" does not work with "output: export" configuration. Use "npx serve@latest out" instead. at <unknown> (dist/server/next.js:215:31) at async NextServer.prepare (dist/server/next.js:154:24) at async initializeImpl (dist/server/lib/render-server.js:92:5) at async initialize (dist/server/lib/router-server.js:436:22) at async Server.<anonymous> (dist/server/lib/start-server.js:272:36) ``` However, there was no `output: export` specified in the [test setup](https://github.com/vercel/next.js/tree/jude/which-config-are-we-using/test/integration/edge-runtime-configurable-guards). **Mysterious!** # Hypothesis `next start` recursively finds the `next.config` upwards in the directory tree and happens to locate an extraneous `next.config` that specified `output: export`. # Changes - Output the config file path in test mode for future debugging - Short-circuit `findUp` for the broken test by placing an empty config in the project directory
Configuration menu - View commit details
-
Copy full SHA for bfcbac9 - Browse repository at this point
Copy the full SHA bfcbac9View commit details -
Configuration menu - View commit details
-
Copy full SHA for f34e02d - Browse repository at this point
Copy the full SHA f34e02dView commit details -
docs: fix static params as promise examples (#72553)
## Improving Documentation dynamic `params` from `generateStaticParams` is now a promise but is now promise in type. Type has been changed for every Promise `params`. Co-authored-by: Delba de Oliveira <[email protected]> Co-authored-by: JJ Kasper <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4a203a0 - Browse repository at this point
Copy the full SHA 4a203a0View commit details -
fix: missing await, missing type Promise (#73088)
Hi, Team. It seems Promise is missing when defining params type. --------- Co-authored-by: hyungji <[email protected]> Co-authored-by: Maikel <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 27961cf - Browse repository at this point
Copy the full SHA 27961cfView commit details -
Disallow multiple server directives at the same level (file or functi…
…on) (#73018) This PR has two main goals: - **Consolidate the detection of server directives in modules and function bodies.** Previously, these were two separate implementations with significant overlap, but also some [questionable discrepancies](#72811 (comment)). - **Model the current directive (in a file or function) using an enum instead of two separate booleans.** This change prevents any confusion that both directives might be present simultaneously. Additionally, we're now emitting an error if multiple directives (`"use server"` and `"use cache"`) are defined in the same location (at the top of a file or function body). A mixed usage of `"use server"` and `"use cache"` _across different locations_ is still allowed, e.g. `"use cache"` at the top of a file, and `"use server"` in a function. > [!NOTE] > The diff may be tricky to review because chunks from two different functions are combined into a single function. Fortunately, we have comprehensive test coverage for the transforms, which instills high confidence that these changes are correct.
Configuration menu - View commit details
-
Copy full SHA for 04adb76 - Browse repository at this point
Copy the full SHA 04adb76View commit details -
Docs: Add canary tags to
expirePath
andexpireTag
(#73096)- `expirePath` and `expireTag` are not yet available in a stable version, so we don't want these APIs leaking into stable docs.
Configuration menu - View commit details
-
Copy full SHA for be82865 - Browse repository at this point
Copy the full SHA be82865View commit details -
docs: update pages automatic static optimization rendering page (#72545)
## Improving Documentation I just add **Good to know** to below path note which was in a block but not add the tag. > Pages > Rendering > Automatic Static Optimization **Before:** > Statically generated pages are still reactive: Next.js will hydrate your application client-side to give it full interactivity. **Now:** > **Good to know:** Statically generated pages are still reactive. Next.js will hydrate your application client-side to give it full interactivity. Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7ee495e - Browse repository at this point
Copy the full SHA 7ee495eView commit details -
docs(authentication): fix typescript code example (#72533)
Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b374332 - Browse repository at this point
Copy the full SHA b374332View commit details -
docs: add details on React Compiler annotations with
"use memo"
(#7……3053) While the React Compiler is still in beta, this functionality was not yet documented. I also updated this to remove the 15 RC since 15 is now stable. Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 87c74c8 - Browse repository at this point
Copy the full SHA 87c74c8View commit details -
remove inheritance from NextCustomServer (#73005)
### What This PR changes `NextCustomServer` to no longer subclass `NextServer` and instead just delegate all methods to `this.renderServer`. I've also added an interface implemented by both `NextServer` and `NextCustomServer` to make it explicit what we're actually exposing. (Note that we're currently exposing too much for legacy reasons. we might want to decide to clean this up a bit, i've started that in #73021) I've also cleaned up some random `(_ as any)`s and unnecessary indirections around the area. ### Why currently, `NextCustomServer` is a subclass of `NextServer`, which makes it very confusing to reason about, because in `prepare()` it creates *a nested `NextServer`* (stored in `this.renderServer`). this isn't immediately visible in the code, but that's what `getRequestHandlers` ends up doing. https://github.com/vercel/next.js/blob/58b993c239689f22641682bbcb0d8dea6d85fdf1/packages/next/src/server/next.ts#L281 then, it delegates *some* methods to that (`render`, `getRequestHandler`, `setAssetPrefix`). But some methods (e.g. `render404`) *aren't* overridden/delegated and just run the implementation inherited from `NextServer`. And those implementations are unaware of `this.renderServer`, so they end up initializing a *second* `NextNodeServer` (`this.server` vs `this.renderServer.server`) and run against that instead. that's bad! and it's why e.g. #61676 was necessary -- we needed to update both servers! i think that this is a leftover of the old implementation where we ran a separate process for rendering. for historical context, see: - #49805 which seems to have introduced this split (the proxy only overrides `prepare`, `getRequestHandler`, and `render`) - #53523 which turned the proxy code into `NextCustomServer` also apparently `render404` and others were broken in development (try running the tests in the first commit I've changed `NextCustomServer` and see the server hang forever).
Configuration menu - View commit details
-
Copy full SHA for 08e7410 - Browse repository at this point
Copy the full SHA 08e7410View commit details -
docs: fix code block language on redirecting docs (#73073)
## Description Follow up #72617. I have already fixed at #72944. `app/api/redirects/route.ts` is ts extension. ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 37b815b - Browse repository at this point
Copy the full SHA 37b815bView commit details -
docs(routing): update params type to be async (v15) (#73111)
## Why? Update params type to be async (v15). - x-ref: #72070
Configuration menu - View commit details
-
Copy full SHA for 915efdd - Browse repository at this point
Copy the full SHA 915efddView commit details
Commits on Nov 23, 2024
-
docs: clarify Switching to Dynamic Rendering section (#73113)
## Why? The default config of fetch, which is `auto no cache`, is slightly different from the fetch option `{ cache: 'no-store' }` (this opts the whole route out of statically prerendering), so we need to clarify that further. - https://nextjs.org/docs/canary/app/api-reference/functions/fetch#optionscache - x-ref: #72982 - Fixes #73109
Configuration menu - View commit details
-
Copy full SHA for 48e7ff5 - Browse repository at this point
Copy the full SHA 48e7ff5View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1b23eb - Browse repository at this point
Copy the full SHA e1b23ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a2f555 - Browse repository at this point
Copy the full SHA 6a2f555View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6aaa51d - Browse repository at this point
Copy the full SHA 6aaa51dView commit details -
Method/function props of exported objects are not server functions (#…
Configuration menu - View commit details
-
Copy full SHA for 2161d8c - Browse repository at this point
Copy the full SHA 2161d8cView commit details -
Forbid
this
andarguments
in server functions (#73059)Accessing `this` or `arguments` in server functions is not allowed. With this PR, we are now emitting build errors in this case. --------- Co-authored-by: Janka Uryga <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c53ee73 - Browse repository at this point
Copy the full SHA c53ee73View commit details -
Configuration menu - View commit details
-
Copy full SHA for 560bfdb - Browse repository at this point
Copy the full SHA 560bfdbView commit details
Commits on Nov 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7b0ab1e - Browse repository at this point
Copy the full SHA 7b0ab1eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 199d2e9 - Browse repository at this point
Copy the full SHA 199d2e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bda67f - Browse repository at this point
Copy the full SHA 1bda67fView commit details -
Reapply "ensure webpack worker exits bubble to parent process (#72921)…
…" (#73138) This relands #72921 to be a more minimal refactor. This re-applies the core change to use the existing worker that has proper error bubbling handling without changing the worker lifecycle. For the purposes of the internal OOM we were seeing, this ensures that any custom `max-old-space-size` flags are preserved during the webpack build step, even when using the shared worker. Instead, I moved it to `createStaticWorker`, as that was where it was intended to be respected when it landed in #46705.
Configuration menu - View commit details
-
Copy full SHA for 603f2e0 - Browse repository at this point
Copy the full SHA 603f2e0View commit details -
Upgrade React from 380f5d67-20241113 to b01722d5-20241114 (#73107)
Co-authored-by: vercel-release-bot <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 28a25af - Browse repository at this point
Copy the full SHA 28a25afView commit details -
Configuration menu - View commit details
-
Copy full SHA for f3b06b9 - Browse repository at this point
Copy the full SHA f3b06b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 084bc4a - Browse repository at this point
Copy the full SHA 084bc4aView commit details
Commits on Nov 25, 2024
-
port turbopack-swc-utils to ResolvedVc (#73086)
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
Configuration menu - View commit details
-
Copy full SHA for 06fed46 - Browse repository at this point
Copy the full SHA 06fed46View commit details -
port turbopack-mdx to use ResolvedVc (#73080)
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
Configuration menu - View commit details
-
Copy full SHA for 70be965 - Browse repository at this point
Copy the full SHA 70be965View commit details -
feat: Update
lightningcss
tov1.0.0-alpha.61
(#73161)### What? Update `lightningcss` to the latest. - https://github.com/parcel-bundler/lightningcss/releases/tag/v1.28.2 ### Why? It's released.
Configuration menu - View commit details
-
Copy full SHA for 2bf4779 - Browse repository at this point
Copy the full SHA 2bf4779View commit details -
port turbopack-resolve to ResolvedVc (#73083)
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
Configuration menu - View commit details
-
Copy full SHA for 2853a5d - Browse repository at this point
Copy the full SHA 2853a5dView commit details -
move turbopack-image to ResolvedVc (#73079)
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
Configuration menu - View commit details
-
Copy full SHA for 1cade4e - Browse repository at this point
Copy the full SHA 1cade4eView commit details -
Turbopack: more tracing spans (#73010)
- adds per-module tracing for `find server actions` (it's implemented in the same way for next/dynamic and client references). Now, `find server actions` isn't just a single blob anymore. - add a tracing span for `all_server_paths`
Configuration menu - View commit details
-
Copy full SHA for 1899edd - Browse repository at this point
Copy the full SHA 1899eddView commit details -
Reenable otel test for Turbopack (#73093)
Turbopack has supported instrumentation.js for a long time now
Configuration menu - View commit details
-
Copy full SHA for 56b28ce - Browse repository at this point
Copy the full SHA 56b28ceView commit details -
Omit unnecessary cache wrapper import (#73160)
When a `"use cache"` module has no exported or annotated cache function, we can omit the import statement for the cache wrapper function.
Configuration menu - View commit details
-
Copy full SHA for adfdd09 - Browse repository at this point
Copy the full SHA adfdd09View commit details -
Handle server function directives in class methods (#73060)
With this PR, we are allowing _static_ class methods to be annotated with `"use cache"` or `"use server"`. Class _instance_ methods on the other hand are not allowed as server functions.
Configuration menu - View commit details
-
Copy full SHA for 6602327 - Browse repository at this point
Copy the full SHA 6602327View commit details -
15.1 docs:
forbidden
,unauthorized
, andauthInterrupts
(#73039)**Do not merge until #72785 lands in canary.** Closes: - https://linear.app/vercel/issue/DOC-3820/[unstable]-forbidden-and-forbiddenjs - https://linear.app/vercel/issue/DOC-3849/[unstable]-unauthorized-and-unauthorizedjs - https://linear.app/vercel/issue/DOC-3860/[experimental]-authinterrupts-config-option
Configuration menu - View commit details
-
Copy full SHA for 712d7c9 - Browse repository at this point
Copy the full SHA 712d7c9View commit details -
Enable another Turbopack build test (#73166)
We forgot to update the manifest when merging the NFT PRs
Configuration menu - View commit details
-
Copy full SHA for 690dcac - Browse repository at this point
Copy the full SHA 690dcacView commit details -
CNA: replace
.eslintrc.json
witheslint.config.mjs
(#73162)### Why? As we upgraded create-next-app ESLint to v9, use flat config (with compatible function) for the templates. `eslint.config.mjs`: ```mjs import { dirname } from "path"; import { fileURLToPath } from "url"; import { FlatCompat } from "@eslint/eslintrc"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const compat = new FlatCompat({ baseDirectory: __dirname, }); const eslintConfig = [...compat.extends("next/core-web-vitals")]; export default eslintConfig; ``` As `import.meta.dirname` was introduced in Node.js version v20.11.0, we can simplify to when on minimum version: ```mjs import { FlatCompat } from "@eslint/eslintrc"; const compat = new FlatCompat({ baseDirectory: import.meta.dirname, }); const eslintConfig = [...compat.extends("next/core-web-vitals")]; export default eslintConfig; ``` But best is that other dependency plugins support flat config so we can upgrade to pure Flat Config as well. Closes NDX-374
Configuration menu - View commit details
-
Copy full SHA for 82cac69 - Browse repository at this point
Copy the full SHA 82cac69View commit details -
Turbopack: don't compute all paths for builds (#73036)
Depends on #73010 A very small speedup, mostly noticeable in cpu time, not really in wall time ``` before: 504.86s user 73.31s system 792% cpu 1:12.93 total 522.09s user 76.70s system 778% cpu 1:16.94 total 503.73s user 68.78s system 818% cpu 1:09.92 total after: 471.20s user 61.73s system 757% cpu 1:10.33 total 481.69s user 69.05s system 805% cpu 1:08.33 total ```
Configuration menu - View commit details
-
Copy full SHA for 2d4d837 - Browse repository at this point
Copy the full SHA 2d4d837View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d69b0c - Browse repository at this point
Copy the full SHA 6d69b0cView commit details -
perf(turbopack): Use
ResolvedVc
forturbopack-css
(#73172)### What? Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `turbopack-css` ### Why? ### How?
Configuration menu - View commit details
-
Copy full SHA for 3ddd390 - Browse repository at this point
Copy the full SHA 3ddd390View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4646d6 - Browse repository at this point
Copy the full SHA e4646d6View commit details -
chore(CI): Remove sysroot override for macos arm64 (#73188)
This is extracted from #72513. This override appears to break the build for rocksdb. It doesn't seem like there's any good reason for us to do this. It looks like we used to do a cross-build for macos arm64 (#28138), which would explain the need to override the sysroot, but we don't do that anymore. We don't do this override for x86-64 builds (even though that one _is_ a cross-build? The napi cli probably does the right thing for us...). Manually triggered `build-and-deploy` CI job: https://github.com/vercel/next.js/actions/runs/12018322261
Configuration menu - View commit details
-
Copy full SHA for e0eed7d - Browse repository at this point
Copy the full SHA e0eed7dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 43566f1 - Browse repository at this point
Copy the full SHA 43566f1View commit details -
(example) using
await
params when dynamic routing (#72896)### Adding or Updating Examples Hi, Team. Updating example to await params as it is now used asynchronously. Co-authored-by: JJ Kasper <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 90d6ef4 - Browse repository at this point
Copy the full SHA 90d6ef4View commit details -
docs: Improve Accuracy and Type Safety on Data Fetching Examples (#73122
) Hi, Team. Updated Reusing data across multiple functions examples on data fetching documentation to improve type safety and accuracy. ### Summary of Changes 1. Added Async Params 2. Fixed Dynamic Route Example Path - Corrected the path structure for dynamic routes to reflect actual usage as `app/page.tsx` cannot be used to access dynamic routed paths. 3. Improved Type Safety in `generateStaticParams` - Type mismatch: `generateStaticParams` expects string parameter, but examples used `post.id` which of type is number, causing both build time and client run time failures. <img width="1109" alt="image" src="https://github.com/user-attachments/assets/ae6fad44-0b7f-4aac-ac31-74a6581c995b"> <img width="714" alt="image" src="https://github.com/user-attachments/assets/d8fb19c9-9dd1-4e6a-8d2b-b25f719e3742"> 4. Replaced let variable with const variable - Prevent accidental reassignment as it is not needed --------- Co-authored-by: JJ Kasper <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7e87edd - Browse repository at this point
Copy the full SHA 7e87eddView commit details
Commits on Nov 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for a2f4b93 - Browse repository at this point
Copy the full SHA a2f4b93View commit details -
fix(next/image): dpl query string should only be used for local image…
…s, not remote images (#73184) Currently, enabling skew protection will cause new deployments to invalidate the browser cache since the deployment id is including in the query string as `dpl`. In many cases, such as JS and CSS, these assets are bundled and include a content hash in the file name, so new deployments already invalidate browser cache. However, the optimized image cache is preserved between deploys, so enabling skew protection breaks that expectation. This PR removes the `dpl` query string for remote images since those files don't live in the deployment and therefore don't need skew protection. - Related to #73015
Configuration menu - View commit details
-
Copy full SHA for 9ea20cb - Browse repository at this point
Copy the full SHA 9ea20cbView commit details -
docs: eslint flat config (#73167)
This PR replaced eslint-related docs code examples from `.eslintrc.json` with `eslint.config.mjs`. Closes NDX-373
Configuration menu - View commit details
-
Copy full SHA for 947f7cd - Browse repository at this point
Copy the full SHA 947f7cdView commit details -
perf(turbopack): Use
ResolvedVc
forturbopack-core
(#73065)### What? Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `turbopack-core` ### Why? ### How?
Configuration menu - View commit details
-
Copy full SHA for 784808a - Browse repository at this point
Copy the full SHA 784808aView commit details -
perf(turbopack): Use
ResolvedVc
forturbopack
,turbopack-tests
,…… `turbopack-wasm` (#73196) ### What? Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `turbopack`, `turbopack-tests`, `turbopack-wasm`. ### Why? ### How?
Configuration menu - View commit details
-
Copy full SHA for 92f02b2 - Browse repository at this point
Copy the full SHA 92f02b2View commit details -
perf(turbopack): Use
ResolvedVc
forturbopack-nodejs
(#73200)### What? Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `turbopack-nodejs`. ### Why? ### How?
Configuration menu - View commit details
-
Copy full SHA for 642bf10 - Browse repository at this point
Copy the full SHA 642bf10View commit details -
perf(turbopack): Use
ResolvedVc
forturbopack-env
(#73202)### What? Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `turbopack-env`. ### Why? ### How?
Configuration menu - View commit details
-
Copy full SHA for 102d71b - Browse repository at this point
Copy the full SHA 102d71bView commit details -
Configuration menu - View commit details
-
Copy full SHA for cebecdc - Browse repository at this point
Copy the full SHA cebecdcView commit details -
Docs:
forbidden
andunauthorized
nits (#73213)Going through the docs with fresh eyes, picked up some nits.
Configuration menu - View commit details
-
Copy full SHA for faa759b - Browse repository at this point
Copy the full SHA faa759bView commit details -
Turbopack: make client references actual references (#73174)
aka "one graph" - Make client references actual references (non-chunkable, so chunking ignores them right now. We can change that later and move more chunking into Turbopack itself as opposed to the manual stuff in `AppEndpoint`) - `find server actions` now just walks the rsc_entry and discovery client references itself - `collecting next/dynamic` still walks the RSC graph which is wrong (as before). I left this to make this PR a noop that shouldn't change any behavior. We'll fix this in the coming reimplementation (and add tests for what is apparently currently not asserted 😐) **View without whitespace changes** Closes PACK-3532
Configuration menu - View commit details
-
Copy full SHA for 6a2d350 - Browse repository at this point
Copy the full SHA 6a2d350View commit details -
Docs: Update
turbopack
API Reference (#73215)Closes: https://linear.app/vercel/issue/DOC-3886/[page]-turbopack - Moves `Turbopack` page under API Reference - Shares page between `app` and `pages` docs - Updates page to follow template Redirects: vercel/front#38704
Configuration menu - View commit details
-
Copy full SHA for e8af80d - Browse repository at this point
Copy the full SHA e8af80dView commit details -
Update authentication docs to use useActionState (#72503)
Changed example to useActionState <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> The current docs for auth using useFormState that throws error as renamed , hence changed the example to use useActionState --------- Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d4136d9 - Browse repository at this point
Copy the full SHA d4136d9View commit details -
Don't hoist a server function if a compile error was emitted (#73189)
This allows us to skip unnecessary work, and also avoids generating invalid code, e.g. not allowed `super` calls in hoisted methods.
Configuration menu - View commit details
-
Copy full SHA for 12c483a - Browse repository at this point
Copy the full SHA 12c483aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 214e0d3 - Browse repository at this point
Copy the full SHA 214e0d3View commit details -
Updated the example of with-styled-jsx-scss to utilize the App Router. (
#70567) This PR updates the with-styled-jsx-scss example for using the App Router. Here are the changes that have been made: - Renamed the "pages" folder to the "app" folder. - Added the layout.tsx file as part of the App Router. - Updated the package.json file. CC: @samcx --------- Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bdca519 - Browse repository at this point
Copy the full SHA bdca519View commit details -
Updated the example of with-styled-jsx-plugins to utilize the App Rou…
…ter (#70663) This PR updates the with-styled-jsx-plugins example for using the App Router. Here are the changes that have been made: - I renamed the "pages" folder and moved it to the "app" folder. - Added the layout.TSX file as part of the App Router. - Updated the package.json file. CC: @samcx --------- Co-authored-by: qed42 <[email protected]> Co-authored-by: Sam Ko <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9cbc4d8 - Browse repository at this point
Copy the full SHA 9cbc4d8View commit details -
Updated the example of with-unstated to utilize the App Router. (#73211)
This PR updates the with-unstated example for using the App Router. Here are the changes that have been made: - Renamed the "pages" folder to the "app" folder. - Added the layout.tsx file as part of the App Router. - Moved the components folder inside app folder. - Updated the package.json file. - Added hooks for counter and clock. CC: @samcx --------- Co-authored-by: samcx <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 661f3fb - Browse repository at this point
Copy the full SHA 661f3fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for ac686ff - Browse repository at this point
Copy the full SHA ac686ffView commit details
Commits on Nov 27, 2024
-
refactor: remove isStandaloneMode context from metadata resolver (#73224
) This removes a check that appears to be redundant: we only want to warn about the fallback behavior when deployed in an environment where the env vars needed to detect proper fallback values (eg, not deployed to Vercel) aren't available. Since this check is already captured, we don't need both. The rationale for explicitly logging in standalone mode (even in dev) is that `standalone` mode won't ever be deployed to Vercel. But it's equally possible for you to build a Next.js app and not deploy it to Vercel. At best, this was reducing some additional console noise. But at worst, you're deploying an app that will serve a `localhost` URL in production. If you're using a relative URL without a metadataBase, it seems worth explicitly calling out as early as possible that we're going to fill in a fallback for you. Ultimately we should surface this information regardless of env in devtools. But since warning is the default, in #73066 I've updated it to only warn in dev when explicitly passing a relative og URL, rather than always making it warn when using the `opengraph-image` convention.
Configuration menu - View commit details
-
Copy full SHA for fc64a11 - Browse repository at this point
Copy the full SHA fc64a11View commit details -
refactor: remove indirection in metadata image resolution (#73225)
This refactors some unnecessary indirection that made it trickier for me to understand the flow of ogImage resolution. Specifically: - `getSocialImageFallbackMetadataBase` was taking in `metadataBase` and then inverting it and returning `isMetadataBaseMissing` which is circular. It was also being called higher up in the stack than it needed to be resulting in args being passed through intermediary functions that didn't need it - `validateResolvedImageUrl` was removed in favor of grabbing the fallback and warning appropriately in `resolveAndValidateImage`. This makes it more obvious that when we're warning about using the fallback, we should actually use the fallback, which I've done in #73066
Configuration menu - View commit details
-
Copy full SHA for 00c875f - Browse repository at this point
Copy the full SHA 00c875fView commit details -
fix: metadataBase should take precedence when resolving relative ogIm…
…ages (#73066) When resolving opengraph / twitter images, we currently ignore the configured `metadataBase` value, which goes against the [documentation](https://nextjs.org/docs/app/api-reference/functions/generate-metadata#default-value) and doesn't seem correct, since an explicit `metadataBase` should be preferred over a fallback. This updates the handling to ensure an explicit `metadataBase` takes priority over the implicit path discovery. The one remaining special case here is for the "static metadata" case, aka the `opengraph-image` convention. We'll continue to prefer the fallback `metadataBase` in preview Vercel deploys & locally. Fixes #66957 Closes NDX-260
Configuration menu - View commit details
-
Copy full SHA for 564794d - Browse repository at this point
Copy the full SHA 564794dView commit details -
perf(turbopack): Use
ResolvedVc
forturbopack-dev-server
(#73195)### What? Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `turbopack-dev-server` ### Why? ### How?
Configuration menu - View commit details
-
Copy full SHA for e220b0d - Browse repository at this point
Copy the full SHA e220b0dView commit details -
perf(turbopack): Use
ResolvedVc
forturbo-tasks-fetch
(#73201)### What? Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `turbopack-tasks-fetch`. ### Why? ### How?
Configuration menu - View commit details
-
Copy full SHA for 1236847 - Browse repository at this point
Copy the full SHA 1236847View commit details -
port turbopack-node to ResolvedVc (#73082)
Does what it says on the tin. One struct seems to be trivially used in a trait which requires it to be a Vc so I left it with a comment. @bgw perhaps we can set up some lint + disabling comment for all the cases in this doc? Would be handy to ensure we are continuing to follow the heuristic in the future also.
Configuration menu - View commit details
-
Copy full SHA for 6ef912d - Browse repository at this point
Copy the full SHA 6ef912dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e1e8a5 - Browse repository at this point
Copy the full SHA 9e1e8a5View commit details -
feat(after): unflag unstable_after internals (#73190)
this PR changes `after`-related code to unconditionally set everything up even if `experimental.after` is disabled, because we want to be able to re-use some of the `after` machinery for instrumentation-related things.
Configuration menu - View commit details
-
Copy full SHA for 7d8bf38 - Browse repository at this point
Copy the full SHA 7d8bf38View commit details -
perf(turbopack): Use
ResolvedVc
fornext-api
, part 1 (#73234)### What? Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `next-api`, but split into multiple PRs. ### Why? To reduce scope of changes of each PRs so I can debug HMR failures. ### How?
Configuration menu - View commit details
-
Copy full SHA for e81d4da - Browse repository at this point
Copy the full SHA e81d4daView commit details -
feat(after): allow using unstable_after in generateStaticParams (#73217)
Allows using `unstable_after` in `generateStaticParams`. definitely niche, but since we're now allowing `after` to be used during build, i see no reason not to. Also fixes an issue where we didn't pass `experimental.after` into the context used for `generateStaticParams`, so if `after` was called, it'd always say that you have to enable `experimental.after` even if you already did.
Configuration menu - View commit details
-
Copy full SHA for 7af6e07 - Browse repository at this point
Copy the full SHA 7af6e07View commit details -
undici 7 was released 30 minutes ago and broke the tests because Turbopack now has troubles with its `node:sqlite` import. You can see the test failure in #73261 (comment) ``` Error: Cannot find module 'node:sqlite': Unsupported external type Url for commonjs reference at <unknown> (.next/server/chunks/ssr/c1118_undici_e1ac85._.js:35:29147) at [project]/node_modules/.pnpm/[email protected]/node_modules/undici/lib/cache/sqlite-cache-store.js [app-rsc] (ecmascript) (.next/server/chunks/ssr/c1118_undici_e1ac85._.js:35:29278) at instantiateModule (.next/server/chunks/ssr/[turbopack]_runtime.js:590:23) at getOrInstantiateModuleFromParent (.next/server/chunks/ssr/[turbopack]_runtime.js:645:12) at commonJsRequire (.next/server/chunks/ssr/[turbopack]_runtime.js:147:20) at [project]/node_modules/.pnpm/[email protected]/node_modules/undici/index.js [app-rsc] (ecmascript) (.next/server/chunks/ssr/c1118_undici_e1ac85._.js:116:5860) at instantiateModule (.next/server/chunks/ssr/[turbopack]_runtime.js:590:23) at getOrInstantiateModuleFromParent (.next/server/chunks/ssr/[turbopack]_runtime.js:645:12) at esmImport (.next/server/chunks/ssr/[turbopack]_runtime.js:132:20) at [project]/app/undici/page.js [app-rsc] (ecmascript) <internal part 2> (.next/server/chunks/ssr/[root of the server]__83c897._.js:1:5666) { ``` https://github.com/nodejs/undici/blob/1cfe0949053aac6267f11b919cee9315a27f1fd6/index.js#L52-L59 https://github.com/nodejs/undici/blob/1cfe0949053aac6267f11b919cee9315a27f1fd6/lib/cache/sqlite-cache-store.js#L3
Configuration menu - View commit details
-
Copy full SHA for 2c546bb - Browse repository at this point
Copy the full SHA 2c546bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 664d888 - Browse repository at this point
Copy the full SHA 664d888View commit details -
Turbopack: use try_join instead of future::try_join_all (#73261)
These were the only 2 occurrences in the codebase. Might be a candidate for an ast-grep lint rule
Configuration menu - View commit details
-
Copy full SHA for f911175 - Browse repository at this point
Copy the full SHA f911175View commit details -
Undeprecate revalidate APIs and rename expire APIs (#73193)
As discussed we are removing the deprecated field from `revalidateTag` and `revalidatePath` as they aren't going away anytime soon and the new `expire` APIs will have slightly different semantics so not a 1-1 rename with no arguments change anymore. We are also adding the `unstable_` prefix for `expireTag`/`expirePath` while we iterate on them so it's clear they will change. --------- Co-authored-by: Zack Tanner <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a771ce2 - Browse repository at this point
Copy the full SHA a771ce2View commit details -
docs(server-actions): add missing formData type (#73257)
This PR adds the missing `FormData` type annotation to the formData parameter in the server actions example. Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a168d74 - Browse repository at this point
Copy the full SHA a168d74View commit details -
perf(turbopack): Use
ResolvedVc
fornext-api
, part 2 (#73235)### What? Use `ResolvedVc<T>` instead of `Vc<T>` for struct fields in `next-api`, but split into multiple PRs. ### Why? To reduce scope of changes of each PRs so I can debug HMR failures. ### How?
Configuration menu - View commit details
-
Copy full SHA for ad8a47a - Browse repository at this point
Copy the full SHA ad8a47aView commit details -
docs: update static-tweet to react-tweet (#73253)
## Description Now that next-tweet has been renamed [react-tweet](https://github.com/vercel/react-tweet), [Static Tweet (Demo)](https://static-tweet.vercel.app/) navigates https://react-tweet.vercel.app. So updated the link. ### Adding or Updating Examples - [x] The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - [x] Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 29fca4b - Browse repository at this point
Copy the full SHA 29fca4bView commit details -
docs(fetching):
params
toawait params
(#73254)Hi Team. This PR fixes an issue in the examples where the params object was destructured without being awaited. Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d1e554b - Browse repository at this point
Copy the full SHA d1e554bView commit details -
Revert "codemod: replace
revalidate(Tag|Path)
toexpire(Tag|Path)
" (Configuration menu - View commit details
-
Copy full SHA for 60b96e8 - Browse repository at this point
Copy the full SHA 60b96e8View commit details -
convert let keyword to const keyword to data fetching and caching exa…
…mple (#73251) Improving Documentation - I noticed that using const instead of let in the example code for data fetching and caching is more appropriate, so I made the change. ![image](https://github.com/user-attachments/assets/73eb2dd7-386f-44ee-b820-7dbdd6a803eb) Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7f47d08 - Browse repository at this point
Copy the full SHA 7f47d08View commit details -
[Turbopack] instead of depending on all env vars, track them via Prox…
…y in webpack loaders (#73112) ### What? * instead of depending on all env vars, track them via Proxy in webpack loaders * fix invalidation of evaluate pool after persistent cache restore
Configuration menu - View commit details
-
Copy full SHA for b5091d3 - Browse repository at this point
Copy the full SHA b5091d3View commit details -
docs: update the demo link of kontent.ai (#73250)
## Summary Follow up #45260. Update Kontent.ai brand name and demo link. ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide Co-authored-by: Delba de Oliveira <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3d5aa27 - Browse repository at this point
Copy the full SHA 3d5aa27View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e8d84b - Browse repository at this point
Copy the full SHA 6e8d84bView commit details -
feat(after): wait for after-callbacks before server shutdown (#72590)
### What This PR improves the reliability of `unstable_after` in a self-hosted context, i.e. on a long-running server (`next start`). when the server receives a signal to gracefully shutdown, we'll wait for any operations scheduled with `unstable_after` to finish, and then exit. ### Why It's less surprising than dropping pending operations on the floor if an instance is getting shut down. This mirrors the standard behavior of finishing handling pending requests before exiting -- we're just extending this a bit to include `after` tasks. ### How Previously `waitUntil` was just a noop in `next start`, so passing a promise to it did nothing. This PR changes the implementation to instead use an "awaiter" that stores promises passed to it and lets us wait for all of them to complete. We then use some existing `onCleanup` machinery to make sure that they're actually awaited before shutdown. Note that I've now made `NextServer.close()` execute before shutdown. This is notable because AFAICT this wasn't being called anywhere before, which is a bit suspicious. ### How (in a bit more detail) This is all a bit hard to follow so here's an overview of how it works: - We have two entrypoints: `startServer` and `NextCustomServer` - `startServer`: - creates a cleanup set (`AsyncCallbackSet`) - calls `createRequestHandlers`, which... - passes `onDevServerCleanup` to turbopack's hot reloader (previously `onCleanup`) - creates a `NextServer` - which will create a `NextNodeServer` - which sets up an `Awaiter` to ensure all `after` callbacks finished running. - adds a call to `NextServer.close()` to the cleanup set - when we receive SIGINT/SIGTERM, we run `NextServer.close()`, which runs `NextNodeServer.close()`, which waits for pending `after` callbacks to finish using the Awaiter. - `NextCustomServer`: - does basically the same setup with a cleanup set and `createRequestHandlers` - but it does not set up a SIGINT/SIGTERM handler to run the cleanups. instead, it expects the user to call its `cleanup()` method when appropriate (basically like we do in `startServer`) - i'm gonna do a follow up and update the custom server docs to reflect this - also going to try to warn if a cleanup was needed but the process exited without it calling it
Configuration menu - View commit details
-
Copy full SHA for 4055dd0 - Browse repository at this point
Copy the full SHA 4055dd0View commit details -
remove ResolvedVc from trait functions (#73270)
Clean up a bad refactor
Configuration menu - View commit details
-
Copy full SHA for 2efe544 - Browse repository at this point
Copy the full SHA 2efe544View commit details