Commit graph

7305 commits

Author SHA1 Message Date
JJ Kasper
d4397d8ab5
Add initial i18n documentation (#18067)
* Add initial i18n documentation

* Apply suggestions from code review

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>

* Apply suggestions from code review

Co-authored-by: Lee Robinson <me@leerob.io>

* Apply more suggestions

* rephrase a bit more

* Update doc

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-10-23 10:42:52 -05:00
Steven
debe4e2348 v9.5.6-canary.13 2020-10-23 10:49:01 -04:00
Steven
a12eeea18d
Add w param (#18151)
Add missing `w` param for [old browsers](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset#Browser_compatibility) like IE that dont support `srcset` (@styfle)
2020-10-23 14:23:16 +00:00
dependabot[bot]
1925ca039c
Bump node-sass from 4.12.0 to 4.13.1 (#18140)
Bumps [node-sass](https://github.com/sass/node-sass) from 4.12.0 to 4.13.1.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/node-sass/compare/v4.12.0...v4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-23 09:58:51 +02:00
dependabot[bot]
11d1d6b546
Bump tree-kill from 1.2.1 to 1.2.2 (#18139)
Bumps [tree-kill](https://github.com/pkrumins/node-tree-kill) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/pkrumins/node-tree-kill/releases)
- [Commits](https://github.com/pkrumins/node-tree-kill/compare/v1.2.1...v1.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-23 09:52:37 +02:00
Yamagishi Kazutoshi
f1005ca661
Pass quality param of image component to preload (#18158)
If give the `priority` and `quality` attributes to an Image Component, the `quality` attribute will not be given to the preload and a warning will be displayed to the devtool.

![screenshot on devtool](https://user-images.githubusercontent.com/12539/96960307-0837e000-153d-11eb-8c01-e15afd40e04f.png)
2020-10-23 06:36:54 +00:00
JJ Kasper
4442fe2faf
Update redirect query encoding (#18149)
* Update redirect query encoding

* Add additional tests
2020-10-22 18:45:43 -05:00
Steven
ac8a0c4836
Update Image Optimization API to prevent upscaling image (#18147)
The `w` parameter in the Image Optimization API is the requested size of the image and should only be resized if the source image is larger than the requested size. This PR fixes the behavior to prevent accidental upscaling, for example icon images.
2020-10-22 20:39:24 +00:00
Steven
07adc8ef26
Change Image component lazy=true to loading=lazy (#18138)
This PR updates the `<Image>` component to follow the same property naming as native `<img>`.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Img#attr-loading

This currently allows two values,`loading=lazy` and `loading=eager`, but there might be new values added in a future spec.

cc @atcastle
2020-10-22 18:59:42 +00:00
JJ Kasper
fe4d16c7f4
v9.5.6-canary.12 2020-10-22 11:40:26 -05:00
JJ Kasper
9bbfa0e8d2
Add locale false handling (#18115)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-22 17:08:01 +02:00
Tim Neutkens
9fb1e60504
Make lazy-loading the default for next/image (#18123)
Co-authored-by: Steven <steven@ceriously.com>
2020-10-22 16:55:51 +02:00
JJ Kasper
81e667bfae
Update fallback 404 handling to prevent reload loop (#18119)
This updates the fallback 404 handling to render the correct 404 page on the client when a 404 is returned from fetching the data route on a fallback page on the client. This prevents us from having to rely on a cache to be updated by the time we reload the page to prevent non-stop reloading. 

This also adds handling in serverless mode to ensure the correct 404 page is rendered when leveraging fallback: 'blocking' mode. 

Additional tests for the fallback: 'blocking' 404 handling will be added in a follow-up where returning notFound from `getServerSideProps` is also added.
2020-10-22 14:54:38 +00:00
Tim Neutkens
4af3611721 v9.5.6-canary.11 2020-10-21 22:10:36 +02:00
Steven
755934d0fc
Fix merge conflict (#18106) 2020-10-21 21:55:02 +02:00
Steven
3f07e554f4
Fix Image component defaults & remove autoOptimize (#18101) 2020-10-21 21:39:12 +02:00
Alex Castle
1a8cb7e1a0
Image Component: Support for Akamai image CDN (#18100) 2020-10-21 21:31:28 +02:00
Tim Neutkens
548d19398f v9.5.6-canary.10 2020-10-21 20:51:35 +02:00
Tim Neutkens
ea29bb3e4c
Fix precompiled code (#18093)
Solves the build failure we're seeing on PRs
2020-10-21 18:43:39 +00:00
Tim Neutkens
71f3e8db7b
Upgrade @ampproject/toolbox-optimizer (#18087)
Fixes #18044
Related to #17416
2020-10-21 18:04:31 +02:00
Ludovico Fischer
6212823735
Upgrade to Chokidar 3. (#17558)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-10-21 15:23:20 +02:00
Tim Neutkens
f232387883
Update peerdependency to account for React 17 (#18089) 2020-10-21 15:23:03 +02:00
Ludovico Fischer
b89d417b37
Update to PostCSS 8. (#17415)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-21 12:31:07 +02:00
Steven
80bf81a3cf
Move sharp to optionalDependencies (#18068)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-10-21 12:21:42 +02:00
Tasuku Uno
9dfc9ebc8a
Fix css dependency in /_error (#17301) 2020-10-21 12:11:18 +02:00
Steven
e8f402adfa
Add unsized property to Image component (#18059)
Implements the `unsized` property from RFC #16832

cc @atcastle
2020-10-21 10:03:31 +00:00
JJ Kasper
2ab34451b7
Pass locales to getStaticPaths for i18n (#18077)
This makes sure the `locales` are passed to `getStaticPaths` and also disables the removing the default locale from the path when the default locale is the preferred header. It also updates tests to ensure the domain redirects are working as expected.  

x-ref: https://github.com/vercel/next.js/pull/17370
2020-10-21 09:35:01 +00:00
Tuan Nguyen
c28d39e47d
Use ya in case xa is false (#18074)
This closes [#18023](https://github.com/vercel/next.js/issues/18023). 

I was following the example mentioned in the issue (https://github.com/vercel/next.js/tree/canary/examples/with-firebase-authentication) and for some reason `xa` was always false, failing fetching food. Through `console.log` I saw that `ya` contained a token value and using `ya` worked.
2020-10-21 01:17:39 +00:00
JJ Kasper
91eb984d58
v9.5.6-canary.9 2020-10-20 15:35:36 -05:00
Felipe Flores
d4f53ec2bc
Update resolve-url-loader to fix vulnerability (#18064)
Bump resolve-url-loader version to fix vulnerability. 

Fixes #18048
Related #18044
2020-10-20 20:26:38 +00:00
JJ Kasper
48a95d5804
v9.5.6-canary.8 2020-10-20 12:09:36 -05:00
JJ Kasper
4d85d4985b
Ensure root index GSP page's revalidate is recorded (#18053) 2020-10-20 18:49:25 +02:00
Tim Neutkens
fdc4eb80d8 v9.5.6-canary.7 2020-10-20 18:46:34 +02:00
Steven
0fb39e2347
Add width and height props to Image component (#18031)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-10-20 18:43:24 +02:00
Alex Castle
01e6bd1684
Remove multi-host support for image component and support quality pass-through (#18038)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-10-20 16:28:01 +02:00
JJ Kasper
a6ef24580e
v9.5.6-canary.6 2020-10-20 05:26:04 -05:00
JJ Kasper
8be3562c48
Ensure correct default locale is detected for domain locale (#18046)
This makes sure that we detect the correct default locale for domain specific locales since a domain can have a different default locale residing at the root and we need to check this on the client for prerendered/auto-static pages. This also makes sure we disable the built-in redirect handling when on Vercel since it's handled already. 

Tests for this are tricky since we need to load the browser with a custom domain which requires editing the host file. Existing tests should ensure this doesn't break non-domain specific locale behavior though. This was also tested manually while testing https://github.com/vercel/vercel/pull/5298



x-ref: https://github.com/vercel/next.js/pull/17370
2020-10-20 10:23:11 +00:00
JJ Kasper
85842cee65
v9.5.6-canary.5 2020-10-19 21:08:26 -05:00
JJ Kasper
114de06432
Update handling for relative files in image-optimizer (#17998)
This updates the new image optimizer endpoint to instead of relying on the `host` and `proto` headers for relative files to use the internal route handling in `next-server` to load files from the public directory. The existing tests for relative files with the endpoint should cover these changes
2020-10-19 17:03:35 +00:00
Ludovico Fischer
0d3671c2c2
Update to postcss-loader 4.0.2. (#17458)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-19 17:07:59 +02:00
Francisco Baio Dias
58edd0998c
Fix typo in headers docs example (#18012) 2020-10-19 11:38:55 +00:00
Justin W Hall
c9d4d6299e
Update step 5 to Strapi example Readme (#17985)
Co-authored-by: Rémi de Juvigny <remi@hey.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-10-19 11:32:01 +02:00
Luis Alvarez D
e05f3a9112
Capitalize Data Fetching title in docs (#18001)
Noticed that most of our mentions to Data Fetching are capitalized in both words, but the page itself wasn't. And it's not consistent with the titles in other sections
2020-10-19 01:31:40 +00:00
Ash Connell
fd4eb558a2
Add with-facebook-pixel example (#17667) 2020-10-19 00:00:27 +00:00
Or Yoffe
68c62b3307
Updated dependencies for example: with-react-native-web (#17375)
The current dependencies of  the example "with-react-native-web" are outdated.
In this PR I updated them and tested that they run and work.

Newest current react and react-dom versions: 16.13.1
Newest current  react-native-web and babel-plugin-react-native-web versions: 0.13.14

Mainly for the people starting with this example to have the new versions since the current versions are very far from each other.
Please merge 🙏
2020-10-18 17:56:41 +00:00
Yamagishi Kazutoshi
753bb9fdba
Fix types for lazy image component (#17984)
Follow-up #17916

Correcting type errors and organizing redundant descriptions.
2020-10-18 10:41:25 +00:00
JJ Kasper
bbdebd4f57
Make sure animated assets aren't de-animated by optimizer (#17974)
This makes sure the image optimizer doesn't de-animate images by transforming them with sharp since sharp doesn't currently handle outputting animated images

x-ref: https://github.com/vercel/next.js/pull/17749
2020-10-17 19:22:10 +00:00
Alex Castle
c9eb3dcad9
Image component lazy loading (#17916)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-10-17 20:55:29 +02:00
Tim Neutkens
b37835ac9c
Make sure w parameter is only included when a width is provided. (#17971) 2020-10-17 18:24:06 +02:00
Ash Connell
82041542e3
Fix with-mongodb hot-reload issue and race condition (#17666)
This PR fixes 2 issues with the mongodb example:

### 1. Fallable Caching Strategy

Calling `connectToDatabase()` multiple times before it's cached results in multiple connections being created. The latest one created was becoming the "cached" one and the others dissappear into the background.

This is now fixed by using **promise sharing** so that only one connection can ever be created.

### 2. Problematic Hot Reload

During development you can monitor your database connections and see that it continues to create more and more connections over time. Some users have reported their [databases reaching maximum connection limits](https://github.com/vercel/next.js/discussions/12229).

This is resolved by using `global` to store the cached connection. It's not ideal but it is necessary.
2020-10-17 00:30:38 +00:00