Commit graph

2096 commits

Author SHA1 Message Date
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
Herman Nygaard
12d2424e86
(examples/image-component): fix placeholder href (#26140) 2021-06-15 13:37:11 -05:00
Tim Neutkens
de08b1fff1
Remove unsupported examples (#26075)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-14 20:27:06 +02:00
Pavel Mineev
8fd5d92721
(examples/with-rbx-bulma-pro): update deps (#26077)
Fixes one of the items from #25854

## Documentation / Examples

- [x] Make sure the linting passes
- [x] Add the StackBlitz button
2021-06-14 17:28:23 +00:00
Pavel Mineev
2bffb16016
(examples): fix missed peer dependencies (#26069)
Fixes some examples from #25854

- with-kea [live demo](https://stackblitz.com/github/akellbl4/next.js/tree/examples/missed-peer-deps/examples/with-kea)
- with-mobx [live demo](https://stackblitz.com/github/akellbl4/next.js/tree/examples/missed-peer-deps/examples/with-mobx)
- with-mobx-react-lite [live demo](https://stackblitz.com/github/akellbl4/next.js/tree/examples/missed-peer-deps/examples/with-mobx-react-lite)
- with-mobx-state-tree [live demo](https://stackblitz.com/github/akellbl4/next.js/tree/examples/missed-peer-deps/examples/with-mobx-state-tree)

## Documentation / Examples

- [x] Add the StackBlitz button
- [x] Make sure the linting passes
2021-06-14 17:17:23 +00:00
Pavel Mineev
f18ce55d8a
(example/with-typescript-grapql): fix deps (#26010)
### Documentation / Examples

Fixed one of the items from #25854

- [x] add `@graphql-codegen/import-types-preset`
- [x] remove depriceated field `schemaEntrypoint`
- [x] add the StackBlitz button
- [x] Make sure the linting passes

[Live demo on StackBlitz](https://stackblitz.com/github/akellbl4/next.js/tree/example/with-typescript-graphql/fix-deps/examples/with-typescript-graphql)
2021-06-13 16:40:28 +00:00
D. Kasi Pavan Kumar
2477b13799
examples/with-mongodb: avoid destructuring of environment variables. (#26029)
Greetings.

As per the [documentation](https://nextjs.org/docs/basic-features/environment-variables), we should not treat process.env as a Javscript Object & cannot destructure variables out of it. This PR avoid destructuring of environment variables in the `with-mongodb` example.



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

- [x] Make sure the linting passes
2021-06-13 16:27:04 +00:00
Pierre de la Martinière
8afdaa3c04
Update next-transpile-modules to 7.3.0 across examples (#26040)
## Documentation / Examples

- [x] Make sure the linting passes

Just updated `next-transpile-modules` across examples. We shipped a workaround in 7.2 for the one breaking change that scared people from updating from v4 to v5+, I tested the updated examples, so we should be good.
2021-06-13 16:21:38 +00:00
Vitaly Baev
fb5418ea32
(examples/with-react-md): switch from node-sass to sass (#26001)
## Documentation / Examples

- [x] Make sure the linting passes

Continuing fixing #25854
Switching from `node-sass` to `sass`
2021-06-11 22:58:00 +00:00
Ikko Ashimine
a1dc5588c2
docs: fix typo in with-unstated/README.md (#26004)
resetted -> reset
2021-06-11 14:12:50 +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
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
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
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
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
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
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
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
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
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
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
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
Geshan Manandhar
b1b3b75774
Add run on Google Cloud Run button to the docker example (#25824)
## Documentation / Examples

- [x] Make sure the linting passes


### Deployed with Cloud Run Button

<img width="1075" alt="Screen Shot 2021-06-06 at 10 22 51 pm" src="https://user-images.githubusercontent.com/170554/120924210-d7946780-c715-11eb-889e-79679f795c54.png">

### Next.js working on Google Cloud Run

<img width="982" alt="Screen Shot 2021-06-06 at 10 23 10 pm" src="https://user-images.githubusercontent.com/170554/120924229-e418c000-c715-11eb-9aca-569923f7306d.png">
2021-06-07 21:32:04 +00:00
Lucas Vieira
58796411a4
feat: bump styled-components version on examples (#25826)
Hey guys! 
Some time ago I used the `with-grommet` example to start a project and I ran into some issues because of the styled-components version. I tried to use some new features and it didn't work as I expected, then I noticed the styled-component version was the `v4`. When I bumped the version it started to work. I am bumping all the styled-components versions on examples because some people may run into the same issue.

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

- [x] Make sure the linting passes
2021-06-06 19:59:07 +00:00
Patrick El-Hage
b7cd0a15aa
fix mobx-state-tree-typesript missing babel/core dependency (#25589)
## What
![Screen Shot 2021-05-29 at 12 23 37 PM](https://user-images.githubusercontent.com/4411839/120082909-7d8f0480-c07a-11eb-8d77-f9d8769cfefc.png)
![Screen Shot 2021-05-29 at 12 24 46 PM](https://user-images.githubusercontent.com/4411839/120082913-81228b80-c07a-11eb-86c2-24f12811cd24.png)



## Bug

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

## Feature

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

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-05 18:49:40 +00:00
Lee Robinson
56794c758e
Remove react-relay-network-modern example. (#25815)
It appears this library isn't maintained, plus there's already the other `with-relay-modern` example. 

https://github.com/relay-tools/react-relay-network-modern/issues/128
2021-06-05 18:26:41 +00:00
daku10
9d14dd8d1d
Update tsconfig of example to be consistent with default output of next.js (#25581)
remove `alwaysStrict: true` rule from tsconfig.json in with-typescript example, because the rule is included in `strict: true` has been already written in tsconfig.json and other included rules such as `noImplicitAny: true` have not been written.  

[tsconfig documentation link](https://www.typescriptlang.org/tsconfig#alwaysStrict)

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-03 22:31:14 +00:00
Tomotaka Sakuma
aada946f84
up-to-date electron (#25551)
Bump up electron of an example, `with-electron-typescript` adding `contextIsolation`,  https://www.electronjs.org/docs/tutorial/context-isolation#context-isolation.
2021-06-03 02:50:44 +00:00
payapula
69b214bca1
Updated with-mdx-remote dynamic components example (#25366)
- Fixed the missing prop `components` to `<MDXRemote/>`.
- Added a `defaultComponents` and `source` mdx to provide more clarity on the example.

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-02 15:49:18 +00:00
LiuuY
a38167f24b
Fix with-docker example fails to load image (#25536)
node version should be 14, otherwise, next/image fails to load static file images located in public dir
detail: https://stackoverflow.com/questions/67641673/next-js-app-running-inside-a-docker-container-fails-to-load-static-file-images
2021-05-28 11:56:12 -05:00
Artem Zakharchenko
9b75b9baa8
Example: Treat "mockServiceWorker" as a generated artifact in "with-msw" (#25515)
## Changes

- Removes `mockServiceWorker.js` file and ignores it from Git. New versions of `msw` generate the worker script automatically at the location specified in `packageJson.msw.workerDirectory`. This keeps the worker script up-to-date with the currently installed version of `msw`.
- Updates `msw` package to the latest version for new features and stability improvements.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-05-27 23:18:15 +00:00
Josef Kahoun
f29dfe247f
Updated example name (#25428)
## 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-05-24 20:40:47 +00:00
Ondřej Chrastina
c348784aeb
New kontent UI screenshots (#25387)
## Documentation / Examples

Kontent CMS went through the UI redesign - <http://new-ui.kontent.ai/>.
* I am updating the example screenshots.
* \+ one fix of the URL in README.

- example was submitted by me in #16034

- [x] Make sure the linting passes
2021-05-24 11:41:03 +00:00
Rubens de Melo
5c05f35a94
Update package.json blog-starter-typescript (#25361)
Update package.json dependencies
2021-05-24 10:44:28 +02:00
Fabian Mastenbroek
09a4fadf79
Fix PatternFly 4 example (#25356)
This change fixes the issues with the PatternFly example showing how to
use PatternFly 4 in conjunction with Next.js:

1. next-transpile-modules has been updated to 7.2.0, which adds support
   for Global CSS imports used by PatternFly 4. This eliminates the
   custom Webpack modification that were necessary previously.
2. All dependencies have been updated to the latest version.
3. Documentation has been updated to include troubleshooting steps.

Addresses #20916
2021-05-22 15:06:14 +00:00
Holiq Ibrahim
0a31a92a3c
fix respomsive example tailwind (#24582)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-05-18 16:17:21 -05:00
polygon
32b96551e7
typo fix (#25159)
Just a simple typo fix!
2021-05-15 20:42:52 +00:00
Rishabh Poddar
8fe30fe49e
Updates SuperTokens dependency version (#25102)
It's a change to the package.json file to update the supertokens-auth-react version. The changes in this version are:
- How supertokens session works in the context of an iframe
- Dependencies of supertokens-auth-react now use a `^`

--------
One more change is to do with how the redirection works in the demo app in case of session expiry or if a user clicks on signout.
2021-05-13 14:50:40 +00:00
Evan Ye
030eae17bd
Update with-mdx-remote example (#24973)
Update the with-mdx-remote example based on [next-mdx-remote](https://github.com/hashicorp/next-mdx-remote) v3.0, to make it faster and lighter-weight.

For more detail of API changes and migration guild, please refer to [v3.0.0 release note](https://github.com/hashicorp/next-mdx-remote/releases/tag/3.0.0).
2021-05-11 03:40:48 +00:00
Henrik Wenz
a18c3c2493
Update with-three-js example (#24857)
## Changes

- Update dependencies
- Use new `useAnimations` hook
- Remove next-transpile-modules in favour of drei
- Refactor Components
- Remove dynamic import
- Enable webpack5 (by removing `next.config.js`)
- Removed missing key warning

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

- [x] Make sure the linting passes
2021-05-10 20:23:25 +00:00
Mike Plis
ea9fe972fb
Fix build in blog-starter-typescript example (#24695)
This example currently fails to build with the error:

```
-> % yarn build
yarn run v1.22.10
$ next build
warn  - React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11. Read more: https://nextjs.org/docs/messages/react-version
info  - Using webpack 5. Reason: no next.config.js https://nextjs.org/docs/messages/webpack5
Failed to compile.

./components/alert.tsx:2:16
Type error: Could not find a declaration file for module 'classnames'. '/Users/mike/workspace/blog/node_modules/classnames/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/classnames` if it exists or add a new declaration (.d.ts) file containing `declare module 'classnames';`

  1 | import Container from './container'
> 2 | import cn from 'classnames'
    |                ^
  3 | import { EXAMPLE_PATH } from '../lib/constants'
  4 |
  5 | type Props = {
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

As of [`v2.3.1`](https://github.com/JedWatson/classnames/blob/master/HISTORY.md#v230--2021-04-01), the `classnames` package started providing its own types, so the `@types/classnames` package [became a stub](https://unpkg.com/browse/@types/classnames@2.3.1/). We get the error because the `classnames` version is pinned to the old, type-less version, while `@types/classnames` picked up the new stubbed version.

Removing `@types/classnames` and updating `classnames` to the latest version fixes the build error.

## Documentation / Examples

- [x] Make sure the linting passes
2021-05-10 19:59:49 +00:00
Tim Neutkens
802a7721e9
Remove outdated/deprecated/unmainted examples (#24945)
## 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-05-10 11:30:04 +00:00
Tim Neutkens
9506f15afd
Update custom server examples (#24814) 2021-05-07 18:50:56 +02:00
iker barriocanal
4bc87e479c
Update example with-sentry (#24819)
The [official Sentry Next.js SDK](https://docs.sentry.io/platforms/javascript/guides/nextjs/) is now the recommended choice to use with Next.js, instead of the previous workarounds. This PR updates the example, which now uses the SDK.
2021-05-07 12:52:03 +00:00
Munawwar
60d844c635
updated zustand example (#24884)
..to use new zustand/context module from zustand 3.5.0. Also fixed code for merging states on client-side navigation.


## Documentation / Examples

- [x] Make sure the linting passes
2021-05-07 12:37:56 +00:00
Aydın Akan
9721aaf73a
react-hook-form example (#21245)
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-05-05 15:47:15 +02:00
Rishabh Poddar
243472f34d
Bumps version of supertokens dependencies and updates its README (#24571)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: NkxxkN <kevin@supertokens.io>
Co-authored-by: NkxxkN <kevin.antoine@protonmail.com>
2021-05-05 14:38:21 +02:00
Lau Wei Lim
fc9b48b5b8
Update signin/signup form samples (#24524)
Fix warning: Prop `href` did not match. Server: "signin" Client: "/signin"
Fix warning: Prop `href` did not match. Server: "signup" Client: "/signup"

## Documentation / Examples

- [] Make sure the linting passes
2021-05-05 12:18:46 +00:00