Commit graph

19497 commits

Author SHA1 Message Date
Josh Story
23955574ae
Update React from 60a927d04 to 2bc7d336a (#61522)
Updates React from 60a927d04 to 2bc7d336a

Also updates aliases for `react.shared-subset` to `react.react-server`

### React upstream changes

- https://github.com/facebook/react/pull/28250
- https://github.com/facebook/react/pull/28225
- https://github.com/facebook/react/pull/28123
- https://github.com/facebook/react/pull/28240
- https://github.com/facebook/react/pull/28239
- https://github.com/facebook/react/pull/28245
- https://github.com/facebook/react/pull/28244
- https://github.com/facebook/react/pull/28238
- https://github.com/facebook/react/pull/28235
- https://github.com/facebook/react/pull/28221
- https://github.com/facebook/react/pull/28215
- https://github.com/facebook/react/pull/28214
- https://github.com/facebook/react/pull/28213
- https://github.com/facebook/react/pull/28212
- https://github.com/facebook/react/pull/28211
- https://github.com/facebook/react/pull/28247
- https://github.com/facebook/react/pull/28210
- https://github.com/facebook/react/pull/28186
- https://github.com/facebook/react/pull/28232
- https://github.com/facebook/react/pull/28169
- https://github.com/facebook/react/pull/28177
- https://github.com/facebook/react/pull/28170
- https://github.com/facebook/react/pull/28168
- https://github.com/facebook/react/pull/28122
- https://github.com/facebook/react/pull/27982
- https://github.com/facebook/react/pull/28217
- https://github.com/facebook/react/pull/28223
- https://github.com/facebook/react/pull/28208
- https://github.com/facebook/react/pull/28209
- https://github.com/facebook/react/pull/28200
- https://github.com/facebook/react/pull/28199
- https://github.com/facebook/react/pull/28198
- https://github.com/facebook/react/pull/28197
- https://github.com/facebook/react/pull/28196
- https://github.com/facebook/react/pull/28194
- https://github.com/facebook/react/pull/28192
- https://github.com/facebook/react/pull/28191
- https://github.com/facebook/react/pull/28182
- https://github.com/facebook/react/pull/28181
- https://github.com/facebook/react/pull/28180
- https://github.com/facebook/react/pull/28178
- https://github.com/facebook/react/pull/28201
- https://github.com/facebook/react/pull/28176
- https://github.com/facebook/react/pull/28162
- https://github.com/facebook/react/pull/28131
- https://github.com/facebook/react/pull/28190
- https://github.com/facebook/react/pull/28172
- https://github.com/facebook/react/pull/28171
- https://github.com/facebook/react/pull/28173
- https://github.com/facebook/react/pull/28174
- https://github.com/facebook/react/pull/28175
- https://github.com/facebook/react/pull/28136
- https://github.com/facebook/react/pull/28135
- https://github.com/facebook/react/pull/28134
- https://github.com/facebook/react/pull/28133
- https://github.com/facebook/react/pull/28132
- https://github.com/facebook/react/pull/28130
- https://github.com/facebook/react/pull/28202
- https://github.com/facebook/react/pull/28102
- https://github.com/facebook/react/pull/28161
- https://github.com/facebook/react/pull/28193
- https://github.com/facebook/react/pull/28195
- https://github.com/facebook/react/pull/28189
- https://github.com/facebook/react/pull/28160
- https://github.com/facebook/react/pull/28096
- https://github.com/facebook/react/pull/28183
- https://github.com/facebook/react/pull/28125
- https://github.com/facebook/react/pull/28157
- https://github.com/facebook/react/pull/28115
- https://github.com/facebook/react/pull/28124
- https://github.com/facebook/react/pull/28163
- https://github.com/facebook/react/pull/28164
- https://github.com/facebook/react/pull/28150
- https://github.com/facebook/react/pull/28159
- https://github.com/facebook/react/pull/28069
- https://github.com/facebook/react/pull/28110
- https://github.com/facebook/react/pull/28148
- https://github.com/facebook/react/pull/28116
- https://github.com/facebook/react/pull/28099
- https://github.com/facebook/react/pull/28100
- https://github.com/facebook/react/pull/28147
- https://github.com/facebook/react/pull/28128
- https://github.com/facebook/react/pull/28126
- https://github.com/facebook/react/pull/28139
- https://github.com/facebook/react/pull/28140
- https://github.com/facebook/react/pull/28141
- https://github.com/facebook/react/pull/28142
- https://github.com/facebook/react/pull/28113
- https://github.com/facebook/react/pull/28129
- https://github.com/facebook/react/pull/28114
- https://github.com/facebook/react/pull/28053
- https://github.com/facebook/react/pull/28091
- https://github.com/facebook/react/pull/28087
- https://github.com/facebook/react/pull/28112
- https://github.com/facebook/react/pull/28086
- https://github.com/facebook/react/pull/28101
- https://github.com/facebook/react/pull/28106
- https://github.com/facebook/react/pull/28117
- https://github.com/facebook/react/pull/28118
- https://github.com/facebook/react/pull/28105
- https://github.com/facebook/react/pull/27883
- https://github.com/facebook/react/pull/28111
- https://github.com/facebook/react/pull/28095
- https://github.com/facebook/react/pull/28108
- https://github.com/facebook/react/pull/28090
- https://github.com/facebook/react/pull/28089
- https://github.com/facebook/react/pull/28076
- https://github.com/facebook/react/pull/28074
- https://github.com/facebook/react/pull/28103
- https://github.com/facebook/react/pull/28098
- https://github.com/facebook/react/pull/28097
- https://github.com/facebook/react/pull/28068
- https://github.com/facebook/react/pull/28093
- https://github.com/facebook/react/pull/28094
- https://github.com/facebook/react/pull/28073
- https://github.com/facebook/react/pull/28084
- https://github.com/facebook/react/pull/28063
- https://github.com/facebook/react/pull/28085
- https://github.com/facebook/react/pull/28083
- https://github.com/facebook/react/pull/28065
- https://github.com/facebook/react/pull/28061
- https://github.com/facebook/react/pull/28077
- https://github.com/facebook/react/pull/28075
- https://github.com/facebook/react/pull/28078
- https://github.com/facebook/react/pull/28050
- https://github.com/facebook/react/pull/28011
- https://github.com/facebook/react/pull/28055
- https://github.com/facebook/react/pull/28066
- https://github.com/facebook/react/pull/28067
- https://github.com/facebook/react/pull/28010
- https://github.com/facebook/react/pull/27993
- https://github.com/facebook/react/pull/28052
- https://github.com/facebook/react/pull/28060
- https://github.com/facebook/react/pull/28059
- https://github.com/facebook/react/pull/28034
- https://github.com/facebook/react/pull/28033
- https://github.com/facebook/react/pull/28004
- https://github.com/facebook/react/pull/28051
- https://github.com/facebook/react/pull/28012
- https://github.com/facebook/react/pull/28001
- https://github.com/facebook/react/pull/28002
- https://github.com/facebook/react/pull/27995
- https://github.com/facebook/react/pull/28006
- https://github.com/facebook/react/pull/28005
- https://github.com/facebook/react/pull/28007
- https://github.com/facebook/react/pull/28008
- https://github.com/facebook/react/pull/28009
- https://github.com/facebook/react/pull/28000
- https://github.com/facebook/react/pull/28003
- https://github.com/facebook/react/pull/27997
- https://github.com/facebook/react/pull/27240
- https://github.com/facebook/react/pull/27977
- https://github.com/facebook/react/pull/27940
- https://github.com/facebook/react/pull/27939
- https://github.com/facebook/react/pull/28090
- https://github.com/facebook/react/pull/28089
- https://github.com/facebook/react/pull/28076
- https://github.com/facebook/react/pull/28074
- https://github.com/facebook/react/pull/28103
- https://github.com/facebook/react/pull/28098
- https://github.com/facebook/react/pull/28097
- https://github.com/facebook/react/pull/28068
- https://github.com/facebook/react/pull/28093
- https://github.com/facebook/react/pull/28094
- https://github.com/facebook/react/pull/28073
- https://github.com/facebook/react/pull/28084
- https://github.com/facebook/react/pull/28063
- https://github.com/facebook/react/pull/28085
- https://github.com/facebook/react/pull/28083
- https://github.com/facebook/react/pull/28065
- https://github.com/facebook/react/pull/28061
- https://github.com/facebook/react/pull/28077
- https://github.com/facebook/react/pull/28075
- https://github.com/facebook/react/pull/28078
- https://github.com/facebook/react/pull/28050
- https://github.com/facebook/react/pull/28011
- https://github.com/facebook/react/pull/28055
- https://github.com/facebook/react/pull/28066
- https://github.com/facebook/react/pull/28067
- https://github.com/facebook/react/pull/28010
- https://github.com/facebook/react/pull/27993
- https://github.com/facebook/react/pull/28052
- https://github.com/facebook/react/pull/28060
- https://github.com/facebook/react/pull/28059
- https://github.com/facebook/react/pull/28034
- https://github.com/facebook/react/pull/28033
- https://github.com/facebook/react/pull/28004
- https://github.com/facebook/react/pull/28051
- https://github.com/facebook/react/pull/28012
- https://github.com/facebook/react/pull/28001
- https://github.com/facebook/react/pull/28002
- https://github.com/facebook/react/pull/27995
- https://github.com/facebook/react/pull/28006
- https://github.com/facebook/react/pull/28005
- https://github.com/facebook/react/pull/28007
- https://github.com/facebook/react/pull/28008
- https://github.com/facebook/react/pull/28009
- https://github.com/facebook/react/pull/28000
- https://github.com/facebook/react/pull/28003
- https://github.com/facebook/react/pull/27997
- https://github.com/facebook/react/pull/27240
- https://github.com/facebook/react/pull/27977
- https://github.com/facebook/react/pull/27940
- https://github.com/facebook/react/pull/27939

Closes NEXT-2331
2024-02-05 18:22:27 -08:00
Jiwon Choi
4c5384351c
fix(next-eslint): .eslintrc.json not being created by next lint on App Router (#55104)
This PR fixes `.eslintrc.json` not being created after the user runs
`next lint` and selects an option of `Strict` or `Base`.
The reason is that the lint check was looking for `pages` and
`src/pages` only. Added `app` and `src/app` to be checked also.

Fixes: #55094
Fixes: #55102

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-05 15:47:18 -08:00
Allan Guigal
4ba1f06380
fix: status code to avoid navigation with empty props (#60968)
### What?
Currently, when a middleware is active and the path results in a 404,
the server responds with a 200 status code to data requests. We propose
a change to ensure that a 404 status code is returned in these
situations, as expected, solving production issues for the navigation
router.

### Why?
The client data requests (identified with `_next/data` path &
`x-nextjs-data` header) get answered the status code 200. The code below
is executed when there is a version skew for the data requests (e.g
prefetch in production).


4125069840/packages/next/src/server/lib/router-server.ts (L217-L227)

The version skew consists in the client side version identified with the
buildId in `__NEXT_DATA__ ` tag to be obsolete compared to the server
version (`BUILD_ID` file).

In the case of prefetching, this leads to the code above being executed,
therefore the `prefetch-reducer.ts` handles the response as valid and
sets it in its cache. Which ultimately triggers a navigation with empty
prop, resulting in erroneous behaviours reported in issues and in our
production websites:

4125069840/packages/next/src/client/components/router-reducer/reducers/prefetch-reducer.ts (L54-L74)

By switching the response to a 404, we trigger this code in the fetch
(`fetchServerResponse`). This change prompts a hard navigation
(mpaNavigation), effectively refreshing the client version and
resynching it with the server version.

4125069840/packages/next/src/client/components/router-reducer/fetch-server-response.ts (L125-L134)

### How?
We simply update the status code to 404 here:

4125069840/packages/next/src/server/lib/router-server.ts (L223)

Closes: https://github.com/vercel/next.js/pull/60785
Closes: https://github.com/vercel/next.js/issues/59295
Fixes: https://github.com/vercel/next.js/issues/47516

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-05 15:34:23 -08:00
vercel-release-bot
bdd0dd2d50 v14.1.1-canary.36 2024-02-05 23:22:30 +00:00
Aly Ahmed
19c2e197ea
fix setAssetPrefix when running on NextCustomServer (#61676)
### What?

Fixes `setAssetPrefix` when running on a custom server using next()
function

### Why?

Looks like when we run next custom server, there are 2 instances created
to handle this case

* main server in `/server/next.ts`
* and Render server `./server/lib/render-server.ts`

The issue mainly happens when calling `setAssetPrefix` it will update
only the main server and not render server

``` javascript
  const next = require('next')
  const app = next({ });
    app.setAssetPrefix('my-fancy-cdn/static');
    app.render(); // render server is used instead of the main server
```

### How?

when calling `setAssetPrefix` on the main server also update the render
server with the same information.

Fixes: #59940
Fixes: #51223 
Fixes: #61383

### Related Resources

#53523  #49805


c9c6ff6d77/docs/03-pages/01-building-your-application/06-configuring/10-custom-server.mdx

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-05 14:09:29 -08:00
OJ Kwon
a4d33d4acd
fix(next-core): adjust server alias for the context (#61690)
### What

This PR attempts to adjust import map to `server-only` / `client-only`
close to the existing webpack configs, makes to pass more tests.

Closes PACK-2396
2024-02-05 14:05:37 -08:00
Balázs Orbán
bb7577aa44
feat(ts): add JSDoc comments for public APIs (#61649)
### What?

This PR adds JSDoc comments to the most common public APIs to improve
the DX in IDEs like VSCode.

### Why?

Currently, we provide no information on some of the most used APIs in
IDEs, which makes it harder than it needs to be to look up the extra
information.

<details>
<summary><b>Before:</b></summary>
<img
src="https://github.com/vercel/next.js/assets/18369201/8b6092e8-8f9b-49da-a3df-b07a59982069"
width="640"/>
</details>

<details>
<summary><b>After:</b></summary>
<img
src="https://github.com/vercel/next.js/assets/18369201/30216f76-414a-43b0-9aa6-2fdd742ab3fe"
width="640"/>
</details>

### How?

Using JSDoc comments, I added a basic description to most public APIs
that link back to the current docs for more details. The description is
kept minimal to avoid out-of-sync documentation.

Note: In the future, the flow could be reversed here, and our API
Reference docs could actually be generated from a single source of
truth, the source code itself. However, this will require more work by
re-organizing our public API submodules in a single directory, (related
#61525), so the API docs are easy to maintain even without a deeper
knowledge of the codebase.

Note: These comments should also be extended to
methods/properties/arguments in these public APIs in the future.

Closes NEXT-2357

[Slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1706735292633029)
2024-02-05 20:31:59 +00:00
Sandeep Mani Kumar Kushwaha
2d488564e6
Fixed #61434 : Docs: Duplicated code snippets (#61446)
<!-- 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?

Issue - Docs: Duplicated code snippets

The code snippet is repeated, second snippet had to be with Link
component.

### How?
Replaced button with Link component.

Fixes #61434 - Docs: Duplicated code snippets

---------

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-05 12:13:29 -08:00
vercel-release-bot
b1f6b8246e v14.1.1-canary.35 2024-02-05 19:38:59 +00:00
Balázs Orbán
645be74efd
feat(cna): remove autoprefixer from default templates (#55725)
### What?

Removing `autoprefixer` from the default Tailwind CSS templates. (It can
be installed afterward)

### Why?

After some investigation by @timneutkens, `autoprefixer` seems to
introduce some compilation overhead

### How?

Removing `autoprefixer` from the auto-installed dependency list, it
would be up to the developer to install this plugin if they need it.

[Slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1695288906722539)
2024-02-05 14:22:47 -05:00
JJ Kasper
2ad058d356
Revert "build: upgrade edge-runtime" (#61686)
See here for additional context
https://github.com/vercel/edge-runtime/pull/795 but TLDR is due to a bug
in the `npmcli` we aren't able to publish Next.js releases after this
package was upgraded.

We can re-land the upgrade after that PR is landed/published. 

Reverts vercel/next.js#61030

Closes NEXT-2367
2024-02-05 19:18:08 +00:00
Balázs Orbán
492b4157f3
feat(ts): expose MiddlewareConfig interface (#61576)
### What?

Expose the `MiddlewareConfig` interface.

### Why?

You can now `import type { MiddlewareConfig } from "next/server"` to
type the `config` object in your `middleware.ts` file.

Now you an type the entire file for example like so:
```ts
// middleware.ts
import type { NextMiddleware, MiddlewareConfig } from "next/server"

export const middleware: NextMiddleware = async (req) => {
  //...
}

export const config: MiddlewareConfig = {
  //...
}
```

### How?

Re-exported the interface from its current location via
`server/web/types`, to colocate it with `NextMidldeware`.

I wonder if we could somehow type this file automatically, but it might
be dependent on https://github.com/microsoft/TypeScript/issues/38511

Closes NEXT-2308

[Slack
thread](https://vercel.slack.com/archives/C03S9JCH2Q5/p1706287433026409?thread_ts=1706058855.423019&cid=C03S9JCH2Q5),
[Slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1706659724141899)
2024-02-05 11:15:58 -08:00
vercel-release-bot
d1fa2876e8 v14.1.1-canary.34 2024-02-05 17:25:07 +00:00
JJ Kasper
dcb513f18c
Upload npm publish log as artifact for debugging (#61680)
Continuing to debug our failed npm publish with adding the debug logs as
an artifact

x-ref:
https://github.com/vercel/next.js/actions/runs/7778346463/job/21207995884#step:11:828

Closes NEXT-2365
2024-02-05 08:57:36 -08:00
Tim Neutkens
89e68377ba
Update next/font tests for Turbopack (#61665)
## What?

Updates the tests to correctly assert for Turbopack.

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

-->


Closes NEXT-2359
2024-02-05 13:25:10 +01:00
Donny/강동윤
8a11319efb
chore: Update @swc/helpers to v0.5.5 (#61659)
### What?

Update `@swc/helpers` to `v0.5.5`.

### Why?

- To apply https://github.com/swc-project/swc/pull/8574. This fixes a bug in helper, which can prevent useful operation while testing with `@next/jest`.

(https://github.com/swc-project/swc/pull/8097 is also included, but it's not used by next.js)

### How?



Closes PACK-2388
2024-02-05 19:22:32 +09:00
Tobias Koppers
2ac1468540
avoid processing client components and server actions in route handlers (#60985)
### What?

app api routes doesn't need to handle client components and server
actions


Closes PACK-2271
2024-02-05 09:57:14 +01:00
Vercel Release Bot
c9c6ff6d77
Update Turbopack test manifest (#61626)
This auto-generated PR updates the integration test manifest used when
testing Turbopack.
2024-02-05 08:08:33 +01:00
Sam Ko
47c74dc454
chore: update README.md (#61650)
## Description

On [second thought](https://github.com/vercel/next.js/pull/48717), the
previous heading size of (`##`) looks better.

Closes NEXT-2358
2024-02-04 18:54:54 -08:00
Ishaan
d245079177
Update README.md (#48717)
## Improving Documentation

### The following changes have been made to the official repository's
**Readme.md**:

- Shortened link text across the readme.
- Added additional descriptions for more details.
- Added bold text to highlight emphasis on important topics
- Changed heading sizes to indicate first headings (h1) for each section
instead of second headings (h2) which was previously being used
- Merged _'Who is using Next.js?'_ section with _'Getting Started'_
section for a more professional, cleaner look.

### The following changes have been made to the repository's
**Contribution docs**:

- Fixed two typos in the docs

---------

Co-authored-by: Sam Ko <sam@vercel.com>
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2024-02-04 18:47:51 -08:00
vercel-release-bot
5d2e79b61f v14.1.1-canary.33 2024-02-05 01:29:47 +00:00
Olivier Tassinari
6587a37b00
Mobile Friendly Test was retired (#61647)
https://twitter.com/googlesearchc/status/1731702833060237642
2024-02-05 01:23:58 +00:00
theItalianDev
29e7227362
enhancement(with-supabase): replace getSession() with getUser() (#61564)
### What?
Enhancement of _with-supabase example_. Replacing in **middelware.ts**,
**supabase.auth.getSession()** with **supabase.auth.getUser()**

### Why?
**Never trust supabase.auth.getSession() inside server code such as
middleware**. It isn't guaranteed to revalidate the Auth token.
**It's safe to trust getUser()** because it sends a request to the
Supabase Auth server every time to revalidate the Auth token.

[Setting up Server-Side Auth for
Next.js](https://supabase.com/docs/guides/auth/server-side/nextjs)
2024-02-05 00:24:39 +00:00
OMikkel
6d5cacad6e
Encode revalidateTag value fixes #61390 (#61392)
fixes #61390

### What?

Added encodeURIComponent to encode revalidateTag value beforing
appending it to the url.

### Why?

If a tag contains special characters the tag wont be revalidated because
the special characters arent encoded.
By encoding the tag any special characters can be used.
Check out issue #61390 for further explanation

I believe this is the reason why users report the revalidateTag as
unreliable. They might be using special characters in their tags to make
sure they are unique, but when deployed to vercel and the fetch cache is
used revalidateTag fail to revalidate them.

### How?

By encoding revalidateTag with encodeURIcomponent the tag can contain
special characters.

Closes NEXT-
Fixes #61390

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-05 00:17:46 +00:00
JJ Kasper
b44b7ebe35
Update to latest version of npm for publishing (#61644)
Seems https://github.com/vercel/next.js/pull/61641 also did not resolve
the `npm publish` error so going to upgrade to latest version as well as
we pinned to a previous major.

Closes NEXT-2354
2024-02-05 00:09:05 +00:00
JJ Kasper
2a824e97db
Ensure publish job has correct status on fail (#61645)
This ensures we show the job as failed correctly when any of the
packages didn't publish successfully.

x-ref:
https://github.com/vercel/next.js/actions/runs/7777481701/job/21205867173

Closes NEXT-2355
2024-02-05 00:06:16 +00:00
Sam Ko
c1bce948e9
chore: upgrade turbo to 1.12.2 (#61643)
## Changes

- Upgrade turbo from 1.11.3 to 1.12.2

Closes NEXT-2353
2024-02-05 00:03:06 +00:00
Sam Ko
5284451ed9
docs: update style9 to stylex (#61646)
## Description

The `style9` [repo](https://github.com/johanholmerin/style9) now
recommends `stylex` since `stylex` has been open sourced.
2024-02-04 16:02:15 -08:00
Andrew Paramoshkin
5ed493e548
docs: update useParams examples and pages usage (#61595)
<!-- 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 #

-->

Updated https://nextjs.org/docs/app/api-reference/functions/use-params
with:
* returns block, examples table: route with no dynamic parameters should
return an empty object
* returns block, `pages` usage: if `useParams` is used in `pages` it
will return `null` only for the initial render and will update its value
with dynamic parameters following the same rules as stated in the doc
above this point.

---------

Co-authored-by: Sam Ko <sam@vercel.com>
2024-02-04 23:44:43 +00:00
vercel-release-bot
498d29413b v14.1.1-canary.32 2024-02-04 23:21:04 +00:00
JJ Kasper
4a5f5dee3f
Remove extra edge-runtime/primitives override (#61641)
Follow-up to https://github.com/vercel/next.js/pull/61637 seeing if the
overrides change is impacting the publish error.

Closes NEXT-2352
2024-02-04 14:06:54 -08:00
JJ Kasper
90ac2df874
Revert "Revert actions/setup-node v4 bump" (#61640)
This doesn't appear to be the root cause so can re-land

Reverts vercel/next.js#61637

Closes NEXT-2351
2024-02-04 14:06:28 -08:00
Wojciech Maj
f7fcd2b773
Fix @react-pdf/renderer not working in RSC (#61317)
<!-- 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?

Fixes @react-pdf/renderer not working in RSC.

### Why?

Next.js RSC version of React does not include features necessary for
@react-pdf/renderer to work.

### How?

Adding @react-pdf/renderer to serverComponentsExternalPackages by
default.

Fixes #61313

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-02-04 21:30:47 +00:00
vercel-release-bot
db24fc0c3f v14.1.1-canary.31 2024-02-04 20:10:43 +00:00
JJ Kasper
226824e0d9
Revert actions/setup-node v4 bump (#61637)
Aims to revert back to previous npm version most likely bumped when this
action was bumped causing our publish to fail

x-ref:
https://github.com/vercel/next.js/actions/runs/7770035719/job/21189787242#step:11:307

Closes NEXT-2350
2024-02-04 19:37:05 +00:00
Zack Tanner
49020b7179
Remove unused mockedRes in resolveRoutes (#61635)
While looking into a bugfix in `resolveRoutes`, I noticed this mocked
req/res handler wasn't being used for anything anymore.


Closes NEXT-2342
2024-02-04 11:07:31 -08:00
Daniel Rivers
5602e6bc14
docs: Add Kinde to authentication docs (#61460)
Added Kinde to the authentication documentation, Its already mentioned
elsewhere in the docs just not here.

Co-authored-by: Lee Robinson <me@leerob.io>
2024-02-04 10:47:37 -06:00
byhow
3fee9e6295
docs: add auto closing tag to <source> (#61546) 2024-02-04 10:47:13 -06:00
hmmChase
d4b1c6c097
Update 03-linking-and-navigating.mdx (#61622)
Fix code example syntax

<!-- 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: JJ Kasper <jj@jjsweb.site>
2024-02-04 00:23:44 +00:00
Vercel Release Bot
a949bab3bc
Update font data (#61621)
This auto-generated PR updates font data with latest available
2024-02-04 00:20:28 +00:00
vercel-release-bot
bedfeac4e3 v14.1.1-canary.30 2024-02-03 23:21:46 +00:00
Leah
cb77a9c586
feat(turbopack): serve google fonts locally and allow preloading them (#61596)
### What?

Adds support for preloading google fonts.

Closes PACK-2351
2024-02-03 21:34:36 +01:00
Vercel Release Bot
d1616dffe6
Update Turbopack test manifest (#61608)
This auto-generated PR updates the integration test manifest used when
testing Turbopack.
2024-02-03 21:32:53 +01:00
Leah
1f8a5a2ed6
feat(turbopack): only preload fonts that opt in (#61591)
### What?

Adds another `ImportMappingReplacement` for the font file in order to
add markers to the filename.
The markers are used to generate the `next-font-manifest.json` (and also
in next.js code).

Closes PACK-2352
2024-02-03 19:53:21 +01:00
vercel-release-bot
aa66300f75 v14.1.1-canary.29 2024-02-02 23:21:11 +00:00
Zack Tanner
a67d247d94
ensure server action errors notify rejection handlers (#61588)
### What
When attaching a rejection listener to a server action promise, in the case of network errors, the rejection handler would be skipped and it'd throw an error that crashes the application.

### Why
When we refactored these reducers to no longer suspend, it caused the rejection handling logic we have to no longer make sense. In this case we're working with a native promise that won't have a `status` property, so we'd re-throw the error and not call `reject`. 

### How
This removes the special status handling logic and makes the rejection handler always call `reject` with the error. This will either be handled by user code or let the error bubble to an error boundary. 

I also cleaned up some mutable code that is no longer needed now that these reducers aren't replayed. 

Closes NEXT-1715
Closes NEXT-2323
Fixes #58638
2024-02-02 14:36:39 -08:00
OJ Kwon
fc22d287ba
refactor(next-core): consolidate custom ecma transform rules (#61481)
This PR consolidates how we inject specific, custom ecma transforms for
the each context.

Previously we had 2 different way to apply custom transforms via
ecmatransform plugin / custom rules, but it could create some conflict
in order as well as can be confusing between how it gets created. PR
uses new moduleruleeffect instead, consolidates all of the references
into single way.

Closes PACK-2342
2024-02-02 12:58:33 -08:00
OJ Kwon
b95e45a511
build(cargo): bump up turbopack (#61590)
* https://github.com/vercel/turbo/pull/7213 <!-- OJ Kwon -
feat(turbopack): extend ecmatransform moduleeffect -->
* https://github.com/vercel/turbo/pull/7219 <!-- Leah - fix(turbopack):
encode source map urls -->
* https://github.com/vercel/turbo/pull/7220 <!-- Leah -
style(turbopack): make idents more readable -->

Closes PACK-2369
2024-02-02 12:22:42 -08:00
Tim Neutkens
dbb2d86ae8
Skip Relay test for Turbopack (#61578)
## What?

This feature will be implemented after Turbopack is stable.

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

-->


Closes NEXT-2339
2024-02-02 17:07:36 +01:00
Abdul Haseeb
f59540fedc
Fixing a case sensitivity error (#61563)
Fixing a simple case sensitivity error in the import statement,
"storeProvider" should be "StoreProvider".

Co-authored-by: Steven <steven@ceriously.com>
2024-02-02 09:33:32 -05:00