Commit graph

11 commits

Author SHA1 Message Date
Craig Wheeler
57426a2849
Update Examples to use React 18 (#42027)
This PR updates the minimum version of React used by examples from 17.0.2 to 18.2.0.

Fixes #41975

## Bug

- [x] Related issues linked using `fixes #41975`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-28 17:43:20 +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
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
Kristoffer K
2acb53bd30
chore: update example names to match their folders (#16268)
**What's the problem this PR addresses?**

A decent amount of the examples don't have a `name` field in `package.json` that matches their folder name, meaning they either lack a name or the names are duplicated.

I was testing Yarn 2 workspaces using the entire examples directory and needed to get rid of the duplicates.

**How did you fix it?**

Updated the names to match the names of their folders
2020-09-05 21:23:51 +00:00
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
Jayden Seric
9fea9dbe6d
Update the with-graphql-react example (#13928)
- Removed the manual `fetch` polyfill as that is handled automatically by Next.js now.
- Updated dependencies, including [`graphql-react`](https://github.com/jaydenseric/graphql-react) and [`next-graphql-react`](https://github.com/jaydenseric/next-graphql-react).
- Removed `next.config.js` as it’s no longer required for [`next-graphql-react`](https://github.com/jaydenseric/next-graphql-react).
- Renamed the index page component from `Home` to `IndexPage`.
- Tweaked the [`graphql-react`](https://github.com/jaydenseric/graphql-react) bundle size mentioned in the readme.
2020-06-09 18:06:19 +00:00
Jayden Seric
547b4acbd8 Update the graphql-react example. (#9550)
- Updated dependencies.
- For compatibility with the current next-graphql-react API, added next.config.js using the `withGraphQLConfig` decorator.
- For compatibility with the current graphql-react API, updated the options used with `useGraphQL`.
- Updated the readme to align with the current graphql-react and next-graphql-react APIs.
- Minor destructuring refactor for clarity.
- Converted the custom App to a functional component.
2019-11-27 10:50:20 +01:00
Joe Haddad
f152c745da
Update remaining examples to latest Next.js 2019-07-08 19:37:58 -04:00
Jayden Seric
0770470b40 Update the with-graphql-react example. (#7317)
- Update dependencies, especially graphql-react.
- Use the graphql-react v8.2.0 API.
- Use a /* GraphQL */ comment template string tag so text editors can syntax highlight, lint and format the GraphQL query.
2019-05-13 09:40:13 -05:00
laiso
fdb10d4f1d Update to Next v8.0 example on with-graphql-react (#6454)
I'm working on examples/with-graphql-react changes to:
- Next v7 to v8.0 and update dependencies
- fix some errors for the change of graphql-react API
2019-02-26 23:44:45 +01:00
Jayden Seric
eb24e6ffc6 Add an example with graphql-react (#5984)
Adds an example with [`graphql-react`](https://github.com/jaydenseric/graphql-react), using [`next-graphql-react`](https://github.com/jaydenseric/next-graphql-react).

[`graphql-react`](https://github.com/jaydenseric/graphql-react) is a lightweight but powerful [GraphQL](https://graphql.org) client for React; the first [Relay](https://facebook.github.io/relay) and [Apollo](https://apollographql.com/docs/react) alternative with server side rendering.
2019-01-09 10:24:38 +01:00