Commit graph

2080 commits

Author SHA1 Message Date
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
Tim Neutkens
3a2b88b307
demo serving storybook static build with serve (#24812)
Unfortunately I couldn't push up changes for that branch as maintainers access was disabled.

Closes #18775

## 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-05 12:02:14 +00:00
Houssein Djirdeh
e783b0a2e8
Adds ESLint with default rule-set (#23702)
This PR re-includes ESLint with some notable changes, namely a guided setup similar to how TypeScript is instantiated in a Next.js application.

To add ESLint to a project, developers will have to create an `.eslintrc` file in the root of their project or add an empty `eslintConfig` object to their `package.json` file.

```js
touch .eslintrc
```

Then running `next build` will show instructions to install the required packages needed:

<img width="862" alt="Screen Shot 2021-04-19 at 7 38 27 PM" src="https://user-images.githubusercontent.com/12476932/115316182-dfd51b00-a146-11eb-830c-90bad20ed151.png">

Once installed and `next build` is run again, `.eslintrc` will be automatically configured to include the default config:

```json
{
  "extends": "next"
}
```

In addition to this change:

- The feature is now under the experimental flag and requires opt-in. After testing and feedback, it will be switched to the top-level namespace and turned on by default.
- A new ESLint shareable configuration package is included that can be extended in any application with `{ extends: 'next' }`
  - This default config extends recommended rule sets from [`eslint-plugin-react`](https://www.npmjs.com/package/eslint-plugin-react), [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks), and [`eslint-plugin-next`](https://www.npmjs.com/package/@next/eslint-plugin-next)
- All rules in [`eslint-plugin-next`](https://www.npmjs.com/package/@next/eslint-plugin-next) have been modified to include actionable links that show more information to help resolve each issue
2021-04-30 11:09:07 +00:00
Darsh Patel
2d6b56086e
Fix: with-passport example dependency issue (#24567)
fixes #24401

Simply bumping `swr` to the latest version seems to fix the issue. 🥂 

Couldn't find a consistent pattern across the examples, but most examples are flexible with swr version and use the semver caret.

Very standard use of the useSWR hook is there in the example with nothing obviously version specific.
2021-04-28 19:19:22 +00:00
Mario Souto
5de5e49bd5
feat: bump styled-components lib version examples (#24482)
Hi folks I know many people that use that example and it could be using the new version of React to be according with the NextJS v11 

## Documentation / Examples

- [ ] Make sure the linting passes
- [ ] Make sure that the bumped up versions are okay
2021-04-27 17:55:06 +00:00
Jerry K Jia
fc538790ec
Fix: Object Destructuring Error (#24397)
According to the official Next.js documentation on [Environmental Variables](https://nextjs.org/docs/basic-features/environment-variables): 
> `process.env` is not a standard JavaScript object, so you’re not able to use object destructuring. Environment variables must be referenced as e.g. `process.env.NEXT_PUBLIC_PUBLISHABLE_KEY`, not `const { NEXT_PUBLIC_PUBLISHABLE_KEY } = process.env`.

<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## 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-04-26 14:59:37 +00:00
Sam Poder
a6ba432641
Now -> Vercel in api-routes-rest (#24431)
View title :)
2021-04-25 03:06:11 +00:00
Jarrod Watts
c481147b86
Update with-aws-amplify-typescript example (#24292)
- Update the Readme to use the latest Amplify CLI versions' prompts
- Update the example to use the [SSR features of AWS Amplify ](https://aws.amazon.com/blogs/mobile/ssr-support-for-aws-amplify-javascript-libraries/)
- Update to use Next version `10` instead of `9`
- Correctly use the types produced by the Amplify CLI in `API.ts`
- Add `amplify auth`  and auth rules to the GraphQL model as suggested by the Amplify CLI.
2021-04-22 10:01:27 +00:00
Shu Uesugi
2979f30087
Fix strapi links (#24330)
Fix broken links on the `cms-strapi` example.

- [x] https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.html
- [x] 23b184781a/backend/extensions/upload/config/settings.js

## Documentation / Examples

- [x] Make sure the linting passes
2021-04-21 21:58:49 +00:00
Sokratis Vidros
e89a080c46
Fix for with-clerk example (#24324)
## 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

The predev npm script assumes that vercel cli is installed. It's better for the example to run without it.
2021-04-21 19:27:36 +00:00
Sokratis Vidros
dfe1b05ff5
Add Clerk.dev example (#24311)
## 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-04-21 18:59:45 +00:00
Rishabh Poddar
41efb824f2
Docs update: Adds supertokens to 'Bring Your Own Database' section as well + improvements to code structure in example (#23779)
- Since SuperTokens is a self hosted solution, it can be added to 'Bring Your Own Database' as well (in https://nextjs.org/docs/authentication#supertokens)
- Improvements to code structure in the with-supertokens example
2021-04-20 17:23:32 +00:00
arshad
dbb63850ee
feat: add with-reflexjs example (#24068)
This PR adds an example for using Next.js with [Reflexjs](https://reflexjs.org).

Thank You

## Documentation / Examples

- [x] Make sure the linting passes
2021-04-20 15:57:50 +00:00
Vincent Voyer
84e47b82a5
docs(examples): with-iron-session logout must be called via POST (#22240)
1. Logout is better called in a POST request (avoids caching in most situations + avoids weird CSRF "logout attacks", i.e. can't be logged out by clicking on an email link)
2. We should wait for logout to complete before mutating the user, otherwise some weird race conditions might prevent swr to catch the right logged out state
2021-04-20 15:46:14 +00:00
Jaime Leonardo Suncin Cruz
f4e610d192
Simplify with redux toolkit typescript (#24161)
Remove clock and notes features to be consistent with `with-redux-toolkit` example, add unit test with Jest

## 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-04-20 03:09:49 +00:00
Emmanuel Gautier
0699114956
chore(with-react-intl): allow extracting translation key from a deeper directory (#23874) 2021-04-19 22:04:49 -05:00
Martin Janeček
1f54ba6559
docs: reduce image size in sample Dockerfile (#24108) 2021-04-19 22:00:56 -05:00