Commit graph

19 commits

Author SHA1 Message Date
Tim Neutkens
ab42da0626
Run next/link codemod for Next.js 13 on examples (#41913) 2022-10-30 21:00:45 +01:00
Tim Neutkens
ed81a14922
Enable @typescript-eslint/no-use-before-define for examples dir (#39469)
Found that this rule was added but all options are set to `false` so it doesn't do anything. Started with enabling it for examples to ensure minimal breaking of existing PRs.

## Bug

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

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-10 16:30:36 +00:00
Carmelo Scandaliato
20949612df
Replace Graphcool with a working GraphQL endpoint in with-apollo-and-redux example (#19248)
The example stopped working when the GraphQL service [Graphcool](https://www.graph.cool/) shut down in July. I have replaced it with an [Hasura](https://hasura.io/) endpoint.

Fixes #19093
2020-12-02 19:45:31 +00:00
Ruslan Dzyubanov
893e57d29e
Update examples/with-apollo (#15178)
apollo-client 2.6.8 -> 3.0.0
2020-07-15 18:23:22 +00:00
Luis Alvarez D
3a9fbd8396
[Examples] Move with-apollo-and-redux to SSG (#13779)
Ref: https://github.com/vercel/next.js/pull/13742
2020-06-09 21:11:45 +00:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
jmgr2996
dd264f582f
chore: Remove redundant imports in several examples (#13030) 2020-05-18 13:02:23 -04:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
Henrik Wenz
e09eb8d415 Update with-apollo-and-redux example (#9270)
close #8830
2019-10-31 10:40:34 -04:00
Henrik Wenz
a9325f123a Remove prefetch attributes from examples (#8481)
* Remove prefetch from with-apollo-and-redux-saga example

Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated

* Remove prefetch from using-inferno example

Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated

* Remove prefetch from with-apollo-and-redux example

Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated

* Remove prefetch from with-apollo-auth example

Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated

* Remove prefetch from with-tailwindcss example

Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated

* Remove prefetch from with-graphql-hooks example

Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated

* Remove prefetch from data-fetch example

Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/zeit/next.js/prefetch-true-deprecated
2019-08-23 10:12:25 -04:00
Tim Neutkens
9c4eefcdbf
Add prettier for examples directory (#5909)
* Add prettier for examples directory

* Fix files

* Fix linting

* Add prettier script in case it has to be ran again
2018-12-17 17:34:32 +01:00
Jerome Fitzgerald
ab889369d5 [fix] apollo-redux: Separate out entire example #3463 (#3629)
* [fix] apollo-redux: Separate out entire example #3463

Apollo and Redux are completely separate ways of managing state. This example serves as a conduit if you were using Apollo 1.X with Redux, and are migrating to Apollo 2.x, however, you have chosen not to manage your entire application state within Apollo (`apollo-link-state`).

There is no "withData" function that allows you to call either/or. You must call "withRedux" and/or "withApollo" on your Component. They can be combined in the example at `index.js` or remain separate as seen in `apollo.js` and `redux.js`.

Going forward, this example may go the way of the dodo.

* [chore] reformat code to match next syntax

Localize prettier sometimes has a mind of its own. 😄️

* Fix linting
2018-01-31 10:40:32 +01:00
Jerome Fitzgerald
46b57a6eff [refactor] with-apollo-and-redux: 2.0.0 (#3484)
* [refactor] with-apollo-and-redux: 2.0.0

- This ports over `with-apollo` (w/ recent `withRouter` fix and addition
for Post) along with implementing `apollo-cache-redux` #3463
- The `redux` side of things is lacking (it is the *same* as the
original example)
- Created a `routes.js` for use on Server and Client Side (to expand the
PostList functionality)
- SSR is maintained
- Redid the "PostVote" a bit... sorry. 😬️

Possible todo(s):
- Add in API and Clock Examples from `with-redux` to show Apollo and
Redux working together a bit more
- redux-saga (I personally use this, may be too opinionated for the base
example though)

Packages updated:
- apollo-cache-redux
- apollo-client-preset
- graphql
- graphql-anywhere
- graphql-tag
- isomorphic-unfetch
- next-routes
- prop-types
- react
- react-apollo
- react-dom
- redux

* [refactor] fix linting issues

When I run `yarn lint` explicitly these were caught, but not doing a
build proper. Apologies on that!

* [chore] 📦️ package.json: like other examples

* [refactor] +apollo-cache-inmemory, -apollo-cache-redux

Separation of Apollo and Redux. 😄️
We could stand to use a few actual examples of Redux, though this is a
good starting block.
Some other code cleanup as well.
2017-12-27 19:57:57 +01:00
Tim Neutkens
c9401214db Fix linting 2017-11-25 12:03:25 +01:00
Brian Dombrowski
5ede8c9dc3 More complete with-apollo-and-redux example with dynamic post route (#3223)
* More complete with-apollo-and-redux example with dynamic post route

* Removed commented out code
2017-11-23 14:05:51 +01:00
Arunoda Susiripala
c5c270c576 Merge master into v3-beta. 2017-07-06 12:24:31 +05:30
Jayden Seric
ec2b76f83b Better data fetching error handling for Apollo examples (#2227)
* Display data fetching errors in Apollo examples.

* Prevent Apollo GraphQL errors from crashing SSR.

Also tidied a few comments in the vicinity.
2017-07-01 23:56:12 +02:00
Adam Soffer
5d71434121 Remove warning when upvoting a post in apollo examples (#2190)
* Fix apollo warning and error when upvoting post

* Fix apollo warning and error when upvoting post in apollo-redux example as well
2017-06-08 19:26:40 +02:00
Adam Soffer
c2036e1326 Create separate Apollo example without Redux integration (#1483)
* Add minimal apollo example

* Update apollo example README

* Update apollo example demo link in README

* Fix button styles

* Fix show more button

* Alias demo url

* Include the data field on the Apollo store when hydrating

* Revert

* Include the data field on the Apollo store when hydrating per tpreusse's suggestion.

* Add example to faq section in README

* Sort by newest; Add active state to buttons

* Make optimization suggestions

* Use process.browser; inline props

* Pass wrapped component's initial props into component heirarchy if they exist

* Remove unnecessary sorting of array

* Update Apollo example

* Remove trailing comma

* Update reduxRootKey

* Remove unnecessary babelrc

* Update with-apollo example

- Remove use of deprecated 'reduxRootKey' option
- Add loading indicator inside pagination button

* Fix with-apollo example pagination; Pass initialState to ApolloClient

* Split apollo example into two (one with and without Redux integration)

* Rename createClient private function to _initClient

* Set initialState default parameter inside initClient function

* Remove redux dep from with-apollo example
2017-03-30 11:21:13 -07:00