Commit graph

12562 commits

Author SHA1 Message Date
hashlash
ad613e4d3d
[Docs] Add useState and useEffect import (#40944)
It makes copy-pasting the code easier since the person will be aware of
the import

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

## Documentation / Examples

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

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-27 12:51:32 -07:00
Artur Sedlukha
377a39a88d
Typo in middleware upgrade guide (#40963)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

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

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-27 12:40:50 -07:00
Henrik Wenz
a283b7b14e
docs: add inline documentation for Link props (#40855)
## Example

**Instead of:**

<img width="674" alt="Screenshot 2022-09-23 at 21 25 58"
src="https://user-images.githubusercontent.com/1265681/192042744-6f1163e2-32af-49a0-bfba-385e5a7bad71.png">


**we should show:**

<img width="890" alt="Screenshot 2022-09-23 at 19 37 21"
src="https://user-images.githubusercontent.com/1265681/192042552-29e6a35a-49fc-4be1-89bf-edaa7b2f6dd9.png">

## Documentation / Examples

- [x] Make sure the linting passes by running `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)

## Further Links

- https://tsdoc.org/

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-27 12:33:01 -07:00
Hannes Bornö
f53f5815f2
Font loader support in app (#40898)
Makes sure font loader CSS ends up correctly in the Flight Manifest and Flight Client Entries.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-27 18:10:05 +00:00
Gal Schlezinger
b24800bebf
[edge] serialize custom config to middleware-manifest (#40881)
This PR serializes `regions` into `middleware-manifest.json`,
allowing to extend Edge Functions and Middleware for deployment
providers.

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

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

Co-authored-by: Seiya Nuta <nuta@seiya.me>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-27 10:30:15 -07:00
JJ Kasper
9657f99eed
Add timeout to playwright setup job (#40960)
The `npm i` step sometimes stall due to the network in GitHub actions so
this adds a timeout so we aren't wasting CI time on this.

x-ref:
https://github.com/vercel/next.js/actions/runs/3136162957/jobs/5092826951
2022-09-27 09:41:22 -07:00
Jimmy Lai
c69677a553
remove reducer from server bundle (#40959)
This reducer takes a good chunk of the bundle but is never run on the server so we can eliminate it. 5-10ms wins from my manual benchmark runs.

![image](https://user-images.githubusercontent.com/11064311/192577550-4b2c3fa1-1ce9-456a-a635-d708e8200f2d.png)


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-27 16:36:17 +00:00
Jimmy Lai
6be2868787
misc: add benchmarking script for edge rendering (#40716)
This PR adds the benchmarking script I've been using for #40251 to
measure the performance improvements that we make to the Edge SSR
runtime.

This tool:
- uploads two version of the benchmarking project to Vercel, one with
the latest canary and the one with your current local changes in dist
(don't forget to build!)
- runs some tests against the published url to measure TTFB
- displays a nice chart and table

What this doesn't do (yet):

- allow you to choose which URL to compare
- allow you to change the measured metric
- run a battery of differnet test


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`


https://user-images.githubusercontent.com/11064311/191270204-04447e20-5a40-43a9-bcda-b7eaeb3d270a.mov


## Documentation / Examples

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

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-27 17:57:16 +02:00
Shu Ding
bb42d40fb7
Always show node_modules inside test in VS Code (#40956)
As per #40926 we commit all node_modules inside test so we can test external packages. It will be much more convenient to not hide them in VS Code. With this configuration, all node_modules folders will be excluded except for these under the test directory.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-27 15:21:30 +00:00
Tim Neutkens
833a67ff8c
Rename 404 -> not-found for new router (#40941)
As discussed with @sebmarkbage, the handling is more about showing a not found component than it is about a specific status code as these can come in late with streaming.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-27 13:50:21 +00:00
Jiachi Liu
b508fef218
Merge e2e test node_modules (#40926)
Merge e2e tests customized `node_modules` with installed `node_modules`,
to let you debug easily locally without moving folder between
`node_modules` and `node_modules_bak`

Also add `optoutServerComponentsBundle` to config schema.
2022-09-27 15:18:08 +02:00
Shu Ding
c86a9b992d
Code refactoring for webpack-config (#40942)
Clean up some utils, global variables and RegExp usages from the places
I touched recently.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-27 12:03:57 +02:00
Shu Ding
da8d299111
Fix SWC loader ignore for the server layer when Babel is used (#40939)
Specific logic to handle the file transpilation on the server layer is
implemented in SWC (#40603). When Babel is enabled, that SWC transform
is ignored at the moment. In this PR we add an additional SWC pass after
Babel to handle that.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

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

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-27 11:31:25 +02:00
Tim Neutkens
a92a3b6d3a
Handle loading returning undefined (#40938)
Since React 18 returning `undefined` from components is allowed which renders to `undefined` in the RSC response so we need a separate prop to know if the loading boundary was provided.

Thanks to @finn-orsini who reported this problem.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-27 08:46:30 +00:00
Shu Ding
406d69d4d9
Fix bundling and module resolution in the server layer (#40818)
We currently resolve the `react-server` condition correctly inside
`externals` for the server layer, however that will cause the resolved
path to be external (as it is called "externals").

So we need a way to hook into the module resolution process to force it
to use the `react-server` condition **when it's on the server layer**.
The `resolve` option doesn't give us that ability, and the solution in
this PR is to leverage `normalModuleFactory`'s resolve hook to override
the resolve options before actually resolving it. And there we can have
the `contextInfo`.

One thing left out is bundling for the edge server, we need to add tests
and sort that out carefully.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-27 10:18:06 +02:00
JJ Kasper
83c25b74d6
v12.3.2-canary.10 2022-09-26 23:31:23 -07:00
JJ Kasper
eb424042f8
Ensure skipClientCache is honored for router.push (#40932)
Fixes: https://github.com/vercel/next.js/issues/40927

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
2022-09-26 23:30:49 -07:00
Donny/강동윤
4f70f3af5d
chore: Update swc (#40928)
This PR updates swc crates to
3d393dd709

---

This PR applies

 - https://github.com/swc-project/swc/pull/5954

Closes https://github.com/vercel/next.js/issues/40803

 - https://github.com/swc-project/swc/pull/5956

Resolves
https://github.com/vercel/next.js/discussions/30237#discussioncomment-3717121
2022-09-26 22:50:50 -07:00
Bruno Crosier
83f89c4f87
Improve types for <Image /> and responseLimit (#40863)
Currently, a developer building a website using Next.js could write this
code with no type errors:

```tsx
<Image
  width="kangaroo"
  height="100px"
  quality="medium"
  {...rest}
/>
```

This PR adds stricter type checking, which will catch this type of error
earlier.

Similarly, this PR adds stricter types for the `responseLimit`, to
ensure the types align to:
https://nextjs.org/docs/messages/api-routes-response-size-limit

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-26 22:41:25 -07:00
JJ Kasper
7903b04bb4
Remove extra pnp test (#40929)
We already have quite a few PnP tests so this removes one of them that
is causing issues with unrelated PRs.

x-ref:
https://github.com/vercel/next.js/actions/runs/3131979254/jobs/5084663564
2022-09-26 21:54:35 -07:00
JJ Kasper
242bf65f98
Revert "Fix: Contentful webhook body parse." (#40925)
Reverts vercel/next.js#40732

x-ref:
https://github.com/vercel/next.js/pull/40732#issuecomment-1258779835
2022-09-26 17:01:54 -07:00
JJ Kasper
3544c79582
Bump TypeScript version in with-typescript (#40924)
Bumps the version for the legacy `with-typescript` example as it's
behind our recommended TypeScript version. We can investigate aliasing
this example to the default template in a follow-up.

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

x-ref:
https://github.com/vercel/next.js/pull/40863#issuecomment-1258771279
2022-09-26 16:59:46 -07:00
Jimmy Lai
11deaaa82b
edge-ssr: bundle next/dist as ESM for better tree-shaking (#40251)
# Context

Edge SSR'd routes cold boot performances are proportional to the
executed code size.

In order to improve it, we are trying to optimize for the bundle size of
a packed Edge SSR route.

This PR adds ESM compilation targets for all Next.js dist packages and
use them to bundle Edge SSR'd route.

This allows us to leverage the better tree shaking/DCE for ESM modules
in webpack in order to decrease the overall bundle size.

This PR also enables minifying Edge SSR routes. Since we don't control
which minifier might be used later (if any), it's best if we provide an
already optimised bundle.

<img width="903" alt="image"
src="https://user-images.githubusercontent.com/11064311/190005211-b7cb2c58-a56a-44b0-8ee4-fd3f603e41bd.png">

This is a 10ms cold boot win per my benchmarking script, which I'll put
in a subsequent PR.

Not done yet:
- ~~swap exported requires in `next/link` (and others) etc to point them
to the esm modules version~~

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

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [x] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Shu Ding <g@shud.in>
2022-09-26 16:56:16 -07:00
Jiachi Liu
2af6b63dd1
Should resolve esm external module imports on server (#40865)
### Issue

When import an esm package in client component, and use it in server
component page, it will fail to SSR but render successfully on client.
It's because the import to esm package will make the client chunk become
an **async module** since esm module will be treated as **async**.

```
page (serve component) -> local module (client) -> external dependency (esm)
```

Then in react SSR layer, it need the module type information of that
chunk, async or not for react so that react could unwrap the async
module from `Promise` properly when SSR.

### Solution

We need to mark the client entries which are effected by async/esm
modules that becoming **async** as `async: true` in SSR manifest.

Since flight manifest plugin is only running against client compiler,
which doesn't have those module information from server compiler. So we
collect the async modules from the **server** compiler **client** layer
from flight entry client plugin, then leverage the collection to detect
if a module is async in flight manifest plugin for react.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
2022-09-26 15:46:01 -07:00
Jiachi Liu
82682a3a53
Disable head element lint rule for appDir (#40921)
Only lint `<head>` elements usage in `pages/`, `<head>` should be able
to use in appDir
2022-09-26 15:20:16 -07:00
JJ Kasper
3837aa1cb0
Update expected middleware test error (#40918)
Fixes:
https://github.com/vercel/next.js/actions/runs/3128790934/jobs/5078100658#step:8:2223
2022-09-26 14:05:26 -07:00
Hannes Bornö
9ec041efbf
Update font loader output path (#40868)
Updates the output path so it's the same as when font files are imported
in CSS: `url(./font.woff2)`

Also adds missing font types to next package.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-26 12:59:38 -07:00
Jacob North
bb1dd47019
Correct link for "Deploy" button (#40894)
The old link was cloning the "with-chakra-ui-typescript" repo which has
been deprecated.

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

## Bug

- [x] Fixed issue with link in README.md
2022-09-26 12:51:31 -07:00
Abdallah NourAldin
194b6ad1c1
update url for React Hydration Documentation (#40883)
Docs point to old
__[hydrate()](https://reactjs.org/docs/react-dom.html#hydrate)__, which
had been replaced with
__[hydrateRoot()](https://reactjs.org/docs/react-dom-client.html#hydrateroot)__
as React 18 came:

> Note:
hydrate has been replaced with hydrateRoot in React 18. See
[hydrateRoot](https://reactjs.org/docs/react-dom-client.html#hydrateroot)
for more info.

From [react 18 docs](https://reactjs.org/docs/react-dom.html#hydrate).
2022-09-26 12:35:12 -07:00
JJ Kasper
84aa99e2c0
Update pre-compiled (#40914)
Fixes:
https://github.com/vercel/next.js/actions/runs/3128790934/jobs/5077187888
2022-09-26 10:59:04 -07:00
Jaril
904619509e
Use an ellipsis character instead (#40913)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

For context, making a test change to allow testing CI changes in
https://github.com/vercel/next.js/pull/40910 without approval each run.

@ijjk How's this? The string's not being snapshotted so it shouldn't
break any tests.
2022-09-26 10:24:24 -07:00
Tim Neutkens
6ceda2a3a2 v12.3.2-canary.9 2022-09-26 16:57:56 +02:00
Tim Neutkens
db705bb9b6 Update pnpm-lock.yaml 2022-09-26 16:56:52 +02:00
Tim Neutkens
7ccc95c525 v12.3.2-canary.8 2022-09-26 15:52:34 +02:00
Tim Neutkens
8b802ddb88
Update handling of redirect/404 throw to cross server->client boundary (#40890) 2022-09-26 13:16:20 +02:00
Tim Neutkens
3211b3f672
Upgrade react@experimental (#40885) 2022-09-25 21:35:05 +02:00
Tim Neutkens
f6e37fd32e
Apply #40833 (#40872) 2022-09-25 11:45:00 +02:00
Shu Ding
d4d9d91566
Add optoutServerComponentsBundle option (#40770)
Follow-up for #40739 to add an option to opt-out specific packages from being bundled.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-24 18:47:42 +00:00
Tim Neutkens
50ab2e48f7
Use startTransition for hydrateRoot to opt-in to non-blocking hydration (#40874)
As per @sebmarkbage's recommendation.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-24 18:10:40 +00:00
Shu Ding
bf0827d0ce
Flight client navigation error (#40861)
When navigating from app to pages, we do a flight render on the server
to generate the redirected path. However due to our new bundling
strategy we can't use the bundled `ComponentMod.renderToReadableStream`
because the component is now a regular component, not a RSC. In that
case we have to import the unbundled flight server.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-23 17:51:12 -07:00
JJ Kasper
01ecb60264
Update app-router options type (#40862)
x-ref: [slack
thread](https://vercel.slack.com/archives/C043ANYDB24/p1663973909118009?thread_ts=1663973783.142799&cid=C043ANYDB24)
2022-09-23 16:32:41 -07:00
Donny/강동윤
b68f78384e
chore: Update swc (#40832)
This PR update swc crates to
8a5ed1e0ba


Noticeable changes include

 - TS 4.9 support.
 - Huge performance improvement (of every api).
2022-09-23 14:09:41 -07:00
Henrik Wenz
cc7fd2c247
chore: refactor with-web-worker example (#40844)
## Changes

- Updated dependencies
- Migrated to typescript
- Removed `div` in favour of Fragment
- Replaces `var` with `let` since we don't need global hoisting here

## Documentation / Examples

- [x] Make sure the linting passes by running `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)
2022-09-23 14:08:30 -07:00
Miguel Afonso
6a11e22e2d
Update .env.local.example (#40839)
We use the variable "SANITY_REVALIDATE_SECRET" on the index page, but
the .env.local.example does not have this variable.

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

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-23 14:02:24 -07:00
CJ Dunteman
b3b8836e17
[docs] Update Cypress config file name (#40849)
The latest version of Cypress no longer supports `cypress.json`, use `cypress.config.js` instead. See details in the Cypress [docs](https://docs.cypress.io/guides/references/configuration).
2022-09-23 20:46:12 +00:00
Hannes Bornö
719116ac81
Allow export const in font loader (#40836)
Allow `export const font = Font()` syntax

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-09-23 20:40:59 +00:00
Kiko Beats
2e02204dc9
build: upgrade edge-runtime (#40788)
**TODO**

- [x] Ensure [body-stream](https://github.com/kikobeats/next.js/blob/edge-runtime/packages/next/server/body-streams.ts) is up-to-date with https://github.com/vercel/edge-runtime/blob/main/packages/runtime/src/server/body-streams.ts

Changelog: https://github.com/vercel/edge-runtime/releases/tag/edge-runtime%401.1.0-beta.33
2022-09-23 12:01:36 +00:00
Tim Neutkens
976ccce59b
Handle redirect in same way as 404 in new router (#40796) 2022-09-23 13:34:47 +02:00
JJ Kasper
5d9f390fe4
v12.3.2-canary.7 2022-09-22 19:50:38 -07:00
JJ Kasper
ce77607e50
Update error handling during app static generation (#40823)
This updates to ensure we properly error during static generation when a
non-dynamic SSR error is thrown so that unexpected errors are not
tolerated. This also fixes the static generation async storage not being
shared correctly due to different instances being created during
bundling.
2022-09-22 19:44:30 -07:00