Commit graph

15770 commits

Author SHA1 Message Date
Toru Kobayashi
ac6addbf63
fix: a11y issues in react-dev-overlay (#49460)
This is a part of fix of #47351

This fixes two issues #47351 mentioned.

1. Buttons must have discernible text
-
https://dequeuniversity.com/rules/axe/4.6/button-name?application=axe-puppeteer

Before:
<img width="549" alt="Screenshot 2023-05-08 at 22 37 00"
src="https://user-images.githubusercontent.com/250407/236839743-3383aea0-f59a-4f2a-9dff-f24de692a97c.png">

This PR:
<img width="447" alt="Screenshot 2023-05-08 at 22 38 50"
src="https://user-images.githubusercontent.com/250407/236839785-3b29b74e-e4db-4ff3-a87c-b69712196264.png">

You can see the accessibility name.

3. Heading levels should only increase by one
-
https://dequeuniversity.com/rules/axe/4.6/heading-order?application=axe-puppeteer

I didn't fix the following issue in this PR because it caused the change
in appearance for the overlay.
I'll fix it as another PR.

2. Elements must have sufficient color contrast
-
https://dequeuniversity.com/rules/axe/4.6/color-contrast?application=axe-puppeteer

<!-- 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 or adding/fixing 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 #

-->
2023-05-10 12:27:43 +02:00
OJ Kwon
1ed7544696
refactor(next-core): remove ast cloning in custom transform (#49560)
### What?

- closes WEB-1024.

Minor refactoring to avoid explicit AST cloning. Still visitors are
using fold though.

### Turbopack changes

* https://github.com/vercel/turbo/pull/4869
* https://github.com/vercel/turbo/pull/4879
* https://github.com/vercel/turbo/pull/4881
2023-05-10 11:07:40 +02:00
Steven
11a7117d40
chore: cross-platform rm -rf script (#49529)
- Closes https://github.com/vercel/next.js/issues/42433
- Closes https://github.com/vercel/next.js/pull/43105
- Closes https://github.com/vercel/next.js/pull/49522
2023-05-10 01:14:37 +00:00
vercel-release-bot
f02cc9f849 v13.4.2-canary.4 2023-05-10 00:28:37 +00:00
JJ Kasper
e3e76a45ee
Add experimental compile/generate handling (#49491)
This implements experimental`compile`/`generate` commands to allow
separate the compilation and static generation steps of the build.
Initially this is for testing and follows same experimental rules which
aren't covered by semver.

Note: most changes are just spacing changes so disabling that in the
diff will be helpful.

x-ref: [initial
thread](https://www.notion.so/vercel/bbdbba2016ed464eb5263d325fecc02f?pvs=4)
x-ref: [slack
thread](https://vercel.slack.com/archives/C03DQ3QFV7C/p1676591260523589?thread_ts=1676554904.334789&cid=C03DQ3QFV7C)
2023-05-09 17:00:08 -07:00
Jiachi Liu
ef2b8f8696
Fix canonical url for dynamic routes (#49512)
The `pathname` in app-render was actually "page" (e.g. `/blog/[slug]`),
with special url conventions. Instead we should use actual request url
as pathname. Rename previous `pathname` arg to `pagePath` for better
readability

Also improved the url validation
2023-05-09 16:31:06 -07:00
Steven
064e0c25d7
chore: fix flaky middleware matcher test (#49555)
```
    ✕ should match query path (2857 ms)

  ● Middleware custom matchers basePath › should match query path

    expect(received).toBe(expected) // Object.is equality

    Expected: "random"
    Received: ""
```

https://github.com/vercel/next.js/actions/runs/4929337370/jobs/8809028722?pr=49529#step:6:201
2023-05-09 22:37:03 +00:00
OJ Kwon
71d8064b3d
feat(next-core): relay transform plugin (#48899)
<!-- 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 or adding/fixing 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

### Why?

### How?

Closes NEXT-
Fixes #

-->

#### What
Part 1 for WEB-848. 

This PR implements initial path to enable relay compiler option in
Turbopack. PR is based on approach WEB-955, that passing custom plugin
transform itself instead of trying to pass down configuration into
turbopack. In result, this PR requires counterpart turbopack PR at
https://github.com/vercel/turbo/pull/4721.

PR also refactors next-shared's transform bit, as we have grown number
of custom transforms.

Unfortunately there are some runtime errors with this transforms, so it
is not possible to use relay actually yet. WEB-956 tracks this.
(https://github.com/swc-project/plugins/pull/179)

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-05-09 11:09:34 -07:00
OJ Kwon
0dce75f642
ci(test): enable turbopack test (#49466)
<!-- 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 or adding/fixing 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



### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

closees WEB-1019.

As discussed, this PR enables running a set of next.js integration tests
with turbopack as blocking CI check. The tests listed as `enabled` is
considered as stable, that should not fail in any case except upstream
test flakyness.

Current approach is simple as we have only small set of tests and does
not consider it becomes a bottleneck. Adding a test under
https://github.com/vercel/next.js/pull/49466/files#diff-fdc68d6039dbe36607cda253b318cd3598a09a94ccb8994f3695aa1d9e1e404bR2
will makes run with turbopack in the CI. in the future, I'll revise test
suite itself so runner, or test case can mark & execute test with
existing test group / scheduling.
2023-05-09 10:46:54 -07:00
Shu Ding
000d022b4e
Support .bind syntax with Action functions (#49422)
This PR implements initial support for `.bind` syntax for inline actions
(not top-level `"use server"` files yet). For example:

```js
export default function Page({ foo, x, y }) {
  async function action(a, b, c, d) {
    'use server'
    console.log(a, b, c, d)
  }

  return <ClientComp action={action.bind(null, foo[0], foo[1], foo.x, foo[y])} />
}
```

Is now valid.

Fixes NEXT-1109.
2023-05-09 19:05:20 +02:00
Shu Ding
d9b82a9535
Fix HMR support for server layer imported SASS and SCSS (#49534)
Closes #43396.

https://github.com/vercel/next.js/issues/43396#issuecomment-1538638785
fix NEXT-684
2023-05-09 16:28:37 +00:00
Shu Ding
881d202962
Fix server CSS imports and HMR not working properly in specific conditions (#49462)
In Hot Reloader we use `mod.resource.replace(/\\/g, '/').includes(key)`
to see if the module is the entry. However that `includes` check isn't
solid. Say the entry key is `app/path/page`, these will all be matched:

```
app/path/page.js
app/path/page.css
app/unrelated/app/path/page/another/page.js
```

This PR fixes that and added a test case. I'm unsure if this fixes the
newly reported cases in #43396.

fix NEXT-1110
2023-05-09 17:48:19 +02:00
lijianan
201ab71ee7
type: update React.CSSProperties type to Record (#49186)
<!-- 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 or adding/fixing 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 #

-->
update React.CSSProperties type to Record

---------

Co-authored-by: Parbez <imranbarbhuiya.fsd@gmail.com>
2023-05-09 15:16:55 +02:00
Josh Parnham
5451564f36
[docs] Add iOS hydration mismatch details to error page (#43584)
We recently ran into hydration mismatch errors on iOS, which we realised
was due to iOS automatically converting what it thought were phone
numbers into links.

We then found this GitHub issue,
https://github.com/vercel/next.js/issues/38290, and thought it would be
useful to add these details to the documentation page linked from the
next.js error.

---

Example from the linked issue:


![image](https://user-images.githubusercontent.com/712727/204925813-f986e2ca-29c2-4b63-9121-df4c7b00b1d8.png)

## 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)

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-05-09 12:55:41 +02:00
Darsh Patel
81f5ed7aa2
Fix: Router.query contains _next when using middleware with dynamic routes (#48753)
Fixes: #43598

This was a tricky one to find! Not sure why more people aren't
complaining about this issue, was super annoying in my use case since
links had the wrong URL.

## What?
This issue only occurred when basepath was defined and middleware and
dynamic pages are being used.
Example from the reproduction repo mentioned in the issue tagged:
<img width="686" alt="Screenshot 2023-04-23 at 9 32 55 PM"
src="https://user-images.githubusercontent.com/11258286/233850968-e14f6b49-858b-410e-b8f9-93c90447090a.png">


## Why?
`nextConfig` wasn't passed to `getNextPathnameInfo` function, hence the
basePath wasn't removed from a intermediate variable and that trickled
down to cause this issue.

Added test case based on the issue reproduction repo

---------

Co-authored-by: Jimmy Lai <laijimmy0@gmail.com>
2023-05-09 12:49:27 +02:00
Shu Ding
761c293093
Add test case for #49235 (#49488)
This PR adds a test case for `headers()` and `cookies().set()` in Client
Component imported actions.
2023-05-09 11:17:44 +02:00
Jiachi Liu
4171cf3866
test: pages react version with react hook in deployment (#48907)
testing react version in pages for deployment env
2023-05-09 11:16:56 +02:00
Cesar Kohl
d6c83a4fef
Replace var with const (#49379)
Hey there :) I found this small issue.

Replace `var` with `const` for block-scope variable declaration
following the standard introduced by ES2015.

<!-- 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 or adding/fixing 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 #

-->
2023-05-09 10:25:39 +02:00
Wojciech Grzebieniowski
e570ad4e56
Fix Node Crypto polyfill (#49288)
### What?

Allow overwriting the `global.crypto` property when polyfilling it.

### Why?

#48941 introduced `global.crypto` polyfill. The problem is that if some
library (e.g.
[xksuid](https://github.com/ValeriaVG/xksuid/blob/main/src/index.node.mjs))
tries to do the same thing, it breaks as `global.crypto` is defined as
non-writable[^1]. Arguably libraries should check for `global.crypto`
presence before overwriting it BUT I think polyfill should match the
actual implementation[^2].



### How?

Make `global.crypto` `enumerable` and `configurable`, as well as define
`set` implementation[^3].

[^1]:
![image](https://user-images.githubusercontent.com/7079786/236440322-7bcf1b18-8fcc-4bb9-b9b4-0f2eb032f5ba.png)

[^2]:
![image](https://user-images.githubusercontent.com/7079786/236437260-d3abdb0c-134f-4c9d-aab8-de7bf4d7c831.png)

[^3]:
![image](https://user-images.githubusercontent.com/7079786/236440393-1c469035-a9f1-4fbe-9ce7-c0308e980510.png)

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-05-09 09:48:12 +02:00
JJ Kasper
04799216ec
Fix failing actions e2e deploy test (#49497)
x-ref:
https://github.com/vercel/next.js/actions/runs/4921305860/jobs/8791173036
2023-05-08 21:09:42 -07:00
vercel-release-bot
8d228780e7 v13.4.2-canary.3 2023-05-09 01:27:04 +00:00
JJ Kasper
7a1bc235f5
Update start release workflow inputs (#49492)
Uses the choice input type instead of requiring manually typing the
values.
2023-05-08 17:26:33 -07:00
Toru Kobayashi
dbb412437a
fix: better error message with an invalid assetPrefix (#49403)
fixes #47641

This adds a friendly error for loading a font error caused by the
invalid `assetPrefix` setting.

Current:
<img width="747" alt="image"
src="https://user-images.githubusercontent.com/250407/236685607-c03b6160-9e8c-4c88-80e1-714f6a140588.png">


This PR:
<img width="890" alt="image"
src="https://user-images.githubusercontent.com/250407/236685499-da4c3d69-0f97-458d-8709-dcc43475e0e9.png">


<!-- 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 or adding/fixing 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: JJ Kasper <jj@jjsweb.site>
2023-05-08 16:14:48 -07:00
JJ Kasper
71d354363e
Fix external rewrite with body (#49487)
This ensures we use the proper body stream when rewriting to an external
resource as currently it tries to consume an already read body stream.

Fixes: https://github.com/vercel/next.js/issues/48040
2023-05-08 15:22:02 -07:00
Shu Ding
20e13490ab
Restrict useOptimistic and useFormStatus APIs on the server layer (#49331)
This PR extends `invalid_server_react_dom_apis` with
`experimental_useOptimistic` and `experimental_useFormStatus` to create
early compile-time errors.
2023-05-09 00:02:32 +02:00
JJ Kasper
5ca02a875c
Fix actions redirect handling (#49483)
This ensures we properly strip conflicting headers from being forwarded
when handling the redirect request/response in actions.

x-ref: [slack
thread](https://vercel.slack.com/archives/C042LHPJ1NX/p1683218335368759)

Fixes: 

```sh
failed to get redirect response TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11413:11) {
  cause: RequestContentLengthMismatchError: Request body length does not match content-length header
      at write (node:internal/deps/undici/undici:9907:41)
      at _resume (node:internal/deps/undici/undici:9885:33)
      at resume (node:internal/deps/undici/undici:9787:7)
      at connect (node:internal/deps/undici/undici:9776:7) {
    code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  }
}
```
2023-05-08 14:41:58 -07:00
Jiachi Liu
b20d5f2df7
Fix metadata image route encoding (#49482)
Fix the bad encoded buffer introduced in #49323
2023-05-08 14:16:34 -07:00
JJ Kasper
00ed2ba7cc
Fix revalidate: false detection in app (#49473)
When revalidate isn't defined in the tree at all and a fetch without
cache/revalidate fields is done we are incorrectly marking the initial
revalidate period with a time based value when it should be `false`.
This causes pages that should be fully static to revalidate
unexpectedly.

x-ref: [twitter
thread](https://twitter.com/diegohaz/status/1655638433795014657)
x-ref: [slack
thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1683566860136879)
2023-05-08 13:19:41 -07:00
vercel-release-bot
3a5501e678 v13.4.2-canary.2 2023-05-08 19:41:35 +00:00
Shu Ding
7730ee1c38
Add request-async-storage to the shared layer (#49470)
This should fix the `requestAsyncStorage not available` error. [Related
report](https://vercel.slack.com/archives/C03S8ED1DKM/p1683553422581859).
2023-05-08 21:33:55 +02:00
Jiachi Liu
5b5c4c3209
Replace metadata clone with custom handler in dev (#49343) 2023-05-08 20:47:41 +02:00
Lee Robinson
e6cfc155a7
Add link to Server Actions docs. (#49384)
To learn more 😄

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-05-08 11:09:20 -07:00
Steven
1c005eb303
Revert "Temporarily disable app dir export integration test" (#49311)
- Reverts vercel/next.js#48291
- Fixes #49059 
- TODO: move these tests to `./tests/e2e/*` to avoid flakes (that will be a follow up PR)
fix NEXT-1092
2023-05-08 17:38:33 +00:00
vercel-release-bot
660d531b6a v13.4.2-canary.1 2023-05-08 16:14:45 +00:00
Jiachi Liu
96c7acf6ad
Inline static data buffer instead of using fs read (#49323) 2023-05-08 16:20:44 +02:00
Jimmy Lai
44e9f0b28c
app-router: add startTransition call to revalidate dispatcher (#49453)
This PR wraps the server patch dispatcher with a transition, we generally want all router dispatch to go through one

I'll follow up on tests properly later



link NEXT-1096
2023-05-08 13:17:17 +00:00
vercel-release-bot
c93747eb33 v13.4.2-canary.0 2023-05-08 09:19:39 +00:00
Tim Neutkens
e15741daca
Remove empty config warning (#49435)
## What?

Removes the empty `next.config.js` warning. Given that `create-next-app` now ships with an empty config with the type definition comment the warning is no longer needed.

## How?

Removed the warning, removed the tests.

Fixes NEXT-1107
2023-05-08 08:58:14 +00:00
Andrew Clark
7e02f11e3a
Upgrade React to 18.3.0-canary-16d053d59-20230506 (#49402)
Fixes a bug where `useFormStatus` crashed during SSR.

Includes the following upstream changes:

- [16d053d59](https://github.com/facebook/react/commits/16d053d59) Add useFormStatus to server rendering stub ([#26788](https://github.com/facebook/react/pull/26788)) (Andrew Clark)
- [efb381bbf](https://github.com/facebook/react/commits/efb381bbf) [Release Script] Print a hint where to get the token ([#26783](https://github.com/facebook/react/pull/26783)) (dan)
- [b00e27342](https://github.com/facebook/react/commits/b00e27342) Use native scheduler if defined in global scope ([#26554](https://github.com/facebook/react/pull/26554)) (Samuel Susla)
- [783e7fcfa](https://github.com/facebook/react/commits/783e7fcfa) React DevTools 4.27.6 -> 4.27.7 ([#26780](https://github.com/facebook/react/pull/26780)) (Ruslan Lesiutin)
- [377c5175f](https://github.com/facebook/react/commits/377c5175f) DevTools: fix backend activation ([#26779](https://github.com/facebook/react/pull/26779)) (Ruslan Lesiutin)
2023-05-07 16:43:06 +00:00
Sanjaiyan Parthipan
173381a572
Fix error message about preconnect 📝 (#40360) 2023-05-07 00:05:07 +00:00
Jiachi Liu
9028a169ac
Add typescript version to next-info (#49346)
typescript version could be helpful for determing user's problem with ts, especially typing with react
2023-05-06 03:17:15 +00:00
Tim Neutkens
061443f804
Fix issue where nextP is not replaced in searchParams (#49315)
## What?

Fixes a bug with iterating over the searchParams while `delete` and
`append` are used.

This is the minimal example of what happened:

```js
const searchParams = new URLSearchParams('a=valueA&b=valueB&c=valueC')

for(const key of searchParams.keys()) {
    console.log(key)
    if(key === 'b') {
      searchParams.delete('b')
      searchParams.append('bb', 'valueBB')
    }
}
```

Output is:

```
a
b
bb
```

Instead of:

```
a
b
c
bb
```

The reason seems to be that the iterator uses an internal count while
iterating, e.g. the implementation in JavaScriptCore:
0743137c2f/Source/WebCore/html/URLSearchParams.cpp (L155-L163)


This can't be reproduced with `new Map()` or `new Set()`.

This PR fixes it by only iterating over the keys that are known before
the loop starts.

Fixes an issue [reported by
users](https://vercel.slack.com/archives/C03S8ED1DKM/p1683007482211449).

<!-- 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 or adding/fixing 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 #

-->
2023-05-05 21:55:47 +02:00
Shu Ding
ef8fef1350
Fix link not being GC'd sometimes (#49318)
The `app-link-gc` module should treat the link with just pathname as the
href and full URL as the same resource. This avoids duplicate styles
during HMR:

<img width="482" alt="CleanShot 2023-05-05 at 18 12 12@2x"
src="https://user-images.githubusercontent.com/3676859/236511257-af510ed2-8e21-430a-bf71-24931b10e5de.png">

[Related bug report
(internal)](https://vercel.slack.com/archives/C03KAR5DCKC/p1683295788069859).
2023-05-05 20:23:35 +02:00
Leah
75eccf7c7f
make sure server component externals only apply to files resolvable by node (#49147)
Fixes WEB-959
2023-05-05 17:33:30 +00:00
Shu Ding
9bd00a8896
Add test case for client sourcemaps (#49308)
This PR adds a test case to ensure that the server reference doesn't expose actual content of the original file in its sourcemap.

Closes NEXT-1041.
2023-05-05 14:23:04 +00:00
vercel-release-bot
92ff2dd7bb v13.4.1 2023-05-05 12:31:07 +00:00
vercel-release-bot
2c37ec01c5 v13.4.1-canary.2 2023-05-05 11:07:10 +00:00
JJ Kasper
618dc2ee63
Fix require-hook with just pages on deploy (#49274) 2023-05-05 12:40:23 +02:00
Tim Neutkens
25a9547cad
Remove experimental config from create-next-app (#49241)
## What?

Removes `experimental.appDir` this was leftover from when I flipped the
switch.

Kept the config file as in the future we might add future flags and
such. It also helps that it has the types comment included so you always
get types.

<!-- 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 or adding/fixing 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: JJ Kasper <jj@jjsweb.site>
2023-05-05 00:22:28 -07:00
JJ Kasper
c881224eae
Add experimental verbose logging flag (#49250)
Only shows fetch request logs by default and allows opting into verbose
request timings via experimental config.

x-ref: [slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1683236293282549)
2023-05-05 00:05:51 -07:00