Commit graph

17957 commits

Author SHA1 Message Date
Jimmy Lai
35a99232c0
misc: tweak stats github action (#56694)
This PR adds a few tweaks to our Github actions PR:
- expand by default the main section
- add some heuristics to not show hash/id changes in the diff view
- add some heuristics to not show increase/decrease size when it's too small (100 bytes is noise most often)
- add rendering runtimes to the list of tracked files


after vs before

![CleanShot 2023-10-11 at 14 56 36@2x](https://github.com/vercel/next.js/assets/11064311/548781bc-e893-45d1-aca4-de73b2b30299)

![CleanShot 2023-10-11 at 14 57 11@2x](https://github.com/vercel/next.js/assets/11064311/8e1c77e3-bed5-46ec-a756-62496df6729e)
2023-10-12 08:27:44 +00:00
Tim Neutkens
c1a1583dd0
Fix reconnection loop when devserver is offline (#56698)
Ensures the webpack-hmr socket is not reconnected infinitely while (and
very quickly) when the dev server is offline. I've implemented a gradual
backoff, after 5 tries at 1 second it'll try 20 times at 5 seconds.
After those 25 retries it reloads the page as something must be wrong
(i.e. the server is offline).

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

-->
2023-10-12 10:07:02 +02:00
vercel-release-bot
7d8cf1f9f3 v13.5.5-canary.8 2023-10-12 00:58:02 +00:00
Shu Ding
41e1dcae88
Improve internal waitUntil utility (#56720)
⚠️ This is an internal API and will be removed soon. Please do not use.

Refactors #56404 to have a better internal API used by both Edge SSR and Edge Route Handlers.

This new API can buffer non-synchronously created "waitUntil"s even after the response has been returned, just need to make sure that there's at least one "waitUntil" queued. E.g.:

```js
async function handler() {
  internal_runWithWaitUntil(async () => { // ← no await
    await taskA()

    internal_runWithWaitUntil(async () => { // ← no await
      await longRunningTaskB()
    })

    await taskC()
  }) 

  return Response(...)
}
```

Internally, the "waitUntil" promise will resolve after all tasks are finished.

cc @ijjk @cramforce @feedthejim as we've synced about some of the details here. Not using ALS because of some promise-related issues.
2023-10-12 00:52:32 +00:00
Zack Tanner
d735d317d1
fix static worker restart behavior (#56728)
In [55841](https://github.com/vercel/next.js/pull/55841), this file was reworked to improve type safety and readability, but it changed the behavior of how we were invoking methods on the worker. Specifically, when a restart occurred, this timeout wrapping function was referencing an already ended worker, resulting in a "Farm is ended, no more calls can be done to it" build error.

This PR ensures that we're fetching the method from the current `this._worker` at the time of invocation, not at the time of method creation.

[Slack x-ref](https://vercel.slack.com/archives/C04KC8A53T7/p1697064752635179?thread_ts=1696952142.759769&cid=C04KC8A53T7)
2023-10-12 00:19:29 +00:00
Michael Novotny
f0dd49e405
Updates Large Page Data error message doc to use JSON.parse to make reading output easier (#56713)
Fixes https://github.com/vercel/feedback/issues/26361
2023-10-11 21:10:44 +00:00
Zack Tanner
daa865fff6
fix lint error from fauna example (#56719)
https://github.com/vercel/next.js/pull/56185 wasn't passing lint checks

[x-ref](https://github.com/vercel/next.js/actions/runs/6487087673/job/17616654281?pr=56718#step:28:196)
2023-10-11 19:45:22 +00:00
Shadid12
216d968c9f
examples: Update Fauna example (#56185) 2023-10-11 12:39:25 -05:00
vercel-release-bot
ec0a8dac03 v13.5.5-canary.7 2023-10-11 13:05:55 +00:00
Tim Neutkens
5be28886c3
Use unique names for separate test suites (#56695)
These two get reported under the same name which makes it harder to
distinguish in the dashboard.

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

-->
2023-10-11 14:42:12 +02:00
Tim Neutkens
d6a1b5d533
Ensure rewrites are included in build manifest when using Turbopack (#56692)
The build manifest when using webpack includes the rewrites config so
that the Pages Router can correctly match the path. The manifest for
Turbopack was missing these properties which caused a bunch of the
middleware tests to fail. This PR reuses the function to generate
rewrites from build-manifest-plugin.

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

-->
2023-10-11 13:20:03 +02:00
vercel-release-bot
e8048b9974 v13.5.5-canary.6 2023-10-11 04:25:10 +00:00
JJ Kasper
dabeb51fff
Fix SSG query with experimental-compile (#56680)
Ensures query isn't omitted when using experimental compile mode with SSG pages as it skips the isReady delay that is normally done with prerendering.
2023-10-11 01:52:36 +00:00
Will Binns-Smith
d73b8366af
Use node:fs instead of fs-extra in .github/actions (#56536)
Test Plan: Stats for this PR?


Closes WEB-1730
2023-10-11 00:52:55 +00:00
OJ Kwon
d79f8a2f03
fix(next-core): allow sass loader for foreign codes (#56679)
### What?

- closes https://github.com/vercel/next.js/issues/55785

Similar to https://github.com/vercel/next.js/pull/56539, next.config's sass applies webpack loaders to node_modules implicitly and this PR mimics those for the turbopack.


Closes WEB-1753
2023-10-10 23:16:12 +00:00
Will Binns-Smith
c8b2d1b44a
(test only) Integration tests: remove flatMap polyfill (#56546)
This has been supported since Node 11. Remove this from our integration tests.

Test Plan: CI


Closes WEB-1735
2023-10-10 20:39:54 +00:00
JJ Kasper
7a08f0082d
Fix trace ignore handling (#56674)
This ensures we separate our ignore handling for next-server runtime entries and `.next/server` chunks. When these were combined our ignores caused modules that should were actually needed by user code to be excluded. 

Verified patch against the provided minimal repros

![CleanShot 2023-10-10 at 11 56 36@2x](https://github.com/vercel/next.js/assets/22380829/1dd83996-fa95-462a-98ed-485ce6c4d3f5)

![CleanShot 2023-10-10 at 12 01 08@2x](https://github.com/vercel/next.js/assets/22380829/c17c6147-0e3e-422b-bf2d-5fedfd6827ef)


x-ref: https://github.com/vercel/next.js/pull/56048#discussion_r1345651964
Fixes: https://github.com/vercel/next.js/issues/56357
2023-10-10 19:41:44 +00:00
Tobias Koppers
52356a0e14
invert test filtering logic to exclude known failing (#56663)
### What?

instead of include known passing tests

also updates the update test manifest

### Why?

Newly added test cases should always pass turbopack (or at least you would need to manually opt-out of it.

### How?

Uses a exclude list of tests instead of an allow list

Closes WEB-1752
2023-10-10 18:26:40 +00:00
vercel-release-bot
1b7895e0a4 v13.5.5-canary.5 2023-10-10 16:04:34 +00:00
Farsab
1c07848297
fix(docs): adjust api route documentation examples (#56660)
Fixed the example functions in the documentation to use `async` in order to use `await` within the function body. 

Co-authored-by: Michael Novotny <446260+manovotny@users.noreply.github.com>
2023-10-10 15:23:00 +00:00
Krishnanand Yadav
f6d6acd9ec
Update 01-contribution-guide.mdx: Fix a typo (#56665)
Fix a small typo in the metadata section of the contributing guide.

Kindly add the label: `hacktoberfest-accepted`.
2023-10-10 15:15:13 +00:00
Steven
35f507242c
fix: next dev with edge runtime on windows (#56502)
- Reverts https://github.com/vercel/next.js/pull/44616
- Regression introduced in https://github.com/vercel/next.js/pull/51651
- Fixes https://github.com/vercel/next.js/issues/55013
2023-10-10 14:03:03 +00:00
Jiachi Liu
5d2c503eac
remove unnecessary structuredClone (#56570)
An issue discovered from #56502 in azure pipeline

```
> Build error occurred
ReferenceError: structuredClone is not defined
```

`structuredClone` is not supported until nodejs 17, here we actually don't need to use `structuredClone` as the values are almost primitives, the deepMerge case we're using mainly objects and array, which are already handled above
2023-10-10 13:43:04 +00:00
Jimmy Lai
d4fcd03966
misc: split app-render into smaller functions (#56611)
This PR splits apart the function used to render App Router pages into smaller chunks for better readability + testing. A lot of the complexity is tied by the fact that a lot of the code of the function relied on closures so I had to coalesce a lot of the captured variables used into one big context that is then passed around during render.

There are a lot of things to slim down further but I don't have the energy to dig more.
2023-10-10 12:18:36 +00:00
Jimmy Lai
56fe014532
chore: bump pnpm to 8.9 (#56649)
There's allegedly a bump in performance for mac for pnpm 8.9 so upgrading it in the repo.
2023-10-10 11:23:10 +00:00
Chris Britten
c8064d69f6
docs(router): clarify dynamic route slug is about a file name, not "folder" (#56596)
### What?

Update documentation on dynamic routing to clarify the use of segment names within file names, rather than referring to them as "folder names".

### Why?

The original documentation used the example term `folderName` when it was referencing dynamic segment names within filenames.  The paths being described here are file names but not folders, and end in a file extension.  This could confuse readers and developers, especially those new to Next.js, leading to potential misunderstandings and misconfigurations.  Perhaps folderName was a relic of a different example wrapping a folder name to do a nested path or other configuration?  But here it seems out of place.

### How?

- Reviewed the provided documentation sections on dynamic routing.
- Replaced references to "folderName" with a different term "segmentName". 
- Ensured the examples provided in the documentation correctly showcase the use of segment names within filenames.
2023-10-10 00:03:49 +00:00
Shu Ding
260ea16467
Improve error handling of Server Actions with skewed deployment (#56618)
When there's a version skew, it might be possible that the Action's ID has changed and we're no longer able to locate it. By definition, that means we **should** return a 404 because it might have a different implementation now. Currently this throws a "cannot access workers of undefined" error which doesn't make sense.

Please review with whitespace ignored.
2023-10-09 20:42:41 +00:00
JoRyGu
3f25a2e747
clarify client components render on server on full page load (#55469)
IMO there is not enough of an indicator that client components render on the server on full page loads towards the top of the documentation page. I've seen plenty of experienced devs totally miss this critical info and get stuck on a problem due to a lack of understanding. Putting at least some kind of indicator above the fold would help with that.




Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-10-09 14:39:24 +00:00
Leah
b4660d8f25
feat(turbopack): add support for edge app pages (#56426)
<!-- 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: Tim Neutkens <tim@timneutkens.nl>
2023-10-09 16:32:20 +02:00
Mustafa Dağkıranlar
9b2f29ebaf
Update actions.ts (#56579)
fixed depricated nonempty()
2023-10-09 02:32:42 +00:00
Zeeshan Ali
bfc2ab9cff
corrected sentence (#56595)
Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-10-09 02:08:50 +00:00
Jiachi Liu
dbf35a7fd4
Fix build restart log (#56543)
### Observed Issue
```
⚠ Restarted collecting page data for [object Object] because it took more than 60 seconds
```

### Fix
The original issue is caused because the path is assigned to the `argument` array itself. Passing the argument type to the he worker, so in restart callback we're type safe, can the value will be correct.
2023-10-07 22:17:10 +00:00
Tim Neutkens
c60ecfcc1c
Ensure react-server-dom-turbopack-experimental uses the right package (#56560)
Was investigating why Turbopack with `serverActions: true` sometimes
crashes with a webpack specific error. Found it wasn't using the right
package.

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

-->
2023-10-07 19:37:58 +02:00
Zack Tanner
e039cc72fc
enable verbatimModuleSyntax to make type imports/exports explicit (#56551)
This has come up in code review a few times, so enabling the tsconfig setting so it's more easily caught.
2023-10-07 15:09:54 +00:00
stefanprobst
e75c366826
fix: don't add isolateModules to tsconfig when extending from tsconfig with verbatimModuleSyntax (#54164)
<!-- 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 #

-->

this is a follow-up to #48018 (don't add `isolatedModules: true` to
`tsconfig.json` when `verbatimModuleSyntax: true` is set), which also
handles the case where `verbatimModuleSyntax: true` is set in a base
tsconfig which is being referenced via `tsconfig#extends`.

---------

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
2023-10-07 07:38:56 -07:00
Tobias Koppers
542f080524
update test manifest (#56522)
update manifest from daily results

Closes WEB-1728
2023-10-07 11:07:59 +02:00
Will Binns-Smith
1286d73c95
Update rust-toolchain to nightly-2023-10-06 (#56541)
This:
- Updates rust-toolchain to nightly-2023-10-06
- Removes allowing clippy rules for needless_pass_by_ref_mut and non_canonical_partial_ord_impl as these were never needed by this repo.

Test Plan: CI


Closes WEB-1733
2023-10-07 09:05:44 +00:00
Wyatt Johnson
4d9b00ada3
refactor: cleanup app render (#56538)
This is just moving the `wrappedRender` function out of the `renderToHTMLOrFlight` function so that it's defined in the module scope.

You'll want to turn on hide whitespace during review 😉
2023-10-07 04:49:51 +00:00
Radu Petre Tarean
06ee9d7ca0
docs: update code snippet for correct file name (#56006)
params would be undefined on the /item route, i believe the route should be /item/[id]
2023-10-07 00:41:03 +00:00
jazsouf
82c095f8c2
docs: add missing word (#56547)
small typo




Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-10-07 00:23:09 +00:00
Wyatt Johnson
50dff93902
Unsilence Taskr Webpack errors (#56542)
Discovered while investigating https://github.com/vercel/next.js/pull/56526, turns out errors occuring during webpack builds do not fail the `pnpm build` which kicks off `taskr`. This is because `taskr` runs their plugins within coroutines, which based on the result, was not handling the promise rejections as expected.
2023-10-06 23:38:18 +00:00
Balázs Orbán
67cd9146c6
fix: log error cause (#56528)
### What?

While debugging #56456, I noticed that we cut useful information, namely the `Error` instances' [`cause` property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause).

### Why?

In #56456, it was hiding the following:

```sh
Error: getaddrinfo EAI_AGAIN undefined
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26)
    at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
  errno: -3001,
  code: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: 'undefined'
}
```

which might be an indicator to the user what was going wrong with the `fetch` call.

### How?

If there is a `err.cause` property, log it together with `err.digest`


Note, this does not fix #56456 but might be useful to debug similar issues as well.
2023-10-06 23:22:13 +00:00
Sukka
edb92a30b5
test: speed up isolated next instance test setup (#56525) 2023-10-07 00:15:59 +02:00
Will Binns-Smith
3c326ea5e8
Turbopack + app router: always use externals for predefined packages (#56440)
This applies the predefined list of packages in server-external-packages.json as always external when used by app router in Turbopack

Test Plan: Added integration tests

Closes WEB-1709
2023-10-06 19:08:01 +00:00
Jimmy Lai
c4c60b37f7
misc: force run e2e deploy tests with bundled server (#56513)
This PR forces the deployments used for e2e testing to use the bundled server.

Manual deploy run https://github.com/vercel/next.js/actions/runs/6430048350
2023-10-06 17:42:41 +00:00
Will Binns-Smith
58db85fb02
Add test for using external node_modules for pages (#56433)
This adds a test that asserts that, without additional configuration like `experimental.bundlePagesExternals`, Next.js does not bundle `node_modules` for pages.


Closes WEB-1708
2023-10-06 17:32:37 +00:00
vercel-release-bot
78b91243dd v13.5.5-canary.4 2023-10-06 15:46:54 +00:00
Shu Ding
9b671046b9
Flatten recursive wildcard exports in barrel optimization (#56489)
This PR flattens the recursive optimization logic of our barrel optimization loader. So now if there're any recursive `export * from ...`, they won't be created as multiple individual Webpack modules, but optimized in one module.

With this change, we are running SWC transform to get the export map directly inside the barrel loader (instead of a separate loader rule). And that map is recursively calculated and cached in memory.

I also published https://unpkg.com/browse/recursive-barrel@1.0.0/ to give this a test. It contains 4 levels of 10 `export *` expressions, which is 10,000 modules in total. Without this change, it takes ~30s to compile and with this change, it goes down to ~7s.
2023-10-06 15:39:15 +00:00
Justin Ridgewell
c6f5089ef2
turbopack: Extract as_chunk into shared ChunkType trait (#56506)
### What?

Step 3 in our chunking refactors extracts ChunkItem::as_chunk into a new ChunkType trait. This new trait isn't useful yet, but will eventually allow us to collect ChunkItems of a similar type into a lists, and perform chunking over all similar items at once.

### Why?

In the end we want to avoid creating chunks from modules directly, but enforce everything going through the ChunkingContext to be chunked. This allows us to replace the existing chunking algorithm with a much more efficient one that avoid duplication between chunks in first place and doesn't require a post-chunking optimization.

### How?

https://github.com/vercel/turbo/pull/6123

Re: https://github.com/vercel/next.js/pull/56504

Closes WEB-1724

Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com>
2023-10-06 15:28:57 +00:00
Jimmy Lai
bc15b5803c
misc: fix wrong next start start duration (#56512)
This PR fixes `next start` and `next dev` so that they show the correct server boot-up time. The previous way of computing the start time was incorrect and misleading as it did not start exactly when next started.

Before:
> ✓ Ready in 120ms

After:
> ✓ Ready in 286ms
2023-10-06 14:57:59 +00:00