Commit graph

14945 commits

Author SHA1 Message Date
JJ Kasper
076844e59f
Ensure URL can be passed to fetch correctly (#46592
Fixes: 

![CleanShot 2023-02-28 at 22 35
57@2x](https://user-images.githubusercontent.com/22380829/222042856-ee6dc3c4-c143-49f2-8023-5def749d6a64.png)


## Bug

- [x] 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)
2023-02-28 21:32:28 -08:00
JJ Kasper
5d48d7e6ed
v13.2.2 2023-02-28 17:48:09 -08:00
OJ Kwon
fc10d02366 feat(overlay): apply data-* header for the error desc (vercel/turbo#4015)
Partially resolves WEB-671.

There are some test cases use `data-nextjs-dialog-header` to lookup its
inner text to verify error output. Due to differences of error overlay
layout between turbopack / next-dev, those 2 have different inner texts.

PR applies a workaround, by introducing new data tag
`data-nextjs-turbo-dialog-body`. Next.js upstream will need following
update to utilize this tag in its test suites.
2023-02-28 17:27:30 -08:00
JJ Kasper
250a2f59b3
v13.2.2-canary.5 2023-02-28 16:31:35 -08:00
Jiachi Liu
b5f92c444b
Fix: canonical should allow relative urls (#46584)
alternate urls should allow string type for relative paths

## Bug

Fixes #45824

- [x] 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)

---------
2023-02-28 16:17:08 -08:00
Shu Ding
5532b6a93f
Fix app client child entry not being disposed when deleting the file (#46583)
Currently if a file or folder (that contains an entry) is renamed in app dir, the dev server will stop working because we never remove the old entry. Since all client entries in app dir are created as child entries programmatically via the RSC plugin, they're different and not handled by our existing hot reloader logic:

f0cbe84e4c/packages/next/src/server/dev/hot-reloader.ts (L666-L677)

This PR adds a file path to child entries as well (it can be layout, page and other entries) so in the entry generation step we can prune the invalid ones.

Fixes #46379, fixes NEXT-650.

## 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)
2023-02-28 23:32:03 +00:00
Vadzim
11494c3002
Fix usage of textDecoder to not break utf8 characters (#46564)
Fix usage of textDecoder to prevent breaking utf8 characters

fixes #46561



## Bug

- [x] Related issues linked using `fixes #number`
// it's too hard to get a reproducible test 
// - Integration tests added
// error links are not needed 
// - Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
2023-02-28 22:20:36 +00:00
Jiachi Liu
4b705a5473
Use og:image instead of og:image:url (#46570)
x-ref: https://github.com/vercel/next.js/discussions/46545

In the open graph protocol spec, `og:image` and `og:image:url` are identical. But some platform might don't have full support for it.

We change it back to render `og:image` as it's the most common and compatible format, also easy to align with the code docs
2023-02-28 21:46:15 +00:00
JJ Kasper
89a9bd9f74
v13.2.2-canary.4 2023-02-28 12:36:40 -08:00
teobler
b6b7933377
fix: generate next-env.d.ts file during next lint command (#46249)
fixes #46104

## Bug

- [x] 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)

---------

Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
2023-02-28 11:51:22 -08:00
Steven
18dc09bf55
fix: should not warn when image unmounts (#46567)
- Fixes #40762

---------
2023-02-28 11:28:55 -08:00
Shu Ding
9edf2d3d1f
Fix CSS imports not included in entries with a custom extension (#46571)
`entryName` will contain the extension if it's not a normal JS entry, this causes CSS being missing in pages with a custom extension in app dir (e.g. MDX). Here we add a `.replace(/\.[^\\/.]+$/, '')` to the entry name.

Fixes NEXT-709

## 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)
2023-02-28 18:53:48 +00:00
JJ Kasper
d49c700d0d
Fix shared entries/invalidators module scope (#46533)
This ensures we don't keep `entries` and `invalidator` in module scope
directly and nest it under a key specific to each compilation so
multiple `next` instances in the same process don't override one and
another.

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

Closes: https://github.com/vercel/next.js/pull/46432
Fixes: https://github.com/vercel/next.js/issues/45852
2023-02-28 10:17:28 -08:00
Jiachi Liu
d0ba8003dc
Fix viewport typing and refactor constants (#46569)
## Bug

x-ref: https://github.com/vercel/next.js/discussions/46542
Closes NEXT-686

- [x] 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)
2023-02-28 17:40:48 +00:00
Serkan Bektaş
0c0318e75b
Wrong function name (#46546)
The function name was written incorrectly. Property 'rewrites' does not exist on type NextResponse.



## 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`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-28 11:46:50 +00:00
Jimmy Lai
886dc9f30f
feat: add support for the src folder for the instrumentation hook (#46529) 2023-02-28 12:08:30 +01:00
Jesse Koldewijn
7a9047a730
Added bcrypt to the serverComponentsExternalPackages auto-optOut list (#46532)
fixes #46493

## 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)
2023-02-28 10:53:37 +00:00
JJ Kasper
619c76c0f9
Fix infinite invalidations loop in app dir (#46526)Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This fixes a case where depending on the timings of compilers being done
could cause an infinite invalidation loop.

**Before**


https://user-images.githubusercontent.com/22380829/221786587-1a4cc6ab-f273-4191-92af-a57e9fff1261.mp4

**After**


https://user-images.githubusercontent.com/22380829/221786611-f55c3da9-0201-40be-95a8-3ef1869d6a66.mp4

x-ref: [slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1677441845988529?thread_ts=1677429424.151329&cid=C03KAR5DCKC)

## Bug

- [x] 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)

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-28 11:07:29 +01:00
Shu Ding
5ff005f7b5
Refactor route types to include rewrites and redirects (#46327)
This PR refactors the implementation of `Route<T>` to be more compact
(2/3 fewer union types), and adds support for static rewrites and
redirects. Check the updated test for more details.

In the future I plan to continue to refactor this by extract static
routes out as unions (instead of always relying on type inference) for
better autocompletion. Maybe a dev-only feature?

## 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)
2023-02-28 10:18:47 +01:00
Balázs Orbán
767e9216f7
fix(error-overlay): hide "Learn more" when up-to-date (#46488)
When the installed `latest` or `canary` of `next` matches the last
published version, we should hide the link that points to the error
message/explanation.

[Slack
thread](https://vercel.slack.com/archives/C04CAN8CGCE/p1677370692392969)

Fixes NEXT-672

## 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: JJ Kasper <jj@jjsweb.site>
2023-02-28 10:15:57 +01:00
Tim Neutkens
3609bdbffe v13.2.2-canary.3 2023-02-28 10:15:03 +01:00
Shu Ding
877f2f5996
Upgrade precompiled react packages (#46365)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-28 10:13:02 +01:00
JJ Kasper
4ac4b757d4
Update fetch cache internal handling (#46522)
x-ref:
https://github.com/vercel/next.js/actions/runs/4288511720/jobs/7470646795
x-ref:
https://github.com/vercel/next.js/actions/runs/4288511720/jobs/7470647108
x-ref:
https://github.com/vercel/next.js/actions/runs/4288511720/jobs/7470647255
2023-02-27 21:39:11 -08:00
Justin Ridgewell
7e2d931ffa Update Middleware Routing (vercel/turbo#3930)
This accomplishes 2 things:
- Moves the creation of the edge info onto the Next.js side
- Extracts the middleware's `export const config = {}`, so that we can know what matchers are needed before invoking the edge function definition.

After this, an update to the Next.js side will enable middleware.

Fixes WEB-623
2023-02-28 02:09:54 +00:00
JJ Kasper
6b276042ee
v13.2.2-canary.2 2023-02-27 17:17:33 -08:00
JJ Kasper
82f4fd3e8c
Update router filter to be less sensitive (#46515)
This skips including dynamic redirects in the client router filter as it
causes extra unexpected hard navigations.

x-ref: [slack
thread](https://vercel.slack.com/archives/C04MEB9L9RQ/p1677521159911179?thread_ts=1677255545.574209&cid=C04MEB9L9RQ)

## 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)
2023-02-27 17:07:26 -08:00
RTrace
9ad1f321b7
Add interactive-widget optional property to Viewport type (#46506)
## 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`
- [x] [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)



Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2023-02-27 23:12:56 +00:00
JJ Kasper
aa614635d6
Update fetch cache key (#46513
x-ref: [slack
thread](https://vercel.slack.com/archives/C042LHPJ1NX/p1677461963151879?thread_ts=1677360662.652689&cid=C042LHPJ1NX)

## 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)
2023-02-27 14:14:14 -08:00
Steven
d3e576dba3
fix: codemod should preserve type only import (#46512)
This PR is similar to PR #46460, but applies the patch to all our codemods.
2023-02-27 21:36:26 +00:00
Tom Ballinger
474b115e6d
Remove baseUrl from create-next-app ts/jsconfig.json (#46458)
Fixes #46288

Makes TypeScript behavior match runtime by no longer allowing files to
be imported absolutely relative to project root without using a relative
path or a path alias. This changes behavior introduced in
https://github.com/vercel/next.js/pull/44672 which also added the paths
alias `@/*: ["./*"]`, which works without a baseUrl.

## 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)
2023-02-27 12:16:04 -08:00
Ngô Đức Anh
792c26d87d
Fix(typedRoutes): fixed 'next' imports on TS < 5.0 (#46507)
<!--
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:
-->

This is yet another follow-up PR of #46378...
In my discussion with the author of PR 46457, I figured out that
exporting with the .d.ts extension doesn't work in TS < 5.0, which I
didn't really notice because my projects were already using TS 5.0 and
Next's tests were passing. This PR just deletes the extension from the
export path.


## 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)
2023-02-27 20:49:52 +01:00
Shu Ding
9376a5afb2
Add image generation test to app route (#46449)
~~Currently blocked by #46448.~~
Closes https://github.com/vercel/satori/issues/410.

## 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)
2023-02-27 19:29:09 +01:00
Jiachi Liu
04547e8163
Add theme color media support for metadata (#46502)
x-ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color

Resolves NEXT-525



## 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`
- [x] [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)
2023-02-27 18:22:05 +00:00
Will Binns-Smith
77283326e1 Snapshot issues in next-dev-tests (vercel/turbo#3774)
This:
* Adds issue snapshot support to next-dev-tests. This will allow us to
assert that certain issues are raised in tests that require next-dev.
* Extracts common snapshot code into a new crates,
`turbopack-test-utils`, which is shared between snapshot tests and
next-dev-tests.
* Implements an issue reporter that emits issues in a channel to the the
integration test code, where they are snapshotted.
* Fixes an issue where next-dev tests that were not Next.js apps would
emit non-fatal issues for a missing `pages/` directory.

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>

---------

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
2023-02-27 10:04:06 -08:00
Shu Ding
16d7ffdd11
Fix SWC's auto_cjs handling (#46448)
Closes #43732.

We currently detect if a module is CJS by look through all string tokens to see if any contains `"__esModule"`. That causes `console.log('__esModule')` being detected as CJS accidentally. This PR changes to detect these cases:
- `module.exports`
- `exports.__esModule` (e.g. `exports.__esModule = true`)
- `Object.defineProperty(exports, "__esModule", ...)` 

Although this solution isn't perfect, it's much more reliable that the current one already.

Note that this also fixes a bug for `@vercel/og` that although `satori`'s ESM module is imported, it still has the `__esModule` string inside, introduced by bundling its vendors.

## 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)
2023-02-27 16:56:05 +00:00
Will Binns-Smith
819d46a606 Automatic babel-loader followup (vercel/turbo#3944)
This:
* Addresses feedback from https://github.com/vercel/turbo/pull/3862
* Exempts VirtualAssets from webpack loaders. This addresses a bug where
next-hydrate.tsx could not be read.
	* Adds `ModuleRuleCondition::ResourceIsVirtualAsset` to filter these

---------

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
2023-02-27 08:14:24 -08:00
Shu Ding
69fe4eee39
Refactor style loader code (#46490)
Should fix the vanilla-extract issue in #46374.

## 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)
2023-02-27 14:29:42 +00:00
Hannes Bornö
ce234fb9ad
Add error for styled-jsx in Server Component (#46482)
Add specific error for the `styled-jsx` import that's implicitly added
to the file when using `<style jsx>`.

Before

![image](https://user-images.githubusercontent.com/25056922/221547281-7b25a979-ee03-4d29-97c8-a038b9ebb214.png)

After

![image](https://user-images.githubusercontent.com/25056922/221547152-ed122163-93e5-48ae-bf95-484388f462ea.png)

Fixes NEXT-669

## 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: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-27 15:04:34 +01:00
Hannes Bornö
86c81d2968
Add @latest to next/font codemod warning (#46486)
Add `@latest` to codemod command in the `@next/font` warning. Otherwise you won't get the latest if it's already in cache, and `built-in-next-font` wouldn't be included in an older version.

## 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)
2023-02-27 12:40:03 +00:00
Hannes Bornö
bd9ad97c8e
Fix next/font/google config not being used (#46484)
Make sure both `@next/font/google` and `next/font/google` works when setting subsets in `next.config.js`.

Fixes NEXT-668

## 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)
2023-02-27 12:18:19 +00:00
Kanary Hong
36664910cc
Fix typo from next-font (#46468
<!--
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:
-->

Abbreviation for weight was `wgth` on axes iteration while other part
was `wght`.
2023-02-27 12:21:01 +01:00
Jan Kaifer
714720ffa9
dynamic = "error" violations should be shown in error overlay (#45893
dynamic = "error" should throw in dev mode, currently, it just gets
ignored.
It doesn't throw a nice custom error, but at least it isn't silently
ignored anymore.

Build behavior stays the same.
2023-02-27 12:20:23 +01:00
Tim Neutkens
ddccab7536
Remove incorrect comment (#46467)Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This was leftover from copying ReadonlyHeaders it seems.
<!--
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:
-->

## 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: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-02-27 12:18:51 +01:00
John Daly
54266bb590
[next/codemod]: Preserve type-only imports when using next-image-to-legacy-image (#46460
<!--
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:
-->

Fix for https://github.com/vercel/next.js/issues/46459

In order to test this, I've updated the `next-image-to-legacy-image`
tests to use fixtures that are written in TypeScript. I've disabled
type-checking and linting on those test fixtures, because they are
pretty noisy.

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

## 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)
2023-02-27 12:06:48 +01:00
Chanhee Lee
586ae4e880
Support Two-letter Language Codes(ISO-639-1) to metadata HrefLang types (#46285
As written in the [reference
link](https://hreflang.org/what-is-a-valid-hreflang) in
`alternative-urls-types.ts`, two-letter language codes in ISO 639-1
format can also be used as HrefLang.

So, adding Two-letter language codes into `HrefLang` type in
`alternative-urls-types.ts`.
closes #46284
2023-02-27 12:03:35 +01:00
Snorre Eskeland Brekke
9d30f43aca
Updates cms-sanity example to use Sanity v3 (#45662
## 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)

Fixes issues reported, for instance here:
https://github.com/vercel/community/discussions/1449
(The example does not deploy atm and uses an old version of Sanity).
## Feature

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

* Updates the Sanity studio to use the latest v3 version. This required
changing some files, as per migrating to Studio v3 docs.
* Updated the README to reflect the changed procedure. 
* Update the next app to use the latest version of next-sanity. Changed
related code as a result.

### Testing
Tested using this deploy url (uses the branch from the forke repo):

https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fsanity-io%2Fnext.js%2Ftree%2Fsanity-v3%2Fexamples%2Fcms-sanity&repository-name=cms-sanity&project-name=cms-sanity&demo-title=Blog+using+Next.js+%26+Sanity&demo-description=On-demand+ISR%2C+sub-second+as-you-type+previews&demo-url=https%3A%2F%2Fnext-blog-sanity.vercel.app%2F&demo-image=https%3A%2F%2Fuser-images.githubusercontent.com%2F110497645%2F182727236-75c02b1b-faed-4ae2-99ce-baa089f7f363.png&integration-ids=oac_hb2LITYajhRQ0i4QznmKH7gx


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

fixes #46450
2023-02-27 11:58:43 +01:00
Jan Kaifer
f3ef4e99b0
Cover 1st-party examples with tests (#45270)Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
We want to make sure that our examples are not breaking.
We don't want to be slowed down by broken 3rd party packages, but we
need to ensure that examples covering next.js features are always green.

Added as a standalone workflow that doesn't parallelize. It will just
run on a cron schedule, so we can check for current status. We can add
Slack ping later if we need to.

The workflow tests just that our examples can build, so mostly TS
issues. We could definitely follow up with actual tests, but that is not
as low-hanging.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2023-02-27 11:54:24 +01:00
Harry
65ce868779
chore: Loss of precision due to Date now amplification (#46344)
Loss of precision due to `Date.now()*1000*1000` (used to record HMR time) has exceeded the safety integer MAX_SAFE_INTEGER.

![image](https://user-images.githubusercontent.com/45198715/221096707-ceaa8fad-1432-428d-8bad-cc83b452127f.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)
2023-02-27 09:29:57 +00:00
Ngô Đức Anh
c0dd8be82f
Fix(typedRoutes): export createServer from 'next/types/index.d.ts' (#46462)
This is a follow-up PR of #46378, which overlooked one thing - I forgot to export `createServer` from `next/types/index.d.ts` in `declare module 'next'`.

I've also reformatted that part as well, so that it matches Next's coding style.

## 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)
2023-02-27 08:22:20 +00:00
Yunus Szönyi
b7b81b2033
fixed spelling mistake (#46446)
## 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/issues/46444
2023-02-26 21:12:35 +00:00