Commit graph

12241 commits

Author SHA1 Message Date
Jiachi Liu
7f54585f8d
Bump styled-jsx and remove manual types creation (#39506) 2022-08-11 10:13:26 -05:00
JJ Kasper
d158c0c580
Make dev watch ignore more specific (#39504)
This fixes the case where we were incorrectly ignoring the next-auth API endpoint since it matched the `.next` watch ignore and also adds a test case to ensure we match this route correctly. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/39495
2022-08-11 15:09:57 +00:00
JJ Kasper
f863ba7193
v12.2.5-canary.4 2022-08-10 23:00:59 -05:00
dcdev67
79d1b33332
[examples] Add on-demand revalidation to Contentful example (#39475)
## 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`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Changes

Added in on-demand revalidation for Contentful example. Specifically, added the revalidate api path, a new environment variable which will contain the secret, and some additions to the README.


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-11 03:58:53 +00:00
Noel Kim (김민혁)
40f0eb126b
feat(next-swc/modularize_imports): Add Kebab case (#38583)
* Feat: Add Kebab case

* Add document

* Feat: Add Kebab case

* Add document

* Add Test cases
2022-08-10 22:51:05 -05:00
JJ Kasper
4e6d05575e
Add hot-reloading for env file changes (#38483)
* Add hot-reloading for env file changes

* update watching

* update test

* update initial env handling

* undo test change

* add comment for entries clearing

* update on-demand-entry-handler restart handling

* lint-fix

* handle bad plugin
2022-08-10 22:27:48 -05:00
X7Becka
970469f359
FIX GAUSSIAN BLUR IN FUTURE\IMAGE (#39190)
## Bug

- [fixes #39035 ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have 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 helpful link attached, see `contributing.md`

## Documentation / Examples

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


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-11 00:09:42 +00:00
JJ Kasper
d246257602
v12.2.5-canary.3 2022-08-10 18:18:54 -05:00
JJ Kasper
c97a8e8f1b
Fix swc build for freebsd target (#39478)
* Fix swc build for freebsd target

* test build

* update build

* update version

* test v0

* use napi directly

* revert vm version

* undo test build
2022-08-10 18:09:10 -05:00
Steven
3d2765342e
Update contributing.md to recommend corepack (#39479)
Since corepack is already [enabled for this repository](1669c60684/package.json (L218)), lets recommend it for contributing.

Learn more: https://styfle.dev/blog/corepack
2022-08-10 22:32:51 +00:00
JJ Kasper
1669c60684
Fix next.config.js overwriting on deploy e2e test (#39476) 2022-08-10 16:44:21 -05:00
Maedah Batool
bd61406e54
Improve next/future/image Migration docs (#39421)
The [comparison table for migration](https://nextjs.org/docs/api-reference/next/future/image#migration) to `next/future/image` looks odd layout-wise. The issue was brought up via this [Slack thread](https://vercel.slack.com/archives/C02F56A54LU/p1660040275310949).

This PR makes this improvement.

### New implementation

<img width="1216" alt="image" src="https://user-images.githubusercontent.com/12712988/183631902-6850836b-cb4e-44ea-909f-ba353725be15.png">

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have 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 helpful link attached, see `contributing.md`

## Documentation / Examples

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


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2022-08-10 20:40:53 +00:00
JJ Kasper
44eea0c9c9
v12.2.5-canary.2 2022-08-10 15:32:25 -05:00
JJ Kasper
c9aa2ea2cf
Tweak styled-jsx type declarations (#39474)
* Tweak styled-jsx type declarations

* fix lint
2022-08-10 15:26:54 -05:00
Wyatt Johnson
f5cab2f515
App Build Stats (#38884)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have 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 helpful link attached, see `contributing.md`

## Documentation / Examples

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


Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-10 19:31:01 +00:00
JJ Kasper
b15a976e11
Handle rewriting WebSocket requests (#39463)
This ensures we properly handle rewrites when the request is a WebSocket request. This also adds an integration test to ensure it is working as expected in dev and production mode. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/32634
Closes: https://github.com/vercel/next.js/pull/38455
2022-08-10 17:00:30 +00:00
JJ Kasper
d64a1507a9
Ensure default _app is used when falling back to default _error (#39467)
* Ensure default _app is used when falling back to default _error

* make render check less specific due to arbitrary wait
2022-08-10 11:36:22 -05:00
Tim Neutkens
ed81a14922
Enable @typescript-eslint/no-use-before-define for examples dir (#39469)
Found that this rule was added but all options are set to `false` so it doesn't do anything. Started with enabling it for examples to ensure minimal breaking of existing PRs.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have 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 helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-10 16:30:36 +00:00
Damien Simonin Feugas
01888dcb00
chore: restores removed tests (#39452)
### 📖 What's in there?

As part of the 4 hands work done in #39397, we accidentally removed a describe for middleware "using a single matcher with i18n" (and no base path nor trailing slash).

This PR restores it.

### 🧪 How to test?

```
pnpm testheadless --testPathPattern middleware-matcher
```

### 🆙 Note to reviewers

There's only a couple lines with meaningful change in this PR. Hide whitespaces in github's diff screen to find it more easily: https://github.com/vercel/next.js/pull/39452/files?diff=split&w=1
2022-08-10 09:53:20 +00:00
Gal Schlezinger
b899d01fff
Bump edge-runtime packages (#39450)
This version fixes a bug where [crypto buffers (ArrayBuffer, Uint8Array) not compatible with text decoding](17475e4df7).
2022-08-10 09:19:48 +00:00
M. Zakiyuddin Munziri
5f033ecb54
Fix docs path "Invalid getServerSideProps Return Value" (#39443)
# Description

The link to https://nextjs.org/docs/messages/invalid-getserversideprops-value does not exist, the correct link should be https://nextjs.org/docs/messages/invalid-getserversideprops-return-value

![image](https://user-images.githubusercontent.com/78015359/183795431-53210024-4938-4f50-9f0a-cb412383780e.png)

![image](https://user-images.githubusercontent.com/78015359/183795482-f17f31c2-cbaf-4652-ad77-5294fa8f104a.png)

# Solution

## From

Referring to the pattern, there is no `return`

![Screenshot from 2022-08-10 10-04-33](https://user-images.githubusercontent.com/78015359/183795393-ba244d6a-84b3-426c-b5ef-4e17d108902a.png)

## To

So I removed the word `return` to match the pattern

![image](https://user-images.githubusercontent.com/78015359/183796280-da6f10d1-c017-4075-942a-01d9ad234c27.png)


## Bug

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

## Documentation / Examples

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

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-10 02:34:43 +00:00
Jono Hewitt
7d59da97ac
Update router.prefetch documentation to include locale option (#39442)
* Update `router.prefetch` documentation

Include documentation for setting the locale as an option within `router.prefetch`.

* apply suggestions

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-09 21:02:55 -05:00
JJ Kasper
a6bc38799a
v12.2.5-canary.1 2022-08-09 18:03:15 -05:00
Damien Simonin Feugas
15a216b856
feat(middleware): augments / matcher with /index (#39397)
* feat(middleware): augments / matcher with /index

* fix(#39396): not invoked with i18n and trailingSlash

* add test case

* tweak matcher a bit and add tests

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-09 17:58:40 -05:00
Alex Castle
e2119c068f
Add component wrapper in sizes documentation code snippet (#39437)
* Wrap sizes code snippets in component

* Don't remove docs import statement
2022-08-09 15:43:25 -05:00
JJ Kasper
997e3c0cf9
Ensure locale redirects are not applied in minimal mode (#39436) 2022-08-09 15:06:00 -05:00
Shu Ding
ed14af308d
Extract redirect utils into a separate file (#39433)
extract redirect utils
2022-08-09 14:34:25 -05:00
Alex Castle
b2d93e8a84
Enhance sizes documentation for next/image (#39301)
This PR updates the documentation for the `sizes` proper in next/image to make it more clear what this prop does and why it's (very) important to use it. After feedback, I'll update this PR to also modify the future image component docs.


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-09 19:30:49 +00:00
Jiachi Liu
3e19ad5c5f
typing: upgrade styled-jsx to remove workaround in build script (#39408)
Improve styled-jsx types in next.js, previously there's no `declare module` for styled-jsx and there's type name conflicts in `styled-jsx/index.d.ts` and we use a rename hack to avoid the conflicts. Now styled-jsx 5.0.3 fixed those issues.

x-ref: https://github.com/vercel/styled-jsx/pull/805
2022-08-09 17:10:33 +00:00
fediev
d3bbfea117
Improve description of context.query in getServerSideProps() (#39422)
Improve description of `query`

`query` is not just representing of the query string. It has the same values as `router.query`.
2022-08-09 10:23:54 -05:00
Balázs Orbán
5ac50a9be0
fix: ensure trailing slash on registry URL when fetching wasm fallback (#39427)
fix: ensure trailing slash on registry URL
2022-08-09 09:32:29 -05:00
Lee Robinson
5d93753bc3
API Routes Request Helpers docs. (#39407)
Renames Middleware to Request Helpers to be both more accurate and also less confusing since Middleware is a separate feature of Next.js now.
2022-08-09 02:02:14 +00:00
Jiachi Liu
71f5f258ab
Setup require hook in next-server for styled-jsx resolving (#39305)
* Use require hook and alias to resolve styled-jsx

* re-export styled-jsx types from compiled

* fix lint

* add test for styled-jsx css

* setup require hook in server

* compile import path to styled-jsx/style

* revert require hook

* add test for server styled-jsx resolving

* update test

* pre copy styled-jsx assets

* fix styled-jsx dts

* add npmrc for styled-jsx e2e test

* load require hook directly

* rm legacy test

* fix lint

* fix pnpm install error

* split require hook

* only alias styled-jsx

* make styled-jsx resolving statically analyzable

* update test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-08 20:27:42 -05:00
JJ Kasper
b0f590162c
v12.2.5-canary.0 2022-08-08 18:44:10 -05:00
pekarja5
289bfa6af9
Fix Link generation for SSG pages if locale domains are used (#36818)
* Fix SSG Link generation if using domain locales

* Updated condition and test

* Changed export worker domain locale check

* Update check

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-08 18:42:40 -05:00
Anthony Shew
60c8e5c29e
Fix: broken TypeScript in WordPress example. (#39402)
* chore: add typescript and update deps

* style: add tsconfig

* chore: add g.avatar.com domain

* fix: images domain api url to match with hostname

* style: convert files to typescript

* refactor(Avatar): const name for readable purpose

* refactor: change regex to extract www from url

* Update next-image domains.

* Update a few types.

* Update readme.

* typo

Co-authored-by: Chaiwat Trisuwan <chaiwattsw@gmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Anthony Shew <anthony@inthezone.dev>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-08 14:18:26 -05:00
Sanjaiyan Parthipan
1cc6e47abe
Update script.md (#39400)
Adding `strategy="lazyOnload"` for prevent minor confusion.

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-08 18:03:23 +00:00
sumiren
9f8713fae4
docs: update When section of getStaticProps page (#39393)
getStaticProps will be called in conjection with fallback.

it's written in following page, but not in concerned page.
https://nextjs.org/docs/basic-features/data-fetching/get-static-paths
2022-08-08 10:20:12 -05:00
Balázs Orbán
b292bdc293
fix(ts): Middleware type tweaks (#38625)
* fix internal type

* allow `void` to be returned from Middleware

* mark deprecated APIs in JSDoc

* fix typo

* add missing error page

* remove unused import
2022-08-08 09:40:44 -05:00
Julien Deniau
8ebd1a24cb
Update polyfill for eslint no-unwanted-polyfillio rule (#33170)
Fixes #33072

I documented all `esXXX` features to be sure that they were already polyfilled. Only `es2019` feature `Object.fromEntries` is not already polyfilled by nextjs.

I added some unwanted polyfill (that are polyfilled by nextjs).

I kept the `es5`, `es6` and `es2015` "as-is" as they contain functions that does not seem to be explicitly polyfilled (all `Math` functions or `Date.now` for example) in the [polyfill file](https://github.com/vercel/next.js/blob/master/packages/next-polyfill-nomodule/src/index.js)

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-08 05:56:31 +00:00
JJ Kasper
f60f8aede6
Land(Update example with-apivideo-upload README) (#39391)
* update(README)

* fix create scripts

Co-authored-by: MarDi66 <yohann.mtfpro@gmail.com>
2022-08-08 00:33:17 -05:00
Everton Nunes
59b144c264
[ESLint] Adds --output-file flag (#36420)
Add support for `--output-file` on ESLint cli, based on this discussion https://github.com/vercel/next.js/discussions/26179, and this closed PR https://github.com/vercel/next.js/pull/35154. With this flag, it is possible to save the output in a file and use it for any purpose.

## 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 helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-08 05:29:23 +00:00
Sukka
4199da09b8
Add Object#fromEntries polyfill (#36426) 2022-08-08 00:04:19 -05:00
Michael Novotny
ab48f54786
Adds eslint-plugin-eslint-plugin to ensure eslint-plugin-next rules follow ESLint rule best practices along with enforcing some consistency. (#37920)
* Adds eslint-plugin-eslint-plugin and recommended rules.

* Removes `fixable` as none of the rules contain fixers.

* Adds description and url rules.

* Adds message format.

* Removes optional dependencies.

* Lints eslint-plugin-next tests too.

* Removes optional dependencies from pnpm lock file.

* Resets pnpm lock file.

* Resets package.json too.

* Fixes pnpm lockfile.
2022-08-07 23:52:02 -05:00
양현석
160da6b806
next/image imgix loader can use multiple auto params (#34808)
fix: imgixLoader can use multiple auto params
2022-08-07 23:27:00 -05:00
LongYinan
4264408b16
Fix emotion shouldForwardProp options breaks component selectors (#39390)
fixes https://github.com/vercel/next.js/issues/38291



## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have 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 helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-08 03:46:11 +00:00
Sicarius
b30ae643a4
Add yarn 2 Setup Files to Valid Files for create-next-app (#30936)
* added yarn 2 based files/dirs to valid files

* remove package.json

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-07 22:05:48 -05:00
LongYinan
4da09da1a2
Fix emotion labelFormat and sourcemap options (#39389)
fixes https://github.com/vercel/next.js/issues/39386
2022-08-07 21:52:44 -05:00
Aniket Singh Rawat
8ddcc6aedb
Fix removing whitespacing in dev overlay (#28277)
## Bug

- [x] Related issues linked using `fixes #number`

fixes #14434 

Before
![image](https://user-images.githubusercontent.com/31622972/130001431-392efc66-69b3-47b5-802a-251a545983fd.png)

After
![image](https://user-images.githubusercontent.com/31622972/130001455-f553c977-c64b-43da-8e27-b513c6ea4179.png)



Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-08 02:16:42 +00:00
Lucas Rosa
a5029e9fd4
Allow custom path for preview mode cookies (#38313)
* Allow custom path for preview mode cookies

* update params order and tests

* update tests

* fix tests and update docs

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-07 20:45:30 -05:00