Commit graph

2128 commits

Author SHA1 Message Date
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
Luc Leray
f52955ec94
Clean up examples package.json (#27121)
Clean up package.json files in the `examples` directory:
- Add `private: true`
- Remove `version` (because they are irrelevant for packages that are not meant to be published)
- Remove `name` (because they are optional for packages that are not meant to be published, and when someone clones an example, they often rename it and the property becomes stale)
- Remove `author`
- Remove `description`
- Remove `license`

Also remove `with-dynamic-app-layout` example completely, since it does the same as `layout-component` (https://github.com/vercel/next.js/pull/27121#discussion_r668178408).

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-12 19:58:03 +00:00
markkaylor
36d00a74b6
[examples] Use Strapi template (#27114)
- Simplifies setting up a Strapi project by using the following template: https://github.com/strapi/strapi-template-next-example
- Adds seed data
- Fixes a broken link on the cover image

- [x] Make sure the linting passes
2021-07-12 16:24:43 +00:00
Enes Akar
655eb5cb5b
Fix tailwind error with Redis example. (#27042) 2021-07-12 10:35:50 -05:00
Rishabh Poddar
08f06e7a0d
Update SuperTokens dependency version in with-supertokens example (#27110)
- Updates supertokens-auth-react to v0.15.0
- In the supertokens example, handles 401 session expired automatically (via the lib).
2021-07-12 14:54:13 +00:00
Lee Robinson
9f1d5d7fca
Update dependencies of all CMS examples. (#27001) 2021-07-09 14:43:56 +02:00
Terry Tan
5e6b92059f
Fix (trailingSlash: true) causes issue in auth0 example (#27010)
I think the issue was due to ```nextjs-auth0``` package on version ```0.8.0```. Upgrading to latest version ```1.4.2``` resolve the issue.

## Bug

- [x] Related issues linked using `fixes` https://github.com/vercel/next.js/issues/19313
2021-07-08 15:54:21 +00:00
Paul Schultz
5b1c3e39e1
Updated next-transpile-modules to 8.0.0 (#26971)
## Bug

- [x] Related issues linked using `fixes #26970`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-07-06 20:14:45 +00:00
Angelo Ashmore
b4089998e6
Use Prismic CDN URL in cms-prismic example (#26837)
The CDN URL is the recommended URL for the Prismic REST and GraphQL APIs.

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-02 21:03:21 +00:00
Artur Sedlukha
748b005cda
Fix using-preact example deps (#26821)
Fix after https://github.com/vercel/next.js/pull/26133
2021-07-01 20:20:20 +00:00
D. Kasi Pavan Kumar
b508d90449
examples: fix typo lunixlinux (#26796)
## 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-07-01 06:20:35 +00:00
Soham Shah
46a85b4e6f
update with-redux-toolkit-typescript (#26714)
## Bug

- [X] Related issues linked using `fixes #26713 `

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

## Screenshots

After this small change the warning disappears.
![image](https://user-images.githubusercontent.com/47717492/123749377-fd56fb80-d8d2-11eb-8b70-dbb7f6f16050.png)
2021-06-29 14:52:03 +00:00
hiro
956bc2f387
Fix typo on "occured" to "occurred" (#26709)
* fix: typo occured -> occurred

* fix: typo occured -> occurred

* fix: typo occured -> occurred

* fix: typo occured -> occurred

* lint-fix


Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-28 23:02:20 -05:00
Lee Robinson
1dd6eeb598
Update layouts example to persist state across client-side transitions. (#26706)
* Update layouts example

* Update examples/layout-component/components/layout.js

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-28 22:19:15 -05:00
Vadorequest
6f42096233
Add link to live demo already hosted (#25718)
* Add link to live demo already hosted

To make it easier for people to simply see the live example without having to deploy a whole new project

* update link


Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-25 11:52:54 -05:00
John
bbedbb7203
fix with-loading example for next 11 (#26569)
## Documentation / Examples

- [X] Make sure the linting passes

This PR updates the with-loading example to follow the documentation of router events for next 11
2021-06-24 18:16:54 +00:00
Pranav P
0b79b6d73d
tailwind examps upgraded to v2.2 (#26549)
## Documentation / Examples

- [x] Make sure the linting passes
2021-06-24 12:05:17 +00:00
Lee Robinson
f6e5a816e2
[examples] Fix ssr-caching example. (#26540)
Closes https://github.com/vercel/next.js/issues/12019 with a better example of proper SSR caching.
2021-06-23 18:27:19 +00:00
Vitaly Baev
562640dbb4
(examples/with-webassembly) fixed for webpack 5 (#26440)
## Documentation / Examples

- [x] Make sure the linting passes

Fixes #26436

As mention in #25854 `with-webassembly` example doesn't work anymore after switching to webpack 5.
This PR adds webpack experimental configuration.
2021-06-21 16:45:16 +00:00
Lee Robinson
eac0374e45
Update with-eslint example. (#25817) 2021-06-20 16:16:34 -05:00
Shubhan Chemburkar
6fd207f5ce
Examples: Fixed the example path to correct value (#26255)
## Documentation / Examples

- [x] Make sure the linting passes

Changes in readme.md:

The path to the example in ```create-next-app``` command was incorrectly specified as ```api-routes``` by the example author. 
Fixed this value to ```api-routes-rate-limit``` as well as app name to ```api-routes-rate-limit-app``` make this consistent with other examples.

No other changes made to example.
2021-06-17 17:23:32 +00:00
Pavel Mineev
9785ba8eca
(examples/with-lingui): update example (#26076)
Fixes one of the items from #25854

## Documentation / Examples

- [x] Make sure the linting passes
- [x] Add the StackBlitz button
- [x] [Live demo](https://stackblitz.com/github/akellbl4/next.js/tree/examples/with-lingui-update/examples/with-lingui)
2021-06-17 16:29:58 +00:00
Levinson D'Souza
b3fad232bd
Updating Typescript to recommended minimum 4.3.2 (#26267)
## 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-17 14:33:32 +00:00
Rishabh Poddar
4132b80735
Update with-supertokens example (#26266)
This PR updates the `package.json` dependency for `with-supertokens` example to use the latest version of our library.
2021-06-17 14:20:31 +00:00
Tim
67aba8469e
Update postcss version in examples (#26226) 2021-06-17 10:37:17 +02:00
Pau Rodriguez Molina
58318a8545
Fix: upgrade react-test-renderer version to 17.0.2 (#26229)
npm i wasn't working because of outdated version of react-test-renderer.

## Bug

- [X] 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-16 21:32:41 +00:00
arshad
3231c35354
Add cms-drupal example (#25198)
Adds cms-drupal example.

Demo: https://cms-drupal.vercel.app
2021-06-16 20:59:31 +00:00
Nick Babcock
5629223407
Update examples to use React 17 (#26133)
[With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples
need to be updated, so the following snippet updated all the examples to
a compatible react version.

```bash
cd examples/
fd -g 'package.json' | xargs sed -r -i 's/"react": ".*"/"react": "^17.0.2"/
fd -g 'package.json' | xargs sed -r -i 's/"react-dom": ".*"/"react-dom": "^17.0.2"/'

# exclude experimental react version
git checkout with-reason-relay/package.json
```
2021-06-16 16:43:26 +00:00
toyamarinyon
fac02d8544
Follow the breaking change of jest-config (#26082)
## Documentation / Examples

When I create a new application using Next.js and use `jest` or `react-testing-library`, I get the following error.
```
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/configuration#testenvironment-string.
    Consider using the "jsdom" test environment.
    
    ReferenceError: document is not defined
```
This is because `jest-config` changed the default testing environment to node in 27.0.
> `jest-config@27.0.0` default to Node testing environment instead of browser (JSDOM) (#9874)


Raised the jest version of `with-typescript-eslint-jest` to 27.0 to make it pass the test.

- [x] Make sure the linting passes
2021-06-16 15:51:58 +00:00
Cauan Cabral
722d08ee13
[examples/cms-wordpress] fix typo on alert message (#26115) 2021-06-16 10:31:50 -05:00
Steven
a3c31b6773
Update next/image docs and example with shimmer animation (#26183)
It was mentioned in Issue #18858 that we might add a `placeholder="skeleton"` but that didn't ship with Next.js 11 because it would likely need to handle additional config such as light mode / dark mode, speed, duration, etc.

So this PR adds an example of `blurDataURL` usage with a nice shimmer animation (sometimes called a skeleton).
2021-06-16 14:54:25 +00:00
Casper
51f392013d
fix(examples): future.webpack5 -> top level webpack5 (#26175)
## Documentation / Examples

- [x] Make sure the linting passes
2021-06-16 12:07:15 +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
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