Commit graph

8569 commits

Author SHA1 Message Date
C. Lewis
eddf5e0de9
docs: advise users of create-next-app --ts, --typescript (#25349)
Since #24655 landed in 10.2.1, I wanted to update the documentation, especially for the top Google results for "next typescript", so that users know how to create a TS project.

Please feel free to change anything you feel is appropriate.
2021-06-11 02:48:06 +00:00
Adem ilter
5142c0e542
Example blog with comments (#24829)
* initial commit

* delete comment

* env name fix

* Update README.md

* remove hapi-boom

* use next-image

* fix alt attr

* date fix for blog posts

* reset gitignore

* fix react best-practices

* prettier

* mdx to md

* fix prettier config. lint 👍

* Update examples/blog-with-comment/components/comment/list.js

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

* refactor api methods

* fix: blog title

* fix: html lang

* next-mdx to gray-matter

Co-authored-by: Noah Fischer <78238464+noahfschr@users.noreply.github.com>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Enes Akar <enesakar@gmail.com>
2021-06-10 21:04:33 -05:00
matamatanot
822797309f
Update json5 and remove @types/json5 (#25946)
## Refactor

https://github.com/json5/json5/blob/master/CHANGELOG.md#v220-code-diff
> New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)

No diffs in the precompiled file.
2021-06-11 02:02:11 +00:00
Sam Verschueren
fb9902842d
docs(examples/with-redux-persist): add 'Open in StackBlitz' button (#25972)
Add `Open in StackBlitz` button to `examples/with-redux-persist` and `examples/with-videojs`. 

#### with-redux-persist
At first we though the example didn't work correctly in WebContainer because it shows the following message

> redux-persist failed to create sync storage. falling back to noop storage.

After investigating this, we saw the same message on local as well and is probably intended behaviour because of SSR. The example works, but it makes sense that it can't get the local storage on the server side and that's what causing the message.

#### with-videojs
The video's couldn't be played in the preview frame before. I fixed it on our end and thus also added the StackBlitz button.

## 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
- [x] Example(s) updated
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-10 23:44:22 +00:00
JJ Kasper
e6da19266c
v10.2.4-canary.13 2021-06-10 17:48:46 -05:00
Steven
dca59bb34d
Fix delay between blur image and high res image (#25994)
Previously, we had an arbitrary delay of 1500ms but instead we can wait until decoding is complete.

Co-authored-by: Kristóf Poduszló <kripod@protonmail.com>
2021-06-10 17:45:54 -04:00
Steven
d8b59f3e46
Add errors for invalid placeholder=blur usage (#25953)
There are strict conditions for using `placeholder=blur` documented in #25949 but this will give the user a better understanding during `next dev` and links to the error.

- Error when `placeholder=blur` and no `blurDataURL`
- The Error for small images with `placeholder=blur` has been changed to a warning
- Added support for blurring a webp image
- Added error page linking to relevant docs
2021-06-10 18:51:35 +00:00
JJ Kasper
2cff809001
Add experimental CRA transform to docs (#25989)
This mentions the experimental create react app transform to the codemods doc including the feedback link while it is experimental. 

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-10 16:44:11 +00:00
Vitaly Baev
e867fe0552
(examples/with-urql): fixes graphql server url (#25987)
## Documentation / Examples

- [x] Make sure the linting passes

As mentioned in #25854 `with-urql` doesn't work. After investigation, I've found that Pokémon GraphQL server located at `https://graphql-pokemon.vercel.app` is down.
After some research I came across its repository and this [pull request](https://github.com/lucasbento/graphql-pokemon/pull/14). That pull request provides new URL `https://graphql-pokemon2.vercel.app` which seems to work.

I don't know the status of this server, maybe @leerob can confirm this PR is ok.
2021-06-10 15:56:30 +00:00
Sam Robbins
d72225eef0
Add changing the hostname to the cli doc (#25971)
## Documentation / Examples

- [x] Make sure the linting passes
2021-06-10 09:14:36 +00:00
Houssein Djirdeh
436e74bb04
ESLint: More updates and bug fixes (#25952)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-06-10 11:02:50 +02:00
Marco Valsecchi
7f25ec4bc4
Fix loader url composition on image/next doc (#25893)
Remove the extra slash to avoid double slashes on returned url (the image src prop needs to start with a slash)
2021-06-10 04:34:48 +00:00
Alex Castle
e5d0a30a2e
Modify image component examples app for static image (#25956)
Some fairly minor changes to the image-component example app. Switches all instances of images from `/public` over to use static images and adds a page with an example image with blurry placeholder enabled.
2021-06-09 22:48:31 +00:00
JJ Kasper
9f9a3eeb84
v10.2.4-canary.12 2021-06-09 14:18:01 -05:00
Sanath Kumar U
9dba4be132
Updated Readme (#25575)
* Updated Readme 

Split the copying instruction into separate code sections as any one of the command is used  and  Its easier to copy individual commands .

* lint-fix


Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-09 13:40:51 -05:00
alicanyildirim
6c0aec4742
tslib module missing in package.json (#25829)
## 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-09 18:34:50 +00:00
Steven
79b4cb007b
Add css blur when placeholder=blur (#25945)
* Add css blur when `placeholder=blur`

* Fix tests
2021-06-09 20:28:44 +02:00
John Jago
c6ba29da00
docs: use descriptive links instead of "click here" (#25897)
* docs: use descriptive links instead of "click here"

Linking text such as "here" or "click here" is not accessible (and
doesn't look that great either). The best example of why it's better to
use link text that provides context is that some screen readers allow
navigation by links alone. If all links say "click here", then how does
the user know which one to go to?

I tried to make the minimal change necessary to make the link text
descriptive but had to reword a few sentences that didn't read well.

* Apply suggestions from code review

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-09 13:23:16 -05:00
Tim Neutkens
f5c5950f6b v10.2.4-canary.11 2021-06-09 19:39:43 +02:00
Tobias Koppers
00c00f2fca
add global callback for refresh latency (#25944)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-09 19:35:57 +02:00
Tim Neutkens
a008d01c09 v10.2.4-canary.10 2021-06-09 16:52:25 +02:00
JJ Kasper
dde9ad46ad
Add experimental cra-to-next transform in codemod cli (#24969)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-06-09 16:51:56 +02:00
Dominic Elm
7530865e45
docs(examples/with-mobx-state-tree-typescript): add 'Open in StackBlitz' button (#25926)
Add `Open in StackBlitz` button to `examples/with-mobx-state-tree-typescript` now that it was fixed in #25589.

## 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
- [x] Example(s) updated
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-09 14:03:33 +00:00
Alex Castle
d6105c9502
Add delay to placeholder removal (#25916)
* Add delay to placeholder removal

* Increase jest timeout for image tests

* Use check instead of immediately expecting the result

Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-06-09 15:35:52 +02:00
matamatanot
f443b694b4
Remove @types/comment-json (#25810) 2021-06-09 13:58:52 +02:00
matamatanot
3821662eb7
Replace CLIEngine with ESLint (#25801)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-06-09 13:54:10 +02:00
Pavel Mineev
3815222238
fix: use key while rendering arrays (#25902)
Fixes one of the items that was mentioned in #25854.

It fixes warning from React in `with-react-multi-carousel`.
2021-06-09 02:30:04 +00:00
Pavel Mineev
bb973be201
fix: move viewport meta tag to head in _app.js (#25901)
Fixes one of the items that was mentioned in  #25854. 
It fixes the warning in `with-next-page-transitions` by moving the viewport tag to `_app.js` from `_document.js`
2021-06-09 02:25:04 +00:00
Houssein Djirdeh
90c64435dd
ESLint: Updates disable ESLint message during builds (#25917)
Fix per review comment on [#25895](https://github.com/vercel/next.js/pull/25895#discussion_r647736514)
2021-06-09 01:25:06 +00:00
JJ Kasper
ce4e1afba4
v10.2.4-canary.9 2021-06-08 18:31:21 -05:00
Steven
a79eb4fd51
Fix immutable header on static image (#25914)
This PR fixes a bug where the first request has the correct immutable header but subsequent requests do not.

Depends on #25909
2021-06-08 23:17:54 +00:00
Houssein Djirdeh
50a36eecd3
ESLint Updates (#25895)
* lots of eslint updates

* adds eslint: dirs flag to next.config.js

* update lint command in docs

* update per review comments

* re-add --no-lint command for build

* Apply suggestions from code review

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-08 17:46:00 -05:00
Steven
7b77415f3c
Refactor image optimizer static immutable header (#25909)
Previously we were accepting a `s=1` query string parameter for static imports, but this is not necessary.

Instead, this PR looks at the file path to determine if the header should be `immutable`.

The nice thing here is we don't need to worry about someone trying `s=1` with an external image or 3rd party loader. In that case, we use the upstream `Cache-Control` header as usual.

This change also ensures we don't add the `immutable` header for `next dev`.

Related to PR #24993
2021-06-08 22:05:02 +00:00
Tim Neutkens
c8624091b9
Improve check for eslint version (#25910)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-08 16:29:34 -05:00
Dominic Elm
d2caaeab64
docs: add 'Open in StackBlitz' buttons to various examples (#25853)
This PR adds a `Preview` section and a `Open in StackBlitz` button to various examples. I have tested all examples and omitted the ones that require third party API keys, or didn't work. Some examples don't work locally either.

Here's an example:
![image](https://user-images.githubusercontent.com/12571019/121027783-88971280-c7a7-11eb-851a-0ad30cf74b42.png)

## 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
- [x] Examples updated
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-08 20:45:02 +00:00
Tim Neutkens
3f2379a9ff v10.2.4-canary.8 2021-06-08 20:19:34 +02:00
Alex Castle
ab450aaa1e
Adjust JPEG quality when generating placeholder (#25904)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-06-08 19:57:24 +02:00
Andrew Turner
535a83dbb8
remove opentelemetry/api (#25900) 2021-06-08 19:01:03 +02:00
Chris Neven
d820542a15
fix(21606): consider scroll option when using shallow routing (#24888)
## Bug

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

fixes [#21606](https://github.com/vercel/next.js/issues/21606)

### Description
When using shallow routing and wanting to scroll to top by setting the `scroll` option to `true` it didn't work. This PR fixes this issue.
2021-06-08 16:48:15 +00:00
Vincent Voyer
5072518875
docs(examples/with-iron-session): fix mutate + fetch, add TypeScript example link (#25889)
This updates the with-iron-session example with:
- updated way to mutate + fetch (re: https://github.com/vvo/next-iron-session/issues/329)
- updated readme to include TypeScript example link

Requirements:
- [x] Make sure the linting passes
2021-06-08 15:21:14 +00:00
matamatanot
ca2921fca3
Update CNA build target in tsconfig (#25780) 2021-06-08 09:32:29 +02:00
JJ Kasper
18f8198954
Prevent node inspect from causing webpack check to fail (#25876) 2021-06-08 09:23:08 +02:00
JJ Kasper
583b5b9d2d
Add warning for older TypeScript versions (#25867) 2021-06-08 09:21:09 +02:00
Tim Neutkens
23ca042c75 v10.2.4-canary.7 2021-06-08 09:10:26 +02:00
Yamagishi Kazutoshi
0a1d418a96
Do not remove placeholder for data URL (#24704) 2021-06-08 09:03:39 +02:00
Yuki Takemoto
3b76d3371a
Fix command in upgrade guide (#25879)
This PR fixed command in upgrade guide.
2021-06-08 02:31:58 +00:00
JJ Kasper
8c63d17c26
v10.2.4-canary.6 2021-06-07 19:02:46 -05:00
Vitaly Baev
ff1b8e9605
fix: added typescript dependency in next-sitemap example (#25866)
As mentioned in #25854 `witn-next-sitemap` example is missing `typescript` package as a dependency

- [x] Make sure the linting passes
2021-06-07 23:46:51 +00:00
Yamagishi Kazutoshi
d22be5efbe
Fix types for static image (#25808)
If you give a Static Image to the Image component, TypeScript will throw a type error. This Pull Request fixes it.

## Bug

- ~~Related issues linked using `fixes #number`~~
- [x] 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~~

---

follow-up #24993
cc @atcastle
2021-06-07 23:27:54 +00:00
Munawwar
5d208e94cc
updated example for zustand v3.5.1 interface change (#25066)
createContext() no longer accepts initialState as parameter

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-07 21:37:12 +00:00