- 25 Jul, 2023 6 commits
-
-
vercel-release-bot authored
-
JJ Kasper authored
We no longer handle basePath stripping further down in minimal mode so this prevents the re-adding we used to do. Manually tested with https://33-base-path-gsp-404-m8w6hhs1m-vtest314-ijjk-testing.vercel.app/docs/api/hello Fixes: [slack thread](https://vercel.slack.com/archives/C03F2CMNGKG/p1690309135573409)
-
Daniel authored
setLoading must be "true" at first and then set to "false". The documentation, as is, always has the value of setLoading set to "false". The purpose of this code is to show "...loading" on the screen while the data is being fetched. In order for this to happen, setLoading must be initially set to "true" and then (after the data is successfully loaded) set to "false", since the line `if (isLoading) return <p>Loading...</p>` is asking if the content is still loading, and if it is, it'll return a message indicating it. Because of this ### What? setLoading should be set to "true" at first. ### Why? Because the code then asks if the content is being loaded. The code (as is) always has setLoading set as "false" and it doesn't show the loading message when it's supposed to. ### How? I changed the line to `const [isLoading, setLoading] = useState(true)`. Co-authored-by:Steven <229881+styfle@users.noreply.github.com>
-
vercel-release-bot authored
-
Steven authored
- Closes #53044 Co-authored-by:ZYSzys <23313266+ZYSzys@users.noreply.github.com>
-
Balázs Orbán authored
### What? Allow the following: ```ts new NextRequest(new Request(...)) ``` ### Why? Cloning a request by passing it to the constructor of another `Request` is allowed by the spec: https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#parameters ### How? If the passed argument is an instance of `Request`, we pass it as-is to `super()` Fixes #52967 Closes NEXT-1468
-
- 24 Jul, 2023 16 commits
-
-
vercel-release-bot authored
-
JJ Kasper authored
These have been flaking for quite a while so skips them more consistently until they are investigated. x-ref: https://github.com/vercel/next.js/actions/runs/5650048471/job/15305721826#step:27:590
-
Steven authored
Previously, this warning message assumed the user knew what `yarn` was and had it installed. This PR changes the warning message to assume the user knows what `npm` is and has it installed, since `npm` ships with the official `node` installation.
-
Steven authored
This PR fixes an issue when `validate-docs-links` is run on a branch like `canary` instead of a branch from a PR. Example error message: https://github.com/vercel/next.js/actions/runs/5649063425/job/15302604957
-
Steven authored
This test was [sometimes failing]( https://github.com/vercel/next.js/actions/runs/5649220907/job/15303327768?pr=53130#step:27:230) because the `tsconfig.json` is [written as an empty object](https://github.com/vercel/next.js/blob/a26bac96048c7231271b5947eaf80241e94ca2fc/packages/next/src/lib/typescript/writeConfigurationDefaults.ts#L123-L125). This PR makes sure the test waits until the tsconfig.json file is written with the complete contents.
-
Jiachi Liu authored
### Why In #52985 the not found solution introduces `NODE_ENV` to determine if it his the not found boundary and should render the not found, as in the next build mode, we have `/_not-found` as a special route which has a empty parallel route, but in next dev mode so far it his the `parallel-default-route`. This could dependend on the `NODE_ENV` passing to next server but not necessarily. ### What Fixes #53082 Fixes #53083 ### How When server actions `not-found` hits, now we create a new loader tree based on the previous one, including `layout` and other components but not the children parallel routes For production case, to make the rendering independent from the `NODE_ENV`, we're using original pathname to check if it's `/_not-found` to determine if it's production build 404 page To support replace the loader tree of action, did a little refactor that passing down the loader tree from top level to `bodyResult`. Then we can change the loader tree itself before rendering, in short, we tweak it from original tree to one for not-found case, so server actions could render it properly
-
OJ Kwon authored
### What? closes WEB-1274. In effort to create feature parity to existing webpack/telemetry-plugin, this PR attempts to define a new struct `ModuleFeatureTelemetry` and emit it via resolve plugin, if module & its subpath matches to the existing plugin. next-dev (--experimental-turbo) now will emit telemetry payload with other output, however this PR does not actually `record` telemetry via `telemetry.record` since original webpack telemetry records it in prod build only.
-
Steven authored
This moves the [validate-docs-links.yml](https://github.com/vercel/next.js/blob/canary/.github/workflows/validate-docs-links.yml) file into the [build_and_test.yml](https://github.com/vercel/next.js/blob/canary/.github/workflows/build_and_test.yml) file so we can mark it as required by using the `needs` property.
-
Tobias Koppers authored
### What? move webpack specific code out of the `client/index.ts` file ### Why? sharing with turbopack. Avoiding extra shims to fake webpack.
-
Sukka authored
The PR replaces `chalk` inside `@next/codemod` with `picocolors`. Generally, `@next/codemod` is used through `npx`/`pnpx` as it serves as a sort of "one-time fix". By replacing `chalk` with the `picocolors` (which is 14 times smaller and 2 times faster), we can speed up the installation process of `npx @next/codemod`. Currently, `@next/codemod` has about 10k downloads per week, so I guess this PR is worth it: <img width="441" alt="image" src="https://github.com/vercel/next.js/assets/40715044/a32fd6e0-bbe6-48e8-985d-83393c141b23"> In my next PR, I will replace `chalk` inside `create-next-app` with `picocolors` as well.
-
Tobias Koppers authored
### What? * use the correct edge resolve options for SSR of client components ### Why? It need to use the edge import conditions here for https://github.com/vercel/next.js/pull/51083
-
Lee Robinson authored
Just needs a language
👍 -
Zack Tanner authored
Relands #52971 but with `node-linker=hoisted` to mimic the behavior of yarn classic (ie, doesn't create a symlink) - Original: https://github.com/vercel/next.js/pull/52971 - Revert https://github.com/vercel/next.js/pull/53032
-
vinay authored
-
Alex Kirszenberg authored
### What adds endpoints for `_app` `_error` and `_document` for pages Co-authored-by:Tobias Koppers <1365881+sokra@users.noreply.github.com>
-
-
- 23 Jul, 2023 4 commits
-
-
vinay authored
-
Paul Barry authored
## For Contributors ### Improving Documentation While working with a custom server, I noticed that [the list of available options within the codebase](https://github.com/vercel/next.js/blob/canary/packages/next/src/server/base-server.ts#L138-L180) was much larger than [the options listed within the docs](https://nextjs.org/docs/pages/building-your-application/configuring/custom-server). This PR extends the `next` import function options to include all of ~the allowed~ documented options from the codebase. - [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-guideCo-authored-by:
Lee Robinson <9113740+leerob@users.noreply.github.com>
-
Sungyun Hur authored
### What? Fix a typo in `08-parallel-routes.mdx` by adding a whitespace. ### Why? <img width="783" alt="스크린샷 2023-07-23 오후 4 11 22" src="https://github.com/vercel/next.js/assets/8033896/0bb92fc5-5a6f-4461-895a-a956abf52a9d"> ### How?
-
trigaten authored
Co-authored-by:Lee Robinson <me@leerob.io>
-
- 22 Jul, 2023 7 commits
-
-
akfm authored
### Why We calculate the “next url” depending on the router state and the previous router state so that when you navigate to a route, the proxy matches with that header and returns you the intercepted route if matching ### What - Fixes #52745 Co-authored-by:Jiachi Liu <4800338+huozhi@users.noreply.github.com>
-
Vu Van Dung authored
### Why? The code snippet in the Route handler `formData` documentation ```ts import { NextResponse } from 'next/server' export async function POST(request: Request) { const formData = await request.formData() return NextResponse.json({ formData }) } ``` is slightly wrong, because `formData` is not a plain object and hence `return NextResponse.json({ formData })` doesn't actually work. Since we are already in the topic of parsing `formData`, I also added a mention on `zod-form-data` which can be used to validate the form and parse it to non-string formats such as `number`. -
Shu Ding authored
This PR refactors some code specifically related to web stream utilities. Please read the review comments for more details.
-
Steven authored
We should unconditionally run this action so we can mark it as "required". It only takes about 13 seconds for each PR so it shouldn't put too much additional load on our CI infra. <img width="811" alt="image" src="https://github.com/vercel/next.js/assets/229881/5c8596e1-71be-4f09-ac29-e0c4a9f12253"> - Depends on the fix from https://github.com/vercel/next.js/pull/53021
-
兰天游 authored
-
vinay authored
`import { cookies } from 'next/headers'` -
Zack Tanner authored
This was causing issues with installing swc binaries (appears to be creating corrupt aliases in `node_modules/@next` rather than the actual resolved swc package) Since pnpm creates hard links on disk, the files being moved aren't the actual binaries, they're just aliases. And when tmpdir gets removed, the aliases point to nothing
-
- 21 Jul, 2023 7 commits
-
-
JJ Kasper authored
Reverts vercel/next.js#53016
-
vercel-release-bot authored
-
vercel-release-bot authored
-
Steven authored
This link is failing CI as seen here: https://github.com/vercel/next.js/actions/runs/5623454975/job/15238167610 ``` Error: The action could not create a Github comment because it is initiated from a forked repo. View the action logs for a list of broken links. This PR introduces broken links to the docs: ┌─────────┬───────────────────────────────────────────────────────────────────────────────┬──────┬─────────────────────────────────────────────────────────────────────────────────────┐ │ (index) │ link │ type │ docPath │ ├─────────┼───────────────────────────────────────────────────────────────────────────────┼──────┼─────────────────────────────────────────────────────────────────────────────────────┤ │ 0 │ 'app/building-your-application/configuring/typescript#statically-typed-links' │ │ 'docs/02-app/01-building-your-application/01-routing/03-linking-and-navigating.mdx' │ └─────────┴───────────────────────────────────────────────────────────────────────────────┴──────┴─────────────────────────────────────────────────────────────────────────────────────┘ Error: This PR introduces broken links to the docs. The action could not create a Github check because it is initiated from a forked repo. Error: Process completed with exit code 1. ```
-
Zack Tanner authored
-
JJ Kasper authored
Temporarily reverts these changes to allow patch release first. Reverts: https://github.com/vercel/next.js/pull/52149 Reverts: https://github.com/vercel/next.js/pull/52492
-
Jiachi Liu authored
Reland #52790 Reverts vercel/next.js#52977 was failed due to failed job [vercel/next.js/actions/runs/5616458194/job/15220295829](https://github.com/vercel/next.js/actions/runs/5616458194/job/15220295829) Should be fine to resolve with https://github.com/vercel/next.js/pull/52979 now Fixes #52718 Fixes #52739 --------- Co-authored-by:
Alex Kirszenberg <alex.kirszenberg@vercel.com> Co-authored-by:
Tobias Koppers <tobias.koppers@googlemail.com>
-