Commit graph

8954 commits

Author SHA1 Message Date
Thang Vu
9fc58f88a2
fix: hydration warning in with-mobx-state-tree-typescript example (#27339)
## Bug

- [x] Related issues linked using `fixes #number` fixes https://github.com/vercel/next.js/issues/27290
- [ ] 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-20 14:15:02 +00:00
Sam Robbins
e0ca6de832
Update layout-component example to use named functions (#27331)
## Documentation / Examples

- [x] Make sure the linting passes

In line with the PR #27297 which solved issue #27252, this updates the example to also use named functions in order to pass ESLint
2021-07-20 14:02:51 +00:00
Jiachi Liu
41b4fc3688
Upgrade swc for mac m1 compiling issue (#27329)
`@swc/core` will trigger a very rare complication issue on mac m1, it's fixed in version 1.2.66
x-ref: https://github.com/swc-project/swc/pull/1939

cc @kdy1 

## 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-20 11:53:48 +00:00
Sofya Tuymedova
0472f0fa81
Fix image link (#27323) 2021-07-20 10:33:50 +00:00
Mikhail Tsyplakov
2a282a4081
fix type NextWebVitalsMetric (#24780)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-07-19 20:39:24 -05:00
Steven
5cd37d9b32
Fix placeholder=blur inside <noscript> (#27311)
We shouldn't be setting `placeholder=blur` styles when JS is disabled because we'll have no way to know when the image is loaded and it will be stuck in blur permanently as mentioned in [this comment](https://github.com/vercel/next.js/pull/19052#issuecomment-882886068).

This PR avoids blur styles on the `<noscript>` version of the image.
2021-07-20 01:23:16 +00:00
Josh Flayhart
ddef873b3b
Update next-image-unconfigured-host.md (#24953)
* Update next-image-unconfigured-host.md

the docs are misleading because I tried this and still got yelled at by compiler, and then added domains and it worked?

* Update next-image-unconfigured-host.md

* Update next-image-unconfigured-host.md

* Update next-image-unconfigured-host.md

* Update next-image-unconfigured-host.md

* Update next-image-unconfigured-host.md

* Update next-image-unconfigured-host.md

* remove unrelated section

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-07-19 19:40:52 -05:00
JJ Kasper
68cd5b12f9
Continue: Update blog-starter-typescript postcss.config.js (#27314)
* Update postcss.config.js

update postcss.config.js based nextjs guide: https://tailwindcss.com/docs/guides/nextjs

* Update examples/blog-starter-typescript/postcss.config.js

* lint-fix

Co-authored-by: Rubens de Melo <rubensdemelo@gmail.com>
Co-authored-by: Lee Robinson <me@leerob.io>
2021-07-19 19:34:01 -05:00
JJ Kasper
c082972b93
Continue: fix typo in breakpoint config (#27313) 2021-07-19 19:00:14 -05:00
Pavel Mineev
4e79481511
(examples/with-i18n-next-intl): fixes warning (#25928)
### Documentation / Examples

Fixed one of the items from #25854

- Fixes warning from `next-intl`
- Hides locale selector in case if no other location
- Fixes path `next/router` import 
- Removes unused variable

---

- [x] Add the StackBlitz button in README.md
- [x] Make sure the linting passes

[Live demo on StackBlitz](https://stackblitz.com/github/akellbl4/next.js/tree/fix/example-with-i18n-next-intl-missing-other/examples/with-i18n-next-intl)
2021-07-19 23:49:45 +00:00
JJ Kasper
198046360d
v11.0.2-canary.17 2021-07-19 18:31:57 -05:00
JJ Kasper
1effbae67a
Fix default server host value causing issues on Windows (#27306)
This fixes a case where the HMR connection for fast refresh would fail to connect on Windows due to a change being made to the default host being listened to. Previously we didn't set a default for the `host` value when calling `server.listen` which allowed the default listening behavior to be used although in https://github.com/vercel/next.js/pull/20409 a default of `0.0.0.0` was added which causes conflicts for some set-ups mainlly on Windows it seems. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/27298
Fixes: https://github.com/vercel/next.js/issues/27254
Fixes: https://github.com/vercel/next.js/issues/4456#issuecomment
Fixes: https://github.com/vercel/next.js/pull/20409#issuecomment-849933092
x-ref: https://github.com/vercel/next.js/pull/20409
2021-07-19 23:12:27 +00:00
Steven
b123942694
Fix minimumCacheTTL so it doesn't affect browser caching (#27307)
In a previous PR (#27200), we added `minimumCacheTTL` to configure the time-to-live for the cached image. However, this was setting the `max-age` header.

This PR ensures that `minimumCacheTTL` doesn't affect browser caching, only the upstream header can affect browser caching.

This is a bit safer in case the developer accidentally caches something that shouldn't be and the cache needs to be invalidated. Simply delete the `.next/cache/images` directory.

- Related to #19914
- Related to #22319
2021-07-19 22:38:03 +00:00
JJ Kasper
f21cba4929
Increase stats action install timeout (#27308)
This updates the PR stats action to add the `--network-timeout 1000000` flag when doing initial `yarn` installation to hopefully prevent the random `yarn` failures while it's running. Thanks @styfle for the tip!
2021-07-19 22:02:19 +00:00
Adam Cowley
9774d9b1e0
Optimised Cypher queries in Neo4j example (#25973)
Thank you for including a Neo4j example!

This PR rewrites the Cypher queries using a [pattern comprehension](https://neo4j.com/docs/cypher-manual/current/syntax/lists/#cypher-pattern-comprehension) which will make them more performant and removes the need for the `collect(DISTINCT ...)` step.
2021-07-19 20:18:40 +00:00
Brandon Chinn
7fea8f3de7
Remove redundant ssr option for styled-components (#27221)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-07-19 14:28:14 -05:00
Sam Robbins
187f4312cc
Use named functions in layouts docs (#27297)
## Documentation / Examples
- [x] Make sure the linting passes

Fixes #27252 by using a named function rather than an arrow function. If this is the correct fix, then modifications are also needed for the `layout-component` example, but I'm just providing this one modification right now in case this fix is incorrect.
2021-07-19 19:15:53 +00:00
qwertyforce
2b319ccfd9
update fastify example to the latest version (#27273)
* update fastify example to newest version

* Update examples/custom-server-fastify/server.js

Co-authored-by: Harsh Karande <harshskarande@gmail.com>

* lint-fix

Co-authored-by: Harsh Karande <harshskarande@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-07-19 10:44:38 -05:00
Yubin
736db42352
Add NextPage type to create-next-app typescript template (#27246)
## Documentation / Examples

- [x] Make sure the linting passes
2021-07-16 19:55:09 +00:00
Janicklas Ralph
dda23f5d9b
Fix inline scripts being duplicated when used with next/script component (#27218)
Fixes inline scripts being duplicated when used with `next/script` component

## Bug

- [x] fixes #26860 
- [x] Integration tests added


## Documentation / Examples
 Updated docs to indicate that `id` is needed for inline scripts
2021-07-16 18:58:34 +00:00
Houssein Djirdeh
6645248d41
[ESLint] Remove error when file patterns are unmatched + ESLint setup changes (#27119)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2021-07-16 20:19:08 +02:00
JJ Kasper
c7deb760b6
Document full routes order in rewrites doc (#27247)
This expands on https://github.com/vercel/next.js/pull/27211 and lists the full routes order used in Next.js to allow more exact matching when leveraging the different rewrite priorities. 

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-16 18:03:50 +00:00
JJ Kasper
4b1bf758b0
Add additional stats app pages (#27202) 2021-07-16 12:13:04 -05:00
JJ Kasper
6e99f7af39
Add note about beforeFiles continuing (#27211)
This adds a note explaining that `beforeFiles` continue instead of checking the filesystem/dynamic routes immediately like they do in `afterFiles` and `fallback`. 

## Documentation / Examples

- [x] Make sure the linting passes

Closes: https://github.com/vercel/next.js/issues/26795
2021-07-16 16:13:40 +00:00
André
057d338db4
Update cms-wordpress readme file (#27234)
## Documentation / Examples

- [x] Make sure the linting passes

- Removed references to [WPGraphiQL](https://github.com/wp-graphql/wp-graphiql) as it is now part of [WPGraphQL](https://github.com/wp-graphql/wp-graphql) plugin.
2021-07-16 15:17:27 +00:00
Thomas Marshall
ccb62f8636
Add x-forward headers to external rewrites (#17557)
* Add x-forward headers to external rewrites

This commit configures the proxy used for external rewrites to include
x-forward headers [1]. This is particularly useful for incremental
adoption, where some routes will be handled by Next.js and others by a
different website. For example, a Rails app will use the
X-Forwarded-Host header to determine which host to use for URL
generation and redirects [2].

[1]: 91fee3e943/lib/http-proxy.js (L31)
[2]: 41139f6ba2/actionpack/lib/action_dispatch/http/url.rb (L221-L227)

* Handle image-optimizer case

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-07-16 10:11:12 -05:00
Remek Ambroziak
3fc5f73dc9
Fix typo in env howto (#27227) 2021-07-16 15:05:20 +00:00
JJ Kasper
14dd7c2954
Add warning for large number of routes (#27214)
This adds a warning when more than 1024 routes are added since it can have performance impacts and includes a document that we can add suggestions to reduce the number of routes being added. 

## 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-16 14:59:54 +00:00
Munawwar
dd029f559f
updated zustand example for 3.5.4+ interface change (#27229)
## Documentation / Examples

- [✓] Make sure the linting passes
2021-07-16 13:41:52 +00:00
Thang Vu
530a2a397d
upgrade next-redux-wrapper to 7.0.2 (#26521)
## Bug

- [x] Related issues linked using `fixes #number`: Fixes #26338
- [ ] Integration tests added
2021-07-16 12:28:31 +00:00
Tobias Koppers
f9795fdd26
improve static generation UX (#27171)
#### improve export spinner

update at least once a minute in non-tty
update progress regularly when using the spinner
decrease frequency of the spinner (windows console output is expensive)

#### restart static page generation and collecting page data worker pools when hanging

when for 1 minute no activity happens on the worker pool, restart it
log a warning for hanging jobs

#### add page generation duration to summary tree

![image](https://user-images.githubusercontent.com/1365881/125750454-8845f1b1-faf0-4598-b7a4-ea796b884691.png)

for `[+n more pages]` is will show `(avg 321 ms)` when the average is over the threshold.
It will allocate 8 lines for preview pages (instead of 4) when they contain slow pages

## Feature

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

## Documentation / Examples

- [ ] Make sure the linting passes
2021-07-16 09:21:44 +00:00
Janicklas Ralph
3b388c346c
Fix Script beforeInteractive on navigation (#26995)
## Bug

- [x] fixes #26342 
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`


## Documentation / Examples

- [x] Make sure the linting passes
2021-07-15 22:51:01 +00:00
JJ Kasper
7644c17f43
v11.0.2-canary.16 2021-07-15 16:42:36 -05:00
Steven
8151a7e0dc
Add minimumCacheTTL config for Image Optimization (#27200)
- Closes #23328  
- Related to #19914 
- Related to #22319 


## 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] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`
2021-07-15 19:55:12 +00:00
Jiachi Liu
71665b2437
Fix gsp generation with file extension (#27144)
Fixes #11831 
Fixes #12212

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-07-15 18:50:17 +00:00
Houssein Djirdeh
c46b405ba7
adds no duplicate head rule (#27179) 2021-07-15 13:04:17 -05:00
Tomas Jansson
d29a95ad63
Change pure functions to functions (#27192)
The right terminology should be used so we don't learn new developers wrong facts.

Using pure function here is plain wrong, the definition of a pure functions is as follows:

> The function return values are identical for identical arguments. The function application has no side effects. 

What you have here both have side effects, the calls to `res.setXXX`, and it isn't identical for identical arguments since you have `Date.now()`.



## 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-15 14:12:58 +00:00
Didi Keke
222830ad47
Fix Prop href did not match error (#27183)
Resolve Prop `href` did not match error.
2021-07-15 01:04:33 +00:00
Didi Keke
dc5bc3f2ff
Fix Prop href did not match error (#27183)
Resolve Prop `href` did not match error.
2021-07-15 01:04:05 +00:00
Didi Keke
1d08687b93
Fix Image is missing required "src" property error (#27180)
Add safety check for `CoverImage` in `/components/post-preview.js` so as to prevent error occurring in the absence of cover image for on posts listed for preview - fixes #23742.
2021-07-14 23:19:42 +00:00
Steven
437ad9ff6a
Fix css minify incorrectly duplicating variables (#27150)
Fixes #26902 

See 507963a480
2021-07-14 21:16:11 +00:00
Tim Neutkens
fdabeb7098
Use SWC to compile Next.js core server files (#27167)
- Use SWC to compile Next.js core server files
- Ensure only @babel/runtime/helpers/interopRequireDefault helper is used

Just an initial comparison to compare size difference of this change.



## 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-14 18:12:04 +00:00
JJ Kasper
86e3ea8e33
v11.0.2-canary.15 2021-07-14 09:16:46 -05:00
Steven
f9001b97bb
Bump babel target to Node.js 12 (#27147)
Next.js 11 supports Node.js 12 and newer. This PR updates babel to reflect this.

Follow up to PR #25761
2021-07-13 20:40:59 +00:00
Steven
52a2022da4
Revert "Update data-fetching.md" (#27148)
Reverts vercel/next.js#27018 per comment https://github.com/vercel/next.js/pull/27018#issuecomment-877548891
2021-07-13 19:53:45 +00:00
JJ Kasper
8c3c2b7ea2
Update redirect regexes to not match _next (#27143)
This updates redirects' regexes to not match `/_next` paths since this is currently unexpected and can easily cause a multi-match redirect to break loading client-side assets. This also fixes custom-routes not matching correctly when `trailingSlash: true/false` is used

## Bug

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

x-ref: https://github.com/vercel/next.js/discussions/24683
x-ref: [slack thread](https://vercel.slack.com/archives/CGU8HUTUH/p1626159845474000)
2021-07-13 19:38:14 +00:00
я котик пур-пур
e0ff050402
Update the "Top level .mdx pages" code sample (#27080)
The regex matches both .md and .mdx extensions, so I've added the .md extension to the description and `pageExtensions` array.

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-13 15:29:39 +00:00
JJ Kasper
8088416082
v11.0.2-canary.14 2021-07-13 09:35:56 -05:00
Lee Robinson
1a9492d51f
Update Going to Production docs to use quote. (#27131)
Will make it look a little nicer 😄
2021-07-12 23:13:52 +00:00
Lee Robinson
a93f8b6393
Fix code block in Layouts docs. (#27130)
<img width="885" alt="CleanShot 2021-07-12 at 17 58 23@2x" src="https://user-images.githubusercontent.com/9113740/125365933-c2c17a00-e33a-11eb-9d24-5970b5437a21.png">
2021-07-12 23:04:06 +00:00