Commit graph

8890 commits

Author SHA1 Message Date
Artyom Kurnikov
fe3f520d8d
Update Fauna example with new guestbook (#27295)
Based on https://github.com/vercel/next.js/pull/26708

- Renames FaunaDB -> Fauna
- Moves to Tailwind instead of bespoke styling
- Use SWR instead of hand-rolled fetch wrapper
- List/Create API for Guestbook
- Preps for setting correct environment variables from Vercel integration
2021-08-02 17:09:04 +00:00
stefanprobst
63aeddbbe0
URI-encode url parameter in image optimizer (#27671)
fixes #27210
maybe related: #19668

currently, the image optimizer returns 400 when an image url contains non-ascii characters. this pr uri-encodes the `url` query parameter to fix it. also see https://github.com/vercel/next.js/issues/27210#issuecomment-890305204

## 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
2021-08-02 17:03:45 +00:00
Lee Robinson
74503f1b8a
Improve custom server documentation. (#27693)
Based on feedback here https://github.com/vercel/next.js/discussions/27687#discussioncomment-1121013.
2021-08-02 16:17:27 +00:00
JJ Kasper
26981aa54c
Undo sourcemap change (#27690)
This undoes the change from https://github.com/vercel/next.js/pull/27623 since it appears to be breaking source maps from changing the sources field in the generated source map to a relative path causing it to break jest's source map handling as can be seen in the `test-unit` CI job [here](https://github.com/vercel/next.js/runs/3214076727). 

This reverts commit f9ebc7772f.
2021-08-02 15:45:39 +00:00
James Howard
2cf58be228
Add missing await for API request (#27676)
`getAllPostsWithSlug` was missing an `await` on `fetchAPI`, resulting
in `data?.allPosts` always returning `undefined`. This meant SSG wasn't
aware of the paths it needed to generate.
2021-08-02 12:59:53 +00:00
Zack Sheppard
807d1ec7ef
Clarify in docs that next/script must not be in next/head (#27534)
Documentation to help future developers avoid #27498 

## Documentation / Examples

- [X] Make sure the linting passes
2021-08-01 14:26:33 +00:00
Tim Neutkens
f9ebc7772f
Ensure Next.js core development sourcemaps use correct input file (#27623)
Noticed while debugging that the error output lines did not make sense and found that `sourceFileName` is not supported in SWC yet. This is a temporary fix until @kdy1 adds the option.
2021-08-01 16:08:06 +02:00
JJ Kasper
c0bb1bc82c
Fix incorrect example in headers and rewrites docs (#27652)
x-ref: https://github.com/vercel/next.js/issues/22660#issuecomment-890400273

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-31 21:53:47 +00:00
Sjors Smits
34d418c12d
[docs] Added per page layout example with TypeScript (#27488)
## Documentation / Examples

- [x] Make sure the linting passes

## Explanation
Fixes #27465 

I added some docs on how to use per page persistent layouts in TypeScript as this requires you to extend some types and it might not be trivial if you are just starting out with TypeScript.

I copied the js example so it might be better to remove some of the duplication where possible, let me know.
All feedback is welcome
2021-07-30 16:30:32 +00:00
JJ Kasper
dd7a54c509
v11.0.2-canary.24 2021-07-29 21:15:13 -05:00
Tim van de Vathorst
282ee8c9d0
Added missing 'create user' functionality (#27516)
I was trying to run the demo locally and found out that the create user function was missing, so I added it!

## Documentation / Examples

- [ ✔ ] Make sure the linting passes
2021-07-29 22:16:55 +00:00
Jiachi Liu
a6e478f9ed
Use require alias to resolve react 18 for testing (#27601)
For test only, previously the react-dom is still been resolved as react 17

## 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
2021-07-29 20:06:13 +00:00
Tim Neutkens
e6d12a9d94
Update Terser (#27600)
Fixes #27593



## Bug

- [x] 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
2021-07-29 18:08:14 +00:00
Tim Neutkens
77c385af06
Update report to leverage new variables (#27084)
## 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
2021-07-29 17:35:25 +00:00
Tobias Koppers
fabaaa903a
persistent cache need to be invalidated when source-maps are enabled (#27607) 2021-07-29 16:59:41 +00:00
Tobias Koppers
4b33cef977
upgrade to webpack 5.47.0 and webpack-sources 3.1.1 (#27538)
* improve source-map performance
* improve watch performance
* bugfixes
* improvements to Data URIs
2021-07-29 16:10:51 +00:00
JJ Kasper
f5ee9ed5af
Only output test logs on failure in CI (#27604)
This updates to only output a test's logs when it fails to reduce the noise in the CI's logs to allow easier investigating a failure. This also updates azure to leverage the `run-tests` script when testing ie11 to allow retrying similar to our other tests.
2021-07-29 15:35:13 +00:00
JJ Kasper
c63bfbe773
v11.0.2-canary.23 2021-07-28 15:19:07 -05:00
stefanprobst
0833f83c86
Fix eslint config next/core-web-vitals (#27567)
fixes what i messed up in #27363. cf. https://github.com/vercel/next.js/pull/27363#issuecomment-888495697

also added an integration test for extending from `next/core-web-vitals` eslint config

## 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
2021-07-28 19:07:54 +00:00
Tim Neutkens
c7e2a1df6a
Use SWC for Next.js core client files (#27196)
Replaces Babel with SWC for Next.js core client-side files.

## 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
2021-07-28 15:10:51 +00:00
Paweł Tymczuk
36b81f989c
Fix: Added the content-disposition header (#27521)
In this PR I've added the `Content-Disposition` header to the response of the image `/_next/image` route. That header is used by the browser when showing the dialog for the `Save image as...` action. 

There are some differences between the browsers, ex:
When requesting the image `test.jpg`,  the response header `Content-Type: image/webp` - in FF the filename from the `Save image as...` dialog would be `test.webp` but in Chrome `test.jpg` even if the `Content-Disposition: inline; filename="test.webp"` is present in the headers.  The same about png images, the rest types are fine.  It looks like FF is checking the `Content-Type` for the extension but the Chrome does not and is doing another type of check.

Fixes #26737

## Bug

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

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-27 23:22:48 +00:00
JJ Kasper
1af78928d6
Document redirect query passing behavior (#27545)
This documents the request query passing behavior of redirects to help avoid confusion. 

## Documentation / Examples

- [x] Make sure the linting passes

Closes: https://github.com/vercel/next.js/issues/27194
2021-07-27 21:34:19 +00:00
Aryan Beezadhur
f3fcbef2cb
Update custom-page-extensions.md (#27541) 2021-07-27 20:15:50 +00:00
JJ Kasper
5eaca0ffe5
Document i18n locale limit (#27542)
Add check for i18n locale count and ensure the limit is documented

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-27 20:09:36 +00:00
JJ Kasper
b0f516db87
Revert "Drop react-is dependency in styled-components example (#27527)" (#27543)
This reverts commit 317c1c4922.
2021-07-27 14:35:56 -05:00
Gerald Monaco
707afe1d4d
Add RenderResult (#27319)
Adds `RenderResult`, replacing the `string` that `renderToHTML` used to return, with an `Observable`-like API that callers can use to subscribe and get a callback when chunks are available to flush, etc.

This is the last architectural change needed for streaming. There are, however, other things currently standing in the way of streaming. For example, it is common to mutate `res` in `getServerSideProps` to do routing work, or write headers, before fetching page data. This pattern effectively nullifies any advantages of streaming. I may do a follow-up PR that adds an experimental alternative for applications not using React 18, but the main purpose for this support is for Suspense and Server Components.

For that reason, there's no actual streaming here yet: instead we just flush a single chunk. A follow-up PR will add support for streaming suspense boundaries in React 18.
2021-07-27 19:18:21 +00:00
Jefferson Bledsoe
26105e285d
ESLint Config: Adds some more basic a11y rules (#25770) 2021-07-27 17:07:56 +02:00
Maia Teegarden
4172a4c0a6
Add initial next swc package with first transform (#27355)
* Set up next-swc package with no custom transforms

* Add hook_optimizer transform

* Fix lint

* Build next-swc on CI

* Add toolchain in rust action

* Build binaries in manual workflow

* Commit from GitHub Actions (Build next-swc native binaries)

* Update dependencies

* Update swc and use stable rust

* Build next-swc binaries

* Test compiled code

* Dedupe @node-rs/helper

* Add workflow to check next-swc binaries

* Fix check native

* PR feedback

* PR feedback

* Pr feedback

* Build next-swc binaries

* Combine native workflows

* Add docs for contributors on less common platforms

* PR feedback

* Compare JsWord instead of converting to string

* Fix workflow formatting

* Add docs for building binaries for CI

* Build next-swc binaries

* Fix workflow if syntax

* Add license info to copied code

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-27 17:07:28 +02:00
Enzo Ferey
317c1c4922
Drop react-is dependency in styled-components example (#27527)
`react-is` dependency was [dropped](8165cbe994) as part of `styled-components@v5`.

(I don't know which checkbox to check)

## 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
2021-07-27 14:26:02 +00:00
shibe23
735fac7ed7
[typo] posts.map( posts => {} ) in examples/blog-starter-typescript (#27523)
In `examples/blog-starter-typescript/pages/posts/[slug].tsx`

before:
 `posts.map(posts => {})`

after:
`posts.map(post => {})`

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-27 04:56:19 +00:00
Aurélien MANCA
97a140f733
fix(critical CSS): use the assetPrefix in the critters config (#27506)
This PR fixes #25927 bug which prevents to use `assetPrefix` config with the experimental critical CSS feature.

Fixes: #25927



## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-07-26 21:00:47 +00:00
Sojin Park
23ac4351f4
fix: Make router ready in case of custom _app getInitialProps (#27473)
From https://github.com/vercel/next.js/pull/20628,  when the page is rendered server-side, `Router`'s `isReady` field needs to be initially set to `true`. However, when `_app` has custom `getInitialProps`, it seems that it is not the case, even though the page is rendered on the server. 

This leads to a bug that `Router.isReady` is never set to `true`.

This pull request fixes the problem by fixing the initial calculation logic of `isReady` of `Router`.

## Bug

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

- [x] Make sure the linting passes
2021-07-26 20:25:55 +00:00
JJ Kasper
7c0f707b06
v11.0.2-canary.22 2021-07-26 12:48:27 -05:00
Luís Galete
57501fa745
Fix typo in placeholder-blur-data-url error docs (#27510)
2021-07-26 17:04:47 +00:00
JJ Kasper
b25a983556
Update bundle analyzer readme (#27507)
Follow-up to https://github.com/vercel/next.js/pull/27463 this adds a note about installing as `devDependency` instead of changing the default install command as the plugin being a `devDependency` might cause issues unless wrapped in a `process.env` check. 


## Documentation / Examples

- [x] Make sure the linting passes
2021-07-26 16:43:07 +00:00
Asher Oloo
f22f88456d
Fixed minor grammar issue (#27493)
## 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
2021-07-26 04:19:37 +00:00
Mahmoud Abdelwahab
f657e09b53
Fix CORS issue in GraphQL example that prevented Apollo Studio from working (#27486)
Update example so Apollo Studio works properly
2021-07-25 21:47:04 +00:00
Noah Weingand
84b71c3a6a
change ts template readme api/index file extension from tsx to ts (#27485)
## Documentation / Examples

- [x] Make sure the linting passes

### Changes
* Corrected the file extension reference from .tsx to .ts for ```packages/create-next-app/templates/typescript/README-template.md```. 
This matches the actual file extension and avoids confusion for new users.
2021-07-25 18:56:35 +00:00
stefanprobst
622f63867a
Update eslint doc comment (#27478)
the behavior of the `eslint.dirs` config option was changed in #26401. this pr adjusts the doc comment accordingly.

## 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
2021-07-25 13:48:46 +00:00
Artur Muller
c88898be12
Clarify error message in isSerializableProps (#22856)
I recently received the "Props must be returned as a plain object" error when I accidentally dropped an array directly inside `props`. This is a trivial error to fix once you know what you did, but I spent good 30 minutes looking in all the wrong places. I hope that this slight clarification in the error message would save someone from wasting their time if they make a similar mistake like myself.
2021-07-25 06:08:30 +00:00
Taylor McGann
270559f7be
Auth0 Example: Fix issuer base URL (#27074)
## Documentation / Examples

- [ ] Make sure the linting passes
2021-07-25 05:12:15 +00:00
brijendravarma
74b159c850
Updated the Error message describing the alternative and added styles… (#14652)
The error message indicates better alternatives and added styles.css sample snippet for good visibility.

![Global_error_msg](https://user-images.githubusercontent.com/38159218/85950309-ac3bc100-b979-11ea-9a8d-4a356cb8007c.JPG)
![CSS-Global](https://user-images.githubusercontent.com/38159218/85950319-b2ca3880-b979-11ea-829a-24335fcfc93d.JPG)
2021-07-25 04:53:33 +00:00
Michał Bundyra
7fe8a001e2
ESLint: custom directories from next.config.js (#26401)
Attempt to fix #26393

~~Sorry, I wasn't able to run tests on local, but I hope at least test should be valid.~~
Edit: Tests are working correctly on my local :) 

fixes #26393



## Bug

- [x] Related issues linked using `fixes #26393`
- [x] Integration tests added
2021-07-25 04:11:29 +00:00
kaykdm
3b2732bc36
[ESLint] add no-typos rule to eslint (#26650)
* add no-typos rule to eslint

* return early when function name is correct

* Handle null decl.type

* update check

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-07-24 22:22:19 -05:00
Guilherme Baron
0d49d9f22f
Add --dev flag to bundle-analyzer install command (#27463)
## Documentation / Examples

- [x] Make sure the linting passes
2021-07-25 02:07:21 +00:00
JJ Kasper
2cf9b462ae
v11.0.2-canary.21 2021-07-24 12:10:01 -05:00
Houssein Djirdeh
078cfb59f9
[ESLint] Adds --format flag to next lint (#27052)
Adds `--format` support to `next lint` to allow defining of additional formatters. Fixes #26387.
2021-07-24 01:35:56 +00:00
Arthur Puyou
fac083bcfa
Update max-age in HSTS sample (#27452)
The previous paragraph mentions a max-age of 2 years, so the number of seconds should match.
2021-07-23 18:01:36 -05:00
Steven
9065cdf836
Add warning when next/image component has style prop (#27441)
We've never supported the `style` prop as seen in the docs https://nextjs.org/docs/api-reference/next/image#other-props

TS users already get a build error but JS users were left in the dark.

This PR adds a warning so its clear during `next dev`.
2021-07-23 22:53:27 +00:00
JJ Kasper
c54f168d9a
Add config check for invalid duplicate locale domains (#27451) 2021-07-23 17:16:14 -05:00