Commit graph

1081 commits

Author SHA1 Message Date
hanneslund
6025c2eedd Update README.md (#8780)
api-routes -> with-aws-amplify-typescript
2019-09-18 10:37:18 +02:00
Weston Thayer
dc28e5b706 Example update: with-sentry-simple (#8684)
* Update to capture server exceptions and more

- Adds test cases for several server and client-side exceptions
- Allows capturing more server-side exceptions by overriding _error.js and using Sentry.captureException() within
- Use @sentry/node on the server
- Rely on Next.js's React Error Boundary instead of creating our own in _app.js

* Update test notes

Found some differences while testing in production

* Remove accidental mount throw on test 8

* Add note about server-side source maps

* Linting fixes
2019-09-17 11:43:51 +02:00
Tommy Ljungberg
960906553b fix(examples): use hooks in with-cookie-auth example (#8729) 2019-09-16 19:57:15 +02:00
Lukáš Huvar
7863b60ef6 Prettier fix (#8754) 2019-09-16 15:24:42 +02:00
Henrik Wenz
1045cd4c5a Refactor api-routes-apollo-server-and-client example (#8673)
* Remove connectToDevTools in favour of better default

Disabled devtools in production

* Refactor api-routes-apollo-server-and-client example
2019-09-12 10:44:53 -05:00
Joe Haddad
53f4f82e4c
Catch all requests in custom server (#8704)
Some users aren't aware they need to edit their custom server to support various HTTP Methods (e.g. POST for API Routes).

Instead, we should just handle all HTTP Methods out-of-the-box.

---

Closes #8237
2019-09-11 10:23:41 -04:00
Michael Lustig
a809368e59 Fix login popup not working (#8700) 2019-09-10 22:16:20 -04:00
Jakub Karabuła-Stysiak
5496e0f8b3 Add electron typescript example (#8682)
* Add initial Electron-Typescript-Next example

* Move and add types

* Update readme

* Update renderer

* remove config
2019-09-10 14:22:00 -05:00
Diogo Dutra
af7d021d48 Fix relay modern server express example (#8683) 2019-09-10 09:01:59 +02:00
Lukáš Huvar
0c6c1f9e07 Fix yarn workspaces example (#8631)
* Add now.json to fix deploy

* Adjust now.json

* Fix next.config.js

* Update next.config.js

* Update examples/with-yarn-workspaces/now.json

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
2019-09-06 13:44:39 +02:00
Aaron Reisman
6c01bbd6df Add Apollo Server and Client Example App (#8195)
* Add Apollo Server and Client Example

* Update Apollo Client to use previous example setup
2019-09-05 18:42:32 -05:00
Henrik Wenz
62aa5c8772 Improve with-apollo-auth example (#8633)
* Remove connectToDevTools in favour of better default

* Remove redirect code from client

* Simplify function

* Remove apollo-boost

This package is optimized for client usage only.
We actually never used it. We only usered its reexports.

More info:
https://www.apollographql.com/docs/react/v2.5/recipes/authentication/#header

* Remove stopPropagation

We actually don’t need it.

* Refactor getToken method

We want to show how to get the token.
This can be from a cookie or some other isomorph store.
We are not interested in the cookie abstraction in this example.

* Secure cookie

not perfect but better than before….

* Add ssr config option

This was documented but not implemented
2019-09-05 11:09:32 -05:00
Henrik Wenz
cba5c05b36 Fix getInitialProps issue in with-apollo example (#8620)
* Fix getInitialProps in with-apollo example

The code before had two design flaws:

* When we skip WithApollo.getInitialProps we must hoist PageComponent.getInitialProps if it is present.
* We should expose the apolloClient to underlying PageComponent.getInitialProps contexts.

* Add abort check

* Add some comments

* Add client only example page

https://github.com/zeit/next.js/pull/8620#issuecomment-527870886

* Remove connectToDevTools setting in favor default config

7eaf4132cd/packages/apollo-client/src/ApolloClient.ts (L170-L173)

* Remove fetch check

This is done by https://www.npmjs.com/package/isomorphic-unfetch

* Remove apollo-boost

I am removing this package, because we never actually used it.
This is because we use the named export of apollo boost wich resolves to apollo-client.

This way we removed apollo-link-state, apollo-link-error

* Remove redirect code from the client
2019-09-04 11:46:39 -05:00
Bauyrzhan
42771f6451 Delete next-env.d.ts in JS implementation example (#8619) 2019-09-04 11:01:18 +02:00
Joe Haddad
ffc205ba8c
Use URL-friendly chunk names (#8609)
* Use URL-friendly chunk names

* Fix example linting
2019-09-03 10:55:48 -04:00
Henrik Wenz
97e40057bb Use import instead of require in with-apollo example (#8575) 2019-09-02 20:14:35 -05:00
Ali eslamifard
40c6ec4fb0 This example shows how to use STOMP inside a Next.js application. (#8511)
* This example show how to use STOMP inside a Next.js application.

* Fix useEffect

* Add _app.js implementation

* Fix lint error

* Fix lint error

* Update examples/with-stomp/README.md

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* withStomp removed

* The url address changed

* _app.js removed. useClient added.

* remove

* revert

* Add next.config.js

* Updated readme
2019-09-02 19:59:29 -05:00
Henrik Wenz
cf4fdaf4f2 Remove _app.js from with-apollo-auth example (#8556)
* Move apollo logic into one file

+ Use http-link from http boost

* Remove _app.js from with-apollo-auth example

* Covert other class components to functional components

* Use esm import instead of require
2019-09-02 16:10:53 -05:00
Lukas Strassel
83a10eefee add cookie path property (#8594)
played around with that example and was wondering why it didn't work any more when having an `auth/login` page.

I hope this addition will spare someone else some confusion :)
2019-09-02 13:30:29 -05:00
Henrik Wenz
4a1215b701 Refactor with-loading example (#8560)
* Remove inline styles in favor of styled-jsx

* Remove getInitialProps from app

Allow automatic static optimization

* Remove _document.js

We really don’t need it in this example

* Migrate Class to Function Components
2019-09-02 13:05:29 -05:00
Henrik Wenz
a09036e061 Fix with-slate example (#8566) 2019-09-02 13:00:15 -05:00
Ali eslamifard
dd9448c574 Update README and data-fetch example to use function components. (#8546)
* This example show how to use STOMP inside a Next.js application.

* Fix useEffect

* Add _app.js implementation

* Fix lint error

* Fix lint error

* Update examples/with-stomp/README.md

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* withStomp removed

* The url address changed

* _app.js removed. useClient added.

* remove

* revert

* remove

* Update README.md according to Hooks concept.

* Update example

* Update README.md

* Components should use functional syntax

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update README.md
2019-09-02 12:47:30 +02:00
Raibima Putra
f47f014f7a Fix react-native-web example FOUC (#8576) 2019-09-02 12:38:51 +02:00
Henrik Wenz
ce25f747e7 Refactor active-class-name example (#8558)
- use router hook instead of hoc
- simplify ActiveLink component
- add prop-types
- add function names
- use fragments instead of divs
2019-08-29 12:22:42 -04:00
Henrik Wenz
aa406a1d62 Fix with-context-api example (#8559)
## Motivation

The code before this PR had serveral issues:

1. Context uses reference identity to determine when to re-render, there are some gotchas that could trigger unintentional renders in consumers when a provider’s parent re-renders.

https://reactjs.org/docs/context.html#caveats

2. `setState` should use the reducer pattern in this example to make sure clicks are not swallowed by react batch.
2019-08-29 12:09:22 -04:00
Adam Goth
c6ec289c55 Fix typo in link in example's README (#8545) 2019-08-28 17:00:48 +02:00
Borek Bernard
4292a9a21c Update with-zones example (#8459)
* Add more pages to the 'blog' zone

- New dynamic page `pages/blog/post/[id].js`
- `pages/blog.js` moved to `pages/blog/index.js`

* Update Now and Next configs to support both `now dev` and `next dev`

- Set `assetPrefix` dynamically to either `/blog` or `''`.
- Update package.json scripts for both 'home' and 'blog' apps, support `yarn dev` in both of them.

* Update example description in README

* Fix formatting issues

* Make `/static` assets work in the 'blog' app

* Add routing rule for `/blog/static` to now.json

* Shorten README

I reverted it back to the state of 233152ee17 and then updated it with info on recent changes of the `with-zones` example.

* Use `continue: true` in now.json

Applies suggestions from code review.

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* Fix JSON formatting

* Add routing rule for `_next` and `static` folders

* Update README of with-zones example slightly

Applies suggestions from code review.

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* Remove unnecessary "dest" from `now.json`

Co-Authored-By: Joe Haddad <timer150@gmail.com>
2019-08-27 16:24:29 -04:00
Jean
08dcbdca9c Improve With Firebase Authentication example (#8533)
* [with-firebase-authentication] remove deprecated warning

* [with-firebase-authentication] improve client and server credentials example

* [with-firebase-authentication] fix typo in the docs
2019-08-27 15:39:13 -04:00
Henrik Wenz
78d274db9b Improve with-apollo example (#8508)
* Simplify apollo setup

* Allow disabling of ssr in favor of automatic static optimization

- Converted Class to Function Component
- Added ssr config option

* Exclude @apollo/react-ssr from client bundle

* Remove WithApollo.getInitialProps from the client

* Remove displayName from production build

* Fix production switch

* Change export & fucntion naming

- Use named export
- Change function naming

* Warn if someone tries to use this HOC with _app.js
2019-08-27 09:43:29 -05:00
Tage A. L. K
9efed17503 Update with-react-intl for v3 (#8526)
* Update dependencies

> Update dependencies

* Changes to make v3 work

> Use hook `useIntl` instead of HOC `injectIntl`
> Change use of class components
> Changes to dependencies

* Small changes

Small changes
2019-08-26 15:40:36 -05:00
Henrik Wenz
17b1154d9b Remove _app from with-apollo example (#8504)
* Remove _app from with-apollo example

This allows automatic static optimization for pages, that don’t need apollo.

* Rename with-apollo

Name should be same as hoc

* Adjust text to reflect latest changes

more info: 4321c469466160d13bcd52afa099385e84a112a0
2019-08-24 22:19:26 -04:00
Henrik Wenz
483cd1052f Refactor data-fetch example (#8490)
* Remove eslint exclusion

https://www.npmjs.com/package/isomorphic-unfetch

* Fix emoji char

* Update preact.js
2019-08-23 11:24:47 -04:00
Joe Haddad
5396ab473a
Remove front from examples 2019-08-23 10:47:40 -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
Henrik Wenz
7eda3bc632 Fix invalid href with-tailwindcss example (#8488)
Uncaught (in promise) Error: Invalid href passed to router: https://github.com/zeit/next.js https://err.sh/zeit/next.js/invalid-href-passed
2019-08-23 09:39:46 -04:00
Jesse Katsumata
3e912323f8 Update redux example using hooks api (#8410)
* Update redux example with hooks api

* Update react and react-redux package

* Apply standard style
2019-08-21 16:23:18 -05:00
Henrik Wenz
a256270e15 [with-apollo] Remove prefetch attibutes (#8465)
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-21 12:20:57 -04:00
Borek Bernard
233152ee17 Add package.json to with-zones example, make create-next-app work (#8453)
* Add package.json to with-zones example

So that create-next-app works.

* Update README – no need to run `yarn` / `npm i`

This example doesn't have any dependencies in its package.json,
everything is handled by running `now dev`.
2019-08-20 14:45:16 -04:00
Stanislav Morozevich
718e577169 Update with-apollo-auth example (#8416)
* Provide default value for apolloState

* Use hooks api

* Fix formatting problems

* Use useRef hook

* Add simple comment about displayName

* Go with caret for react-hooks and react-ssr
2019-08-19 23:49:24 -04:00
Kristoffer K
3fa7c12857 [with-electron] Upgrade electron & transpile for the installed version (#8399)
* Upgrade packages

* Transpile for the installed electron version

* standard --fix
2019-08-19 23:25:43 -04:00
none23
c13d1bca27 Fix a typo in with-reasonml-todo example (#8420)
Noticed a minor typo
2019-08-19 12:33:22 +02:00
Kateryna Pohrebniak
ef13f5cc93 Typo in class name in with-react-esi example (#8414) 2019-08-18 20:00:47 +02:00
matamatak
ab95c6d9a1 Updated with-redux-thunk example using useSelector and useDispatch (#8396)
* use useSelector and useDispatch

* update README

* fix space and trailing comma
2019-08-16 14:50:46 -05:00
Joe Haddad
a04a5f014a
Remove extra DOM method call (#8394) 2019-08-16 12:00:46 -04:00
Evan Bacon
e80bbe4b80 [Expo] Updated React Native example (#8376)
* Created a new example for React Native web

- use the latest `react-native-web`
- remove unused `react-art`
- remove redundant `babel-plugin-module-resolver`
- remove unused `.babelrc`
- add missing `app.json` (standard in React Native)
- added example for rendering an `<a />`
- added header examples

* `yarn lint-fix`
2019-08-15 08:01:09 +02:00
Rafael Almeida
1765007a10 Update with-apollo example with hooks (#8363)
* Add @apollo/react-hooks and @apollo/react-ssr

* Migrate react-apollo to @apollo/react-hooks and Query component

* Migrate direct client mutations to useMutation hook

* Disable submit button when submiting a new post

* Fix Show More button not updating when loading more entries

* All queries with uppercase name

* Remove react-apollo

* Update getDataFromTree links

* Fixed lint issues
2019-08-14 15:00:34 -05:00
Kristoffer K
a7baeb045e fix(examples): correct the path in with-electron (#8370)
* fix(examples): correct path in with-electron

* Update index.js
2019-08-14 20:44:34 +02:00
Tim Neutkens
a90a55545b
Deprecate Container usage (#8327)
* Remove Container from examples

* Update readme to reflect Container removal
2019-08-11 22:02:33 +02:00
Tim Neutkens
6d2539013c
Fix layout example building (#8326) 2019-08-11 20:12:50 +02:00
Junyoung Choi
08b14e49b0 Simplify mobx example (#8269) 2019-08-08 14:09:18 -05:00