Commit graph

13183 commits

Author SHA1 Message Date
JJ Kasper
ea9c5aac5f
Update caching for swc turbo builds (#42929)
Updates to leverage turbo remote caching for the swc builds and
normalize the package versions to prevent repo version bumps from
un-necessarily invalidating the cache.

Full cache hits can be seen in this test run
https://github.com/vercel/next.js/actions/runs/3469932131/jobs/5797559609
2022-11-15 08:24:04 -08:00
Hannes Bornö
a0e51781e8
fix: Error: NEXT_REDIRECT crashing server in prod (#42793)
Fixes: #42587

## 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-11-15 13:46:55 +00:00
Adil Ansari
0f8b3d6c8b
Tigris example with Next.js (#42662) 2022-11-15 12:00:29 +01:00
Max Proske
efbabd2a5e
Convert with-app-layout example to TypeScript (#42930)
Converted example to TypeScript to match Contribution docs.

## 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-11-15 10:44:38 +00:00
OJ Kwon
0e8f2412ae
feat(next/swc): allow to run custom turbopack binary (#42656)
<!--
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:
-->

This PR exposes internal injection point to specify custom binary /
bindings for the turbopack. It doesn't affect any existing native
bindings (swc), but only allows to run custom turbopack
(`turbo.startDev`) if specified.

The changes are mostly for the internal dev / testing iteration purpose.
Currently, the workflow to test new turbopack changes in next.js is

- update next-swc's cargo to point to specific changes in turbopack
- rebuild, specify next.js to use local binary

This requires additional build times (turbopack build cannot be used,
have to rebuild next-swc napi bindings) as well as if we'd like to try
some changes on the CI between next.js canary + latest turbopack,
integration gets bit tricky. 2 env variable is exposed for the purpose -
`__INTERNAL_CUSTOM_TURBOPACK_BINARY` stands for the executable binary
(next-dev) can be built in turbopack,
`__INTERNAL_CUSTOM_TURBOPACK_BINDINGS` stands for the custom napi
bindings if needed. Both are strictly internal as name implies. There
won't be any documentation, no semver guarantee or else. Current plan is
to execute some subset of next.js test on turbopack PRs with these
entrypoints.

Feature / security wise these are mostly harmless I believe - this is
devserver usually don't run on CI, and trying to print out warning if
flag is enabled.

## 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-11-14 21:24:31 -08:00
JJ Kasper
f2c2343ca8
Ensure query is provided correctly with middleware rewrites (#42818)
x-ref: [slack
thread](https://vercel.slack.com/archives/C035J346QQL/p1668195556550659)
Fixes: https://github.com/vercel/next.js/issues/42463

## Bug

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

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm 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-11-14 20:30:23 -08:00
JJ Kasper
8b4d9e652e
Add more details to invalid-next-config doc (#42917)
This adds some more clarity to the error doc and we can also iterate on
the warnings to show suggestions as well in follow-ups.

x-ref: [slack
thread](https://vercel.slack.com/archives/CHZGRCJSD/p1668430036939189?thread_ts=1668394104.483679&cid=CHZGRCJSD)

## 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-11-14 13:59:59 -08:00
Steven Tey
71fa80b665
Make cover image full width (#42916)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

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

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm 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-11-14 12:48:48 -08:00
Sukka
3b4594f6d7
types(#42003): better typing for next/link (#42117)
<!--
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:
-->

The PR closes #42003.

Replace `(e: any) => void` with
`React.MouseEventHandler<HTMLAnchorElement>` and
`React.TouchEventHandler<HTMLAnchorElement>`. The original typing
overlap issue has also been fixed.

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
2022-11-14 12:37:41 -08:00
Donny/강동윤
9c2c8587be
feat(next-swc/relay): Add javascript to language (#42894)
Resolves
https://github.com/vercel/next.js/discussions/35904#discussioncomment-3299461
2022-11-14 12:28:39 -08:00
Tim Neutkens
4ca30fe433
Use window.location directly instead of parsing into URL (#42888)
Fixes
https://github.com/vercel/next.js/pull/42735#discussion_r1019116319.

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

## Bug

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

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm 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-11-14 12:23:15 -08:00
JJ Kasper
c3993c828f
Update to latest version of turbo CLI (#42803)
Continuation of https://github.com/vercel/next.js/pull/42711 fixing
latest turbo usage in musl environment

## 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-11-14 11:52:12 -08:00
Steven Tey
0d2a3de336
Convert blog cover images to next/image (#42908)
## 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-11-14 17:29:54 +00:00
Lee Robinson
ad61e84101
Update SFCC example to use TypeScript + @next/font (#42865)
This is now ready for review.

Co-authored-by: Hassan El Mghari <hassan4709@gmail.com>
2022-11-14 09:46:31 -06:00
Damien Simonin Feugas
9faba368bd
docs(edge-api-routes): fixes example (#42903)
## 📖 What's in there?

The last example on the documentation page for [Edge Api routes](https://nextjs.org/docs/api-routes/edge-api-routes) is wrong since next@13 breaking change on cookie handling.
While [middleware page](https://nextjs.org/docs/advanced-features/middleware#using-cookies) is updated, this one was left off.
2022-11-14 15:36:03 +00:00
Tim Neutkens
230571cd58
Add additional item to RSC payload, preparing for head.tsx on navigation (#42791) 2022-11-14 14:50:30 +01:00
Kolton Gagnon
3a0065d701
Update docs/advanced-features/debugging.md (#42842)
Updated `.vscode/launch.json` debugging file due to the following errors: 
- `console: pwa-chrome` shows an  eslint error recommending `console: chrome`
- `console` key  is now deprecated.

Tested client and server-side debugging on:
- Mac v12.6 (21G115)
- VSCode v1.73.1
- Chrome v107.0.5304.110

See attached screenshots for linting errors.

**console: pwa-chrome**

<img width="464" alt="CleanShot 2022-11-12 at 22 06 15@2x" src="https://user-images.githubusercontent.com/3606121/201502364-e796b1a0-51a5-4aee-8bcf-8828e03f244a.png">

**`console`**

<img width="503" alt="CleanShot 2022-11-12 at 22 06 37@2x" src="https://user-images.githubusercontent.com/3606121/201502369-55d75a93-360f-4d67-ba15-438d683c041b.png">



## Bug

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

## Feature

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

## Documentation / Examples

- [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-11-14 12:58:03 +00:00
Max Proske
994089fcc2
Improve with-algolia-react-instantsearch example and convert to TypeScript (#42617)
Converted to TypeScript to match Contribution docs, and updated/simplified the example.

- Replaced stylesheets in Head component with imported styles
- Removed `style-loader`, `css-loader`, `cross-env`, `prop-types` packages
- Removed custom webpack config

## 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-11-14 12:30:57 +00:00
Horacio Valencia
081b8fba67
Updates Apollo Server Examples to use Apollo Server 4 & @as-integrations/next (#42771)
Closes https://github.com/vercel/next.js/issues/42769

## Description 

This PR address https://github.com/vercel/next.js/issues/42769 by updating the `api-routes-apollo-server`, `api-routes-apollo-server-and-client` and `api-routes-apollo-server-and-client-auth` examples to use Apollo Server 4 and [@as-integrations/next](https://github.com/apollo-server-integrations/apollo-server-integration-next), which is the Apollo Server Next integration package. The PR also updates the three examples to use Typescript. The functionality of the examples is the same.


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


closes https://github.com/vercel/next.js/pull/33545
closes https://github.com/vercel/next.js/pull/30082
closes https://github.com/vercel/next.js/issues/21984
closes #10413
2022-11-14 12:13:31 +00:00
Andy Kenward
0bc94466b0
docs(examples): auth0 update callback URL (#42855) 2022-11-14 12:59:24 +01:00
Tim Neutkens
79f7231406 v13.0.4-canary.0 2022-11-14 12:40:08 +01:00
Laszlo Heves
c10ac686b5
docs: fix middleware docs cookie example (#42816)
fixes #42815

## 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-11-12 00:47:39 +00:00
Jiachi Liu
b180becad5
Update bundle analyzer dependency and output (#42797)
* Update `webpack-bundle-analyzer` to 4.7.0
* Change the output file paths of bundle analyzing results to
`./next/analyze/<nodejs|edge|client>.html`
2022-11-11 16:39:45 -08:00
Donny/강동윤
5e965bc9c4
fix: Fix regression of swc minifier (#42790)
- Closes https://github.com/vercel/next.js/issues/42782
2022-11-11 14:55:38 +00:00
Balázs Orbán
f5031a48c8
chore(examples): next/future/image -> next/image (#42794) 2022-11-11 15:14:25 +01:00
Shu Ding
872c8d5c22
Show link to the docs for route segment config options (#42779)
This PR adds links to the docs when hovering on the option names and
values. It will be helpful especially when there's an invalid value:


![option-links](https://user-images.githubusercontent.com/3676859/201303933-8a8bcfd3-4e6b-4191-a0b0-2944539ccf66.gif)

## 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-11-11 13:05:56 +01:00
JJ Kasper
4240dcc410
v13.0.3 2022-11-10 19:26:00 -08:00
JJ Kasper
895d895972
v13.0.3-canary.4 2022-11-10 17:50:06 -08:00
JJ Kasper
3a22e9768b
Track page counts during builds (#42766)
Ensures we keep track of page counts during builds. 

## 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-11-10 17:47:33 -08:00
Jiachi Liu
028b8d040d
Fix resolving for esm package with only exports.import condition (#42767)
Should be able to resolve `exports.import` condition for esm packages only when import them in server components

Fixes: #42534

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
2022-11-11 00:50:46 +00:00
Oskar Grunning
cb8fdc6db6
fix: enable emotion import map (#42750)
This PR aims to add support for the `importMap` option for `emotion`. It's already supported by `swc_emotion`.

Fixes https://github.com/vercel/next.js/issues/41646.

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`
2022-11-10 21:23:40 +00:00
Ismael
29f20d30fd
font api updates (#42724)
<!--
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:
-->

Update the next fonts API reference to match the latest changes from
[beta.nextjs.org](https://beta.nextjs.org/docs/api-reference/components/font)

## 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
- [x] 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-11-10 12:11:04 -06:00
Tim Neutkens
6490252b40
Don't pushState when already on the url (#42735)
Solves the case where you click a link to the page you're on already that pushes additional history entries, uses replaceState for that instead. This mirrors the default `<a>` behavior.



## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] 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-11-10 18:06:57 +00:00
Shu Ding
f612acffbc
Add test case for image generation (#42693)
This PR adds a basic test case to ensure Next.js and Edge Runtime
changes don't break the image generation feature, as well as record the
usage.

## Bug

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

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Documentation added
- [x] 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-11-10 09:26:36 -08:00
Tim Neutkens
9d30e777ca
Handle hydration replaceState for static page with searchParams (#42744)
Ensures the searchParams do not get removed when the page is static.

Fixes #42697

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

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] 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-11-10 09:24:31 -08:00
Shu Ding
276533d03e
Eagerly bundle external ESM dependencies for pages (#42741)
One potential risk is ESM dependencies that can't be bundled will cause
a build error. This also means that the `esmExternals` configuration
will be affected.

Closes #42249, closes #42588. Related: #1395.

## Bug

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

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm 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: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-10 18:11:38 +01:00
Hannes Bornö
6ab52ed41b
@next/font return types (#42753)
Currently the return type is the same when you declare a variable and
when you don't.
```tsx
const inter1 = Inter()
const inter2 = Inter({ variable: "--inter-font" })

inter1.variable // string | undefined
inter2.variable // string | undefined
```

With this change you get a type error if you try to access `.variable`
without providing a variable name.
```tsx
const inter1 = Inter()
const inter2 = Inter({ variable: "--inter-font" })

inter1.variable // Property 'variable' does not exist on type 'NextFont'.ts(2339)
inter2.variable // string
```

## 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-11-10 08:56:27 -08:00
OJ Kwon
784d9a73d8
build(next-swc): update turbopack to latest (#42733) 2022-11-10 11:52:48 +01:00
JJ Kasper
b50ade893f
v13.0.3-canary.3 2022-11-09 21:16:06 -08:00
JJ Kasper
abaaf80f51
Revert "Update to latest version of turbo CLI (#42711)"
This reverts commit 2c199c4c19.
2022-11-09 21:15:36 -08:00
Hugh Lilly
031ed5557d
fix comma splice in verifyRootLayout.ts (#42324)
The phrase "Your page X did not have a root layout, we created Y for
you." creates a [comma
splice](https://en.wikipedia.org/wiki/Comma_splice). This PR fixes it.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-11-09 20:59:55 -08:00
cvolant
101a70ba8d
Fix as option with optional catch all routes url object syntax (#42355)
In `Link`, `router.push`, and `router.replace`, `as` option used to
throw for optional catch all routes with url object syntax: optional
attribute were not taken into account when checking missing parameters
in router change method.
This PR just add a condition in the filter callback to filter out
optional routes.
Fixes #41624

## Bug

- [X] Related issues linked using `fixes #number`
- [X] Integration tests added
- [X] Errors have a helpful link attached, see `contributing.md`
2022-11-09 20:48:38 -08:00
Mark Ladyshau
2b85da7735
Change condition to check for string attribute in lint rules utility function (#42625)
<!--
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:
-->

Fixes #42604.

## Bug

- [x] 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-11-09 19:54:38 -08:00
Parbez
eed63e1edc
fix: publish compat folder (#42613)
<!--
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:
-->
#42502 added `next/compat` but it's top level export folder wasn't
published to nextjs
## 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-11-09 19:26:34 -08:00
Jiachi Liu
3174c730b8
Alias next public api to esm on edge runtime (#42709)
Cases like `next/link` and `next/router` imports are not alias since
they're not matching the existing alias pattern setting for edge
runtime, which causes router-context being bundled twice (both with cjs
and esm) into edge worker bundle.
so we resolve their paths and alias them to esm bundle for webpack
bundling.

Other minor changes:

* update `require` calls to `import` expressions in edge ssr loaders
* remove client layer for apps without `appDir` enabled
* export `type` for ts typings in next/image to avoid alias to break
resolving

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
2022-11-09 19:20:32 -08:00
JJ Kasper
2c199c4c19
Update to latest version of turbo CLI (#42711)
Ensures we have latest patches in turbo CLI. 

## 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-11-09 18:22:15 -08:00
Jiachi Liu
05bdd715a8
Use import to load page and layout (#42325)
Fixes #42534

* Use eager `import()` to load page/layout to avoid esm module resolution error, eager is to make sure all the sub resources like css are also included
* Fix layer detection, should use `module.layer` directly since `module.resourceResolveData` is not alway presented. It lost when switching from `require()` to `import()` for page/layout component

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`
2022-11-10 02:16:59 +00:00
JJ Kasper
e0b946a4bb
Fix replaceAll usage in post-process (#42714)
Similar to https://github.com/vercel/next.js/pull/42550

Fixes:
https://dev.azure.com/nextjs/next.js/_build/results?buildId=43629&view=logs&jobId=14d0eb3f-bc66-5450-3353-28256327ad6c
x-ref: https://github.com/vercel/next.js/pull/42495

## 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-11-09 17:26:55 -08:00
JJ Kasper
d124189ab0
Ensure appDir is included in webpack configVars (#42710)
This ensures the webpack cache is updated when toggling between `appDir:
true/false`.

## 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-11-09 17:22:50 -08:00
Shu Ding
18134f87fc
Fix CSS handling rules (#42615)
This PR fixes (and simplifies) CSS loader rules, major things fixed with
this PR:
- (Tests added) Even if `appDir` isn't enabled, CSS/SASS/CSSM/SASSM
should still be transpiled for packages in node_modules, configured via
`transpilePackages`.
- They should be transpiled from other packages in the same monorepo
(not inside node_modules).

## Bug

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

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm 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-11-09 16:28:48 -08:00