- 11 Feb, 2023 2 commits
-
-
Tim Neutkens authored
-
Jiachi Liu authored
x-ref: https://github.com/facebook/react/pull/26148
-
- 10 Feb, 2023 9 commits
-
-
Jonas A Walden authored
-
Jiachi Liu authored
## Bug Fixes #45756 Closes NEXT-518 Since next/dynamic is separated for `app/` and `pages/`, need to apply the interop for app dir dynamic api as well
-
LongYinan authored
- [x] Depends on https://github.com/vercel/next.js/pull/45776 Turbotrace occupies too many memories while running; this PR makes it run after the webpack build is finished, it can reduce the memory hogging by webpack and turbotrace, thus avoiding OOM The `maxFiles` option in turbotrace is removed because there is `memoryLimit` option takes over its role. Close WEB-556
-
Tim Neutkens authored
fix #42492 ## 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)
-
Shu Ding authored
Address the problem reported in https://github.com/vercel/next.js/discussions/41745#discussioncomment-4936492. ## 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)
-
LongYinan authored
Update turbopack to 230209.02 (#45776)Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> # New Features - https://github.com/vercel/turbo/pull/3540 - https://github.com/vercel/turbo/pull/3549 - https://github.com/vercel/turbo/pull/3465 - https://github.com/vercel/turbo/pull/3550 - https://github.com/vercel/turbo/pull/3495 - https://github.com/vercel/turbo/pull/3624 - https://github.com/vercel/turbo/pull/3600 - https://github.com/vercel/turbo/pull/3676 - https://github.com/vercel/turbo/pull/3689 # Fixes - https://github.com/vercel/turbo/pull/3437 - https://github.com/vercel/turbo/pull/3542 - https://github.com/vercel/turbo/pull/3531 - https://github.com/vercel/turbo/pull/3552 - https://github.com/vercel/turbo/pull/3551 - https://github.com/vercel/turbo/pull/3597 - https://github.com/vercel/turbo/pull/3644 - https://github.com/vercel/turbo/pull/3623 - https://github.com/vercel/turbo/pull/3634 - https://github.com/vercel/turbo/pull/3574 - https://github.com/vercel/turbo/pull/3673 - https://github.com/vercel/turbo/pull/3675 - https://github.com/vercel/turbo/pull/3723 - https://github.com/vercel/turbo/pull/3677 - https://github.com/vercel/turbo/pull/3717 - https://github.com/vercel/turbo/pull/3701 # Performance Improvements - https://github.com/vercel/turbo/pull/3361 - https://github.com/vercel/turbo/pull/3619 --------- Co-authored-by:
kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Shu Ding authored
Closes #41824. ## 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)
-
Jimmy Lai authored
Fixes #45122 and #44817 NEXT-447 This PR: - changes the usage of the cluster module in `next dev` to use `child_process` instead. This is mostly the same thing and helps alleviate issues with libraries that rely on `Cluster.isMaster`. - fixes the implementation also to check if the `--inspect` option is used to then manually attribute the correct port, which is whatever the current port is, plus one. With the previous cluster implementation, it always increased automatically every time the server died. - adds back the warning log I had removed by mistake to inform the user that the server is restarting. <!-- 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)
-
Jiachi Liu authored
Moving tests to reduce app-dir/app/index.test.ts running duration
-
- 09 Feb, 2023 11 commits
-
-
JJ Kasper authored
These had incorrect import alias flags since the `"` characters were being included incorrectly. x-ref: https://github.com/vercel/next.js/actions/runs/4137310428/jobs/7152385081
-
Shu Ding authored
No changes in this PR, just move out all CSS related tests out of app-dir/app/index.tests.ts into a separate suite. ## 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:
kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Shu Ding authored
Improve the experience that when you have type errors, you can use CMD+Click to directly jump to the metadata definition: https://user-images.githubusercontent.com/3676859/217918427-590d1feb-1d05-4b15-8146-0b7aa35fab0b.mp4 ## 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)
-
Jiachi Liu authored
## Feature * Picking up root favicon (`/app/favicon.ico`) into icons, and add missing `type` prop for `<link>` * Fixes the `/favicon.ico` 500 in dev server (`fileExists` checking part) Closes NEXT-475 - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [x] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
-
Alex Kirszenberg authored
In Turbopack, we defer to the Next.js router for rewrites and redirects. We need to be able to differentiate results where the Next.js router found a corresponding route and where it didn't, in order to redirect the latter to assets or rewrite them to 404. Right now, with `nextConfig.basePath = "base"`, the router will return the same result for `/base/1` and `/1`. With this diff, the router would return `none` for `/1`, which lets us differentiate on the Turbopack side.
-
JJ Kasper authored
Fixes: https://github.com/vercel/next.js/issues/45161 ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
-
Shu Ding authored
The current behavior is, when `appDir` is enabled, global CSS should be allowed to be imported from anywhere (because components can be re-used by both pages and app). Changes in #45619 made it not behaving correctly and this PR fixes it. ## 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)
-
JJ Kasper authored
-
JJ Kasper authored
This fixes a mismatch in behavior between dev/start where bundle 404s could be rewritten in production but not dev. Also ensures we have a regression test for this behavior. x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1675869554570429) ## Bug - [x] 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) --------- Co-authored-by:
Shu Uesugi <shu.chibicode@gmail.com>
-
Shu Ding authored
-
Jiachi Liu authored
## Feature For property that needs to be resolved as URL, compose with `metadataBase` if it's provided Closes NEXT-398 ### Detail updates * fix issue that path having extra `/` in the middle for pages path under app dir * don't render Meta if value is empty string, e.g. `og:title` can be `''` from value of `title.absolute` * did some refactor to separate resolvers into different files * add some unit tests for resolve urls - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [x] Related issues linked using `fixes #number` - [x] [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) --------- Co-authored-by:
Shu Ding <g@shud.in>
-
- 08 Feb, 2023 12 commits
-
-
Will Binns-Smith authored
This adds: - Documentation for Turbopack experimental fields `turbopackLoaders` and `resolveAlias` to the API reference site. - Typings and schema for the above Turbopack experimental options Test Plan: - `pnpm build`, updated an example to use TypeScript for its Next.js config, and verified the config passed with matching shapes and failed with mismatching shapes.
-
Steven authored
-
Vu Van Dung authored
The very-newly-released `generateMetadata` function currently does not allow itself to be synchronous. It leads to situations like this ```ts export async function generateMetadata() { return { title: "Hello, world!" }; } ``` where there's evidently no reason to use `async`, but it's forced by Next.js. This PR aims to remove this restriction: `generateMetadata` can be synchronous now. ## Bug - [x] Related issues linked using `fixes #45685` - [ ] 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` - [x] [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) Signed-off-by:Vu Van Dung <me@joulev.dev> Co-authored-by:
Jiachi Liu <inbox@huozhi.im>
-
Shu Ding authored
This PR changes the loader logic from something like `ctx.hasAppDir ? useAppLoaderForCSS : usePagesLoaderForCSS`, to a mental modal of `[ctx.hasAppDir ? useAppLoaderForCSSInAppLayer : null, usePagesLoaderForCSSInPagesLayer]`. This change makes sure that both pages and app can exist and work well together, instead of a binary switch. Also renamed the loader with `-dev` removed, because it is used for production build too. NEXT-461 ## 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:
kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Jan Kaifer 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)
-
Michael Law authored
-
Balázs Orbán authored
-
Dawid Czesak authored
-
OJ Kwon 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: --> Partially resolves WEB-544. This PR adds a new detection to the external env variable `NEXT_TEST_CONTINUE_ON_ERROR`. If those variable is set, even if a suite of test fails test runner will keep executing remaining tests. Turbopack (vercel/turbo) runs Next.js integration tests to track its feature parity to the existing Next.js features and currently it is expected to fail on certain test: however, we still want to execute all of the tests to track how many tests are passing / fails. Once this change lands turbopack need further verification to see if all of tests are actually running. ## 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
Replaces usage of `hasHeader` of `getHeader` and also ensures we include `hasHeader` in our `mockRes` we create during revalidate for good measure. ## Bug - [x] 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) Closes: https://github.com/vercel/next.js/issues/34929 Closes: https://github.com/vercel/next.js/issues/37338 Closes: https://github.com/vercel/next.js/issues/45481
-
Jiachi Liu authored
Warn users when there's `head.js` being used in `app/`, and recommend to use metadata. Will show a warning in console while rendering Closes NEXT-268 --------- Co-authored-by:
JJ Kasper <jj@jjsweb.site> Co-authored-by:
Lee Robinson <me@leerob.io>
-
Shu Ding authored
NEXT-476 ## 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)
-
- 07 Feb, 2023 6 commits
-
-
Balázs Orbán authored
Realized when I was checking out https://github.com/vercel/next.js/issues/45431 that the package manager will complain about missing peer deps, even though they are not required with the `experimental.mdxRs` option. Fixing a small visual issue too: <details> <summary>Before:</summary> <img src="https://user-images.githubusercontent.com/18369201/215777932-caf133c0-1459-4c25-a438-11020e41f879.png"/> </details> <details> <summary>After:</summary> <img src="https://user-images.githubusercontent.com/18369201/215777802-d3f245ae-af56-46e9-8ccd-3bac241bdcfa.png"/> </details> ## 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)
-
Mike Plummer authored
[Cypress](https://www.cypress.io/) recently went GA with a Component Testing offering which supports Next.js. This PR adds a brief section on what and how to use Cypress for component-level testing and updates the example project with a component test. Any feedback on content or the example is welcome, thanks for considering! ## 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)
-
SCG82 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: --> ## 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) Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Bennett Dams authored
Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
José Fernando Höwer Barbosa 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 - [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) First of all thanks for this amazing project and all the help you provide with these examples. It seems there is code duplication in this example. After some tests locally seem to _document.js is not necessary for `gtag` to work properly. https://github.com/vercel/next.js/blob/9d97a1e34a8a6e09eb127292c730d1a8df63ebb6/examples/with-google-analytics/pages/_app.js#L30-L34 https://github.com/vercel/next.js/blob/9d97a1e34a8a6e09eb127292c730d1a8df63ebb6/examples/with-google-analytics/pages/_document.js#L13-L17 I am aware of https://github.com/vercel/next.js/pull/40645 and I would like to ask @dave-hay, @SukkaW and @ijjk to consider this is still necessary. If so why then not move all content of the scripts from _app to _document? In any case, I am open to adding here some comments explaining what is the reason for this code duplication if necessary. <hr/> Changes that come from https://github.com/vercel/next.js/pull/43897 1. The `event` hashChangeComplete should be removed since `/home` and `/home/#section` is not new pageview, but just reference to the same page. If we go from /home to /home/#section (with a button click or a link for example) this shouldn't trigger a new page visit on `gtag`. For this reason, I think we should revert the changes from https://github.com/vercel/next.js/pull/36079. If there is a better argument of why this should stay I am also open to creating comments to clarify this on the example since I don't think should be the default behavior and not useful in most cases. 2. The `id="gtag-init"` was added with no context to the example from https://github.com/vercel/next.js/pull/29530 If there is a reason for this id in the script to existing I am open to adding a comment that clarifies this since in my experience is not necessary at all. Edit: Batching with https://github.com/vercel/next.js/pull/43897 as recommended by https://github.com/vercel/next.js/pull/43897#issuecomment-1344635000 --------- Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Shu Ding authored
The server directive is allowed to have other directives and comments above. This PR fixes the transform with tests added for failing cases. ## 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)
-