Commit graph

14 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
Ludovico Fischer
b3a631305d
fix(examples): make with-graphql-hooks run correctly again (#20929)
Fixes #20474

* Switch API url to working URL used in apollo example
* Update deps
* Move styled jsx out of the way to avoid demonstrating too many
  unfamiliar concepts at once

dev, build and start work now.
2021-01-11 13:55:18 +00:00
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
Sebastian Sycz
76673fd880
Update graphql-hooks with memcache (#14364)
Today the cd4178b53e of graphl-hooks and graphl-hooks-memcache has been released, which fixes the problem with Safari.
2020-06-20 19:40:15 +00:00
Ty Mick
725376a9d7
Fix GraphQL Hooks Example Safari bug (#14205)
Fixes #14187, where the [GraphQL Hooks Example](https://github.com/vercel/next.js/tree/canary/examples/with-graphql-hooks), when opened in Safari, doesn't respond to events in production and doesn't load at all in the dev server.

This is caused by [a bug in graphql-hooks-memcache@1.3.2](https://github.com/nearform/graphql-hooks/issues/496), which they've fixed but haven't released the fix yet. So this example fix just temporarily downgrades graphql-hooks-memcache by changing its version range to `1.3.1 || ^1.3.3`.
2020-06-16 08:33:57 +00:00
Luis Alvarez D
b4ec992815
[Examples] Move with-graphql-hooks to SSG (#13858)
Related to https://github.com/vercel/next.js/issues/11014

The setup is very similar to the one used for Apollo examples.

@Joezo I've removed the demo example that you added to the readme (https://github.com/vercel/next.js/pull/6482) as it will be outdated after this PR is merged.
2020-06-08 16:23:34 +00:00
Dan Williams
2c8ab89e37
Fixed graphql-hooks example data prefetch (#13799)
- Fixes the Next.js `with-graphql-hooks` example so that data is prefetched during SSR:
    - The example was using an old version of `graphql-hooks` where SSR was broken
    - It had a bug where the `graphql-hooks` client passed in to the `AppTree` as a prop was not being used (instead was creating a new client every time)

This resolves https://github.com/nearform/graphql-hooks/issues/439 for `graphql-hooks`.
2020-06-05 17:11:40 +00:00
Willian Justen
18dc1f66c6 Remove isomorphic-unfetch from examples (#12948)
Since 9.4 release, fetch is pollyfilled by default from #12353,
so the import is not needed anymore.
2020-05-15 22:23:55 +02:00
Luis Alvarez D
7edf0da0c4 Add the deploy button to compatible examples (#9547) 2019-11-27 11:40:58 -05:00
Joe Haddad
f152c745da
Update remaining examples to latest Next.js 2019-07-08 19:37:58 -04:00
Alex Parish
5ed51c0049 Update with-graphql-hooks example to exclude SSR library from commons chunk (#7015) 2019-04-11 17:59:42 -05:00
Joe Warren
5fd7b85280 Add graphql-hooks example (#6482)
Adds an example app using [graphql-hooks](https://github.com/nearform/graphql-hooks) that started life as the with-apollo example app. It uses the same graph.cool backend, mostly to demonstrate how similar it is.
2019-03-01 18:21:03 +01:00