- 10 Jan, 2023 2 commits
-
-
JJ Kasper authored
-
JJ Kasper authored
Lands https://github.com/vercel/next.js/pull/44562 with lint fixes Closes: https://github.com/vercel/next.js/pull/44562 ## 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) Co-authored-by:
Mateusz Lesiak <mateusz.lesiak@columbusglobal.com>
-
- 09 Jan, 2023 8 commits
-
-
JJ Kasper authored
This adds prompts for using a `src/` directory and experimental `app/` directory with create-next-app. Also adds `jsconfig` and `tsconfig` options to alias `@/*` by default. x-ref: [slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1672856097701429) ## 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 - [x] 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)
-
JJ Kasper authored
Closes: https://github.com/vercel/next.js/issues/44733 ## Documentation / Examples - [x] 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)
-
Hannes Bornö authored
I messed up the unknown font error in https://github.com/vercel/next.js/pull/44594. Restore the original error. ## 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)
-
Jimmy Lai authored
Fixes a bug where the export syntax with multiple declarations didn't work. I.e. this now works: ``` export const foo = 'bar', runtime = 'edge' ``` [x-slack-ref](https://vercel.slack.com/archives/C03LF48T3B7/p1673152323630709) ## 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)
-
Hannes Bornö authored
Co-authored-by:kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Tim Neutkens authored
-
Hannes Bornö authored
## 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)
-
Tim Neutkens authored
-
- 08 Jan, 2023 1 commit
-
-
Markus Gritsch authored
Before migrating "loadable" the from js to ts, the reload-ready function initialized its "ids" parameter with an empty array. The migration step added the parameter type but removed the initialization. Providing an empty array as the default value for the ids parameter is necessary; otherwise, the ids variable in the createLoadableComponent function, line 102, gets undefined, and the loading of components fails. fixes #44695
-
- 07 Jan, 2023 2 commits
-
-
Basant authored
This will fix a typo where it says that the redirect will happen if the `missing` has matched. Which is not true. ## 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)
-
Wyatt Johnson authored
Previously we were targeting lower versions of Node.js for `app` directory support, but a higher version of Node.js (with support for `AsyncLocalStorage`) was made required to use `undici` instead of `node-fetch`. This PR serves to: 1. Simplify the usage of those storage objects by removing the unnecessary fallback code. Everything now just uses the native `AsyncLocalStorage` interface. 2. Isolates the initialization of each store within it's own bound context to prevent leakage. 3. Adds immutibility flags to variables that should only be initlaized once upon store creation to prevent errors. This actually revealed some bugs in the implementation that were corrected. In the event that this was in error, the following adapter could be used to simulate the previous beheviour with minor changes to the present implementation ([see this gist](https://gist.github.com/wyattjoh/6f3dffb99a4ac1a8254c90284f05026a)). [Slack Reference](https://vercel.slack.com/archives/C04DUD7EB1B/p1673030967568029)
-
- 06 Jan, 2023 22 commits
-
-
JJ Kasper authored
Since this needs to updated quite often this moves it out of the `compiled` folder and pre-compiles on package build instead. x-ref: https://github.com/vercel/next.js/actions/runs/3858962360/jobs/6578078564
-
JJ Kasper authored
-
Will Binns-Smith authored
Depends on https://github.com/vercel/next.js/pull/44666 This will install `package.json` dependencies in examples before running them.
-
JJ Kasper authored
We aren't able to use `pnpm` for this script as it will no-op inside of the Next.js repo so we need to use a different package manager instead. x-ref: [slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1673040998334369?thread_ts=1673034003.245089&cid=C04DUD7EB1B)
-
JJ Kasper authored
This implements an experimental config to leverage a pre-compiled version of `next-server` which avoids the need for build-time tracing of `next-server` dependencies and also optimizes the files included to only have necessary dependencies in environments with full Next.js support. Leveraging this config reduces `output: 'standalone'` size by `5 MB` uncompressed and around `1MB` compressed. <details> <summary>Before</summary>  </details> <details> <summary>After</summary>  </details> x-ref: [slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1669062037261249?thread_ts=1668993202.171709&cid=C03KAR5DCKC) x-ref: [slack thread](https://vercel.slack.com/archives/C041SKJRH7W/p1665850356157749)
-
Tim Neutkens authored
Adds support for rendering MDX as a Server Component. The main reason a MDX file couldn't be rendered as a Server Component is that `@mdx-js/react` has a legacy/deprecated context setup in the file. Because of calling `React.createContext` the MDX file couldn't be a Server Component. I've added support for a special file `mdx-components.tsx` (or `.js`) at the root of the project (can be `src` dir too). By using mdx-components you don't need a global context provider which in turn makes MDX compatible to be rendered as a Server Component. Note: this changes `@next/mdx` to add support for that file so it has to be landed first before the example works. <!-- 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 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) Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
JJ Kasper authored
Uses example.vercel.sh as example.com flakes quite a bit. Fixes: https://github.com/vercel/next.js/actions/runs/3857935438/jobs/6576287232
-
Jan Kaifer authored
Make templates actual executable tests to that we ensure there are no regressions. It also makes the setup easier. Also changes the layout to typescript because that's what we want to use by default anyway. Also refactors helper function to use plop specific `{{ toFileName name }}` syntax for easier template modification. Co-authored-by:JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
Balázs Orbán authored
Resolves #44626
-
Rishabh Poddar authored
Update dependency version
-
Tobias Koppers authored
Co-authored-by:
Hannes Bornö <hannes.borno@vercel.com> Co-authored-by:
Hannes Bornö <borno.hannes@gmail.com>
-
Damien Simonin Feugas authored
##
📖 What's in there? With Edge Function GA for API Routes, it would make sense to suggest developer to change their runtime key from `experimental-edge` to `edge`. Current behavior is: 1. when using `experimental-edge` in API route: > prints a warning _once:_ `warn - You are using an experimental edge runtime, the API might change.` 1. when using `experimental-edge` in pages: > prints a warning _once:_ `warn - You are using an experimental edge runtime, the API might change. ` 1. when using `edge` in pages: > throws an error _for each page_: `error - Page /xyz provided runtime 'edge', the edge runtime for rendering is currently experimental. Use runtime 'experimental-edge' instead.` This PR adjust case # 1 to indicates which API file is using `experimental-edge` (a warning per page), and suggest to migrate: `warn - /pages/api/xyz provided runtime 'experimental-edge'. It can be updated to 'edge' instead.` - [x] Integration tests added ## 🧪 How to test? Besides running e2e tests with `NEXT_TEST_MODE=dev pnpm testheadless --testPathPattern edge-configurable-runtime`, you can create a test app in `examples` folder: ```jsx // examples/edge-warnings/pages/api/edge.js export default () => new Response('ok') export const config = { runtime: 'experimental-edge' } // examples/edge-warnings/pages/index.jsx export default () => <p>hello world</p> export const runtime = 'experimental-edge' ``` Build next.js then run with `pnpm next dev examples/edge-warnings`. You can try adding more pages with `experimental-edge` runtime (will not produce more warnings), adding more API with `experimental-edge` (will produce new warnings), or change page runtime to `edge` (will produce errors). -
JJ Kasper authored
These paths needed updating from the new template paths. Fixes: https://github.com/vercel/next.js/actions/runs/3855317263/jobs/6570244567
-
Raul Melo authored
I copied the middleware example from the docs to ignore a few matches but the optimized images stopped working. I figure that it was missing adding in the Regex of my middleware. ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm build && pnpm lint`
-
Balázs Orbán authored
Closes #43946 ## 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) Co-authored-by:
Steven <229881+styfle@users.noreply.github.com>
-
Steven authored
This PR updates the `@next/mdx` docs example code snippet to show merging config inside next.config.js Related to comment https://github.com/vercel/next.js/pull/44205#issuecomment-1373714608
-
JJ Kasper authored
-
JJ Kasper authored
The error message differs slightly based on the Node.js version so this special cases it. Fixes: https://dev.azure.com/nextjs/next.js/_build/results?buildId=45839&view=logs&j=8af7cf9c-43a1-584d-6f5c-57bad8880974&t=7ae70e63-3625-50f4-6764-5b3e72b4bd7a
-
Hannes Bornö authored
Throws if any of the Next.js client hooks are used in a server component in DEV. ``` Error: useSearchParams only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/react-client-hook-in-server-component ``` Fixes NEXT-287 ## 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)
-
JJ Kasper authored
Corrects the docs only change on the canary branch x-ref: https://github.com/vercel/next.js/actions/runs/3851804915/jobs/6563359142
-
JJ Kasper authored
This temporarily disables the Azure e2e tests that are currently stalling and backing up the test queue due to known failures on windows, we should re-enable these after they are patched.
-
Daiki Nishikawa 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 that you're making: --> ## Documentation / Examples Based on https://github.com/necolas/react-native-web/discussions/2217, the `babel-plugin-react-native-web` is not necessary. Therefore, I remove babel.config.js and npm package from package.json. This modification will improve build performance and bundle size. - [x] Make sure the linting passes by running `pnpm build && pnpm lint` - [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
-
- 05 Jan, 2023 5 commits
-
-
-
Hannes Bornö authored
Currently there's a bug when selecting Chinese, Japanese or Korean (CJK) as subsets. ```js const notoSans = Noto_Sans_JP({ subsets: ['japanese'], }) ``` It actually doesn't work, nothing preloads. This PR solves this by removing CJK languages as candidates for preloading. The reason is that they contain so many glyphs that each font-family is split up in 100+ font files. It doesn't make sense to preload all of them. So CJK users will have to disable preloading. ```js const notoSansJapanese = Noto_Sans_JP({ weight: '400', preload: false, }) ``` In case you do manually disable preloading like above, the default `font-display` is changed to `swap`. This PR also improves the validation errors of subsets. 1. Providing unknown subset ``` `@next/font` error: Unknown subset `japanese` for font `Inter`. Available subsets: `cyrillic`, `cyrillic-ext`, `greek`, `greek-ext`, `latin`, `latin-ext`, `vietnamese` ``` 2. Missing specified subset. The error has a link with further instructions. ``` `@next/font` error: Missing selected subsets for font `Inter`. Please specify subsets in the function call or in your `next.config.js`. Read more: https://nextjs.org/docs/messages/google-fonts-missing-subsets ``` fixes NEXT-336 ## 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) -
JJ Kasper authored
-
Michał Niedziółka authored
The current link to specification doesn't have most of the policies, which are spread across multiple different documents. I have changed the link to [w3c Policy Controlled Features](https://github.com/w3c/webappsec-permissions-policy/blob/main/features.md), which contains every feature and its status. <!-- 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 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 - [x] 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)
-
Tim Neutkens authored
The initial prefetching implementation was based on the response returning below the common layout, however when static generation was added the RSC payload for these changed to only include the router tree patch and the fully rendered page. Currently the flow for prefetch is this: - `router.prefetch` - Fetch RSC payload - Dispatch `ACTION_PREFETCH` with RSC payload. Note: the fetch is intentionally not in the reducer as the fetch happens during an event or effect, e.g. hover or `useEffect` - Reducer handles `ACTION_PREFETCH`, creates the router tree, applies the `subTreeData` to the cache append-only. Saves the new router tree in the `prefetchCache` part of the reducer state. - Then, on navigation, the `subTreeData` should be already available so there's no additional apply. The router state is applied based on the `prefetchCache`. This approach is fine when the RSC payload returned never overrides the `subTreeData` of an already existing node, however that does happen in case of static pages because the subTreeData is for the root cache node instead of a deeper node. The new flow for prefetching: - `router.prefetch` - Fetch RSC payload - Dispatch `ACTION_PREFETCH` with RSC payload - Reducer handles `ACTION_PREFETCH`, creates the router tree, Saves the new router tree and `subTreeData` in the `prefetchCache` part of the reducer state. - Then, on navigation, the `subTreeData` and router state are applied based on the `prefetchCache`. <!-- 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 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) Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-