Commit graph

16412 commits

Author SHA1 Message Date
Timothy Vernon
0759104287
Docs: Fix broken link (#51991)
Link leads to a 404 page
2023-06-29 20:39:49 +00:00
Tim Neutkens
e10431612d
Remove test skip (#51988)
Re-enables the test disabled in #51879 as it was fixed in #51973
2023-06-29 20:23:55 +00:00
Tyler Lutz
a2df492957
Update next lint section (#51898)
App directory is stable so you no longer need appDir.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-06-29 19:56:45 +00:00
Delba de Oliveira
18406adf9c
Make sure DevEx can approve docs PRs / Remove Spaces (#51996) 2023-06-29 17:10:53 +00:00
vercel-release-bot
152cfed6e8 v13.4.8-canary.11 2023-06-29 15:40:12 +00:00
vercel-release-bot
9ff526056b v13.4.8-canary.10 2023-06-29 13:55:17 +00:00
Tim Neutkens
ed280d2c46
Add shared input filesystem (#51879)
## What?

Currently we use 3 separate webpack compilers:

- server
- client
- edge

All of these were creating their own input filesystem (which is used to
read file, stat, etc.). Changing them to share a single inputFileSystem
allows the `cachedFileSystem` to be reused better, as `stat` and
`readFile` can be cached across the 3 compilers.

For the page on vercel.com we've been testing this shaves off 300-400ms
on a cold compile (no cache, deleted `.next`).

<!-- 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: Shu Ding <g@shud.in>
2023-06-29 15:49:05 +02:00
Jimmy Lai
8703c55f9f
export config into functions config manifest (#51700)
remaining:
- add tests

caveat: this only works at the route level, we won't inherit from the layout or anything. I think that's fine




Co-authored-by: Florentin / 珞辰 <8146736+ecklf@users.noreply.github.com>
2023-06-29 13:42:25 +00:00
Leah
484bdebc24
Update turbopack and swc_core to v0.78.24 (#51943)
Reverts #51940

### What?

Update SWC crates and turbopack

### Turbopack Updates

* https://github.com/vercel/turbo/pull/5366 <!-- Justin Ridgewell - Fix
bug with `imports` field from a nested directory -->
* https://github.com/vercel/turbo/pull/5361 <!-- Tobias Koppers - update
for next.js changes to env vars -->
* https://github.com/vercel/turbo/pull/5311 <!-- OJ Kwon -
test(filetrace): skip failing tests -->
* https://github.com/vercel/turbo/pull/5402 <!-- Leah - reduce indent in
`analyze_ecmascript_module` by splitting the function up -->
* https://github.com/vercel/turbo/pull/5412 <!-- Leah - Update
`swc_core` to `v0.78.24` -->

Closes WEB-1174

Turbopack counterpart: https://github.com/vercel/turbo/pull/5412

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-06-29 15:11:57 +02:00
Tim Neutkens
3773c5be8c
Ensure metadata test is not affected by other tests (#51973)
Turn out the `should error when id is missing in generateSitemaps` test
was passing because of this test passing: `should error when id is
missing in generateImageMetadata`

<!-- 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: Jiachi Liu <inbox@huozhi.im>
2023-06-29 15:10:19 +02:00
Ngô Đức Anh
c897933b6e
fix(typedRoutes): added missing anchor props to LinkRestProps (#51977)
### What?
This PR fixes `next/link`'s `<Link />` missing many `<a />` props when
`experimental.typedRoutes` is enabled.

### How?
It does that by changing `AnchorHTMLAttributes<HTMLAnchorElement>` in
LinkRestProps to
`DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>,
HTMLAnchorElement>`, which contains all `<a />` props.

Fixes #51907

---------

Co-authored-by: Shu Ding <g@shud.in>
2023-06-29 14:24:44 +02:00
Delba de Oliveira
7c5eb3191e
[Docs] Remove unnecessary mention of scroll false (#51964) 2023-06-29 12:21:49 +00:00
vercel-release-bot
68075376f0 v13.4.8-canary.9 2023-06-29 11:27:00 +00:00
Shu Ding
922a45839a
Optimize next-app-loader file resolution (#51924)
This PR changes `fs.stat` calls (to check if a file exists or not) to be
aggregated as `fs.readdir` calls and cached during the entire loader
pass. This is because we have a huge amount of file to check, but they
are always in a small amount of directories.

For example, a route that's 5-directory deep (`/a/b/c/d/page.js`) can
have up to 4,000 special segments and metadata files to check. However
they're always under these 5 directories. So instead of 4,000 `fs.stat`
calls let's just do 5 `fs.readdir` calls.

Didn't measure it carefully but a quick local test shows a 20~30%
improvement.

<details>
<summary>Another idea for future improvements</summary>
Currently, we create a MissingModuleDependency for any combination of
possible metadata filename. But in reality, we only need to track them
incrementally by index. For example if `icon1.js` is missing, it's kinda
waste to still track `icon2.js`~`icon9.js` because `icon1.js` will be
added first. This change should at least reduce the number of file
watchers by 80% and the initial compilation time by 0.5~1s, depending on
the actual route.
</details>

---------

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-06-29 13:21:32 +02:00
Tim Neutkens
b236670f97
Fix entrypoints.get and entrypoints.stream from turbopack (#50733)
## What?

Both `entrypoints.get` and `entrypoints.stream` threw an error because it was using the wrong tasks implementation. @sokra helped fix it.
2023-06-29 09:40:02 +00:00
Francesco Sansalvadore
b636d3d755
[examples] Update styling for with-supabase example (#51751)
### Adding or Updating Examples

Improve styling for the `with-supabase` example.

<img width="2048" alt="Screenshot 2023-06-24 at 15 07 46"
src="https://github.com/vercel/next.js/assets/25671831/0bba9a0a-a660-411e-b960-ea933aa2750a">
<img width="2048" alt="Screenshot 2023-06-24 at 15 07 58"
src="https://github.com/vercel/next.js/assets/25671831/00f70c8b-e6ea-47ac-8a2e-829b4b808280">

---------

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 21:11:13 -07:00
Balázs Orbán
3dcaf922de
docs: clarify reactStrictMode: true by default (#51931)
Closes #51841

[Slack thread](https://vercel.slack.com/archives/C03S9JCH2Q5/p1687815414309519?thread_ts=1687814821.415089&cid=C03S9JCH2Q5)

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2023-06-29 03:48:29 +00:00
Olivier Tassinari
60d27380f7
fix modularizeImports with @mui/material (#51953)
Fixes #51872. We were exploring in
https://github.com/mui/material-ui/pull/35457 the option to move the
`modularizeImports` config to our Next.js examples to fix
https://github.com/mui/material-ui/issues/35450 however, we never got to
complete the work.

We are not yet in a position where we can apply modularizeImports to
`@mui/material`. We still have folders to create to make it work.

Maybe we should close https://github.com/mui/material-ui/pull/35457?

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 20:26:04 -07:00
Jiachi Liu
f4b947fb56
Fix eslint async client component (#51952)
Fixes #51917 

It's throwing error in arrow function, should also be covered in the
lint rule
fix NEXT-1326
2023-06-28 20:03:32 -07:00
JJ Kasper
15b84c1dd3
lint fix 2023-06-28 20:00:37 -07:00
Lee Robinson
e602207cb0
docs: make custom image loader a client component. (#51858) 2023-06-28 19:36:20 -07:00
Charles Dudley
f17614abd1
[Docs] Fix run-on sentence (#51956)
As stated in title :)
2023-06-29 02:28:28 +00:00
Steven
946c9c5c46
Add unstable_getImgProps export from next/image (#51205)
### Description 

This PR refactors the Image component so that the core logic can be consolidated into a single function.

This allows usage outside of `<Image>`, such as:

1. Working with [`background-image`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-image) or [`image-set`](https://developer.mozilla.org/en-US/docs/Web/CSS/image/image-set)
2. Working with canvas [`context.drawImage()`](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Using_images) or simply `new Image()`
3. Working with [`<picture>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture) media queries to implement Art Direction or Light/Dark Mode images

### Example

```tsx
import { unstable_getImgProps as getImgProps } from 'next/image'

export default function Page() {
  const common = { alt: 'Hero', width: 800, height: 400 }
  const { props: { srcSet: dark } } = getImgProps({ ...common, src: '/dark.png' })
  const { props: { srcSet: light, ...rest } } = getImgProps({ ...common, src: '/light.png' })

  return (<picture>
  <source media="(prefers-color-scheme: dark)" srcSet={dark} />
  <source media="(prefers-color-scheme: light)" srcSet={light} />
  <img {...rest} />
</picture>)
}
```

### Related

fix NEXT-257

Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-06-29 01:35:08 +00:00
Mrxbox98
bd1fc78bd8
Add cpu-features to server external packages (#51946)
<!-- 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 #

-->
### What?
Adds [cpu-features](https://www.npmjs.com/package/cpu-features) to
external server packages.

### Why?
To prevent developers from having to add ``cpu-features`` to their next
config.
2023-06-28 17:52:04 -07:00
Jiachi Liu
3fb41561c4
Support react profiling option for app dir client components (#51947)
`reactProductionProfiling` was a next config working for pages before mainly for profiling react, this PR also enables it for pages.

### Chanegs

* Add react profiling entry and related alias
* Fix `reactProductionProfiling` is missing in next config type and schema

Closes #51131
2023-06-29 00:00:11 +00:00
Tyler Lutz
1f19a5b810
Add separate links in shared documentation (#51733)
### What?
- Added separate links for the app and pages router in the shared documentation.
- Added comment at the top of all shared documentation.
- Fixed typos in pages documentation comment.

### Why?
- To limit the switching between the different routers in shared documentation when clicking the links.
2023-06-28 23:37:56 +00:00
VelociRaptor
64c297f194
[docs] fix curly brackets in mdx (#51916)
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-06-28 23:19:49 +00:00
Christian Ivicevic
73491308b4
[docs] Replace the term "hole" with "slot" (#51919)
It feels more natural to use the actual term "slot" when describing how
to interweave server and client components since it's used in other
frameworks as well.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 16:07:15 -07:00
VelociRaptor
d390d75e1f
[docs] fix angle bracket in mdx (#51920) 2023-06-28 23:01:24 +00:00
Josh Goldberg ✨
0bd9b4bbdf
fix(next): improve error for using <Html> outside of document (#45056)
## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added -> this is a pretty niche edge case, do
you want me to?
- [x] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

Fixes #45024

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-28 15:40:35 -07:00
Jacob Fletcher
d206c68ad7
adds payload to server-external-packages.json (#51933)
### What?
Adds `payload` to the external package list

### Why?

To prevent developers using
[Payload](https://github.com/payloadcms/payload) modules within Next.js
from having to add this in their next config.
2023-06-28 13:03:08 -07:00
Jiachi Liu
e7b9b9a816
Update codeowners (#51935)
revert to the previous version of codeowners before vercel spaces is
applied
2023-06-28 12:17:41 -07:00
Leah
fd13fb5e64
Revert "Update swc_core to v0.78.24" (#51940)
Reverts vercel/next.js#51857

Because a turbopack update with the matching swc versions wasn't
included, this would increase the binary size
2023-06-28 19:35:04 +02:00
Justin Ridgewell
525ecf4158
Ensure edge runtime Pages API/App Route handlers AbortSignal aborts on client disconnect (#51727)
### What?

This ensures the `request.signal` `AbortSignal` that every Pages API and App Route handler receives aborts when the client disconnects.

### Why?

Now that we [support cancelling](https://github.com/vercel/next.js/pull/51594) responses mid-stream, it's important that we can communicate that abort to developer code. Eg, for AI endpoints that have an streaming `fetch` connection to the some 3p AI service, it's important that they're able to abort that stream when the client's browser disconnects.

### How?

Just need to listen for `error` events on Node's `IncomingMessage` request object, and forward that to an `AbortController`. After that, propagate the signal through the server to web-style handlers.
2023-06-28 16:50:45 +00:00
Donny/강동윤
e05c8c2d7e
Update swc_core to v0.78.24 (#51857)
### What?

Update SWC crates

### Why?

There were many fixes.

### How?

Closes WEB-1174


Turbopack counterpart: https://github.com/vercel/turbo/pull/5288
2023-06-28 16:04:35 +00:00
Leah
f2dc6c87e9
error recovery during turbopack hydration (#51882)
### What?

Makes sure the next.js hydration code can run and that we can open the error overlay when there's an error in the entry page

Fixes WEB-1168
2023-06-28 14:50:04 +00:00
Leah
f1a4f7ad7d
fix turbopack mdx import map (#51881)
I accidentally broke this with #49818
2023-06-28 14:19:33 +00:00
Sukka
e7a692537c
Reduce the client bundle size of App Router (#51806)
After migrating a Next.js app from Pages Router to App Router and using as many RSC as possible, I notice that the client js bundle size actually increases by 5%. It turns out that Next.js has introduced a lot of code to the client bundle.

<img width="1354" alt="image" src="https://github.com/vercel/next.js/assets/40715044/c7216fee-818b-4593-917e-bf0d2a00967a">

The PR is an attempt to reduce the client bundle size.
2023-06-28 13:32:10 +00:00
vercel-release-bot
e33b87d894 v13.4.8-canary.8 2023-06-28 09:04:46 +00:00
Shu Ding
ba252d8765
Simplify module context invalidation (#51905)
It _might_ be an overhead to send over a large amount of data over
`postMessage` just for diff. HMR and module compilation is way less
frequent than evaluation in the sandbox, so maybe we should always
invalidate the cache eagerly without any comparison and defer the
workload to `evaluateInContext`.

Some observations:

<img width="662"
src="https://github.com/vercel/next.js/assets/3676859/12136002-8857-4e10-ba9a-bf420d098dc8">

<img width="662" alt="CleanShot 2023-06-28 at 08 26 23@2x"
src="https://github.com/vercel/next.js/assets/3676859/db054948-a0ea-4d98-bf4f-aa125e0eb1b5">

![CleanShot 2023-06-28 at 08 02
24@2x](https://github.com/vercel/next.js/assets/3676859/b674beb1-d53c-4a1d-a9bf-ca3672e089c8)
2023-06-28 11:00:39 +02:00
Jimmy Lai
5b883bb5d1
performance: enable minification for the server bundles (#51831)
This PR makes the server code be minified.

## Why

This will improve performance of the server code because of the lesser
size, lesser time to parse and lesser code via tree sharking.

Cons: this should lead to increased build times, so a
`disableServerMinification` config was added


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

-->

link NEXT-1319
2023-06-28 09:08:17 +02:00
Milo
5b5ea47c54
Avoiding try-catch block on examples/app-dir-i18n-routing (#51786)
`Negotiator.languages()` accepts an array of available locales and
returns only results that are present in it.

This effectively eliminates the need to use a try-catch block when
calling `matchLocale`.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-27 17:00:14 -07:00
Shu Ding
702d3d291c
Add retries and clear message to font fetching (#51890)
Improve the problems mentioned in #45080.

- Adding error retries (3 attempts) to font fetching. When you have a slow network, it might take >3s to load.
- Improve the error message to tell you that you might have unstable network connection.
- Do not cause build error (caused by missing `AbortController`) in Node 14 (even if we don't support Node 14, better to pass the build instead of hard error).
2023-06-27 23:57:06 +00:00
vercel-release-bot
2c856cb256 v13.4.8-canary.7 2023-06-27 23:04:22 +00:00
Max Leiter
25629bb880
node-polyfill-web-streams: require from stream/web instead of stream (#51906)
Follow-up to #51901
2023-06-27 15:09:45 -07:00
Max Leiter
a3d3016de8
next/node-polyfill-web-streams: fix web stream polyfill for Node v16 (#51901)
### What?
Slack thread:
https://vercel.slack.com/archives/C050WU03V3N/p1687889719318819

In Node 16, the ReadableStream is not on the global but instead under
the `stream` package. We should polyfill the global with that
implementation, if available

### Why?
Fixes passing ReadableStream from the Node.js runtime to the vercel/ai
SDK.
2023-06-27 12:46:23 -07:00
OJ Kwon
73c905dc53
feat(next-dev): add a new experimental flag (#51895)
### What?

WEB-1239. This is mainly for the code paths to not to cause regressions to existing turbopack.
2023-06-27 18:34:04 +00:00
Jiachi Liu
a04a34d3b7
Support relative url for openGraph.url and itunes.appArgument (#51877)
To enable the ability of leveraging current `pathname` and configured `metadataBase` for other canonical like urls, we support those urls with auto resolving with `pathename` and `metadataBase` like canonical url, then you could just configure relative paths like below

```js
openGraph: {
    url: './abc', // will be resolved based on pathname and metadata base
},
itunes: {
   appId: 'my-app-id'
   appArgument: './native-app'
}
```


Fixes #51829
Closes NEXT-1302
2023-06-27 17:01:49 +00:00
Jiachi Liu
a54d08bd50
Fix windows fill metadata dynamic path (#51885)
Fixes #51583
Fixes NEXT-1315
2023-06-27 16:16:24 +00:00
Leah
252c5a6908
make stdout blocking on macos (#51883)
### What?

Node.js sets stdout to non-blocking by default, rust expects it to be blocking

so when logging a lot of data, it can happen that rust receives an error while writing causing it to panic, the error is just that the resource is temporarily unavailable, but rust doesn't handle this case

See https://github.com/napi-rs/napi-rs/issues/1630
2023-06-27 14:55:27 +00:00