- 06 Jan, 2023 21 commits
-
-
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 14 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>
-
Steven authored
This PR fixes telemetry so it no longer reports `pnpm next` when contributing to Next.js
-
JJ Kasper authored
Follow-up to https://github.com/vercel/next.js/pull/44577 ensures we skip when not running these specifically x-ref: https://github.com/vercel/next.js/actions/runs/3848960975/jobs/6557471848
-
Christian Riedel authored
[docs/bugfix] fix code example for "Prefixing the Default Locale" - NEXT_LOCALE cookie usage (#44587) For this trivial bug(fix) I did not create an issue prior. The example code changed with #40728 for the "Prefixing the Default Locale" section in the docs has a minor bug, where the NEXT_LOCALE cookie is grabbed and stringified instead of using the value property. This results in `"[object Object]"` and an endless redirection circle. https://nextjs.org/docs/advanced-features/i18n-routing#prefixing-the-default-locale ## 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
Ensures static generation is used and the dictionary is not accidentally used in client components ## 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
Co-authored-by:kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Jan Kaifer authored
Co-authored-by:
Vu Van Dung <joulev.vvd@yahoo.com> Co-authored-by:
Tim Neutkens <tim@timneutkens.nl>
-
Jimmy Lai authored
Fixing + doing some maintenance as I was using it for some things. Changes: - fixed a bug related to how React is injected - added a progress tracker for the numbers of requests - retry on 500 - added a param for crashing the lambda manually (useful for cold boots) - added a param to skip build, useful if you want to retest the same variation - don't crash when there's no data to compare ## 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)
-
Jan Kaifer authored
Co-authored-by:
Tim Neutkens <tim@timneutkens.nl> Co-authored-by:
kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Lee Robinson authored
Reviewed these and did not find them as relevant anymore.
-
- 04 Jan, 2023 5 commits
-
-
JJ Kasper authored
Updates to only run the create-next-app tests for PRs when the related package files change, continues to always run on canary though.
-
Steven authored
There is [some confusion](https://twitter.com/samselikoff/status/1608840153963057152) over why `"target": "es5"` is in `tsconfig.json` and whether or not it should be changed. The `target` property is not used by Next.js, so this PR removes it. - Closes: #37271 - Closes: #43582
-
JJ Kasper authored
This removes an extra Yarn PnP test that is failing from a nested dependency change. We have three other examples being tested against PnP which should be sufficient. x-ref: https://github.com/vercel/next.js/actions/runs/3840569532/jobs/6542443736 x-ref: https://github.com/vercel/next.js/actions/runs/3840569532/jobs/6542444509 x-ref: https://github.com/vercel/next.js/actions/runs/3840569532/jobs/6542448724 x-ref: https://github.com/vercel/next.js/actions/runs/3840569532/jobs/6542449653
-
Shu Uesugi authored
This PR improves the [Modularize Imports](https://nextjs.org/docs/advanced-features/compiler#modularize-imports) section of Next.js Compiler docs as well as [the `modularize-imports` example](https://github.com/vercel/next.js/tree/canary/examples/modularize-imports). They were originally added in [this PR](https://github.com/vercel/next.js/pull/34969). - Link to [the `modularize-imports` example](https://github.com/vercel/next.js/tree/canary/examples/modularize-imports) was missing from the docs. - Clarified some explanations and reorganized the content so it's easier to understand. - Added docs for `skipDefaultConversion`. - Added docs for `preventFullImport`. - Illustrated how to use `kebabCase` and `skipDefaultConversion` on the [the `modularize-imports` example](https://github.com/vercel/next.js/tree/canary/examples/modularize-imports). ## Documentation / Examples - [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)
-
Hassan El Mghari authored
## Improvements to Image Gallery - Added blur image optimization that cuts initial page size by more than half - Added masonry layout to handle images of different sizes - Converted querySelector to use refs
-