Commit graph

21407 commits

Author SHA1 Message Date
Kevin Mårtensson
1e0634069a
fix: wait for playwright fixture to setup before running test (#66842)
### What?

Sometimes, probably when you have a lot of tests, I've noticed that some
tests are failing with the error `browserContext.route: Test ended`.
After some debugging I found that `page.route(…)` needs to be awaited
before continuing.

### Why?

So that Playwright works correctly with the `next` fixture.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-06-14 14:02:45 -07:00
vercel-release-bot
6306ea3c1a v15.0.0-canary.31 2024-06-14 20:56:05 +00:00
JJ Kasper
fd9c524a72
Revert "Use turbo-tasks-malloc on all platforms" (#66884)
Reverting while we investigate further 

Reverts vercel/next.js#66815
2024-06-14 13:36:19 -07:00
Zack Tanner
6ae9828cce
de-flake next-image test (#66882)
This navigation event is timing out in Turbopack builds, but not for any
particularly good reason: I think the link click is just taking a while,
due to builds still being fairly experimental.

Rather than clicking a link to navigate to the client side test suite,
this just starts the test there, which is similar to how the server test
works anyway and still accomplishes what this test is intended for.

Flakes:

[1](https://github.com/vercel/next.js/actions/runs/9520142937/job/26245881436)

[2](https://github.com/vercel/next.js/actions/runs/9520142937/job/26245558183)

[3](https://github.com/vercel/next.js/actions/runs/9520142937/job/26244822150)

[4](https://github.com/vercel/next.js/actions/runs/9519242919/job/26244323363)
2024-06-14 13:26:30 -07:00
Zack Tanner
f8f27734f8
fix webhook token (#66883)
Accidentally inverted these
2024-06-14 13:10:56 -07:00
Sam Ko
710b0b7cd4
chore(github): update users (#66877)
## Why?

Update the labeler list.
2024-06-14 11:20:29 -07:00
Ankit Tiwari
14b7b37a84
Update with-supertokens example (#66827)
Updates the with-supertokens example to replace `getSSRSession` usage
with manual JWT parsing in SSR as shown in
https://github.com/supertokens/create-supertokens-app/pull/107

Co-authored-by: Sam Ko <sam@vercel.com>
2024-06-14 18:06:20 +00:00
Eng Zer Jun
642e93c6f2
docs: update code block filename in Module Aliases section (#66825)
The filenames of the last two code blocks on this page
https://nextjs.org/docs/app/building-your-application/configuring/absolute-imports-and-module-aliases#module-aliases
are written as comment instead of using the `filename` prop.


![image](https://github.com/vercel/next.js/assets/20135478/6186ea56-6ea8-4fe9-ba29-e8036aee5f9d)

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-06-14 11:01:36 -07:00
Albert Chang
61897f2c21
Update use-search-params.mdx (#66857)
add missing 'use client' to the example code in
https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-06-14 17:46:30 +00:00
Zack Tanner
c436a83c65
tweak deploy test jobs (#66856)
- remove fail fast so we can get a full picture of what's failing
- remove alerting/retrying to existing job

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-06-14 10:37:28 -07:00
Jiachi Liu
ce69888af1
Reland "Middleware to use react-server condition" (#66534) 2024-06-14 17:41:12 +02:00
vercel-release-bot
e4d107cc93 v15.0.0-canary.30 2024-06-14 15:05:15 +00:00
Hendrik Liebau
b8bf2c84b9
[ppr] Improve DX for static shell debugging in dev mode (#66806)
Users that experiment with PPR and might have seen #61798, or #62703, or
most recently #65483, may try the `__nextppronly=1` query param to debug
the static shell. This will lead to the following uncaught error and
blank page:

<img width="1045" alt="static shell debugging hydration error"
src="https://github.com/vercel/next.js/assets/761683/ed382d97-82ae-4a23-9930-bb4d4419e88e">

It might not be immediately obvious that javascript must be disabled to
see the static shell. To improve the DX in this scenario we can omit the
bootstrap script to skip hydration, and thus prevent the error. Then
debugging the static shell works even without disabling javascript in
the devtools.

<img width="1045" alt="static shell debugging without hydration"
src="https://github.com/vercel/next.js/assets/761683/57f6cb88-f5b4-473f-963f-7fda8c8e7f00">

In addition, we should add the closing body and html tags to the shell
so that a valid HTML document is returned.
2024-06-14 11:29:11 +00:00
Benjamin Woodruff
a00146e001
Use turbo-tasks-malloc on all platforms (#66815)
This was previously disabled on `aarch64-unknown-linux-musl` and `wasm`,
due to compilation errors.
    
I moved the logic to disable `mimalloc` on these platforms into the
`turbo-tasks-malloc` crates in https://github.com/vercel/turbo/pull/8462
(which this PR depends on).
    
In addition to centralizing mimalloc platform support logic, this means
that we can get allocation data from these platforms while using the
system allocator.

**Depends on:** https://github.com/vercel/turbo/pull/8462

Included turbopack changes:
* https://github.com/vercel/turbo/pull/8409 <!-- hrmny -
fix(turbopack-ecmascript-runtime): prevent hanging when top level await
is skipped -->
* https://github.com/vercel/turbo/pull/8466 <!-- hrmny - fix(turbopack):
make external module wrapper return not found instead of panicking -->
* https://github.com/vercel/turbo/pull/8469 <!-- hrmny - fix(turbopack):
add ecmascript options to mdx -->
* https://github.com/vercel/turbo/pull/8447 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.93.4` -->
* https://github.com/vercel/turbo/pull/8472 <!-- Donny/강동윤 - feat:
Reduce the number of parts created by tree shaking -->
* https://github.com/vercel/turbo/pull/8480 <!-- Will Binns-Smith -
Publish `@vercel/devlow-bench` -->
* https://github.com/vercel/turbo/pull/8481 <!-- Will Binns-Smith -
chore: release npm packages -->
* https://github.com/vercel/turbo/pull/8462 <!-- Benjamin Woodruff -
Update mimalloc, enable for glibc Linux aarch64, explicitly disable for
wasm and musl -->
2024-06-14 04:56:04 +00:00
Zack Tanner
1b93f366fc
de-flake interception-route-prefetch-cache test (#66854)
All deployed apps looked/worked fine -- I think just weren't handling
the timing right in this test. When replaying locally, it seemed the
browser was clicking the various links pre-hydration and missing the
route interception cue.

<details>
<summary>View Runs</summary>

- Run 1
![CleanShot 2024-06-13 at 19 24
20@2x](https://github.com/vercel/next.js/assets/1939140/8997255b-7812-4266-a9dc-c839b74abb37)

- Run 2
![CleanShot 2024-06-13 at 19 44
29@2x](https://github.com/vercel/next.js/assets/1939140/75968aa5-ac98-4170-b23d-f0c395f748d9)

- Run 3
![CleanShot 2024-06-13 at 19 47
59@2x](https://github.com/vercel/next.js/assets/1939140/f1314f07-b989-4687-a134-f25b57a5c6a2)


</details>
2024-06-14 02:52:32 +00:00
vercel-release-bot
c0b3c47059 v15.0.0-canary.29 2024-06-14 00:14:19 +00:00
Zack Tanner
02de207967
fix actions-navigation deploy test (#66850)
Switches to reading action result from state rather than runtime logs.
2024-06-13 16:57:26 -07:00
Zack Tanner
4dd26753d9
fix deploy tests that patch node_modules (#66849)
`node_modules` gets ignored when deployed unless explicitly allowed, and
the regular install command will clobber what was in there.

This allowlists the `node_modules` directory and copies it into a new
folder, runs the install command, and then merges the patched
`node_modules` in so the patched modules are available in the test.
2024-06-13 23:21:34 +00:00
Zack Tanner
d8f1a5d30f
enable parallel-routes-and-interception deploy tests (#66848)
Only 1 test suite in this suite is failing and it's related to file
tracing, which should be fixed in a follow-up. For now this enables
deploy tests for everything else to make sure we don't regress.

This also simplifies the original test to not require stopping the
server & patching a file.
2024-06-13 15:48:47 -07:00
Zack Tanner
b9d542183e
fix app-action deploy tests (#66846)
- Fixed redirects tests not working when deployed because they were
`POST` requests to a static page
- Skipped 404 test for a similar reason: a `POST` to the static not
found page is handled differently, and we won't have access to the
runtime logs anyway
- Refactored interception routes test to not rely on runtime logs
- Fixed revalidation test & removed comment about flakiness

<details>
<summary>Validated Run Summary</summary>

![CleanShot 2024-06-13 at 13 45
32@2x](https://github.com/vercel/next.js/assets/1939140/8b85cb60-b389-451c-b449-41067f86a8d3)

</details>
2024-06-13 14:20:43 -07:00
Jiachi Liu
46441387be
Fix: only inject clientTraceMetadata into html page once (#66763) 2024-06-13 12:58:01 -07:00
Zack Tanner
918af1667a
fix parallel-routes-revalidation deploy test (#66831)
These 2 tests use an in-memory data store that won't be necessarily
shared across invocations of the lambda. This skips the tests that rely
on that functionality as testing it in `next start` should be
sufficient.
2024-06-13 08:57:50 -07:00
Zack Tanner
96d6370572
fix revalidate-reason deploy test (#66830)
Since `next.cliOutput` won't have access to runtime logs we can refactor
this test to render text on the page instead.
2024-06-13 08:54:59 -07:00
Zack Tanner
258726e42b
re-add test output string in run-tests (#66828)
I missed that this was used by the comment webhook when I removed it in
#66721. This restores the existing code and adds a better comment
explaining why it's there.
2024-06-13 07:43:55 -07:00
Donny/강동윤
36192ea36e
build: Update swc_core to v0.93.4 (#66781)
### What?

Update `swc_core` to `v0.93.4`.

### Why?

To apply https://github.com/swc-project/swc/pull/9036 and https://github.com/swc-project/swc/pull/9037. Those PR makes parsing of some files 5x faster.

### How?
2024-06-13 00:37:11 +00:00
Zack Tanner
7c97f56bfd
fix app-prefetch-false-loading deploy test (#66811)
This gates the part that depends on runtime logs. This test is still
valuable without this particular check.
2024-06-13 00:13:24 +00:00
Zack Tanner
107a45fa6c
fix ppr deploy test (#66809)
This test was only failing because `vercel logs` limit the output to 100
lines, and telemetry debugging was adding a lot of verbosity to the
build logs.

This bumps the log lines to a higher value to give some more breathing
room, and did a drive-by `check` -> `retry` refactor.
2024-06-12 16:35:55 -07:00
vercel-release-bot
970420d78b v15.0.0-canary.28 2024-06-12 22:23:29 +00:00
Will Binns-Smith
33872bfa1e
Make InvalidImportResolvePlugin a BeforeResolvePlugin (#66622)
https://github.com/vercel/turbo/pull/8165 introduced plugins that
operate before resolving occurs, meaning that plugins like
`InvalidImportResolvePlugin` which never use the initial resolve result
and report issues can avoid that work.

Test Plan: `TURBOPACK_DEV=1 TURBOPACK=1 pnpm test-dev
test/development/acceptance-app/invalid-imports.test.ts`
2024-06-12 22:15:33 +00:00
Zack Tanner
8f67469ba4
fix parallel-route-not-found-params deploy test (#66807)
The rest of this test is valid for a deployed environment, we just won't
have access to runtime logs.
2024-06-12 20:26:57 +00:00
Sam Ko
e296846427
chore: bump turbo to 2.0.3 (#66784)
## Why?

This pull request bumps turborepo from 1.13.3-canary.2 to
[2.0.3](https://github.com/vercel/turbo/releases/tag/v2.0.3) across
multiple GitHub workflows and configuration files.

Re-attempting after we
[reverted](https://github.com/vercel/next.js/pull/66775).
2024-06-12 19:31:42 +00:00
Ivan Torres
bebc63fce0
Update devdependecy commander (#66771)
Upgrade devdependecy commander to latest versio.

Now in command, the optional argument is with [] and the required
argument is with <>.

---------

Co-authored-by: torresgol10.itd <torresgol10.itd@gmail.com>
Co-authored-by: Sam Ko <sam@vercel.com>
2024-06-12 11:25:09 -07:00
Zack Tanner
535d466734
fix edge-document deploy test (#66805)
No need to stop the server & patch a file for this test.

This updates the setup step to create the necessary files so it can be
deployed.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-06-12 18:05:18 +00:00
JJ Kasper
73918c6711
Ensure turbo is setup when building in docker (#66804)
This ensures we always set up turbo to the version we expect even if
we're building in docker since the cache is pulled outside of docker.

x-ref:
https://github.com/vercel/next.js/actions/runs/9484631800/job/26134568488
2024-06-12 09:42:50 -07:00
Wyatt Johnson
f34445e25a
refactor: simplified async storage wrappers (#66767) 2024-06-12 09:07:45 -07:00
Zack Tanner
ac46ffe08f
disable deploy tests for incompatible suites (#66776)
This disables tests that should not be run in a deployed environment,
because they use incompatible APIs or there's no reason to test them
outside of `next start`. Specifically disables for things like:

- Using `next.patchFile`, `next.renameFile`, etc.
- Attempting to use `next.cliOutput` to query runtime logs. When
deployed, these are only build-time logs.

[Latest Run](https://github.com/vercel/next.js/actions/runs/9483807368)
2024-06-12 07:38:02 -07:00
Tim Neutkens
f87dc4ae5e
Add bench application with heavy dependencies (#66564)
## What?

Work in progress, I'm collecting some dependencies that we keep seeing
in traces of slow compilation, makes it easier to optimize these.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-06-12 15:05:47 +02:00
Tobias Koppers
4398e348ee
use node js chunking context for evaluation (#66710)
### What?

Refactoring to use node.js chunking context for evaluation

see https://github.com/vercel/turbo/pull/8402

### Why?

### Turbopack changes

* vercel/turbo#8422
* vercel/turbo#8402
2024-06-12 10:38:28 +00:00
Zack Tanner
eb6575adb9
tweak deploy test concurrency & fail condition (#66779)
[x-ref](https://github.com/vercel/next.js/actions/runs/9475354204/job/26106589121)
2024-06-11 19:38:32 -07:00
vercel-release-bot
0cce20d50a v15.0.0-canary.27 2024-06-12 01:55:32 +00:00
JJ Kasper
d22da49b49
Revert "chore: bump turbo to 2.0.3" (#66775)
Seems the latest turbo version is causing issues with our rust
compilation so reverting for now

Reverts vercel/next.js#66762
2024-06-11 18:17:06 -07:00
vercel-release-bot
03b5267bdb v15.0.0-canary.26 2024-06-11 23:22:38 +00:00
Zack Tanner
e167e7fb64
fix app-custom-routes deploy test (#66773)
- `next.cliOutput` will only refer to build time logs, so this
particular assertion won't work
- Drive-by refactor for it to use `retry` instead of `check`

Verified this passes when deployed
2024-06-11 22:41:37 +00:00
Sam Ko
561dcf6c43
chore: bump turbo to 2.0.3 (#66762)
## Why?

This pull request bumps turborepo from 1.13.3-canary.2 to
[2.0.3](https://github.com/vercel/turbo/releases/tag/v2.0.3) across
multiple GitHub workflows and configuration files.
2024-06-11 22:28:01 +00:00
Zack Tanner
0c49daad3c
fix client-cache deploy tests (#66770)
- Telemetry debugging isn't available when deployed
- The loading test had a race bug

Verified all of these passed when deployed locally.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-06-11 22:17:44 +00:00
Zack Tanner
a00555ae3a
tweak deploy failure notification condition (#66769)
Make sure this doesn't get skipped
[x-ref

](https://github.com/vercel/next.js/actions/runs/9472800340/job/26098835283)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-06-11 14:39:18 -07:00
Zack Tanner
b8be05c1ae
fix e2e deployment test action (#66721)
[Test
Run](https://github.com/vercel/next.js/actions/runs/9471783416/job/26095882422)

Changes:

- Add a setup step that clears the project so it doesn't happen in each
runner
- Run when a release is published rather than on cron
- Notify via Slack when a failure occurs
- Leverage build_reusable for the test runner to match the
build_and_test workflow
- Fixes to `next-deploy` script: not properly logging/catching errors
- Adds manifest to ignore known issues 
- Split into 6 runners with 2 concurrency (12 deploys at a time)
- Adds some logging so we know what's happening
- Disable Playwright trace mode (it kept failing to find a trace file
and cluttering the output. Don't think we need it here anyway)

<details>
- <summary>Removed noisy output</summary>

![CleanShot 2024-06-10 at 14 08
05@2x](https://github.com/vercel/next.js/assets/1939140/f227e71c-95b4-4859-90de-a23c88c55ea8)

</details>


<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
2024-06-11 20:59:43 +00:00
Donny/강동윤
65fd44b892
build: Update swc_core to v0.93.2 (#66698)
# Turbopack

* https://github.com/vercel/turbo/pull/8324 <!-- Tobias Koppers - fix panic in debug mode -->
* https://github.com/vercel/turbo/pull/8395 <!-- Donny/강동윤 - build: Update `swc_core` to `v0.93.2` -->


### What?


Update `swc_core`. 

### Why?

Update `swc_core`. The regression of minifier is fixed by https://github.com/swc-project/swc/pull/9031


### How?
2024-06-11 20:02:10 +00:00
Wyatt Johnson
f0e4298f67
Ensure urlPathname is always a pathname (#63846)
### What?

This modifies the static generation store to instead store a `url`
object with the `pathname` and `search` properties. This corrects the
previous behaviour which used the variable `urlPathname` which had
ambiguous meanings as it technically contained the search string as
well, not just the pathname.

In cases during the app render, this still grabs the contents of
`url.pathname + url.search` (where `url.search` always has a leading `?`
if it has any query parameters, [see the
docs](https://developer.mozilla.org/en-US/docs/Web/API/URL/search)) so
that it emulates the current behaviour. This allows more specific access
though, where now additional parsing can be eliminated which had to
strip the query string off of the `urlPathname` in a few places, and
more worrisome, still accidentally contained the search string causing
errors.

### How?

This requires an upstream fix (#64088) which corrected a bug with the
store access which had caused some previous test failures (accessing
`store.url.pathname` was throwing as `store.url` was undefined on the
wrong return, check the upstream PR for more details on that).

This also changes out usage of `pagePath` with `route`, and lets it be
the fallback (for debugging and error messaging). During static
generation, we will provide a value for the page being rendered that's
correlated to the particular file on the filesystem that the route is
based on:

```
// rendering app/users/[userID]/page.tsx
page: /users/[userID]
pathname: /users/1, /users/2, etc
```

The `route` is used only for debugging, such as when
`generateStaticParams` incorrectly calls `headers()`.

This also moves the pathname from the `staticGenerationStore` into the
`requestStore`, as it's tied to a given request.

Closes NEXT-2965
2024-06-11 12:49:07 -07:00
Janka Uryga
0fee50ed6e
fix: app-router prefetch crash when an invalid URL is passed to Link (#66755)
Closes [#66650](https://github.com/vercel/next.js/issues/66650)
Closes NEXT-3520

### What?

- Make Link not throw during prefetch if it received an invalid `href`
(see [#66650](https://github.com/vercel/next.js/issues/66650))
- Throw in dev mode if an invalid link was passed to `router.prefetch`
-- this matches current prod behavior
- (previously, we'd immediately exit out of `router.prefetch`, so the
user would see no indication that this'd fail in prod)

### Why?

If an invalid URL was passed to `<Link>`, the whole app would crash and
show "A client-side exception occurred". A failed prefetch should not
bring down the whole app.

Note that This preserves the current behavior of explicit
`router.prefetch(url)` throwing an error if `url` is invalid. We may
want to adjust this in the future, but that could be considered a
breaking change, so I'm leaving it out for now. This only affects
`Link`, which was intended to catch any errors thrown from
`router.prefetch`, but that bit was accidentally broken.
2024-06-11 21:36:27 +02:00