Commit graph

9905 commits

Author SHA1 Message Date
Steven
44b4dbcd41
Adjust AVIF size so that its smaller than WebP size (#31494)
Generally, AVIF quality can be lower compared to WebP so we can adjust this for the user so that it looks roughly the same depending on if the browser supports AVIF or WebP.

- Fixes #31254 
- Related to https://github.com/lovell/sharp/issues/2850
2021-11-17 20:31:16 +00:00
Gerald Monaco
0cf7061859
Make missing Document components an error (#31505)
* Make missing document components an error

* Fix broken tests
2021-11-17 13:34:16 -06:00
Keen Yee Liau
9ab1709175
telemetry: track usage of 'optimizeFonts' (#31522)
`optimizeFonts` is enabled by default, but the Aurora team would like
to find out how many users explicitly turn it off.
2021-11-17 13:33:37 -06:00
Maia Teegarden
b80c378975
Add/wasm build (#31470) 2021-11-17 20:01:02 +01:00
Kevin Wolf
af6e9e2d87
Add middleware examples to custom page extensions (#31545)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-17 18:03:02 +00:00
xuchaobei
9739e6c100
Update environment-variables.md (#31525)
Remove `NEXT_PUBLIC_` prefix for server-only enviroment vars.


## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-17 17:01:42 +00:00
Donny/강동윤
2df861ac12
Update swc (#31540)
This PR applies
 - https://github.com/swc-project/swc/pull/2784

Closes #31479
2021-11-17 16:51:00 +00:00
Jiachi Liu
055e28ef81
Ensure only one doctype is rendered (#31534)
React-dom renders doctype automatically when `<html>` is detected. We should append `DOCTYPE` prefix only when necessary.
x-ref: https://github.com/facebook/react/pull/21680

## Bug

![image](https://user-images.githubusercontent.com/4800338/142215292-4af4a61d-2d75-48ae-a31a-0af641c72dcf.png)

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-11-17 14:57:48 +00:00
Yang Feng
06770e4c64
Click-to-open error state for development overlay #14461 (#21819) 2021-11-17 15:03:50 +01:00
Steven
d87dc2b5a0
Add detection for Google-PageRenderer bot (#31521)
- Fixes https://github.com/vercel/next.js/discussions/31482
2021-11-17 03:49:37 +00:00
jj@jjsweb.site
2ad9dac873
v12.0.5-canary.0 2021-11-16 16:48:33 -06:00
Shu Ding
4ea7d7b177
Refactor the middleware SSR loader (#31508)
Initial step for #31506, to move the adapter logic out of the loader output string so it will be easier to reuse code in the future. Also, more options are passed to the loader to align with the serverless loader.

## 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 `yarn lint`
2021-11-16 20:43:57 +00:00
Jiachi Liu
55ab4f06b7
Use _error for development in streaming (#31466)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-11-16 20:18:57 +01:00
Kiko Beats
593d943cd0
NextResponse: add .json static method (#31483)
closes: https://github.com/vercel/next.js/issues/31196

This new API was suggested in a previous version of this feature:
https://github.com/vercel/next.js/pull/31024#discussion_r745035448

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2021-11-16 18:38:47 +00:00
Nikola Knežević
af82de4274
Fix type declaration for API Routes response (#31486)
There is missing equals sign in the type declaration in the example for API Routes.

## Documentation / Examples

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


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2021-11-16 17:54:53 +00:00
Tobias Koppers
bf973165fe
update webpack (#31455)
https://github.com/webpack/webpack/releases/tag/v5.64.1
2021-11-16 17:28:42 +00:00
Gonzalo Pozzo
d550b13b8d
Script examples (#31181)
* Add script component examples

* Update script examples

* Refactor code

* Remove unused files

* Fix linter

* Fix lint error

* Fix prettier
2021-11-16 11:47:12 -05:00
Tobias Koppers
b79591cdaf
simplify output messages (#31454)
remove all `client/server/middleware only` messages and show `client and server` instead only when both compilers has been used.
2021-11-16 15:57:30 +00:00
Javi Velasco
9375485969
Remove TextEncoder and TextDecoder wrappers (#31490)
This PR removes the class wrapper that we have for `TextEncoder` and `TextDecoder`. Since this is merged we will be using directly the Node version in the sandbox.
2021-11-16 14:12:22 +00:00
stefanprobst
f195650f74
fix: allow next lint without eslint-config-next installed (#29823) 2021-11-16 14:07:31 +01:00
Tim Neutkens
d8028f553e
Revert "Add docs for the Rust Compiler (SWC)." (#31484) 2021-11-16 10:42:45 +01:00
Lee Robinson
47aad2fafd
Add docs for the Rust Compiler (SWC). (#31467)
This clearly lists what transforms are supported, which are currently experimental, and what is still unsupported with a place to leave feedback and your existing Babel setup.
2021-11-16 09:40:28 +00:00
Yamagishi Kazutoshi
32f0c9a403
Support ESLint v8 (#29865)
Co-authored-by: Michaël De Boey <info@michaeldeboey.be>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2021-11-16 10:18:27 +01:00
Heyang Zhou
a39a8969d3
Add a swc transform for removal of console.* calls. (#31449) 2021-11-16 10:18:05 +01:00
Abdullah Mzaien
aedb86591f
Update react-18.md (#31476)
Changing the install tags to beta since react released the [beta](https://github.com/reactwg/react-18/discussions/112) today



## 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 `yarn lint`
2021-11-16 04:09:42 +00:00
jj@jjsweb.site
abd87a515e
v12.0.4 2021-11-15 14:43:54 -06:00
jj@jjsweb.site
b204640008
v12.0.4-canary.15 2021-11-15 14:07:57 -06:00
JJ Kasper
a9eb0de8e7
Ensure swc dep is copied for isolated tests (#31462) 2021-11-15 13:55:32 -06:00
Kiko Beats
b51a020941
middleware: add request referrer support (#31343)
closes: https://github.com/vercel/next.js/issues/30353

According with spec, `'about:client'` is the default value is the user doesn't provide it.

It needs to add a test there, looks like there no unit tests for these classes 🤔
2021-11-15 19:52:44 +00:00
jj@jjsweb.site
66d9b4e14a
v12.0.4-canary.14 2021-11-15 12:54:42 -06:00
JJ Kasper
be03a1d17b
Remove .only and ensure jest lint rules apply for all tests (#31456) 2021-11-15 12:46:12 -06:00
Jiachi Liu
ef5795327a
Close stream when fatal error occurs (#31164)
* support custom 500 error in streaming

* remove unused imports
2021-11-15 11:49:50 -06:00
Steven
eb0bd63af4
Fix basePath replacing server-side and normalizeLocalePath() when path is empty string (#30978)
This fixes our `basePath` detection/replacing server-side as we were incorrectly considering `/docss` a match for a `basePath` of `/docs` which caused us to have an unexpected value in the `normalizeLocalePath` function. 

- Fixes #22429
- Regression introduced in #17757 
- Fixes: https://github.com/vercel/next.js/issues/31423

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2021-11-15 17:33:21 +00:00
Tim Neutkens
2d9ac399c1
Remove moment locale replace from craCompat as it's a default in Next.js 12 (#31431) 2021-11-15 10:36:53 -06:00
Shu Ding
16d56e2c49
Refactor server/render for SSR streaming (#31231)
Initial step to refactor the rendering logic by decoupling the handler and renderer:
1. Delegate Flight rendering to server/render
2. Reuse the piper glue code for both Fizz and Flight streams
3. Add buffering for ReadableStream

In 1), this PR also makes sure that gSSP/gSP are correctly executed before the Flight stream and `pageProps` and `router` are correctly delivered to the component.

Related to #30994.

## 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 `yarn lint`
2021-11-15 15:29:34 +00:00
Vincent Voyer
7d82e07df8
docs(auth): fix iron-session example url + API (#31413)
This fixes the iron-session example url from an old url to the new,
always-up-to-date url.

I believe the Next.js team owns the previous url but it's not up-to-date.

This commit also changes req.session.get("user") => req.session.user to reflect
the new API.
2021-11-15 14:49:15 +00:00
Bradley Turek
a47955718e
Clarify with commas (#31224)
Adds a few commas where they could improve the clarity of the sentence.

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


Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
2021-11-15 14:37:08 +00:00
Orri Arnarsson
06d4bbbb24
docs: next-iron-session renamed to iron-session (#31292)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2021-11-15 14:12:20 +00:00
Byron
8c547139e4
add filename to babel warning about anonymous function default exports (#31322)
fixes #29667

I didn't add an integration test, but I can take a stab at it if you point me in the right direction!
2021-11-15 14:01:20 +00:00
Tim Neutkens
e5171758d3 v12.0.4-canary.13 2021-11-15 14:19:55 +01:00
Tim Neutkens
9da8d65632
Add minify debug env var to investigate minifier bugs (#31417) 2021-11-15 14:15:18 +01:00
Jiachi Liu
0afc1d2b5a
Fix storybook styled-jsx example with styled-jsx 5 (#31357)
## Documentation / Examples

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

x-ref: https://github.com/vercel/styled-jsx/issues/761

Since next.js is using styled-jsx v5 beta now, it requires wrapping a `StyleRegistry` component on the root top.
ref: [styled-jsx doc](https://github.com/vercel/styled-jsx/tree/beta#server-side-rendering)
2021-11-15 11:01:49 +00:00
Nikola Knežević
61ca7369c6
Fix function syntax for API Routes documentation (#31414)
There is a non-valid mix of classic and arrow function notation in the documentation. I've fixed it to be a classical function notation because all the other examples are like that.

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2021-11-15 10:50:13 +00:00
Tim Neutkens
4223611af8
Ensure Git feature.manyFiles is enabled (#31408) 2021-11-15 11:37:44 +01:00
Tobias Koppers
644d361c98
show (middleware only) when a middleware is added to the compiler (#31409)
## 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 `yarn lint`
2021-11-15 09:20:27 +00:00
Tim Neutkens
8c84b4a1b6 v12.0.4-canary.12 2021-11-15 09:42:05 +01:00
Donny/강동윤
6fd44383f3
Update swc & fix styled-jsx (#31407) 2021-11-15 09:27:45 +01:00
Onur Temiz
aaec9a9353
Update image-optimization.md (#31401)
"styled-jsx" link was broken. Added `/docs/` prefix and removed `.md` suffix to fix it.

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
2021-11-14 23:13:16 +00:00
Max Schmitt
b7f8025c66
examples: Add Playwright testing example (#29426) 2021-11-14 14:17:59 -06:00
Alessandro Ursino
312572d020
examples: fix README with google analytics (#31384) 2021-11-14 14:13:53 -06:00