* Add licences to all example/package.json that lack them
* Revert "Add licences to all example/package.json that lack them"
This reverts commit 5d4e25012f7334772b8ef5924bc355277e827cba.
* Update check-examples to remove `license` field from examples
* Remove `license` from all examples.
This was mentioned in vercel/next.js#27121 but it looks like it didn't end up being in the merge?
Co-authored-by: JJ Kasper <jj@jjsweb.site>
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
[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
```
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
Adding a example with **Neo4j** native graph database.
- with-apollo-neo4j-graphql: basic apollo configuration with neo4j driver and neo4j-graphql-js.
:)
* Remove React redundant import on `analyze-bundles` example
Co-authored-by: Marcus Silva <mvfsillva@gmail.com>
* Remove React redundant import on `api-routes-apollo-server-and-client-auth` example
Co-authored-by: Marcus Silva <mvfsillva@gmail.com>
* Remove React redundant import on `custom-server` example
Co-authored-by: Marcus Silva <mvfsillva@gmail.com>
* Remove React redundant import on `custom-server-actionhero` example
Co-authored-by: Marcus Silva <mvfsillva@gmail.com>
Co-authored-by: Marcus Silva <mvfsillva@gmail.com>
* Find/Replace "Deploy it to the cloud..."
* Find/Replace "Deploy it to the cloud..." (no colon)
* Find/Replace "Deploy it to the cloud..." for firebase
* Convert remaining ones
* Storybook deployment
* Update with-stripe-typescript
* Update contributing.md
* Remove `now`
* Update examples/with-stripe-typescript/README.md
Co-Authored-By: Luis Alvarez D. <luis@zeit.co>
1. Prevent possible race conditions of cache pruning, refetching and redirects
2. Note: the original code has the following defect.
SignOut action restarts the dev server effectively resetting the memory and erasing all the "registered users" data. You have to SignUp again after SignOut. I'm not sure how
to properly fix it a.t.m
* Fix api-routes-apollo-server-and-client-auth Example
`client.resetStore()` must be called after SignIn, SignOut actions
Otherwise, even the current basic auth is not working 100% of the time...
For example, as caching occurs here:
```
const { data, loading } = useQuery(ViewerQuery)
```
it sometimes (race conditions!) prevents a user from signing in
the current code base.
Check https://github.com/apollographql/apollo-cache-persist/issues/34#issuecomment-371177206 comment for more info.
* Fix api-routes-apollo-server-and-client-auth Example (linting)