1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
Commit graph

685 commits

Author SHA1 Message Date
Tomek d1fbcfe5de update with-asset-import example (#4830)
Changes:
- use `next-images` plugin for handling static files import
2018-07-24 19:11:21 +02:00
Rustam Gilyaziev e2b518525c Update with-react-intl example (#4825)
Changes:
- added withIntl HOC because injectIntl do no hoist static methods
- fixed `Cannot read property 'locale' of undefined`
2018-07-24 00:43:57 +02:00
Tomek b1222962f0 update client-only-render-external-dependency example (#4822)
Changes:
* use `dynamic` imports instead of `require`
* update `recharts` dependency
2018-07-22 20:53:22 +02:00
Tomek 53853d3fa9 update with-redux-observable example (#4818) 2018-07-22 01:37:59 +02:00
Tomek 822cc3c863 update with-react-intl example (#4817) 2018-07-22 01:37:25 +02:00
Tomek 0d93d42640 update with-react-ga example (#4816)
Changes:
* updated `react-ga` package
* updated README.md
* Removed `Layout` component and used custom App component
* used `routeChangeComplete` to log route changes.
2018-07-21 19:27:48 +02:00
Adrian Li 6ef7625ba6 Update example: Semantic-UI (#4815)
The existing example currently does not work because of outdated usage patterns. This PR seeks to update these patterns to the latest recommended best practice while bumping versions.

# Summary

- Bumped version numbers in `package.json`;
- Moved `<link />` tag from `pages/index.js` to `pages/_document.js` as is [recommended](https://github.com/zeit/next-plugins/tree/master/packages/next-css#usage);
- Replace individual css/font imports with import of minified CSS as is [recommended](https://react.semantic-ui.com/usage#semantic-ui-css-package);
- Removed prop (no longer used) from `<List />` element.
2018-07-21 12:42:38 +02:00
Brian Kim 0298c722b1 improve custom-server-fastify example (#4805)
I’ve been experimenting with Next.js and Fastify and I made the following changes to the Fastify example based on what I found:

### Use Fastify’s plugin API
IMO putting Fastify’s listen call in a promise callback is an anti-pattern, b/c the Fastify plugin API is meant to solve the problem of async server bootstrapping.

[From Fastify’s Getting Started docs](https://www.fastify.io/docs/latest/Getting-Started/):
> Fastify provides a foundation that assists with the asynchronous bootstrapping of your application.

### Set reply.sent in handlers which return promises

[From Fastify’s Routes docs](https://www.fastify.io/docs/latest/Routes/#promise-resolution):
> If your handler is an `async` function or returns a promise, you should be aware of a special behaviour which is necessary to support the callback and promise control-flow. If the handler's promise is resolved with `undefined`, it will be ignored causing the request to hang and an *error* log to be emitted.
>
> 1. If you want to use `async/await` or promises but respond a value with `reply.send`:
>     - **Don't** `return` any value.
>     - **Don't** forget to call `reply.send`.
> 2. If you want to use `async/await` or promises:
>     - **Don't** use `reply.send`.
>     - **Don't** return `undefined`.

`app.render` returns a promise which contains undefined, so returning it in a Fastify handler will log an error. However, returning anything besides undefined will cause Fastify to try to write to the response which Next.js has already ended. The solution is to manually set the `reply.sent` flag to true when any Next.js rendering promise is fulfilled as an alternative to calling `reply.send`.

### Make Next.js handle 404 errors
This allows any route to throw a NotFound error and let Next.js handle the rendering of the 404 page.

### Make Next.js handle any route which starts with `_next` in dev
This prevents dev routes from being caught by user-defined routes.
2018-07-19 21:27:22 +02:00
Tim Neutkens 6415d5f4ee
Upgrade fastify in custom-server-fastify (#4801) 2018-07-19 00:18:15 +02:00
Tim Neutkens 76657f8451
Upgrade serve in with-static-export example (#4800) 2018-07-18 22:16:06 +02:00
David Calhoun 6f4925c193 [change] Update RNW example (#4787) 2018-07-15 20:59:20 +02:00
Kenneth Luján Rosas dca2ca6f2b [with-apollo] simplify apolloState prop (#4755)
As seen on `with-apollo-auth` there are some things that need to be addressed here too.

* #4554 remove useless `apolloState` from App props on `getDataFromTree`
* #4563 simplify `apolloState` prop

Let me know if further changes/fixes are needed. 
Thank you 🎉
2018-07-12 18:59:28 +02:00
Michael Herold 5b3578e58f #4751 - Explicitly mention install when cloning examples (#4758)
Preferably this installation wouldn't be necessary, but in lieu of a fix...

#4751
2018-07-11 23:56:15 +02:00
jhartley218 ad2d4432e7 Update @types/next to latest in typescript example. (#4750)
Updating to a more recent version of `@types/next` fixes an error I encountered while building a new app on top of the "with-typescript" example:

`Property `push` not found in SingletonRouter`

Additional context: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/26665

To test, add a simple Router.push operation to the `pages/index.tsx`

```
import Router from 'next/router'
// ...
<span onClick={() => Router.push({ pathname: '/about' })}>TEST</span>
```
2018-07-09 13:32:52 +02:00
Brendan Houle d7d61d3d4a Prepend polyfills only once (#4643) (#4738) 2018-07-06 11:54:16 +02:00
NikitaVlaznev 728871b005 Apollo example: avoid double render in browser (#4734)
Apollo's getDataFromTree is supposed to be called during the server side rendering.
Being called in browser it fires an unnecessary fake render process and blocks components from rendering with loading=true.

Also there was a mistake in this code:

    // `getDataFromTree` renders the component first, the client is passed off as a property.
    // After that rendering is done using Next's normal rendering pipeline
    this.apolloClient = props.apolloClient || initApollo(props.apolloState.data)

**Apollo** component is not rendered by getDataFromTree actually, it renders the **App** directly, thus props.apolloClient will always be undefined.

This example was discussed here: https://github.com/zeit/next.js/issues/387.
2018-07-05 20:49:23 +02:00
Michael Hsu a1f5f35c2e fix(with-pkg): Rename dist to server (#4727)
This PR is a follow-up to 6.1 breaking #4506: Rename `dist` to `server`
2018-07-04 15:12:36 +02:00
Junyoung Choi (Sai) a25359bf3f Improve with-mobx example (#4705)
in flavor of https://github.com/zeit/next.js/pull/4377
2018-06-30 22:29:24 +02:00
Vinicius Pacheco Furtado de6bf4e75f Fix typescript examples (#4704)
Update @zeit/next-typescript version on examples using it
2018-06-30 22:23:38 +02:00
Gary Meehan 0da53a1444 Add [with-storybook] example (#4588)
The purpose of the PR is to add the simplest possible integration with Storybook. 

It leaves the default Storybook and also adds a custom component to show how it would be used in both the app and Storybook.

Update: 
Tested with latest 👉  6.1.1
2018-06-29 22:24:44 +02:00
Gary Meehan 6a489efc1a [hello-world example] remove unused file (patch)
Removes unused file
Adds note on `day` subdirectory.
2018-06-29 22:23:39 +02:00
dengyunxie 4744fbd096 Make the file beautiful (#4694)
unified format😀😋
2018-06-29 17:02:00 +02:00
Niklas Wagner dde20fc841 Added note for AWSAppSyncClient (#4611)
I had some trouble to get server side rendering with the AWSAppSyncClient working. I finally found a solution in https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/82 but it might be worth to share it here as well. Instead of adding a big code block to each file I'll just refer to this Pull Request.

______

In case you want to use the `AWSAppSyncClient` you just need to replace the `create()` function with this function:
```jsx
import AWSAppSyncClient from 'aws-appsync';
import { AUTH_TYPE } from 'aws-appsync/lib/link/auth-link';

function create(initialState) {
  const client = new AWSAppSyncClient({
    url: AWS_AppSync.graphqlEndpoint,
    region: AWS_AppSync.region,
    auth: {
      type: AUTH_TYPE.API_KEY,
      apiKey: AWS_AppSync.apiKey,

      // Amazon Cognito Federated Identities using AWS Amplify
      //credentials: () => Auth.currentCredentials(),

      // Amazon Cognito user pools using AWS Amplify
      // type: AUTH_TYPE.AMAZON_COGNITO_USER_POOLS,
      // jwtToken: async () => (await Auth.currentSession()).getIdToken().getJwtToken(),
    },
    disableOffline: true,
  }, {
    cache: new InMemoryCache().restore(initialState || {}),
    ssrMode: true
  });

  return client;
}
```
2018-06-29 10:08:26 +02:00
Bünyamin Benny Genel 6ed2da4575 with-socket.io Example updated with _app.js (#4644)
with-socket.io example was using a single index file and was managing connection in there. This would lead handling connection (disconnecting and reconnecting) in each added page.

I updated example with addition of `_app.js` and handled connection in there. This helped only subscribing to event in page and maintaining connection throughout example.
2018-06-23 22:17:37 +02:00
Brice BERNARD 0989ecc223 [with-jest] Move jest deps to devDeps (#4650) 2018-06-22 17:12:31 +02:00
Bünyamin Benny Genel 67cb87adb5 Added with-unstated example (#4628)
Small example app using [unstated](https://github.com/jamiebuilds/unstated) library. Example uses components and logic from [with-redux](https://github.com/zeit/next.js/tree/canary/examples/with-redux) example.
2018-06-19 21:50:37 +02:00
Telegin Evgeniy cdfcde16a6 Update with-universal-configuration (#4624)
resolves #4623
2018-06-17 13:50:52 +02:00
Telegin Evgeniy 3566b92900 Update with-markdown example (#4612)
I have updated [examples/with-markdown](https://github.com/zeit/next.js/tree/canary/examples/with-markdown) in order to make it works with next 6 🎉 

<details>
<summary>Error</summary>
Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/zhenyatelegin/Desktop/next.js/examples/with-markdown/node_modules/markdown-in-js/babel.js
</details>
2018-06-15 20:55:14 +02:00
Telegin Evgeniy 6cdd7cb291 Update with-absolute-imports example to Babel 7 (#4610)
Hello!

I have updated `babel-plugin-module-resolver` to `^3.1.1` and moved it to `devDependencies` in [with-absolute-imports](https://github.com/zeit/next.js/tree/canary/examples/with-absolute-imports) example to make it work with Babel 7 :)

## Error logs
```
zhenyatelegin@MBP-Zhenya  ~/Desktop/next.js/examples/with-absolute-imports   canary  yarn build
yarn run v1.5.1
warning package.json: No license field
$ next build
> Failed to build
{ Error: (client) ./pages/index.js
Module build failed: Error: Cannot find module 'babel-plugin-module-resolver' from '/Users/zhenyatelegin/Desktop/next.js/examples/with-absolute-imports'
    at Function.module.exports [as sync] (/Users/zhenyatelegin/Desktop/next.js/node_modules/resolve/lib/sync.js:40:15)
    at resolveStandardizedName (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/files/plugins.js:78:29)
    at resolvePlugin (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/files/plugins.js:27:10)
    at loadPlugin (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/files/plugins.js:35:18)
    at createDescriptor (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:152:21)
    at /Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:104:12
    at Array.map (<anonymous>)
    at createDescriptors (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:103:27)
    at createPluginDescriptors (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:99:10)
    at /Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:50:19
    at plugins (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:40:25)
    at mergeChainOpts (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-chain.js:296:68)
    at /Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-chain.js:251:7
    at buildRootChain (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-chain.js:85:20)
    at loadPrivatePartialConfig (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/partial.js:41:53)
    at Object.loadPartialConfig (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/partial.js:66:16)
 @ multi ./pages/index.js
    at /Users/zhenyatelegin/Desktop/next.js/dist/server/build/index.js:144:31
    at runWithDependencies (/Users/zhenyatelegin/Desktop/next.js/node_modules/webpack/lib/MultiCompiler.js:154:4)
    at /Users/zhenyatelegin/Desktop/next.js/node_modules/async/dist/async.js:1140:9
    at /Users/zhenyatelegin/Desktop/next.js/node_modules/async/dist/async.js:473:16
    at iteratorCallback (/Users/zhenyatelegin/Desktop/next.js/node_modules/async/dist/async.js:1064:13)
    at /Users/zhenyatelegin/Desktop/next.js/node_modules/async/dist/async.js:969:16
    at /Users/zhenyatelegin/Desktop/next.js/node_modules/async/dist/async.js:1137:13
    at runCompilers (/Users/zhenyatelegin/Desktop/next.js/node_modules/webpack/lib/MultiCompiler.js:96:47)
    at fn (/Users/zhenyatelegin/Desktop/next.js/node_modules/webpack/lib/MultiCompiler.js:101:6)
    at compiler.run (/Users/zhenyatelegin/Desktop/next.js/node_modules/webpack/lib/MultiCompiler.js:150:5)
    at emitRecords.err (/Users/zhenyatelegin/Desktop/next.js/node_modules/webpack/lib/Compiler.js:265:13)
    at Compiler.emitRecords (/Users/zhenyatelegin/Desktop/next.js/node_modules/webpack/lib/Compiler.js:371:38)
    at emitAssets.err (/Users/zhenyatelegin/Desktop/next.js/node_modules/webpack/lib/Compiler.js:258:10)
    at applyPluginsAsyncSeries1.err (/Users/zhenyatelegin/Desktop/next.js/node_modules/webpack/lib/Compiler.js:364:12)
    at next (/Users/zhenyatelegin/Desktop/next.js/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/zhenyatelegin/Desktop/next.js/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
  errors:
   [ '(client) ./pages/index.js\nModule build failed: Error: Cannot find module \'babel-plugin-module-resolver\' from \'/Users/zhenyatelegin/Desktop/next.js/examples/with-absolute-imports\'\n    at Function.module.exports [as sync] (/Users/zhenyatelegin/Desktop/next.js/node_modules/resolve/lib/sync.js:40:15)\n    at resolveStandardizedName (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/files/plugins.js:78:29)\n    at resolvePlugin (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/files/plugins.js:27:10)\n    at loadPlugin (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/files/plugins.js:35:18)\n    at createDescriptor (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:152:21)\n    at /Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:104:12\n    at Array.map (<anonymous>)\n    at createDescriptors (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:103:27)\n    at createPluginDescriptors (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:99:10)\n    at /Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:50:19\n    at plugins (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:40:25)\n    at mergeChainOpts (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-chain.js:296:68)\n    at /Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-chain.js:251:7\n    at buildRootChain (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-chain.js:85:20)\n    at loadPrivatePartialConfig (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/partial.js:41:53)\n    at Object.loadPartialConfig (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/partial.js:66:16)\n @ multi ./pages/index.js',
     '(server) ./pages/index.js\nModule build failed: Error: Cannot find module \'babel-plugin-module-resolver\' from \'/Users/zhenyatelegin/Desktop/next.js/examples/with-absolute-imports\'\n    at Function.module.exports [as sync] (/Users/zhenyatelegin/Desktop/next.js/node_modules/resolve/lib/sync.js:40:15)\n    at resolveStandardizedName (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/files/plugins.js:78:29)\n    at resolvePlugin (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/files/plugins.js:27:10)\n    at loadPlugin (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/files/plugins.js:35:18)\n    at createDescriptor (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:152:21)\n    at /Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:104:12\n    at Array.map (<anonymous>)\n    at createDescriptors (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:103:27)\n    at createPluginDescriptors (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:99:10)\n    at /Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:50:19\n    at plugins (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-descriptors.js:40:25)\n    at mergeChainOpts (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-chain.js:296:68)\n    at /Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-chain.js:251:7\n    at buildRootChain (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/config-chain.js:85:20)\n    at loadPrivatePartialConfig (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/partial.js:41:53)\n    at Object.loadPartialConfig (/Users/zhenyatelegin/Desktop/next.js/node_modules/@babel/core/lib/config/partial.js:66:16)\n @ multi ./pages/index.js' ],
  warnings: [] }
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c next build
Directory: /Users/zhenyatelegin/Desktop/next.js/examples/with-absolute-imports
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/Users/zhenyatelegin/Desktop/next.js/examples/with-absolute-imports/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
2018-06-15 11:10:25 +02:00
Constantine 6d47d03611 with-styled-components: Move babel plugin to dev dependency (#4602) 2018-06-14 14:33:41 +02:00
Lon Ilesanmi 81802d2e60 Clean up Redux example (#4594)
- Remove unused imports

- Edit some comments

- Rename Wrapper App Class
2018-06-13 14:40:59 +02:00
James Hegedus 4f4b7a1bce with-firebase-hosting: fix npm scripts, remove firebase.json predeploy scripts (#4593)
* remove `predeploy` scripts from `firebase.json` in favour of `npm` `pre` scripts as they are consistent across `deploy` and `serve` commands. (to revisit once Firebase add support in the `firebase.json` for `preserve`)
* update deps
* workaround some bug where Babel could not resolve the standard `next/babel` config. Explicitly defining this seems to remove the issue.
* closes #4562
2018-06-12 17:37:13 +02:00
Telegin Evgeniy 567da9adbf Upgrade gh-pages example to next 6.0.3 (#4575)
Hello! I have got an error while building [gh-pages example](https://github.com/zeit/next.js/tree/canary/examples/gh-pages) with next 6.0.3. I have found solution to use CommonJS modules in `.babelrc`

This resolves #4227
2018-06-10 13:08:52 +02:00
Brice BERNARD 7e8acf3a30 [with-apollo-auth] simplify apolloState prop (#4563)
We don't need `.data` as `apollo.cache.extract()` returns at least `{}` when cache is empty
2018-06-08 11:48:10 +02:00
Brice BERNARD e318de62c0 [with-apollo-auth] Remove useless check from constructor (#4560)
We don't pass apolloClient as props, so I removed the check as confusing and always false.

see https://github.com/zeit/next.js/blob/canary/examples/with-apollo-auth/lib/withApollo.js#L72-L75

Again please explain me if I am wrong :)
2018-06-08 10:27:31 +02:00
Brice BERNARD 1a8bdba56b [with-apollo-auth] Remove useless apolloState from App's props (#4554)
App component does not need/use apolloState prop, so let's remove it. If I'm wrong please explain me the purpose of this.
2018-06-08 08:54:19 +02:00
Giau Tran Minh 631e6c7eba Added example for Ant Design with LESS (#4520)
* Added example for Ant Design with LESS

* Fix ESLINT
2018-06-07 13:14:27 +02:00
Eugene Sokovikov 3684231add stop duplicating charset (#4546)
**Make amp example valid**

I'm using amp validator chrome plugin which shows that `meta charset=utf-8` is duplicated.
I assume that `Head` component adds `<meta charset="utf-8" class="next-head next-head">`
anyway.
And this line just duplicating it.

<img width="987" alt="screen shot 2018-06-06 at 15 54 45" src="https://user-images.githubusercontent.com/1488195/41036743-198ca00a-69a2-11e8-978c-5a5cb5a994d2.png">
2018-06-06 14:23:20 +02:00
Nick Gauthier bbbf7ab498 Upgrade with-jest-typescript example to next 6.0.0 (#4543)
Hello! I ran into an issue using typescript and jest with next 6.0.0. I was able to work through fixing it and I wanted to share my solution back to next.js, by upgrading the with-jest-typescript example to next 6.0.0.

The steps I followed were:

1. `npx babel-upgrade --write` which added babel-core@^7.0.0-bridge.0 to allow jest's babel 6 to play nice with next's babel 7
2. Remove `ts-jest` and replace with `babel-jest` to use babel to transform the typescript code, as is done when the dev and production builds run
3. Update the babelrc to use commonjs modules in test mode to be compatible with jest

Also, I removed the `NODE_ENV=test` on the jest task, because jest sets the env to test anyways, and I'm on windows where this code is incorrect. The other option is to use `cross-env` but I felt it was simpler to just remove the environment override.

To my knowledge, this PR would help on the following issues:

#3663 #4227 #4531 #4528 #4239
2018-06-06 10:31:21 +02:00
Tobi 905da6f92b fixes bug in with-react-intl example: messages and locale variables were undefined on CSR (#4517) 2018-06-01 23:16:11 +02:00
Jorge Cuadra 8082eddaef Remove unused import (patch) (#4493) 2018-05-29 19:33:21 +02:00
Shu Ding 8cbc0be845 Add with-next-less example (#4492) 2018-05-29 10:37:03 +02:00
daniel tea 832c494470 fix README typo (#4476)
`idead` to `idea`
2018-05-26 12:11:09 +02:00
Tim Neutkens 2e9bed098d Remove page-transitions example 2018-05-25 14:19:40 +02:00
Kelly Burke 3f6834dfec sitemap.xml and robots.txt example (#4163)
This example app shows you how to set up sitemap.xml and robots.txt files for proper indexing by search engine bots.
2018-05-25 14:01:32 +02:00
Luke Barton cbfdcce32d Update typescript examples to use 1.0.1 of next-typescript (#4472)
* Update typescript examples to use 1.0.1 of next-typescript

* Add .babelrc modifications to upgraded typescript examples
2018-05-25 11:28:35 +02:00
Rob Brennan 0330962618 Improve custom server typescript example v2 (#4470) 2018-05-25 11:03:59 +02:00
Dimka Vasilyev 763ddc08a1 added support flex: 1 and and tag support Dimensions (#4460) 2018-05-23 22:47:16 +02:00
Tim Neutkens c461d46efd Fix viewport issue in with-react-native-web 2018-05-23 22:44:22 +02:00
Jerome Fitzgerald dbe28e1471 📝️Restructure with-material-ui per #4439 (#4444)
Restructure with-material-ui (patch)
2018-05-21 22:14:31 +02:00
Luis Fernando Alvarez D 2ef80a354c Fixed error with the cookie parser in with-apollo-auth (#4445)
Fixes #4442
2018-05-21 21:51:00 +02:00
Tage A. L. K 54e152b11b Minor update to with-apollo-auth (#4426)
Changes
* Update dependencies.
* Remove sending client prop to component on pages.
* Use withApollo correctly on components.
* Use `client.cache.reset()` instead of `prop.client.resetStore()`.

@adamsoffer @timneutkens
2018-05-21 12:13:56 +02:00
James Hegedus 57be892d02 with-firebase-hosting: update to work with next v6 (#4435)
* with-firebase-hosting: update next.js 6, readme about customization

* now next.js 6 is on Babel 7, remove conflicting babel deps
* update Next Server/Cloud Function .babelrc config
* update other deps: Cloud Functions to 1.x.x etc
* rm install-deps script as it is no longer used on deployment (firebase does not upload node_modules)
* make scripts consistent in their wrapping of dirs with \" (escaped double quotes)

* with-firebase-hosting: pin next to "latest" version

* with-firebase-hosting: fix lint errors
2018-05-21 10:28:09 +02:00
Sampson Oliver 35d32b48cc Create with-firebase-hosting-and-typescript example (#4443)
Adds an example based off of @jthegedus work on firebase hosting, compatible with next v6 and using typescript in both the firebase functions and the next app.
2018-05-21 10:25:45 +02:00
Luis Fernando Alvarez D 915673fcd6 Example updated: with-apollo-auth to Next 6 (#4420) 2018-05-18 10:55:12 +02:00
Luc db545d9bc9 Fix and improve example : with-componentdidcatch (#4400)
* Fix example with-componentdidcatch

* Improve demo in example
: with-componentdidcatch

* Change next dependency to latest

* Revert _app.js
2018-05-18 10:51:11 +02:00
Nathan Walters f5402476cf Add example with next-page-transitions (#4404) 2018-05-17 12:47:19 +02:00
yhirano55 ee1b6d93ce Minor improve with-typescript example [ci skip] (#4402)
* Added license to package.json.
* Modified package name same as dir name.
2018-05-17 12:45:13 +02:00
Lionel c8bf63e72c Update with-url-object-routing (#4314)
Use `withRouter` HOC to avoid _deprecation warning_ using `url`
2018-05-16 12:35:27 +02:00
Jesús Lobos b0128c7e2d Fix "with-i18next" example (#4393)
* Fix "with-i18next" example

Fixes #4380

* Trailing space removed
2018-05-16 12:10:01 +02:00
Yuri Yakovlev 59aa5a4dde Return empty string instead of null in the Authorization (#4389)
I was unable to make right check of `authorization` in the header on GraphQL side because now it returns `null` as string instead of empty string
2018-05-16 12:09:23 +02:00
HaNdTriX 79a7878c7d Update with-electron example (#4386)
Electron recommends to disable nodeIntegration in BrowserViews.
This PR follows this recommendation and updates the example accordingly.

 Changes:

- disable nodeIntegration
- update dependencies
2018-05-16 10:49:13 +02:00
yhirano55 b90c77b17f Improve with-redux-saga example (#4392)
* Rename page component's class name: Counter => Index, Counter => Other
* Rename counter component class name: AddCount => Counter
* Add counter actions `decrement` and `reset` same as with-redux example
* Modify page link by NavigateTo attr in Page component
* Modify license MIT => ISC same as others in package.json
* Modify README
2018-05-16 10:47:12 +02:00
yhirano55 e8c7dd4958 Fix with-mobx example (#4394)
fixes #4390

* Installing only `babel-plugin-transform-decorators-legacy` didn't work
* It also needs to install `babel-plugin-transform-class-properties`
2018-05-16 10:20:13 +02:00
yhirano55 3db3f4b42a Improve with-redux example (#4377)
It's better that Counter behave not only `increment (add)` but also `decrement` or `reset`.

* Add decrement, reset handlers and rename add handler in `components/counter.js`
* Add increment, decrement, reset actions to `store.js`
* Rename page component class name: Counter => Index in `pages/index.js`
* Remove needless dispatch count event on getInitialProps in `pages/index.js`
* Format JSX to be readable in `pages/_app.js`
* Remove needless line from `components/examples.js`
* Remove needless spaces in `lib/with-redux-store.js`
2018-05-15 09:49:07 +02:00
yhirano55 c762dc10d7 Add license section in with-pretty-url-routing [ci skip] (#4366) 2018-05-14 01:40:08 +02:00
yhirano55 f29d6671bf Update with-asset-imports [ci skip] (#4365)
* Add name, version, license to package.json
2018-05-14 00:29:39 +02:00
yhirano55 82e77a8838 Update ssr-caching example (#4363)
* Remove unnecessary dir key from next's argument
* Add license section to package.json
2018-05-14 00:00:37 +02:00
yhirano55 8512bf49f7 Update pass-server-data example [ci skip] (#4362)
* Update react, react-dom major version
* Add license section to package.json
* Use isomorphic-unfetch instead of isomorphic-fetch
2018-05-14 00:00:03 +02:00
Gaston Fartek 4f59c95149 updating with-redux-saga example (#4356) 2018-05-13 18:26:17 +02:00
yhirano55 af1082286e Fix class name in data-fetch example (#4358)
* Fixed class name in data-fetch example
* Removed needless empty lines
2018-05-13 18:12:03 +02:00
yhirano55 b2047de51a Update package.json in with-docker example (#4359)
* Added name, version, license keys.
2018-05-13 18:10:00 +02:00
yhirano55 8c5c2c23bb Update babel-plugin-module-resolver version in with-global-stylesheet (#4360)
I found build error, so I've updated babel-plugin-module-resolver
2018-05-13 18:09:25 +02:00
yhirano55 b3e47d19f8 Update README in with-global-stylesheet-simple [ci skip] (#4361)
Use https instead of http for tachyons URL
2018-05-13 18:08:44 +02:00
Petr Messner fa5c0b8a47 Fix example with-custom-babel-config: update to Babel 7 (#4349)
The option `"decoratorsLegacy": true` seems mandatory, fails without it:

> The new decorators proposal is not supported yet. You must pass the `"decoratorsLegacy": true` option to @babel/preset-stage-0
2018-05-13 00:47:56 +02:00
Tim Neutkens db29791cdc Merge branch 'master' into canary 2018-05-12 20:20:20 +02:00
Tim Neutkens 2c3f40600c Upgrade with-typescript to use latest next-typescript 2018-05-12 13:59:15 +02:00
Karthik Muralidharan 16ff96b107 rename; Clock.js to clock (#4342)
Fixes the compilation error : 

```
* ./clock in ./components/examples.js
ModuleNotFoundError: Module not found: Error: [CaseSensit
ivePathsPlugin] `/components/clock.js` does not matc
h the corresponding path on disk `Clock.js`.
```
2018-05-11 22:08:42 +02:00
Jason Leibowitz 126507cc1c Add Example of Redux Wrapper with Immutable.js (#4327)
* Add immutable redux example

* Updated readme

* Fix linting errors
2018-05-10 19:40:21 +02:00
Pascal Birchler 6b04b55354 Fix typo in next-with-apollo-auth test docs (#4328) 2018-05-10 19:02:29 +02:00
Andrew Razumovsky 0d4d7d840a [with-react-i18next] Fix flickering on page change via <Link /> (#4318)
* Fix flickering on page change via <Link />

* Remove process.browser check
2018-05-09 15:06:37 +02:00
Volker Rose aec4c00214 Update next-typescript to latest version 0.1.1 (#4176)
This example gave me 404s on `pages/*.tsx` when using it with the latest nextjs (`5.1.0`) and `@zeit/next-typescript@0.0.11`. The latest next-typescript plugin version fixes it.
2018-05-08 17:38:21 +02:00
Kirill Konshin 76f5e979b3 Support _app approach for upgraded Redux Wrapper (#4207)
* Support _app approach for upgraded Redux Wrapper

* Updated according to discussion

* Package.json versions
2018-05-08 14:57:41 +02:00
Michael Hsu 4b95725e09 fix(with-pkg): update pkg config for next.js (#4307)
* fix(with-pkg): update pkg config for next.js

* update docs
2018-05-08 11:52:52 +02:00
Jorge Cuadra 596bd21e33 Add eslint parser to avoid errors in IDE. (#4297) 2018-05-07 21:11:14 +02:00
Tim Neutkens 0697c289f8
Implement with-redux using _app.js (#4295)
* Simplify redux example

* Simplify redux example even more

* Remove empty space
2018-05-07 15:03:54 +02:00
Tim Neutkens 6c0091fb7a
Add new apollo example using _app.js (#4286)
* Add new apollo example

* Update readme

* Update with-apollo to use _app.js

* Move withData to _app

* Make SSR work again

* Remove withData

* Use HOC to provide apolloClient

* Spread pageprops
2018-05-07 15:02:56 +02:00
Tim Neutkens 6bc363e615
Fix with-jest example (#4278)
Fixes #4263
2018-05-05 05:36:59 -07:00
Tim Neutkens 3685c30fb4 Merge branch 'master' into canary 2018-05-05 14:23:05 +02:00
Michael Hsu 738376c812 Add docker example (#4261)
* Add docker example

* fix lint
2018-05-05 04:12:56 -07:00
Tim Phillips 08965008c6 Prevent now-env from running in production (#4259) 2018-05-04 22:14:59 -07:00
Tim Neutkens 62f9736ca3 Add basic export example 2018-05-01 19:06:06 -07:00
Tim Neutkens f1b9577210 Merge branch 'canary'
# Conflicts:
#	package.json
#	yarn.lock
2018-04-29 11:43:37 -07:00
Tony Kovanen 6158243339 with-reasonml: better setup (#4218)
With this setup we're compiling the .re/.ml files directly to source
directories with a .bs.js extension, and enabling next.js to pick up
that extension for pages.
2018-04-27 08:24:46 -07:00
Tony Kovanen f378448b79 with-reasonml: use default exports (#4217) 2018-04-26 20:35:30 -07:00
Tony Kovanen 2457df5d06 examples/with-reasonml: use bs-next for Next.Link (#4214)
Fixes #4028
2018-04-26 10:05:04 -07:00
Iago Dahlem Lorensini a0019b3dc9 Update broken link on with-redux-reselect-recompose example (#4209) 2018-04-25 09:29:48 -07:00
Tim Neutkens 0daf9beedc Add _app layout example 2018-04-24 12:31:26 -07:00
Tim Neutkens 326c84a730 Add readme for componentDidCatch example 2018-04-23 15:07:48 -07:00
Tim Neutkens 65c0014ad1 Add componentDidCatch example 2018-04-23 14:22:36 -07:00