Commit graph

16227 commits

Author SHA1 Message Date
vercel-release-bot
a3ef99acd9 v13.4.7-canary.1 2023-06-16 13:57:51 +00:00
Shu Ding
46981388aa
Fix bundling of Server Actions (#51367)
There're 3 layers in the RSC module graph: server → client → action. "Action" means that a Client Component re-enters the server layer by importing a file with `"use server"`, and it should behave the same as the server layer but you can't enter the client layer again (hence we have a 3rd layer name).

Since the action layer has the same behavior and module resolution rules, it should be bundled just like the server layer.

Closes #50658. Originally the issue was that `auth/next` isn't being bundled on the action layer, and it has the async local storage imported. Because of that, that storage comes from node_modules instead of the server bundle.
fix NEXT-1290
2023-06-16 13:47:48 +00:00
Jon Meyers
3cac09790b
examples: update with-supabase example to App Router (#51335)
### What?

Update Next.js with Supabase example

### Why?

Existing example for Next.js with Supabase is out of date

### How?

- Rename `with-supabase-auth-db-realtime` to `with-supabase`
- Update example to use App Router
- Use Supabase Auth Helpers for Next.js to configure auth cookies

---------
2023-06-16 06:16:42 -07:00
Bruno Eduardo de Souza Medeiros
94c9418091
docs: remove copy mentioning appDir as an experimental feature (#51403)
The documentation for `(App or Pages) / Building your Application /
Configuring / Eslint`
[here](https://nextjs.org/docs/app/building-your-application/configuring/eslint#linting-custom-directories-and-files)
is mentioning the appDir as an experimental feature that needs to be
enabled.

This PR update it's content removing this mention

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-16 05:54:38 -07:00
JJ Kasper
c78c3798b4
Update flakey build output test (#51411)
These are sorted by duration which can be arbitrary and aren't
guaranteed to not be collapsed so this updates to only check for the
ones we know will always be visible.

x-ref:
https://github.com/vercel/next.js/actions/runs/5289693006/jobs/9573031740?pr=51406#step:26:275
2023-06-16 05:45:36 -07:00
JJ Kasper
1528a49bf1
Revert "Route Module Updates Redux" (#51409)
This appears to still be hitting the previous issue mentioned in
https://github.com/vercel/next.js/pull/51322

Reverts vercel/next.js#51373
2023-06-16 05:44:03 -07:00
Nick McCurdy
1602c2af25
Fix pnpm ERR_INVALID_THIS on Node 20 (#51406)
### What?

Fixes pnpm/pnpm#6424

### Why?

So users of Node 20 can contribute to Next.js

### How?

Upgrades pnpm with back compatibility to patch `ERR_INVALID_THIS` error.
If Node 14 support isn't necessary, I'd recommend upgrading to pnpm 8
for continued feature support and committing the lockfile.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-16 05:37:11 -07:00
OJ Kwon
d6952989a8
ci(workflow): upload test trace for deploy e2e (#51389)
### What?

WEB-1193.

context: https://vercel.slack.com/archives/C04DUD7EB1B/p1686873054726149

we want to observe flakyness over deploy e2e tests.
2023-06-16 12:14:43 +00:00
Lee Robinson
f7533e0dc1
docs: Add streaming AI example. (#51382)
Addresses https://github.com/vercel/feedback/issues/32707.
2023-06-16 03:11:38 +00:00
Dima Vakatsiienko
04cd1fd4ef
Upgrade with-redux example to app router (#49994)
### What?

Update **with-redux** example.

### Why?

**with-redux** example have:
- outdated packages
- outdated approaches and relies on **pages** directory

Since **app router** is stable now and is recommended to use, I've updated this example.

### How?

An update includes:
- move example to **app router**
- update **package.json** deps to the latest versions
- modernize jest by switching from **ts-node** to **@swc/jest**
- fix and overhaul **tests**
- modernize **redux** infra
- overhaul example **source code quality**


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-06-16 02:00:04 +00:00
vercel-release-bot
cbb69b2cfc v13.4.7-canary.0 2023-06-16 01:02:52 +00:00
JJ Kasper
da98193602
Lock down server IPC address (#51378)
This attempts to avoid IPv6 and IPv4 resolve issues across network
setups by locking down our internal IPC requests to just one address for
consistency. This way there aren't issues when `localhost` resolves to
one or the other in different cases.

x-ref: https://github.com/vercel/next.js/issues/49677
2023-06-15 17:58:10 -07:00
Wyatt Johnson
ab3f707eff
Route Module Updates Redux (#51373)
Small QOL improvements to `RenderResult` and `RouteModule` setup.
2023-06-15 22:45:49 +00:00
vercel-release-bot
ce4aa787e8 v13.4.6 2023-06-15 21:21:35 +00:00
vercel-release-bot
019ed1c39b v13.4.6-canary.8 2023-06-15 20:08:03 +00:00
Valentin Politov
5b268be6f3
examples: migrate with-elasticsearch to TypeScript (#44842)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/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`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) 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://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

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


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-06-15 16:26:09 +00:00
Milan K
b09bbad535
Auth0 V2 migration update (#45302)
## Documentation / Examples

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

Hi Next.js team,  

This PR aims to update examples/auth0 with Auth0 V2 and fix profile api console error.

https://github.com/auth0/nextjs-auth0/blob/v2.0.0/V2_MIGRATION_GUIDE.md

Thanks for the review.
2023-06-15 16:10:16 +00:00
Hank Lin
e43f134c1f
docs: fix the url of router event (#51339)
Refer to [here](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/toString#examples)

The `searchParams.toString()` doesn't include the question mark.


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2023-06-15 15:56:35 +00:00
Tom
831f58a70c
change strapi example to latest one - fixes #51332 (#51334)
fixes #51332 




### What?

Changed the link to the latest official Strapi example with Next.js (+ App Router), Tailwind and TypeScript.

### Why?

The current example will be archived. See related blog post: https://strapi.io/blog/introducing-the-new-strapi-starter-with-nextjs13-tailwind-and-typescript

> We'd also like to address what this means for older Strapi starters. Due to limited bandwidth, we've decided to support only this new Strapi Starter officially, and all other starters will be archived.

### How?

.
2023-06-15 15:21:48 +00:00
Shu Ding
7d7d5a762d
Fix shared layer bundling in Edge Runtime (#51348)
Our shared layer matcher doesn't contain `next/dist/esm`, which breaks Server Actions when there're cookie/header accesses.

Closes #50099. Fix NEXT-1229
2023-06-15 13:03:51 +00:00
Tobias Koppers
a806f1ad84
Update turbopack (#51336)
### What?

update Turbopack and sync dependencies with turbo

### Turbopack changes

* https://github.com/vercel/turbo/pull/5303
2023-06-15 09:39:17 +00:00
Nicolás Figueroa
29bd0980cf
with-facebook-pixel: new implementation with app folder (#49880)
### What?

* **Facebook pixel implementation with the new `app folder` structure.**
* The pixel script can now be kept in the public folder.
* The Facebook script can be placed in the `layout.js` file
* A component called `FacebookPixel` is provided to handle the initial script setup and manage `PageView` events when the page changes.
* Classic implementation with `pages` folder now is in `_pages`

### Why?
To provide an example of implementing the new `app folder` structure with Next.js ˆ13, which includes using the new files like `layout`, `page`, etc.

### How?

Utilizing the `next/script` package and the `layout.js` file to initialize the Facebook pixel when the application starts and manage subsequent events.

### Evidence of Implementation:

Here are some examples that demonstrate the successful implementation of the Facebook pixel using the new `app folder` structure and `Next.js ˆ13`


Tracking main page `app/page.js`
<img width="399" alt="image" src="https://github.com/vercel/next.js/assets/26902419/fd3baee8-363d-4f2c-b949-517409ad36de">

<img width="2105" alt="image" src="https://github.com/vercel/next.js/assets/26902419/7d91d786-cd31-4c21-bb79-7e9a78fb1c3b">

Tracking another path `app/about/page.js`
<img width="333" alt="image" src="https://github.com/vercel/next.js/assets/26902419/dda7bc05-6fb5-482d-8a6a-d981a08c66e1">

<img width="2102" alt="image" src="https://github.com/vercel/next.js/assets/26902419/b0392d6e-31fe-42d1-a7b4-ca38879dde94">

navigation between pages with `next/link`
<img width="2098" alt="image" src="https://github.com/vercel/next.js/assets/26902419/21115bee-a77f-4467-bb25-c95e2850cda2">
2023-06-15 04:11:32 +00:00
vercel-release-bot
c59c39a431 v13.4.6-canary.7 2023-06-15 03:58:41 +00:00
JJ Kasper
bdcca0ccff
Fix CSS deploy id case (#51325)
x-ref: [slack
thread](https://vercel.slack.com/archives/C04MEB9L9RQ/p1686787663510239?thread_ts=1686770561.895939&cid=C04MEB9L9RQ)
2023-06-14 20:28:18 -07:00
mknichel
1660fdfcbb
Update Next.js code owners (#51319)
This PR updates `.vercel.approvers` files to fix some validation errors
and to more closely match desired behavior for assigning and notifying
members of the team for reviews that was discussed on an internal Slack
thread.

- Owners files for `.cargo/` and `.config/` are moved to their
respective directories instead of being placed at the root.
- Fixes the `@vercel/next-js` team name (it uses a dash instead of a
period)
- Adds `:notify` to reviewers so that all of the people listed are
notified of the pull request, but only a single person would be
requested as a reviewer.
- `@vercel/web-tooling:optional` was made optional so that they are not
requested for any change to `pnpm-lock.yaml` but still have the ability
to approve PRs that modify it.

---------
2023-06-14 20:07:32 -07:00
JJ Kasper
f9ae5b7f31
Revert "test(next-dev): hard fail if next-dev runs with turbopack intenral flag" (#51327)
Reverts vercel/next.js#51308
2023-06-14 20:06:55 -07:00
OJ Kwon
a7c31cc509
test(next-dev): hard fail if next-dev runs with turbopack intenral flag (#51308)
<!-- 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?

WEB-1183

Context:
https://vercel.slack.com/archives/C04KC8A53T7/p1686768648161459?thread_ts=1686763527.218549&cid=C04KC8A53T7

We'd like to avoid false positives to the test cases if test supposed to
run turbopack (having __INTERNAL_ flags) but somehow test fixture does
not run turbopack correctly.
2023-06-14 19:29:59 -07:00
vercel-release-bot
dde67aec5a v13.4.6-canary.6 2023-06-15 01:39:48 +00:00
JJ Kasper
2e68ff7dc0
Revert "Route Module Cleanup" (#51322)
x-ref: [slack
thread](https://vercel.slack.com/archives/C04MEB9L9RQ/p1686788708114089?thread_ts=1686770561.895939&cid=C04MEB9L9RQ)

Reverts vercel/next.js#50936
2023-06-14 18:30:14 -07:00
Shu Ding
38d1f1699d
Fix Server Actions compiler (#51318)
Make sure we are using `var` instead of `const` as we always put the new
appended statements to the end of the module body, but they can still be
referenced before in the HOC case in the runtime. This causes a runtime
error.

Tl;dr: `a = 1; var a` is fine, but `a; const a = ...` will result in a
compilation error.

Closes #49344.
2023-06-14 17:01:05 -07:00
JJ Kasper
b4350466c7
Update e2e deploy tests to continue (#51321)
Instead of temporarily disabling flakey or unpatched tests in deploy
mode this continues to run all tests and see all failures at once.

x-ref:
https://github.com/vercel/next.js/actions/runs/5272454654/jobs/9536161644
2023-06-14 17:00:28 -07:00
JJ Kasper
409668107d
Revert "Prefer module fields for RSC server layer" (#51316)
Closes: https://github.com/vercel/next.js/issues/51309

Reverts vercel/next.js#51179
2023-06-14 16:55:38 -07:00
JJ Kasper
115b6ad953
Allow configuring analyzerMode in bundle-analyzer (#47468)
It's valid to want to output JSON instead of HTML for the bundle
analyzer so we can expose this specific config the same as
`openAnalyzer`. cc @mknichel
2023-06-14 16:33:39 -07:00
vercel-release-bot
40ce621901 v13.4.6-canary.5 2023-06-14 21:54:03 +00:00
JJ Kasper
4aef2b42e4
Update flakey deploy tests (#51314)
x-ref:
https://github.com/vercel/next.js/actions/runs/5266469399/jobs/9520655301
2023-06-14 14:50:05 -07:00
JJ Kasper
323e335b54
Ensure swc is copied for release stats (#51315)
x-ref:
https://github.com/vercel/next.js/actions/runs/5266469399/jobs/9520655185
2023-06-14 14:48:20 -07:00
JJ Kasper
3ec70a26d3
Skip cargo bench job on release (#51311)
This fails when run during a release since the new version isn't
published yet

x-ref:
https://github.com/vercel/next.js/actions/runs/5266469610/jobs/9520466217
2023-06-14 14:44:23 -07:00
Shu Ding
9a36f337da
Simplify server CSS handling (#51018)
Remove the Server CSS manifest and related logic, and use the chunkGroup
CSS files instead for each entry to inject stylesheet links.

Why was that manifest needed in the first place? When implementing CSS
collection for RSC and nested layout initially, we collect CSS imports
at each layer and create corresponding client entries. But then soon got
hit by the problem of duplication and improper tree-shaking. Two layers
can have the same CSS imported so we solved it in a way that "if an
upper layer imports this module, skip it in child layers". Note that
this is deduped by module, so we need to keep the information of "layer
(entry) → CSS modules" somewhere, in a manifest.

Another reason is that we create the client entry before Webpack
optimizes modules, so we can inject the client entry into the same
compilation. But that means the collected client modules from the server
layer are not properly optimized (DCE). **This is a general issue at the
moment that's not specifically related to CSS, although using that
manifest to collect DCE'd info and join the original collected CSS files
with that info temporarily solved it.** That's why I disabled some tests
related to font CSS collection and want to improve it in a more general
way.

Why is that not needed anymore? Main reason is to keep a good balance
between duplication and number of chunks, and delegate the decision to
Webpack's splitChunks plugin. It is not possible to get to a point of 0
duplication unless we ship every CSS module as a single chunk. And since
in #50406 we made the duplication better but at the chunk asset level,
instead of the original module level.

Prior work: #50406, #50610.
2023-06-14 14:43:08 -07:00
Michael Novotny
f7c105d371
Adds env suggestions (#51312)
Adds suggestions from #51063, which didn't get applied before merge.
2023-06-14 21:33:34 +00:00
mPaella
d492b937e2
fix: Incorrect build size outputs for app dir (#50768)
### What?
Fixes https://github.com/vercel/next.js/issues/50129

### Why?
The current denormalization of app dir paths doesnt account for the
normalization done in `normalizeAppPath`, causing build log outputs for
certain paths such as anything under a route groups to be incorrect

### How?
There's 2 ways this could be fixed:

1.) Denormalize the app dir paths by reading the
`app-path-routes-manifest.json` and mapping back to the original file
path
2.) (what I chose to do) Normalize the keys of `appBuildManifest`

### Result

App dir paths, including route groups, now have their correct output
size

<img width="494" alt="image"
src="https://github.com/vercel/next.js/assets/93682696/0eee79b8-7d60-4c88-b07a-dfb750aa9592">

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-14 14:24:57 -07:00
bri
c76653f2f7
chore: update next/font/google font list (#49969)
Ran script `update-google-fonts`, adding these fonts to `next/font/google`:

- [Instrument Sans](https://fonts.google.com/specimen/Instrument+Sans)
- [Noto Sans Nag Mundari](https://fonts.google.com/noto/specimen/Noto+Sans+Nag+Mundari)
- [Wix Madefor Display](https://fonts.google.com/specimen/Wix+Madefor+Display)
- [Wix Madefor Text](https://fonts.google.com/specimen/Wix+Madefor+Text)

and updating these fonts:
- [Radio Canada](https://fonts.google.com/specimen/Radio+Canada) (added `canadian-aboriginal` subset)

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-06-14 21:03:44 +00:00
tom
d4c2335b0f
chore: add dark mode for dev overlay (#48601)
This PR adds a dark mode to the error overlay which respects the browsers color scheme.
I just did this because I was blinded by the dev overlay a lot today and thought this change might be appreciated.

Screenshot (dark mode):
<img width="2056" alt="image" src="https://user-images.githubusercontent.com/17279485/233201837-0d005e10-d73f-4ddd-9f4a-285829ec63b1.png">
 
Screenshot (retained light mode):
<img width="1064" alt="image" src="https://user-images.githubusercontent.com/17279485/233202019-83ec79d8-d2ca-44c8-bc0a-7696355dfe72.png">


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-06-14 20:33:07 +00:00
Max Proske
28dca13498
Update Docker examples to use Compose v2 command (#51134)
Compose v1 has reached EOL, and will no longer be included with Docker after June 2023: https://www.docker.com/blog/docker-desktop-4-19/
2023-06-14 20:03:36 +00:00
Shu Ding
5e9b5e5d3c
Update example of Server Actions HoC (#51299)
Currently the Server Action function with `"use server"` must be an
async function as it's required by the compiler, even if it returns a
promise already.
2023-06-14 12:17:45 -07:00
JJ Kasper
c3e2999fa6
Update flakey build output test (#51307)
x-ref:
https://github.com/vercel/next.js/actions/runs/5270495246/jobs/9530090721
2023-06-14 12:15:43 -07:00
Tyler Lutz
9539440965
Docs: Remove extra word in 03-scripts.mdx (#51304)
Removes extra 'the' in the documentation

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-14 12:06:25 -07:00
Gideon
86112a357c
Update images.mdx (#51275)
fix Fastly and Gumlet heading level
2023-06-14 18:59:04 +00:00
JJ Kasper
916d2aa4d5
Validate i18n locale domain (#50220)
The `domain` value is meant to be a hostname and not include `http` or
port so this ensures we validate it doesn't contain `:` unexpectedly
causing invalid behavior.

Closes: https://github.com/vercel/next.js/issues/49656
x-ref:
https://github.com/vercel/next.js/issues/24991#issuecomment-870418366

---------

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2023-06-14 11:07:58 -07:00
Wyatt Johnson
616ae108d9
Route Module Cleanup (#50936)
This cleans up some setup functions within the route modules, improves logic around headers, and handles the case where the URL is invalid better for routes using the request adapters.
2023-06-14 17:54:23 +00:00
OJ Kwon
2761cf34fa
feat(turbopack): enable sassOptions (#51259)
### What?

Minor fix to remove guards to the config since turbopack have this feature enabled.
2023-06-14 17:27:04 +00:00