Commit graph

33 commits

Author SHA1 Message Date
Steven
801e48eae9
Update docs to clarify that image imports are static (#28744)
This PR clarifies the usage for static image imports.
2021-09-02 18:51:30 +00:00
Steven
cb6290adf3
Update docs for sharp usage to mention Vercel (#28476)
There was some confusion in [this tweet](https://twitter.com/mtliendo/status/1430269174459338759) so I revised the docs around `sharp` usage.
2021-08-24 22:51:28 +00:00
Nick Crews
0608f493dd
Document that Google has begun using CLS metric (#27843)
Google has begun using Cumulative Layout Shift as a factor in ranking search results, according to the linked Google docs.

This perhaps will make this page out of sync with other Nextjs docs, but I figure better start somewhere.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] 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-08 17:52:44 +00:00
Alex Castle
1b733423d6
Use Sharp if available for Image Optimization (#27346)
* Use sharp for image transformations when available

* Refactor resizeImage and add sharp warning

* only show sharp warning once per instance

* Modify sharp error message

* Add documentation for optional sharp dependency

* Update docs/basic-features/image-optimization.md

Co-authored-by: Steven <steven@ceriously.com>

* Import types for sharp

* Update lockfile

* Add testing against sharp

* use fs-extra for node 12

* Rename test sharp path variable

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

* update squoosh specific test

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

* update tests

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-07-22 18:11:17 -05: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
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
Steven
1a8ad14089
Rename next/image dangerously-unoptimized to custom and warn when applicable (#26998)
Since we are no longer accepting new built-in loaders, users may wish to use a different cloud provider.

So this PR renames `dangerously-unoptimized` to `custom` to handle this case as well as the intention of `next export`.

If the user doesn't add a `loader` prop, we throw an error.
If the user adds a `loader` prop but it doesn't return the width, we print a warning.

- Follow up to #26847 
- Fixes #21079 
- Fixes #19612 
- Related to #26850
2021-07-08 19:35:19 +00:00
Darsh Patel
226e81c733
Add dangerously-unoptimized loader for next/image (#26847)
* add support for static loader

* update existing test

* add test

* add prettier-ignore

* update docs

* apply suggestions from review

* remove un-needed normalize

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

* update test

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
2021-07-07 15:20:16 -05:00
Joe Bell
98acfaf8cc
Extend disclaimer for dynamic image imports (#26241)
* docs: extend disclaimer for dynamic image imports

* docs: extend guidance on blurDataURL

* Update docs/api-reference/next/image.md

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2021-06-18 16:21:12 +02:00
Tim Neutkens
2967fe1df3
Update docs on static image imports (#26211)
Incorporates some of the feedback we've had about this doc.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## 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.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-06-16 18:46:01 +00:00
Steven
e4eed61a31
Update next/image docs and examples (#26150)
This updates the `next/image` docs and examples to add missing information.
2021-06-16 01:26:53 +00:00
Lee Robinson
f3cbdf0b02
Document how to use basePath with next/image. (#23123)
Supersedes https://github.com/vercel/next.js/pull/23115 for more clarity and a better recommendation.
2021-03-16 19:56:41 +00:00
Shane Rogers
308c2beca2
Add image base path configuration option (#23115)
I similarly [couldn't find this info](https://github.com/vercel/next.js/issues/19711#issuecomment-750414110) in the docs about configuring the image path when using an app `basePath`, so thought I'd add it.
2021-03-16 17:13:24 +00:00
Lee Robinson
9431439c6d
Add note about next/export to Image Optimization docs. (#23088)
https://github.com/vercel/next.js/discussions/19065#discussioncomment-484842
2021-03-16 01:05:14 +00:00
Lee Robinson
9afc0f58c4
Add docs for custom image loaders. (#20788)
Docs for https://github.com/vercel/next.js/pull/20216/.
2021-01-06 02:16:09 +00:00
matamatanot
d33d1dd00a
Ignore domains option when loader is set (#18447)
```
images: {
    domains: ['example.com'],
    path: 'https://example.com/myaccount/',
},
```
Those `domains` and `path` look a lot alike for me and so, I was confused. I found out that the domains are ignored if the Loader is set, which makes sense.
2020-12-30 01:35:37 +00:00
Wesley Tian
1231ddb001
Fix typo in image-optimization.md (#19670)
Either use `avoid` or `prevent` as verb, but not both.
2020-11-30 02:00:38 +00:00
Abdelrahman Rifai
1bb318c082
docs: fix a typo "concatenated" instead of "concatentated" (#18812) 2020-11-04 18:28:06 -05:00
Steven
35f8f521a2
Update Image docs with links to examples (#18770)
This revises the docs to add headings and also links to layout examples.

Fixes #18554
2020-11-04 17:24:14 +00:00
Steven
d4a92d92ba
Update example for Image Component (#18762) 2020-11-03 15:40:53 -05:00
Steven
2b94b1eea6
Update default widths configuration to handle 2x/3x DPI (#18717)
- Update default `deviceSizes`
- Add default `imageSizes`
- Use `layout` value to determine which `srcset` to use

Fixes #18420 
Closes #18714
2020-11-03 02:12:46 +00:00
Steven
44fe971e6b
Update image optimization docs to include blog details (#18401)
This PR documents some details that are mentioned in the blog post https://nextjs.org/blog/next-10
2020-10-28 17:29:42 +00:00
Steven
79314ef5d8
Update docs with details for cached images (#18399)
This PR explains the caching algorithm for the default loader.
2020-10-28 12:40:40 -04:00
Steven
3195de65d1
Fix docs default config values (#18319)
Missed one rename from #18294
2020-10-27 18:53:37 +00:00
Steven
ab0b0a8a4d
Update docs - add default config for images property (#18296)
- Explain how defaults work and what the default values are.
- Mention quality on the basic page
2020-10-27 14:07:33 +00:00
Steven
f773a1a44a
Rename iconSizes to imageSizes, remove size limitation (#18294)
This does two things:

- Rename `iconSizes` to `imageSizes`.
- Give priority to `imageSizes` regardless of `deviceSizes` as a means to opt-out of the srcset behavior.
2020-10-27 13:19:23 +00:00
Steven
3a169fbbf0
Separate config into deviceSizes and iconSizes (#18267)
This separates the `next.config.js` property `images.sizes` into to properties: `images.deviceSizes` and `images.iconSizes`.

The purpose is for images that are not intended to take up the majority of the viewport.


Related to #18122
2020-10-26 20:07:52 +00:00
Tim Neutkens
557a0001db
Update image-optimization.md 2020-10-26 18:17:26 +01:00
Tim Neutkens
c381a35247
Update image-optimization.md 2020-10-26 18:13:21 +01:00
Tim Neutkens
8db23295d3
Update image-optimization.md 2020-10-26 18:12:40 +01:00
Tim Neutkens
129fb85da4
Update image-optimization.md 2020-10-26 18:07:23 +01:00
Steven
ce38e4f6fe
FIx image optimization docs (#18254)
Add missing links in the documentation
2020-10-26 12:51:11 -04:00
Steven
3c6f421d99
Add docs for Image Optimization (#18107)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-10-24 14:53:28 +02:00