forked from vercel/next.js
-
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 #354
Open
pull
wants to merge
10,000
commits into
Mement-Mori:canary
Choose a base branch
from
vercel:canary
base: canary
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,562,071
−665,987
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ijjk
force-pushed
the
canary
branch
3 times, most recently
from
December 2, 2022 05:49
e078ebe
to
6b863fe
Compare
## Summary Delete an incorrect link and update a right 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: JJ Kasper <jj@jjsweb.site>
When `pages/500` uses `getStaticProps` we can honor statically generating the page but we can't send a `Cache-Control` with `stale-while-revalidate` as we shouldn't be caching errored pages ever. This ensures we handle that case and add a regression test for it.
## Summary The old analyze command use `yarn build`. This happens an error with node, pnpm and bun. ### 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
## Summary According to [Adding examples](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md), `auth-app` project name is needed. ### 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 <!-- 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: JJ Kasper <jj@jjsweb.site>
This auto-generated PR updates font data with latest available
"like" => "likely"
The Google fonts API requires this. Previously, `get_stylesheet_url` trusted that the weight axis inputs were sorted correctly, which they may not be. This PR creates and uses two new enums: - `FontAxesWeights`, to capture weights as ints, and moves the responsibility of sorting weights into `get_stylesheet_url` itself. - `VariantValue` to wrap each value for variants, as these can be either a string (an expression representing a variable font weight range) or a `u16`, representing a fixed font weight. This allows us to defer stringifying these until format time while still comparing them for ordering. Test Plan: Added a unit test for `get_stylesheet_url`. Closes PACK-3359
We already propagate tags from `fetch` calls to the work unit store. For `revalidateTag` to work properly for `fetch` calls in `"use cache"`, we also need to consider the other direction, and add tags from the work unit store to the tags that are used for the fetch cache entry in the cache handler. fixes #71924
This PR clarifies scroll behavior when components are added to a page that do not contain visible elements. This PR adds a note to the `Link` docs explaining how Next.js traverses the DOM and bypasses certain components looking for a scrollable element. Fixes: https://linear.app/vercel/issue/DOC-3391/add-guidance-on-metadata-placement-and-page-scroll-with-link --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
### Description: This PR updates the Dockerfile in the `examples/with-docker` folder to include the `.npmrc` file in the dependency copy command. ### Original Command: ```dockerfile # Install dependencies based on the preferred package manager COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ ``` ### Updated Command: ```dockerfile # Install dependencies based on the preferred package manager COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc ./ ``` ### Reason for Change: Including `.npmrc` allows for custom npm configurations, such as `legacy-peer-deps=true`. Without this option, some installations can fail due to unresolved peer dependencies, particularly for projects with older dependencies. This update ensures that any additional configurations specified in `.npmrc` are applied during installation, improving Docker build consistency and stability for projects with custom npm requirements. ### Diff: ```diff - COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ + COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc ./ ``` --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
…operty (#72079) ## What The way Next.js re-defines a global `WebSocket` property makes it non-configurable. No other agents, such as API mocking libraries, are able to re-defined it. This [causes issues](mswjs/msw#2339) for Next.js users. # Why Because the way the `WebSocket` property descriptor is set in Next.js doesn't allow that property to be configured anymore (and neither does it have a setter): https://github.com/vercel/next.js/blob/de4f197e2fde19526ee019fbebb068e962b58fc0/packages/next/src/server/node-environment-baseline.ts#L11-L15 ## How This can be solved by setting `configurable: true` on the object descriptor. Generally, I'd advise against such restrictive descriptors for globals Next.js doesn't own, like fetch or WebSocket. Try adhering to how such globals are defined in Node.js—configurable and often with setters: ``` > Object.getOwnPropertyDescriptor(global, 'WebSocket') { get: [Function: get WebSocket], set: [Function: set WebSocket], enumerable: false, configurable: true } ```
## 📚 Improving Documentation Hello, I've fixed `testing` to `Testing`. (lowercase to uppercase) ![image](https://github.com/user-attachments/assets/3d3198cf-e750-4957-b436-1e964d6976e9) In other documents, `T` is always uppercase as shown in the screenshot above. Co-authored-by: JJ Kasper <jj@jjsweb.site>
## 📚 Improving Documentation Hello, I’ve updated the `02-jest.mdx` documentation with the following improvements: 1. I added the comment, `"The content of this doc is shared between the app and pages router."` This document is used by both the Pages Router and App Router, and I found this comment in other files within the `docs` directory. 2. ~~I introduced `<PagesOnly>` and `<AppOnly>` components. Previously, when clicking links in the App Router page, it would navigate to the Pages Router documentation. I’ve modified this so that links open in the App Router documentation when viewed there.~~ 3. Additional typo corrections: 1. Removed colons (`:`) from headings, as they aren’t used in other docs. 2. Added missing double quotes (`"`). --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
current [link](https://workos.com/docs/user-management) for WorkOS point to Node.js document, This update ensures all links lead directly to their respective Next.js integration pages. Also updated link for Stytch and Kinde auth link to point to appropriate docs page. Co-authored-by: JJ Kasper <jj@jjsweb.site>
For a given path expression, we want it to optionally match a `.json` suffix. However, the original implementation was flawed: The path `/:id` was altered to `/:id(.json)?`, which then converted to the Regex pattern `^(?:\/(.json))?[\/#\?]?$`. This Regex incorrectly matched only `/` or `/_json` — clearly not the intended result. The fix involved adjusting the way we append the `.json` suffix. Instead of `/:id(.json)?`, we now use `/:id{(\\.json)}?`, which converts to the Regex `^(?:\/([^\/#\?]+?))(\.json)?[\/#\?]?$`. This pattern correctly matches both cases, with or without the `.json` suffix. ----- Fixes #53840 Fixes #55558 Closes DX-2088
## 📚 Fixed typos Hello, I've fixed redundant double space in `middleware-plugin.ts`. I think it is a typo. Co-authored-by: JJ Kasper <jj@jjsweb.site>
### What? This PR updates the Edge Runtime documentation to clarify the use of capitalization and improves formatting consistency. ### Why? To maintain documentation clarity and consistency, ensuring accurate information and readability across the documentation. --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
The "Examples" heading was not being rendered correctly [on this docs page](https://nextjs.org/docs/app/api-reference/file-conventions/page#displaying-content-based-on-params). All this does is fix the whitespace character to allow the MDX to be rendered properly. Co-authored-by: JJ Kasper <jj@jjsweb.site>
If a user creates a custom fetch implementation in module scope, the logic to preload entries during `next start` will result in fetch not being patched before the userland implementation. As a result, it won't opt into any caching heuristics from our patched fetch. Fixes #71881 (in addition to the other PR in this stack)
## Description At #72178, [ESLint](https://nextjs.org/docs/app/api-reference/config/eslint) docs was moved. So update the old URLs. ### 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: Zack Tanner <1939140+ztanner@users.noreply.github.com>
# Summary Update [`example.test.ts`](https://github.com/vercel/next.js/blob/canary/test/examples/examples.test.ts) and [`turbopack-dev-examples-manifest.json`](https://github.com/vercel/next.js/blob/canary/test/turbopack-dev-examples-manifest.json) by removing deleted examples. ## Descriptions [examples: cleanup #57845](#57845) deleted ... - amp-first - amp-story - data-fetch - fast-refresh-demo - hello-world-esm - progressive-render - using-router - with-app-layout - with-env-from-next-config-js - with-loading [updated the example of modularize-imports to utilize the App Router #69771](#69771) deleted ... - modularize-imports [docs: Add docs on CSP and nonce generation #54601](https://github.com/vercel/next.js/pull/54601/files) deleted ... - styled-jsx-with-csp [Updated the example of with-draft-js to utilize the App Router. #70045](#70045) deleted ... - with-draft-js [Remove deprecated library example #62813](#62813) deleted ... - with-react-with-styles [Remove with-reasonml-todo example #62812](https://github.com/vercel/next.js/pull/62812/files) deleted ... - with-reasonml-todo [Remove with-semantic-ui example #62811](https://github.com/vercel/next.js/pull/62811/files) deleted ... - with-semantic-ui [Updated the example of with-vercel-fetch to utilize the App Router. #70069](#70069) deleted ... - with-vercel-fetch Co-authored-by: JJ Kasper <jj@jjsweb.site>
## Description At #72178, [TypeScript](https://nextjs.org/docs/app/api-reference/config/typescript) docs was moved. So update the old URLs. ### 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: Zack Tanner <1939140+ztanner@users.noreply.github.com>
### What? switches the database for persistent caching from lmdb to rocksdb. ### Why? * No preallocated sparse file which cause problems * Compression support * Multiple files instead of a big single file * Better performance
## Why? The current error message when you have have a set `weight: ['400', '700']` and set `axes: ['wdth']` for a variable font is confusing—it should mention to correct your weight property (e.g., `weight: 'variable'` or nothing at all for `weight`). - Fixes #72413
Need to investigate why this flakes only in Turbopack. Disabling in that context for now.
Adds tracing settings to the various contexts that are used for nft There are cases where we need to know whether tracing is useful, this PR sets up that state ahead of the next one(s) which actually take advantage of them. Closes PACK-3377
This PR updates the server actions error handling section to remove advising using a try catch, in favor of linking to the Error Handling docs, which has the correct information. <!-- 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? * add load speed and total time * reuse buffer while loading * performance with parallelisation * allow to disable corrected time for performance reasons * parallelize graph creation
…adings in TS and ESLint config pages (#72465) This PR: - Moves `next.config.js` options under a "config" folder which includes references for other configuration such as the ESLint plugin. I figure it would be tidier than having "Next.config.js Options" and "Config" in the API reference. - Fixes the issue with the "config" folder not showing up in canary: https://linear.app/vercel/issue/DOC-3749/bug-figure-out-why-new-config-folder-isnt-showing-up-in-the-canary - Fixes the indentation issues and missing example header (caused by an invisible character). Redirects: vercel/front#38704
### What? Adds a TODO for a low hanging performance fruit
## Description Follow up #72391. I missed some error pages. ### 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 <32464864+delbaoliveira@users.noreply.github.com>
Hi, Team. I'd like to contribute as removing unnecessary fragments. I believe that the fragment will create one more grouping node on virtual dom, which is not necessary on this example. If it is essential, please kindly let me know why. Thank you so much for your support. ### Improving Documentation - remove unnecessary fragment tags Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
…d-mutations.mdx (#72496) #### Description: - fix grammatical error: remove unnecessary 'a' Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
This PR fixes a broken link. In my language (Japanese), MDN redirects were not functioning correctly, so I replaced them with appropriate links. https://developer.mozilla.org/docs/Web/Events/popstate redirects https://developer.mozilla.org/ja/docs/Web/Events/popstate (404) Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
## Description [create-playwright](https://github.com/microsoft/create-playwright) makes the below special `.gitignore` file. ```txt node_modules/ /test-results/ /playwright-report/ /blob-report/ /playwright/.cache/ ``` It's good to add these files to .gitignore for convinience. ### 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: JJ Kasper <jj@jjsweb.site>
…l!()` (#72487) Early returns should use `anyhow::bail!()`. Ran ast-grep with ```bash sg run --lang rust --pattern 'return Err(anyhow!($$$ARGS));' --rewrite 'anyhow::bail!($$$ARGS)' --update-all && sg run --lang rust --pattern 'return Err(anyhow::anyhow!($$$ARGS));' --rewrite 'anyhow::bail!($$$ARGS)' --update-all && cargo fmt ``` Manually cleaned up unused import warnings (second commit) because `cargo fix` hangs (idle, no CPU usage) about halfway through our build, and I'm not sure why. I tested the latest nightly, and it hangs too.
The path to the export from the `dist` directory currently doesn't resolve.
...and use test patterns more consistently
Bumps `edge-runtime` (and friends to not duplicate dependencies further) to include vercel/edge-runtime#1023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )