Commit graph

13550 commits

Author SHA1 Message Date
Jiachi Liu
cd0ebd8e8c
Implement loadable with lazy and suspense for next dynamic (#42589)
### Summary

Migrate `next/dynamic` to implementation based on `React.lazy` and
`Suspense`. Then it becomes easier to migrate the existing code in pages
to layouts. Then we can support both `ssr` and `loading` option for
`next/dynamic`.

For `loading` option, it will work like `Suspense`'s `fallback` property

```js
<Suspense fallback={loading}>
  <DynamicComponent />
 </Suspense>
```

For `ssr` option, by default `React.lazy` supports SSR, but we'll
disable the `ssr: false` case for dynamic import in server components
since there's no client side involved.

Then we don't need `suspense` option anymore as react >= 18 is always
required. Mark it as deprecated.

It also supports to load client component dynamically in server
components now.

#### Code code changes
* switch loadable component to `lazy` + `Suspense`
* will make sure it's retuning a module from `loader()` to
`loader().then(mod => ({ default: mod.default || mod }))` since `lazy()`
only accepts loader returning a module
* Inside suspense boundary, throwing an error for ssr: false, catch the
error on server and client side and ignore it.
* Ignore options like ssr: false for server components since they're on
server, doesn't make sense
* Remove legacy dynamic related transform
#### Feature changes
* `next/dynamic` will work in the same way across the board (appDir and
pages)
* For the throwing error, will make it become a API that throws error
later in the future, so users can customize more with `Suspense`
* You can load client components now in server components with dynamic.
Resolves #43147

#### Tests
* existing dynamic tests all work
* add case: import client component and load through next/dynamic in
server components

### Issues
2022-12-07 19:42:10 +01:00
JJ Kasper
a704b71cba
Lock pnpm version during publish (#43820)
x-ref: [slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1670409758653869)
2022-12-07 17:24:43 +00:00
JJ Kasper
d798df838f
Fix test binary generation and update test config (#43790)
Leverages the playwright container more to avoid the flaky setup step
for the necessary dependencies. Also fixes the dev binary generating
from https://github.com/vercel/next.js/pull/43745

x-ref:
https://github.com/vercel/next.js/actions/runs/3633110048/jobs/6129816165
x-ref:
https://github.com/vercel/next.js/actions/runs/3633110048/jobs/6129815918
x-ref:
https://github.com/vercel/next.js/actions/runs/3633110048/jobs/6129810273
2022-12-07 08:43:19 -08:00
Shu Ding
476bb09b09
Fix HMR issue after patching the client module (#43819)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2022-12-07 17:34:56 +01:00
Jiachi Liu
56ea306167
Display error digest if presented (#43742)
Co-authored-by: Shu Ding <g@shud.in>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-07 17:34:25 +01:00
Jan Kaifer
2022fa6d45
Add test for providing correct params to layouts (#43775) 2022-12-07 17:34:01 +01:00
Jan Kaifer
aa7cdf35ea
Remove notifications emitted during pnpm dev (#43801)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-07 17:11:29 +01:00
Jan Kaifer
16cf9a8b83
Remove serverComponents from next.conf.js because it's unused (#43805) 2022-12-07 15:57:03 +01:00
Shu Ding
2a230397c0
Assign layer to app client entries (#43197)
This is one of the required changes to refactor bundling strategy for
pages and app.

## 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 build && 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-12-07 15:20:50 +01:00
Thomas Ballinger
dbc833440c
chore(examples): Update convex example (#43741) 2022-12-07 14:12:36 +01:00
Anuj Singh
8006dbc741
chore(examples): Remove deprecated function from chakra (#43784)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-07 14:10:32 +01:00
Max Proske
f56e5c942d
Convert with-why-did-you-render example to TypeScript (#43736) 2022-12-07 14:10:04 +01:00
Grace Yun
783a3cede1
Remove swcMinify from Next config in CNA template (#43782)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-07 14:09:29 +01:00
Shu Ding
b168c37cb5
Fix chunk hash logic in hot-reloader for server components (#43778)
Previously we were assuming that `serverOnlyChanges` is the same as
"server component changes". However that's not always true, as one can
change a component from server component to client component, or vice
versa, where the change affects both server and client builds, so
`serverOnlyChanges` will be empty.

This PR fixes the logic by strictly hashing and comparing modules in the
server layer. Note that I intentionally skipped the test as this fix
[isn't
complete](https://vercel.slack.com/archives/C035J346QQL/p1670343453333079).

NEX-30

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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-07 13:13:31 +01:00
Jan Kaifer
08d270cdeb
Add tests for rendering null and undefined in RSC (#43768) 2022-12-07 12:24:02 +01:00
Hannes Bornö
738de0164f
Remove __webpack_exports__ from error overlay (#43715) 2022-12-07 11:50:39 +01:00
Jan Kaifer
ba19ce3782
Force reflow when setting scrollBehavior (#43673)
fixes https://github.com/vercel/next.js/issues/40719
2022-12-07 11:45:42 +01:00
Michael Novotny
bd9148d498
Changes vercel/examples links from linking to GitHub repo to template marketplace (#43780)
### Description

* Gives us [Vercel] more SEO juice rather than GitHub.
* Gives us the freedom to control GitHub repo file structure independent from URLs.

## Feature

- [x] Documentation added
2022-12-07 00:27:43 +00:00
Shu Ding
18d41a90a4
Add tests for server component HMR (#43779)
Something we haven't covered in our tests.

NEX-35

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] 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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-07 00:22:46 +01:00
Jiachi Liu
fe0315ab8e
fix ci pnpm lock error (#43767)
x-ref:
https://github.com/vercel/next.js/actions/runs/3630104729/jobs/6123068544

Co-authored-by: huozhi <huozhi@users.noreply.github.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-12-06 12:13:51 -08:00
Jiachi Liu
a19f04c5a1
Revert "Adding head element checking for root layout" (#43760)
Reverts vercel/next.js#43597

The tests were disabled and currently the checking of these components
are not reliable, it also breaks the hmr. Revert it for now and then
we'll revisit how to re-enable the required tags checking
2022-12-06 15:41:29 +01:00
Jan Kaifer
efe1742668
Update bug report template to make it clear we require repro (#43735)
Co-authored-by: Steven <steven@ceriously.com>
2022-12-06 15:07:35 +01:00
Tim Neutkens
ea21c66231 v13.0.7-canary.2 2022-12-06 13:42:44 +01:00
Tim Neutkens
5cff316aee
Remove additional <div> at each segment level in app (#43717) 2022-12-06 10:26:37 +01:00
LongYinan
cbf87e1ebf
Build test binary in Docker image (#43745)
<!--
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`](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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-06 13:17:03 +08:00
Jimmy Lai
fa42c3461f
perf: disable prefetching for links in viewport in development for app routes (#43730)
There has been a few complaints about memory usage of the Next.js 13 dev server. One of the reasons why is that prefetching is always enabled when a link is visible on app routes (and not on pages). Disabling this behaviour, whilst keeping prefetching on hover/click, should help improve resources usage.

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

- [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`
- [ ] [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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-05 13:49:37 +00:00
Jan Kaifer
b653942050
Disable jest autorun in this repo (#43727)
When someone installs jest extension it will run all the tests
that is not possible in this repo because there is so many

<!--
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`](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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-05 12:11:43 +00:00
Soonwoo Hong
0bd3422b6c
docs: Add notes about NEXT_MANUAL_SIG_HANDLE (#43686)
It seems that setting `NEXT_MANUAL_SIG_HANDLE` in `.env` file is not working, so I added some notes.

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && 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-12-04 22:03:19 +00:00
Alfred Mountfield
324de6bf7a
Fix typos in 1.bug_report.yml (#43697)
Found some tiny typos when using the bug template.

## 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)
2022-12-04 13:35:10 -08:00
Maaz
e085fd6f8f
Fix typo in comment (#43685)
## 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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-04 13:34:15 -08:00
JJ Kasper
c51af7cab5
Update flakey GSSP preview test (#43702)
Ensures we grab a new port when launching fresh server as the existing
port may still be held up.

x-ref:
https://github.com/vercel/next.js/actions/runs/3611678257/jobs/6086329090
2022-12-04 13:16:22 -08:00
JJ Kasper
992c46e63b
Update flakey app logbox test (#43682)
x-ref:
https://github.com/vercel/next.js/actions/runs/3611458418/attempts/2
x-ref:
https://github.com/vercel/next.js/actions/runs/3611458418/attempts/1
x-ref:
https://github.com/vercel/next.js/actions/runs/3611571327/jobs/6086144720
2022-12-03 20:24:49 -08:00
JJ Kasper
90f022aeb6
Update test config (#43661)
Updates our test config to take advantage of more concurrency and also
updates to leverage the playwright docker image to reduce flakes from
actions/setup-node stalling or playwright dependencies stalling on `apt
install`.

This reduces our test times from upwards of 30 minutes down to back
around 15 minutes.
2022-12-03 19:49:00 -08:00
Tim Neutkens
2fcc1e2c2c
Remove resolved app directory todos (#43672)
All of these todos have been handled right before Next.js conf / shortly after, this PR is cleaning them up.



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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-03 20:34:53 +00:00
JJ Kasper
9329743744
v13.0.7-canary.1 2022-12-02 23:36:18 -08:00
JJ Kasper
0c756bee15
Update cache handling for app (#43659)
This updates the app directory caching. 

x-ref: [slack thread
](https://vercel.slack.com/archives/C042LHPJ1NX/p1669231119199339)

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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-02 23:32:49 -08:00
Hannes Bornö
3a7c35a926
@next/font fallback fonts order fix (#43633)
The fallback fonts are applied in the wrong order which can cause the
generated fallback font not to get applied.

ref:
[slack](https://vercel.slack.com/archives/C03S8ED1DKM/p1669834408302339?thread_ts=1669765718.933099&cid=C03S8ED1DKM)

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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-02 22:09:38 -08:00
Balázs Orbán
bb770ca4f3
fix: properly handle trailingSlash: true and rewrites (#43641)
Fixes #43623

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

- [ ] Make sure the linting passes by running `pnpm build && 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: Wyatt Johnson <accounts+github@wyattjoh.ca>
2022-12-02 22:04:36 -08:00
Grace Yun
d464ef8f18
Update create-next-app template (#43482)
Refreshes `create-next-app` template designed by @evilrabbit. Credits to
members of Vercel's Design team @dizzyup + @emilkowalski for support on
CSS optimizations + code clean up.

The refreshed template includes one new dependency: `@next/font`. The
main script + related test have been updated to reflect this.

**Before:**

![Before -
Dark](https://user-images.githubusercontent.com/74513600/204942683-2847fda2-a538-4aff-b988-37d554c6d77f.png)
![Before -
Light](https://user-images.githubusercontent.com/74513600/204942685-7592f34a-4132-42c3-b4ce-25138ce66c71.png)

**After:**

![After -
Dark](https://user-images.githubusercontent.com/74513600/204942715-ad35649d-6881-43ea-ae58-5d9f95cc755a.png)
![After -
Light](https://user-images.githubusercontent.com/74513600/204942717-46e99c5c-6594-4035-acd4-a10e31ce22f9.png)

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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-02 22:01:04 -08:00
Hannes Bornö
d41afd7152
Revert: 'Minimized runtime errors in app dir' (#43648)
Reverts: #43511

It incorrectly shows render errors minimized although it should only be
for uncaught errors/rejections. Keep old behaviour for now.

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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-02 20:51:23 +01:00
Hassan El Mghari
c6ec490eb1
Fixed broken Cloudinary example (#43646)
Adding TypeScript as a dependency to fix the Cloudinary example
2022-12-02 17:12:54 +00:00
Mateusz Burzyński
482fccb922
Adding head element checking for root layout (#43597)
### Update

We removed the `<head>` element checking for root layout in #41621. Since we also need `<head>` for preload in the future, and also css-in-js will require that. We're adding back the `head` element checking to make sure user always provide valid root layout including it.

### Issue

An issue was reported [here](https://github.com/mui/material-ui/issues/34905#issuecomment-1331945868) that the Emotion/MUI site was suffering from FOUC.

After an inspection, I noticed that the SSRed HTML didn't contain the inserted styles at all - despite them being inserted through `useServerInsertedHTML`. I managed to debug it down and discovered that their layout was missing `<head></head>` and thus the stream transformer skipped the insertion altogether cause of this check:
fbc98abab3/packages/next/server/node-web-streams-helper.ts (L177-L183)

I've figured that at the very least we could surface this as a console error in development to nudge the user to fix the missing `<head/>`

cc @huozhi 



Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2022-12-02 16:41:46 +00:00
JJ Kasper
166e5fb9b9
v13.0.7-canary.0 2022-12-01 21:50:10 -08:00
JJ Kasper
6b863fe294
Apply publish step optimizations (#43620)
Follow-up to https://github.com/vercel/next.js/pull/32337 this removes
the un-necessary step where we fetch all of the tags which requires
pulling a lot of un-necessary git history inflating cache size and
publish times.

The only reason these tags were needing to be fetched is due to an issue
in how the `actions/checkout` step works
(https://github.com/actions/checkout/issues/882).

This reduces the publish times by at least 4 minutes by removing the
tags fetching step
https://github.com/vercel/next.js/actions/runs/3598569786/jobs/6061449995#step:16:14

As a further optimization this adds concurrency to the `npm publish`
calls themselves to hopefully reduce time spent there as well.
2022-12-01 21:48:51 -08:00
Bryce Kalow
2063ff3338
fix(jest): pattern when detecting packages to transpile in next/jest (#43546)
<!--
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:
-->
In #42987 we added support for `transpilePackages` in `next/jest`, but
the pattern is not functioning how we would expect here, and as a result
all modules from `node_modules` are getting transformed. File patterns
that should not be transformed should match, but due to the trailing
`/`, no packages are matching.

Currently (no match, incorrectly gets transformed):
https://regexr.com/73fvo

With this fix (matches, correctly does not get transformed):
https://regexr.com/73fvr

As far as I can tell, the `pnpm` pattern is being generated correctly.

@balazsorban44 I wasn't sure the best way to test this one, let me know
if you've got an idea. 🙏

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

- [ ] Make sure the linting passes by running `pnpm build && 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-12-01 20:55:22 -08:00
7yue
5fb243d2ad
examples(with-turbopack): Fix styling page default active stylingNav (#42739)
<!--
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:
-->

Closes: https://github.com/vercel/next.js/pull/42768

## 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 build && 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-12-01 20:18:14 -08:00
Jiachi Liu
48290c6a05
Update react next tag (#43617)
Fixes #43033

Also remove the unsued react-dom files: bundles for bun, and
react-dom-test-utils

x-ref: https://github.com/facebook/react/pull/25713

## Bug

- [x] 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)
2022-12-01 20:15:54 -08:00
Hassan El Mghari
57dc7207e6
Add with-cloudinary example (#43250)
Added an image gallery example using Next.js and Cloudinary.

Edit: This is now ready to ship!

Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-12-02 04:05:34 +00:00
JJ Kasper
5003add92b
v13.0.6 2022-12-01 19:17:58 -08:00
JJ Kasper
5f420f710f
v13.0.6-canary.4 2022-12-01 18:20:36 -08:00