- 17 Mar, 2023 25 commits
-
-
JJ Kasper authored
-
Shu Ding authored
This Webpack loader rule should have the exactly same conditions as https://github.com/vercel/next.js/blob/828fd5a162b02c41cbfbef539688ae454594f24c/packages/next/src/build/webpack-config.ts#L1940-L1951 Except that it matches 2 special layers and an extra loader.
-
Steven authored
Follow up to #47219
-
Steven authored
- Closes #43096 - Available since Chrome 101: https://chromestatus.com/feature/5273474901737472 - Coming to Safari: https://bugs.webkit.org/show_bug.cgi?id=252739 - Introduction blog: https://web.dev/priority-hints/ fix NEXT-319 ([link](https://linear.app/vercel/issue/NEXT-319))
-
JJ Kasper authored
This ensures revalidate can be fetch specific instead of cache key specific and adds a test case to ensure config based revalidate isn't overridden by fetch based revalidate.
-
Jiachi Liu authored
* Add `manifest.webmanifest` and `manifest.(j|t)xs?` support for manifest.json route * Add `Manifest` type for it for autocomplete purpose. Remove the exports for `SitemapFile` and `RobotsFile` globally, will discuss how to re-export them with better naming later Small fix for `Robots` typing, should allow `string | string[]` for user agent of single Robots Closes NEXT-839 ---------
-
Lee Robinson authored
There has been some helpful [discussion on Twitter](https://twitter.com/dan_abramov/status/1636778278882099216) around this page of documentation. I refactored the introduction to make it more clear that you also get to use SPA features when doing a static export, and underscoring the value of being able to deploy/host virtually anywhere with this approach. Co-authored-by:
Steven <229881+styfle@users.noreply.github.com>
-
Wyatt Johnson authored
This serves to correct a specific issue related to multiple locales being specified in the pathname as well as some general i18n improvements. - Multiple locales are now parsed correctly (only taking the first locale, treating the rest of the string as the pathname) - `LocaleRouteNormalizer` has been split into `I18NProvider` and `LocaleRouteNormalizer` (tests added) - Adjusted the `I18NProvider.analyze` method (previously `LocaleRouteNormalizer.match`) to require the `defaultLocale: string | undefined` to ensure consistent behaviour - Added more comments around i18n
-
AdamKatzDev authored
Resolves #39689, partially resolves #28642 (see notes below) Inspired by #44627 In #28642 it was also asked to expose `server.headersTimeout`, but it is probably not needed for most use cases and not implemented even in `next start`. It was needed to change this option before https://github.com/nodejs/node/issues/27363. There also exists a rare bug that is described here https://github.com/nodejs/node/pull/32329#issuecomment-614119125. To fix this exposing `server.headersTimeout` might be required both in `server.js` and in `next start`. Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Mrugesh Mohapatra authored
<!-- 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 or adding/fixing 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 # --> Fixed a typo in the warning message for the experimental.runtime check
-
Shu Ding authored
Currently all import CSS resources, including CSS modules, are imported lazily. This means that they can't be chunked as by definition of "lazy" they can be loaded separately. This PR changes it to always use "eager" so if they're in the same entry, these CSS resources can be chunked together and reduce the total amount of requests. However the downside will be tree shaking, as not all modules in a chunk are used by one entry. Two entries can only share a part of it. Since CSS modules won't have side effects this should be a good trade off. ## Bug - [ ] Related issues linked using `fixes #number` - [x] 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. - [ ] 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:
JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
Shu Ding authored
Currently if `notFound()` or `redirect()` is called when the shell was already sent out, we can no longer change the status code and head tags. In that case we inject these specific meta tags into the HTML stream so specific agents can read them. fix NEXT-220 ([link](https://linear.app/vercel/issue/NEXT-220))
-
Jiachi Liu authored
Generated metadata icons through api routes instead of using webpack emitting file. Each metadata image file will go through `next-metadata-image-loader` to get the image basic info, and then it will go through `next-metadata-route-loader` to be converted as a routes. Related to NEXT-264 Closes NEXT-810
-
Tim Neutkens authored
-
Gal Schlezinger authored
This PR enables Node.js core modules in edge runtime by leaving a `require` statement in the output source as externals - [x] buffer - [ ] async_hooks - [ ] util - [ ] assert - [ ] events
-
Tobias Koppers authored
### What? add reason of compilation to the `updated in` message.  ### Why? the general update in message is confusing and didn't show what is happening. Sometimes people are confused why turbopack compiles something. The new messages explain that turbopack timings measure request handing duration in addition to pure compilation time. ### How? depends on https://github.com/vercel/turbo/pull/4208 fixes WEB-722
-
Felipe Saldanha authored
-
Tim Neutkens authored
-
Tobias Koppers authored
## Features * https://github.com/vercel/turbo/pull/4208 ## Testing * https://github.com/vercel/turbo/pull/4211Co-authored-by:
Justin Ridgewell <112982+jridgewell@users.noreply.github.com>
-
Justin Ridgewell authored
The old `test_generator::test_resources` could only find resources relative to the project root, and not relative to the test file. Because of the new nextpack directory structure, this causes all kinds of headaches between running in nextpack and running in turbo (`next.js/packages/next-swc` vs `nextpack/next.js/packages/next-swc`).
-
-
Shu Ding authored
When calling the server (via `callServer`), we concat all closure values (`$$bound`) and arguments of the function call into one array on the client. Hence on the server, we will have to compile the function differently to support that. With this change, the compiled function will have a `$$with_bound` flag to indicate that if it accepts closure values. If so, the only argument passed will be an array like `[...bound_values, ...fn_args]`, and we compile the function parameters to `(closure, arg1 = closure[N], arg2 = closure[N + 1], ...)` where `N` is the number of the closure identifiers. This way we can still fill these arguments by only pass an "bound + args" array. If it doesn't accept closure values, it will be directly called with `...fn_args` so no compilation change needed. The reason that we use `arg1 = closure[N]` is that this can support complex patterns in parameters such as `f(closure, {a} = closure[1], [b] = closure[2])`. fix NEXT-487 ([link](https://linear.app/vercel/issue/NEXT-487)) -
Franktronics authored
Simple correction of a word in the comments
-
Shu Ding authored
This PR makes sure that `callServer` is specified in all Flight response creation calls. Added a test to cover HMR. https://vercel.slack.com/archives/C03KAR5DCKC/p1678997184339409
-
- 16 Mar, 2023 15 commits
-
-
Steven authored
In the case when the user configured `output: export` and used an API Route Handler that cannot be converted to static, Next.js must throw an error. fix NEXT-823 ([link](https://linear.app/vercel/issue/NEXT-823))
-
Tim Neutkens authored
-
Tim Neutkens authored
Ensures that using `searchParams` opts into dynamic rendering. Fixes #43077 fix NEXT-601 ([link](https://linear.app/vercel/issue/NEXT-601)) <!-- 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: --> ## Bug - [ ] 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. - [ ] 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)
-
Leah authored
It was complaining about having 2 versions of sentry for some reason
-
Shu Uesugi authored
x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1678838567947919) Follow-up to https://github.com/vercel/next.js/pull/46317. The issue is that, if: - `experimental.clientRouterFilter` is enabled - `i18n` is enabled with `defaultLocale` set - Next.js router navigates to a path that (1) is the same as `defaultLocale` and (2) will be redirected, then: - **Expected:** Should hard-navigate to this path without any locale prefix (and then redirect occurs) - **Actual:** Hard-navigates to this path with `defaultLocale` prefix, even though it's not needed (and then redirect occurrs) ### Solution This PR fixes the above issue by adding `defaultLocale` to `addLocale` which is passed to `handleHardNavigation`. [`addLocale` skips adding the locale if `locale` is equal to `defaultLocale`](https://github.com/vercel/next.js/blob/02125cf3b1dfba52b240fd6e0f959d896e4b6195/packages/next/src/shared/lib/router/utils/add-locale.ts#L17). ### Fixing a bug - [x] Related issues linked using `fixes #number` - [x] Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjsCo-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Jiachi Liu authored
* Rename client reference plugins from `Flight*` to `ClientReference*` * Rename `serverComponentManifest` to `clientReferenceManifest` * Group the key/value in client reference manifest * Update turbopack crates
-
Jan Kaifer authored
-
Will Binns-Smith authored
fix NEXT-827 ([link](https://linear.app/vercel/issue/NEXT-827)) This aligns use of the next/font transform across the workspace under a single crate, now called `next-transform-font`.
-
Balázs Orbán authored
### What? This PR introduces a new `--tailwind` flag to the `create-next-app` CLI, to make it easier to bootstrap a Next.js app with Tailwind CSS pre-configured. This is going to be the **default**. To opt-out of Tailwind CSS, you can use the `--no-tailwind` flag. ### Why? Tailwind CSS is one of the most popular styling solutions right now, and we would like to make it easier to get started. Currently, the closest you can come to this is by running `pnpm create next-app -e with-tailwindcss` which will clone the https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss example. But that example is not configured for the App Router. This PR will let you add Tailwind CSS to both `app/`, `pages/`, and start out with TypeScript or JavaScript via the CLI prompts. (Some community feedback https://twitter.com/dev_jonaskaas/status/1632367991827443713, https://twitter.com/samselikoff/status/1634662473331617794) ### How? We are adding 4 new templates to the CLI bundle. > Note: The styling is not pixel-perfect compared to the current templates (using CSS modules) to require fewer overrides, but I tried to match it as close as possible. Here are a few screenshots: <details> <summary><b>Current, light</b></summary> <img src="https://user-images.githubusercontent.com/18369201/224733372-9dba86fe-9191-471d-ad9f-ab904c47f544.png"/> </details> <details> <summary><b>Tailwind (new), light</b></summary> <img src="https://user-images.githubusercontent.com/18369201/224733610-038d9d0f-634d-4b69-b5c2-a5056b56760c.png"/> </details> <details> <summary><b>Current, dark, responsive</b></summary> <img src="https://user-images.githubusercontent.com/18369201/224733790-9b4d730c-0336-4dbe-bc10-1cae1d7fd145.png"/> </details> <details> <summary><b>Tailwind (new), dark, responsive</b></summary> <img src="https://user-images.githubusercontent.com/18369201/224734375-28384bbc-2c3a-4125-8f29-c102f3b7aa1d.png"/> </details> #### For reviewers This introduces 4 new templates, with a very similar code base to the original ones. To keep the PR focused, I decided to copy over duplicate code, but we could potentially create a shared folder for files that are the same across templates to somewhat reduce the CLI size. Not sure if it's worth it, let me know. Probably fine for now, but something to consider if we are adding more permutations in the future. --- ~Work remaining:~ - [x] app+ts - [x] layout - [x] dark mode - [x] media queries - [x] animations - [x] app+js - [x] pages+ts - [x] pages+js - [x] prompt/config - [x] deprecate Tailwind CSS example in favor of CLI - [x] update docs - [x] add test - [x] add [Prettier plugin](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) Closes NEXT-772 Related #45814, #44286
-
Tobias Koppers authored
### What? Improve the UX of the error overlay ### Why? * error overlay doesn't reopen when closed, but new error appear * error overlay shows non-actionable warnings in node_modules * error overlay shows unrelevant errors in node_modules ### How? * low priority for errors in node_modules * hide node_modules warnings * open error overlay on new error * Also updated the files I touched to the next.js prettier format fixes WEB-712 fixes WEB-713 fixes WEB-714 fixes WEB-727 Co-authored-by:Leah <8845940+ForsakenHarmony@users.noreply.github.com>
-
Shu Ding authored
This PR makes sure that we are not appending statements after the function or arrow expression, if they're actions. Instead we put all them in a `ParenExpr` so the entire thing can be defined inline. fix NEXT-813 ([link](https://linear.app/vercel/issue/NEXT-813))
-
Jiachi Liu authored
Previously when we move to metadata images to custom app routes, when the image files get imported, it matches the `next-image-loader` rule which accidentally generate a static file into media. This PR appends the metadata reource query to the imported rerource, and then skip in the `next-metadata-route-loader` so they won't get applied by image loader or emit any unexpected assets
-
Tim Neutkens authored
Ensures `router.refresh()` matches the upcoming `revalidatePath('/')` api. This also ensures that when server context has changed it applies to all routes, not just the one that triggered the refresh. - When `router.refresh()` is called we fetch the full RSC payload from the server (root layout till the page) - The client-side router cache is fully invalidated, effectively making it empty - The client-side router prefetch cache is fully invalidated, effectively making it empty - RSC payload is applied to the state fix NEXT-590 ([link](https://linear.app/vercel/issue/NEXT-590)) <!-- 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: --> ## Bug - [ ] 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. - [ ] 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) -
Ngô Đức Anh authored
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 or adding/fixing 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? This PR fixes the issue where files from other directories are allowed into type `Route`. ### Why? It is caused by the fact that `this.collectPage` only blocked files in `appDir` that are not `page.js` and `pages/`'s `_app.js`, `_document.js`,... ### How? This fixes that by blocking files that are not in any of these directories as well. Closes NEXT- Fixes #47151
-
Steven authored
This PR is a follow up to PR #47022 which broke `next dev`. A test has been added to confirm `next dev` works as expected. fix NEXT-825 ([link](https://linear.app/vercel/issue/NEXT-825)) ([NEXT-825](https://linear.app/vercel/issue/NEXT-825))
-