- 21 Aug, 2023 17 commits
-
-
vercel-release-bot authored
-
JJ Kasper authored
This ensures we properly populate locale information with `skipMiddlewareUrlNormalize` enabled as we shouldn't provide incorrect values even if we are skipping normalizing. Fixes: https://github.com/vercel/next.js/issues/53646
-
Sloane Sturzenegger authored
fixes issue #44141 , discussion #44148 This is missing and has caused me issues in production. Seems like a great polyfill to have, given that Next already polyfills so many adjacent Array methods. ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [x] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by:
Eyas Valdez <37156127+spiltbeans@users.noreply.github.com> Co-authored-by:
JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
Dima Voytenko authored
The test mode should allow interception of all fetches made by the server, including rewrites. --------- Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
-
Dima Voytenko authored
Examples of the output with this change: <img width="346" alt="image" src="https://github.com/vercel/next.js/assets/726049/6f8b94ea-5890-401a-9760-15af38ea4f0c">
-
JJ Kasper authored
We don't need to apply this check for non-dynamic app routes so this adds a check to skip it when not necessary. x-ref: [slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1692366432958709) --------- Co-authored-by:
Zack Tanner <zacktanner@gmail.com>
-
Jiachi Liu authored
Can't repro anymore, add a test case for issue 45189 Closes #45189 Closes NEXT-1396
-
JJ Kasper authored
Fixes this build error on windows due to invalid path: ```sh Error: error: invalid path 'test/e2e/app-dir/app/app/bootstrap/[[...*]]/ClientComponent.js' Error: The process 'C:\Program Files\Git\cmd\git.exe' failed with exit code 128 ``` x-ref: https://github.com/vercel/next.js/actions/runs/5930602201/job/16080672888#step:7:62
-
Zack Tanner authored
A long-running server action shouldn't block page navigation. This makes use of a global mutable to detect when a navigation event occurs -- this change will unblock other reducers (such as navigation). If we bailed on the action, we trigger a `router.refresh()` to ensure any side effects from the action are refetched. Closes NEXT-1131 Fixes #49425
-
OJ Kwon authored
### What? Came to realize it might be useful to upload full trace. This is avoided by default as trace might grow excessively, however might be useful to audit individual trace if it can be uploaded. Closes WEB-1416
-
Josh Story authored
in #54059 the nonce attribute was added to preinitialized scripts to when using this CSP directive. The test added asserts there is at least one script that has the nonce attribute. I've changed this to 2 because currently our builds produce at least two "main" scripts, the main chunk and the webpack runtime. The way we bootstrap there is always exactly one bootstrap script which means if we only assert that there is one script with a nonce we might not be asserting anything about the preinit script path. If we ever update our webpack config to produce a single main script this test will fail but we should never do that (it's bad for caching) and so it shouldn't happen and if it does it will hopefully force us to consider if we're making a mistake Additionally I've added another test that is more e2e. it asserts that the page bootstraps even when using CSP (in prod). In Dev it asserts the CSP attributes but it expects the bootstrap to fail because our dev mode violates the CSP directive with eval.
-
Mohamed A. Salah authored
When I try to deploy to Google Cloud Run it fails after some investigation I saw this line in .next/standalone/server.js ```javascript const hostname = process.env.HOSTNAME || 'localhost' ``` This some how make this log when i run docker ```shell - ready started server on 172.17.0.2:3000, url: http://172.17.0.2:3000 ``` I don't know why it's logging this address even if the server running on localhost. So this my fix Set hostname to 0.0.0.0 to avoid deployment failing on Google cloud run.
-
Delba de Oliveira authored
Fix broken links picked up by crawl-analysis: https://vercel.slack.com/archives/C03S9JCH2Q5/p1692621216597749
-
Tooooooooon authored
Co-authored-by:Michael Novotny <446260+manovotny@users.noreply.github.com>
-
Steven authored
There are a few cases that are not handled by App Router when using `output: export` config. A few of them are expected, but some are yet to be implemented. Regardless of the intent of the future, this PR ensures the error messages match what was documented to be [unsupported](https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features). - Documentation: https://github.com/vercel/next.js/pull/53592 - Issue: #48022
-
Lee Robinson authored
This PR updates the `cms-contentful` example to use: - App Router - TypeScript - Draft Mode (previously Preview Mode) - ISR / Data Cache (revalidations through `revalidateTag`) Further, it combines many separate files into more manageable single files, and tries to better bucket provider-specific logic into the `lib/` folder. I'm hoping this can be the foundation for re-writing the rest of the `cms-*` examples to use App Router. Overall, the code is much easier to reason about IMO. Pretty happy with the change. I sprinkled some `any`'s throughout here, but if someone wants to make it better, go for it! https://app-router-contentful.vercel.app/
-
- 20 Aug, 2023 10 commits
-
-
Laurent Thiebault authored
docs: update a small typo in `02-app/01-building-your-application/06-optimizing/01-images.mdx` (#54311) Hello, I just make this PR because the `/me.png` example is not in "remote images" section but in "local images", that's why I propose to edit this :) Thank you! ### 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
-
Shu Ding authored
Similar to #54004, this PR changes `private-next-rsc-action-validate` and `private-next-rsc-action-client-wrapper` to export named values instead of default values. In #54230 (currently broken), the Server Action file was bundled via Vite/Rollup as an external dependency so we're not doing the ESM interoperation correctly. Closes #54230.
-
Nikhil Bhargava authored
Fixes #54055. A bug recently introduced in https://github.com/vercel/next.js/pull/53705 made it so that we were now preinitializing some of our scripts slightly better, but in doing so, we failed to pass in a nonce. This broke nonce-based CSP usage. The fix was to add the `nonce` to our `ReactDOM.preinit` calls. Manual testing shows that this change fixes the error and the nonce is now passed in as expected. Co-authored-by:
Dan Ott <360261+danieltott@users.noreply.github.com>
-
vercel-release-bot authored
-
Jimmy Lai authored
This PR changes the heuristic in the client cache to only check and show the prefetched data when it was prefetched or last read 30s ago vs keeping it around as long as it was accessed within 30s.
-
Tim Neutkens authored
Noticed these arrays don't actually do anything specific, removed them. Update: After the multi-zone test failed it seems this was added to ensure you can run multiple Next.js instances in the same process, this simplifies it a bit and adds a comment explaining why it's called.
-
Donny/강동윤 authored
### What? Update swc crates to https://github.com/swc-project/swc/commit/becea47a2dba1000791fecb13f93bebcdb0a5cf7 ### Why? x-ref: https://vercel.slack.com/archives/C02HY34AKME/p1692293544442219 ### How? Closes WEB-1410
-
Jiachi Liu authored
### What & Why Add base path handling for the url in redirect error if the `basePath` is configured. This is only break for server rendering case as the `basePath` is missing in the `Location` header. When running `next build`, everything is managed well with app router and base path on client side so it didn't break. ### How Adding `basePath` if it's presented for `Location` header. Update the `RenderOpts` type as basePath is already passed down in it, also update them for turbopack entries Fixes #54163 Closes NEXT-1529
-
Jiachi Liu authored
### What & Why emotion-js has its own [jsx transform](https://emotion.sh/docs/typescript#emotionreact) which is being applied when `compiler.emotion` is enabled in `next.config.js`. Thanks to emotion-js team that provided an emotion-js example setup with app router [here](https://github.com/emotion-js/emotion/issues/2928#issuecomment-1319792703), so that we can use it as test example with app router. Based on the setup, we create a test case working with emotion js but failed with error mentioned in #41994 that some client hooks appearing in server components. That is because the emotion-js jsx factory includes some client hooks. ### How For server components, css-in-js is not recommended to apply so we disabled the transform before, the emotion jsx factory is a separate config that should also not be applied in server components. So in this case we still use react jsx factory instead of the emotion-js one for server components then it won't error. The test case can also be used as an example for basic emotion-js use case with app router. Fixes #41994 Closes NEXT-1368
-
Joseph authored
### What? Docs change. ### Why? - https://github.com/vercel/next.js/issues/54269 ### How? Bump the Node.js version shown at: https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#nodejs-version Fixes #54269
-
- 19 Aug, 2023 4 commits
-
-
Jiachi Liu authored
In the past few rounds of improving metadata image routes bundling, we have improved the bundling strategy and also updated [the usage tutorial of using custom fonts in og image routes](https://vercel.com/docs/functions/edge-functions/og-image-generation/og-image-examples) which should load the font in the image route handler. Adding some tests to ensure custom fonts are working with metadata Closes #48081
-
Zack Tanner authored
This adds an `--experimental-https` flag to `next dev` which will generate a self-signed certificate via [mkcert](https://github.com/FiloSottile/mkcert) and use it for the dev server. also supports passing in pre-existing certs via `--experimental-https-cert` and `--experimental-https-key` x-ref: https://github.com/vercel/next.js/discussions/33768 https://github.com/vercel/next.js/discussions/10935
-
Vercel Release Bot authored
This auto-generated PR updates font data with latest available
-
vercel-release-bot authored
-
- 18 Aug, 2023 9 commits
-
-
vercel-release-bot authored
-
Corey Larson authored
Fixes https://github.com/vercel/next.js/issues/54240 The Link component in App Router is not respecting `scroll-behavior: smooth` when only the hash changes. It appears to be caused by `focusAndScrollRef.onlyHashChange = false` being set before `handleSmoothScroll` is called, causing `htmlElement.style.scrollBehavior` to be overridden to `auto` before `scrollIntoView` is called. Moving `focusAndScrollRef.onlyHashChange = false` to after `handleSmoothScroll` invocation resolves the issue.
-
Shu Ding authored
This fixes the compilation of `export { action as renamed }` syntax. Previously it's compiled as `export var action = ...` and with this fix, it will be `export var renamed = ...`. Closes #54229. -
-
David Goguen authored
Image Optimization API currently does not work if a custom loaderFile is specified in next.config.js, even if loader is explicitly set to 'default', because it is currently being overridden to 'custom' simply because a loaderFile is specified. This is unnecessary and causing the Image Optimization API routes not to be initialized since the change to the config happens before the routes are initialized. [Sandbox Reproduction](https://codesandbox.io/p/sandbox/purple-pine-t7hhgl?file=%2Fimage-loader.js%3A8%2C1) - Fixes #53415
-
Balázs Orbán authored
Running the action added in #53541 on forks will result in always failing, so we can skip it. Fixes #54210
-
vinay authored
Fixes #54223
-
Jiachi Liu authored
For group routes, unlike normal routes, the root layout is located in the "group"'s segment instead of root layer. To make it also able to leverage the default not found error component as root not found component, we need to determine if we're in the root group segment in the loader tree, and add the not-found boundary for it. If you compre the loader tree visually they will look like this: Normal route tree structure ``` ['', { children: [segment, {...}, {...}]}, { layout: ..., 'not-found': ... } ] ``` Group routes ``` ['' { children: ['(group)', {...}, { layout, 'not-found': ... }]} {} ] ``` Comparing to normal case, we go 1 layer down in the tree for group routes, then insert the not-found boundary there Fixes #52255 Closes NEXT-1532 -
Shu Ding authored
This PR removes our client module reference proxy implementation to directly use the one from the upstream Flight server, as it's added here: https://github.com/facebook/react/pull/27033. Also updated the server reference creation code a bit to use `defineProperties` - we can't switch to the upstream `registerServerReference` API yet as our Server Actions compiler needs to change a bit to adapt that API since we might have existing `bound` and/or `originalAction` provided.
-