- 14 Sep, 2022 3 commits
-
-
JJ Kasper authored
-
Sukka authored
Another step toward fixing #40025. Multiple `next/script` components with the same `src` may exist in the Next.js app. So the `loadScript` function will always attach the `onLoad` handler to the `loadingPromise` every time it executes. However, with strict mode (or wrapped inside the `<OffScreen />` component), the `useEffect` could execute more than once for the same `next/script` component, thus the `loadScript` for each `next/script` component could execute more than once (and `onLoad` to be attached more than once), results in `onLoad` fires more than once. The PR makes sure that for every `next/script` component mounted, the `loadScript` will always be executed only once for each of them. The corresponding `onload fires correctly` integration test case is also updated to run in dev mode. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
-
Henrik Wenz authored
## Info This PR merges with-mobx-lite into with-mobx. After that we will migrate `with-mobx` to typescript. ## Context As discussed in https://github.com/vercel/next.js/pull/40302#issuecomment-1239238966 we are going to merge the mobx examples. #40302 ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
- 13 Sep, 2022 15 commits
-
-
Tim Neutkens authored
Adds some of the tests we didn't have yet for app. <!-- Thanks for opening a PR! Your contribution is much appreciated. In order 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 helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
Jiachi Liu authored
Consume the original sourcemap in flight client loader if there's any, to avoid source map is generated based on the module proxy which make debugging hard Testing with adding `debugger` in layout router, screenshot: <img width="400" alt="image" src="https://user-images.githubusercontent.com/4800338/189866388-adb1aba5-496b-4b8d-8098-ec04d6f1914a.png">
-
Balázs Orbán authored
As pointed out in https://github.com/vercel/next.js/issues/40389#issuecomment-1243039792, the `filter` matched more files than necessary and merged different example directories together. This change makes the filter match the example directory name precisely. Fixes #40389 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
Sukka authored
This PR follows #40181, adding the dark mode support for the brand new Next.js logo (BTW, the new logo is awesome!). The dark version of the logo is also served from `assets.vercel.com` (I just change the original logo URL, replace the `light` with `dark`, and surprisingly find out that doesn't result in 404). cc @Nutlope @steven-tey Ref: [Specify theme context for images in Markdown (Beta) - GitHub Blog](https://github.blog/changelog/2022-05-19-specify-theme-context-for-images-in-markdown-beta/) Currently, the Next.js README in dark mode: <img width="917" alt="image" src="https://user-images.githubusercontent.com/40715044/188449078-864f6b71-7741-44f4-aee6-02a281b0a263.png"> After the PR: <img width="914" alt="image" src="https://user-images.githubusercontent.com/40715044/188449265-a3556565-d866-4e0e-9b97-be62fba6c6fe.png"> Preview link: https://github.com/SukkaW/next.js/tree/readme-logo-darkmode
-
Steven Tey authored
## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) Co-authored-by:
Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
-
hiro authored
## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
Tim Neutkens authored
- Use React.startTransition instead of useTransition - Upgrade to latest React experimental - Split router cache invalidate into separate function Some minor cleanup while verifying behaviors.
-
Balázs Orbán authored
Ref: #40501
-
Jan Klimo authored
<!-- Thanks for opening a PR! Your contribution is much appreciated. In order 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 helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) Co-authored-by:
Balázs Orbán <info@balazsorban.com>
-
Balázs Orbán authored
Closes #40497 Ref: https://pnpm.io/cli/link, https://stackoverflow.com/a/70266777 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
JDansercoer authored
`eslint-plugin-react` has a broken version between v7.31.2-6. Upping the version range ensure that only functioning packages get installed. Fixes #40245 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` Co-authored-by:JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
Steven Tey authored
<!-- Thanks for opening a PR! Your contribution is much appreciated. In order 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 - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Victor Boucher authored
Made an addition to the version history within the Script component docs. In the docs there are examples where the Script component is being used within a _document.js/tsx file, but it does not get mentioned that this is only supported from version 12.2.2 onwards. ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
Ryan Parker authored
## Summary This PR adds a note about how to see the data that this error is complaining about: ```sh Warning: data for page "/" is xxx which exceeds the threshold of 128 kB, this amount of data can reduce performance. ``` This debug trick was something I came across in a [discussion](https://github.com/vercel/next.js/discussions/39880) and I thought it would be helpful to others like it was for me. ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) Co-authored-by:
JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
Malte Ubl authored
Such bots typically navigate websites using hard navigations (as they crawl one URL at a time). Respectively, they do not benefit from prefetches at all, while increasing the cost of both the crawl and operating the site. <!-- Thanks for opening a PR! Your contribution is much appreciated. In order 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` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
-
- 12 Sep, 2022 12 commits
-
-
JJ Kasper authored
Follow-up to https://github.com/vercel/next.js/pull/39539 as discussed this renames to `unstable_` prefix initially while we test this out further. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
Damien Simonin Feugas authored
###
📖 What's in there? Dynamic code evaluation (`eval()`, `new Function()`, ...) is not supported on the edge runtime, hence why we fail the build when detecting such statement in the middleware or `experimental-edge` routes at build time. However, there could be false positives, which static analysis and tree-shaking can not exclude: - `qs` through these dependencies (get-intrinsic: [source](https://github.com/ljharb/get-intrinsic/blob/main/index.js#L12)) - `function-bind` ([source](https://github.com/Raynos/function-bind/blob/master/implementation.js#L42)) - `has` ([source](https://github.com/tarruda/has/blob/master/src/index.js#L5)) This PR leverages the existing `config` export to let user allow some of their files. it’s meant for allowing users to import 3rd party modules who embed dynamic code evaluation, but do not use it (because or code paths), and can't be tree-shaked. By default, it’s keeping the existing behavior: warn in dev, fails to build. If users allow dynamic code, and that code is reached at runtime, their app stills breaks. ### 🧪 How to test? - (existing) integration tests for disallowing dynamic code evaluation: `pnpm testheadless --testPathPattern=runtime-dynamic` - (new) integration tests for allowing dynamic code evaluation: `pnpm testheadless --testPathPattern=runtime-configurable` - (amended) production tests for validating the new configuration keys: `pnpm testheadless --testPathPattern=config-validations` To try it live, you could have an application such as: ```js // lib/index.js /* eslint-disable no-eval */ export function hasUnusedDynamic() { if ((() => false)()) { eval('100') } } export function hasDynamic() { eval('100') } // pages/index.jsx export default function Page({ edgeRoute }) { return <p>{edgeRoute}</p> } export const getServerSideProps = async (req) => { const res = await fetch(`http://localhost:3000/api/route`) const data = await res.json() return { props: { edgeRoute: data.ok ? `Hi from the edge route` : '' } } } // pages/api/route.js import { hasDynamic } from '../../lib' export default async function handle() { hasDynamic() return Response.json({ ok: true }) } export const config = { runtime: 'experimental-edge' , allowDynamic: '/lib/**' } ``` Playing with `config.allowDynamic`, you should be able to: - build the app even if it uses `eval()` (it will obviously fail at runtime) - build the app that _imports but does not use_ `eval()` - run the app in dev, even if it uses `eval()` with no warning ###🆙 Notes to reviewers Before adding documentation and telemetry, I'd like to collect comments on a couple of points: - the overall design for this feature: is a list of globs useful and easy enough? - should the globs be relative to the application root (current implementation) to to the edge route/middleware file? - (especially to @sokra) is the implementation idiomatic enough? I've leverage loaders to read the _entry point_ configuration once, then the ModuleGraph to get it back during the parsing phase. I couldn't re-use the existing `getExtractMetadata()` facility since it's happening late after the parsing. - there's a glitch with `import { ServerRuntime } from '../../types'` in `get-page-static-info.ts` ([here](https://github.com/vercel/next.js/pull/39539/files#diff-cb7ac6392c3dd707c5edab159c3144ec114eafea92dad5d98f4eedfc612174d2L12)). I had to use `next/types` because it was failing during lint. Any clue why? ###☑ ️ Checklist - [ ] 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` - [x] Integration tests added - [x] Documentation added - [x] Telemetry added. In case of a feature if it's used or not. - [x] Errors have helpful link attached, see `contributing.md` -
Thomas Knickman authored
## Documentation / Examples We now maintain a landing page of all monorepo examples with Next.js apps. We can point users here instead. - [X] Make sure the linting passes by running `pnpm lint` - [X] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
M.K. Safi authored
I was a little confused by the `loading` property having the value `<header />`. I think that property is meant to show a loading state while the file is being loaded? If my assumption is correct, I think this change makes sense.
-
JJ Kasper authored
-
Donny/강동윤 authored
This PR update swc crates to https://github.com/swc-project/swc/commit/4c078b0ac3c26254ae94648e00fac90a4e31d34c This PR applies - patches for the performance of minifier - https://github.com/swc-project/swc/pull/5796 - Closes https://github.com/vercel/next.js/issues/40399
-
Đorđe Spasić authored
## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) Co-authored-by:
JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
Balázs Orbán authored
See the blog post: https://nextjs.org/blog/next-12-3##swc-minifier-stable ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Jiachi Liu authored
Remove the unused RSC handling for pages in both server router and client side in favor of using RSC in app dir
-
Tim Neutkens authored
Found that the cause was that `React.useId()` returns the same value across requests whereas it was being used to create a unique key. On further inspection that code could be removed altogether as `id` was not used client-side and the `rscCache` map is no longer needed as the flight instance is already being created per request so it can live in the context of the request execution. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
Balázs Orbán authored
-
Lee Robinson authored
This PR updates the server components documentation to make it more clear the benefit of server components and what their current status is inside Next.js. It removes code snippets and CTAs for trying them out, as things have changed with the Layouts RFC since these docs were previously written. With the upcoming changes, server components will now be the default inside `app`. The list of supported and unsupported features was no longer accurate. We will be providing more guidance as the layouts and routing changes are ready to be tested. [Read the Layouts RFC](https://nextjs.org/blog/layouts-rfc) for more details.
-
- 11 Sep, 2022 1 commit
-
-
JJ Kasper authored
This ensures we ignore all except the files/directories we are explicitly wanting to watch to prevent watching/considering directories with massive amounts of files slowing down startup. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` Fixes: https://github.com/vercel/next.js/pull/38483#issuecomment-1242154665
-
- 09 Sep, 2022 9 commits
-
-
Balázs Orbán authored
An alternative solution to #40371 Ref: #38867, https://github.com/t3-oss/create-t3-app/issues/412, https://github.com/t3-oss/create-t3-app/pull/414 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
Hannes Bornö authored
Added missing trace for `client-full-reload` event in hot reloader. Full reload tests moved to hmr, think they make more sense there than on their own.
-
Sukka authored
The PR fixes #40388. Currently, `next/dynamic` will try to provide a default `loading` to the `loadableOptions` even when `suspense` is enabled, thus triggering the incorrect warning. The PR fixes that. The corresponding integration test case is also updated. cc @huozhi ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` Co-authored-by:huozhi <inbox@huozhi.im>
-
Jiachi Liu authored
x-ref: https://github.com/vercel/styled-jsx/pull/813
-
Andrew Johnson authored
## Documentation / Examples - [x] Make sure the linting passes by running `pnpm lint` - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) The MDX guide is missing `@mdx-js/react` as a required dependency in the setup section. Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Jiachi Liu authored
Disable this test and investigate it later x-ref: https://github.com/vercel/next.js/runs/8270347830?check_suite_focus=true x-ref: https://github.com/vercel/next.js/runs/8270348185?check_suite_focus=true
-
Balázs Orbán authored
Closes #40366 Rebass is not dependent on `styled-components` anymore. See: https://rebassjs.org/migrating/#v4-breaking-changes Closes #40367 Document has been converted (#39871) from class, so `this.props` threw an error. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `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` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
-
Tim Neutkens authored
Co-authored-by:Jiachi Liu <inbox@huozhi.im>
-
rubytree33 authored
Fixes #40368. ## Bug - [x] Related issues linked using `fixes #number` - [ ] ~~Integration tests added~~ [none applicable] - [ ] ~~Errors have helpful link attached, see `contributing.md`~~ [no new errors]
-