-)
-
-export default flowRight([withLanguages, withUserAgent])(AboutPage)
diff --git a/examples/with-higher-order-component/pages/index.js b/examples/with-higher-order-component/pages/index.js
deleted file mode 100644
index 6e64db757511c..0000000000000
--- a/examples/with-higher-order-component/pages/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import flowRight from 'lodash.flowright'
-
-import { Nav } from '../components/Nav'
-import { withLanguages } from '../hocs/withLanguages'
-import { withUserAgent } from '../hocs/withUserAgent'
-
-const IndexPage = props => (
-
-
-
Index
-
{JSON.stringify(props, null, 2)}
-
-)
-
-export default flowRight([withLanguages, withUserAgent])(IndexPage)
diff --git a/examples/with-immutable-redux-wrapper/README.md b/examples/with-immutable-redux-wrapper/README.md
deleted file mode 100644
index ea68fcfcd7ef1..0000000000000
--- a/examples/with-immutable-redux-wrapper/README.md
+++ /dev/null
@@ -1,76 +0,0 @@
-# Immutable Redux Example
-
-Usually splitting your app state into `pages` feels natural but sometimes you'll want to have global state for your app. This is an example on how you can use redux that also works with our universal rendering approach. This is just a way you can do it but it's not the only one.
-
-> This example and documentation is based on the [with-redux-wrapper](https://github.com/zeit/next.js/tree/master/examples/with-redux-wrapper) example.
-
-## Deploy your own
-
-Deploy the example using [ZEIT Now](https://zeit.co/now):
-
-[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/with-immutable-redux-wrapper)
-
-## How to use
-
-### Using `create-next-app`
-
-Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
-
-```bash
-npm init next-app --example with-immutable-redux-wrapper with-immutable-redux-wrapper-app
-# or
-yarn create next-app --example with-immutable-redux-wrapper with-immutable-redux-wrapper-app
-```
-
-### Download manually
-
-Download the example:
-
-```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-immutable-redux-wrapper
-cd with-immutable-redux-wrapper
-```
-
-Install it and run:
-
-```bash
-npm install
-npm run dev
-# or
-yarn
-yarn dev
-```
-
-Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
-
-## Notes
-
-In the first example we are going to display a digital clock that updates every second. The first render is happening in the server and then the browser will take over. To illustrate this, the server rendered clock will have a different background color than the client one.
-
-![](http://i.imgur.com/JCxtWSj.gif)
-
-Our page is located at `pages/index.js` so it will map the route `/`. To get the initial data for rendering we are implementing the static method `getInitialProps`, initializing the redux store and dispatching the required actions until we are ready to return the initial state to be rendered. Since the component is wrapped with `next-redux-wrapper`, the component is automatically connected to Redux and wrapped with `react-redux Provider`, that allows us to access redux state immediately and send the store down to children components so they can access to the state when required.
-
-For safety it is recommended to wrap all pages, no matter if they use Redux or not, so that you should not care about it anymore in all child components.
-
-`withRedux` function accepts `makeStore` as first argument, all other arguments are internally passed to `react-redux connect()` function. `makeStore` function will receive initialState as one argument and should return a new instance of redux store each time when called, no memoization needed here. See the [full example](https://github.com/kirill-konshin/next-redux-wrapper#usage) in the Next Redux Wrapper repository. And there's another package [next-connect-redux](https://github.com/huzidaha/next-connect-redux) available with similar features.
-
-To pass the initial state from the server to the client we pass it as a prop called `initialState` so then it's available when the client takes over.
-
-The trick here for supporting universal redux is to separate the cases for the client and the server. When we are on the server we want to create a new store every time, otherwise different users data will be mixed up. If we are in the client we want to use always the same store. That's what we accomplish on `store.js`
-
-The clock, under `components/Clock.js`, has access to the state using the `connect` function from `react-redux`. In this case Clock is a direct child from the page but it could be deep down the render tree.
-
-The second example, under `components/AddCount.js`, shows a simple add counter function with a class component implementing a common redux pattern of mapping state and props. Again, the first render is happening in the server and instead of starting the count at 0, it will dispatch an action in redux that starts the count at 1. This continues to highlight how each navigation triggers a server render first and then a client render second, when you navigate between pages.
-
-For simplicity and readability, Reducers, Actions, and Store creators are all in the same file: `store.js`
-
-## What changed with immutable-redux-wrapper
-
-Immutability can bring increased performance to your app, and leads to simpler programming and debugging, as data that never changes is easier to reason about than data that is free to be changed arbitrarily throughout your app.
-
-In fact, Redux requires your state to be immutable. You do not have to use Immutable.JS as regular JavaScript, when written correctly, is perfectly capable of providing immutability on its own. However, guaranteeing immutability with JavaScript is difficult, and it can be easy to mutate an object accidentally, causing both bugs in your app that are extremely difficult to locate. For this reason, using an immutable update library such as Immutable.JS can significantly improve the reliability of your app and make your app's development much easier.
-
-[Read more](https://redux.js.org/faq/immutable-data#what-approaches-are-there-for-handling-data-immutability-do-i-have-to-use-immutable-js) about the importance of immutability in Redux here.
-
-This example wraps the exiting with-redux-wrapper example in Immutable.JS and displays how to pass immutable data from state to components.
diff --git a/examples/with-immutable-redux-wrapper/components/AddCount.js b/examples/with-immutable-redux-wrapper/components/AddCount.js
deleted file mode 100644
index d634a028da267..0000000000000
--- a/examples/with-immutable-redux-wrapper/components/AddCount.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* eslint-disable */
-import React, { Component } from 'react'
-import { connect } from 'react-redux'
-import { bindActionCreators } from 'redux'
-import { addCount } from '../store'
-
-class AddCount extends Component {
- add = () => {
- this.props.addCount()
- }
-
- render() {
- const { count } = this.props
- return (
-
-`;
diff --git a/examples/with-ioc/__tests__/blog.page_with_provide.test.js b/examples/with-ioc/__tests__/blog.page_with_provide.test.js
deleted file mode 100644
index 2bccaa4f2bfea..0000000000000
--- a/examples/with-ioc/__tests__/blog.page_with_provide.test.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* eslint-env jest */
-
-/*
- * Testing pages with @provide decorator:
- *
- * Snapshots – as usual
- *
- * Shallow rendering – need to `.dive()` one level deep,
- * as with any High Order Component.
- * Also `.html()` may cause havoc when it'd try to expand the render
- * but won't inject context since top level co,ponent has been rendered already.
- * This problem is not unique to IoC though, anything that relies on context (i.e. Redux)
- * is facing the same issue. Use `.debug()` or `mount()` instead
- */
-
-import { shallow } from 'enzyme'
-import React from 'react'
-import renderer from 'react-test-renderer'
-
-import App from '../pages/blog.js'
-
-describe('With Enzyme', () => {
- it('Blog renders components', () => {
- const app = shallow().dive()
- expect(app.find('h1').text()).toEqual('Hi There!')
- })
-})
-
-describe('With Snapshot Testing', () => {
- it('Blog renders components', () => {
- const component = renderer.create()
- const tree = component.toJSON()
- expect(tree).toMatchSnapshot()
- })
-})
diff --git a/examples/with-ioc/__tests__/endpoint.component_with_inject.test.js b/examples/with-ioc/__tests__/endpoint.component_with_inject.test.js
deleted file mode 100644
index 1c33af1eb0b06..0000000000000
--- a/examples/with-ioc/__tests__/endpoint.component_with_inject.test.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* eslint-env jest */
-
-/*
- * Individual component testing is pretty simple
- * just provide your dependencies as props
- * and add `.dive()` step to your shallow render,
- * as with any High Order Component.
- *
- * Remarks about `.html()` may apply,
- * depending if any of the children components
- * expect anything from the context
- */
-
-import { shallow } from 'enzyme'
-import React from 'react'
-import renderer from 'react-test-renderer'
-
-import Component from '../components/endpoint.js'
-
-describe('With Enzyme', () => {
- it('Component renders with props', () => {
- // no need to mock Link component much for shallow rendering
- const injected = shallow( {}} />)
- const component = injected.dive()
- expect(component.find('h3').text()).toEqual('Endpoint')
- expect(
- component
- .find('Link')
- .first()
- .find('a')
- .text()
- ).toEqual('About: foo baz')
- })
-})
-
-describe('With Snapshot Testing', () => {
- it('Blog renders components', () => {
- const component = renderer.create(
- (
-
-)
diff --git a/examples/with-ioc/routes.js b/examples/with-ioc/routes.js
deleted file mode 100644
index 41ea20d1ba823..0000000000000
--- a/examples/with-ioc/routes.js
+++ /dev/null
@@ -1,5 +0,0 @@
-const nextRoutes = require('next-routes')
-const routes = (module.exports = nextRoutes())
-
-routes.add('blog', '/blog/:slug')
-routes.add('about', '/about-us/:foo(bar|baz)')
diff --git a/examples/with-ioc/server.js b/examples/with-ioc/server.js
deleted file mode 100644
index 9cd10606b1fdb..0000000000000
--- a/examples/with-ioc/server.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const { createServer } = require('http')
-const next = require('next')
-const routes = require('./routes')
-
-const port = parseInt(process.env.PORT, 10) || 3000
-const dev = process.env.NODE_ENV !== 'production'
-const app = next({ dev })
-const handler = routes.getRequestHandler(app)
-
-app.prepare().then(() => {
- createServer(handler).listen(port, err => {
- if (err) throw err
- console.log(`> Ready on http://localhost:${port}`)
- })
-})
diff --git a/examples/with-kea/.babelrc b/examples/with-kea/.babelrc
deleted file mode 100644
index 8a6b29925cab7..0000000000000
--- a/examples/with-kea/.babelrc
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "presets": [
- "next/babel"
- ],
- "plugins": [
- ["@babel/plugin-proposal-decorators", { "legacy": true }]
- ]
-}
diff --git a/examples/with-kea/pages/_app.js b/examples/with-kea/pages/_app.js
index 5c80d4e015abb..f842a4e7d1341 100644
--- a/examples/with-kea/pages/_app.js
+++ b/examples/with-kea/pages/_app.js
@@ -1,24 +1,16 @@
import React from 'react'
import { Provider } from 'react-redux'
-import App from 'next/app'
import withRedux from 'next-redux-wrapper'
import { initStore } from '../store'
-@withRedux(initStore, { debug: process.env.NODE_ENV === 'development' })
-export default class MyApp extends App {
- static async getInitialProps({ Component, ctx }) {
- const pageProps = Component.getInitialProps
- ? await Component.getInitialProps(ctx)
- : {}
- return { pageProps }
- }
-
- render() {
- const { Component, pageProps, store } = this.props
- return (
-
-
-
- )
- }
+function MyApp({ Component, pageProps, store }) {
+ return (
+
+
+
+ )
}
+
+export default withRedux(initStore, {
+ debug: process.env.NODE_ENV === 'development',
+})(MyApp)
diff --git a/examples/with-mobx-keystone-typescript/.babelrc b/examples/with-mobx-keystone-typescript/.babelrc
deleted file mode 100644
index 1bbd4ca8f2cd9..0000000000000
--- a/examples/with-mobx-keystone-typescript/.babelrc
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "presets": ["next/babel"],
- "plugins": [["@babel/plugin-proposal-decorators", { "legacy": true }]]
-}
diff --git a/examples/with-mobx-keystone-typescript/README.md b/examples/with-mobx-keystone-typescript/README.md
deleted file mode 100644
index 780048de3dbb2..0000000000000
--- a/examples/with-mobx-keystone-typescript/README.md
+++ /dev/null
@@ -1,108 +0,0 @@
-# mobx-keystone example
-
-Usually splitting your app state into `pages` feels natural but sometimes you'll want to have global state for your app. This is an example on how you can use mobx that also works with our universal rendering approach. This is just a way you can do it but it's not the only one.
-
-## Deploy your own
-
-Deploy the example using [ZEIT Now](https://zeit.co/now):
-
-[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/with-mobx-keystone-typescript)
-
-## How to use
-
-### Using `create-next-app`
-
-Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
-
-```bash
-npm init next-app --example with-mobx-keystone-typescript with-mobx-keystone-typescript-app
-# or
-yarn create next-app --example with-mobx-keystone-typescript with-mobx-keystone-typescript-app
-```
-
-### Download manually
-
-Download the example [or clone the repo](https://github.com/zeit/next.js):
-
-```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-mobx-keystone-typescript
-cd with-mobx-keystone-typescript
-```
-
-Install it and run:
-
-```bash
-npm install
-npm run dev
-# or
-yarn
-yarn dev
-```
-
-Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
-
-## Notes
-
-This example is a typescript and mobx-keysone port of the [with-redux](https://github.com/zeit/next.js/tree/master/examples/with-redux) example. MobX support has been implemented using React Hooks. Decorator support is activated by adding a `.babelrc` file at the root of the project:
-
-```json
-{
- "presets": ["next/babel"],
- "plugins": ["transform-decorators-legacy"]
-}
-```
-
-In this example we are going to display a digital clock that updates every second. The first render is happening in the server and then the browser will take over. To illustrate this, the server rendered clock will have a different background color than the client one.
-
-![](http://i.imgur.com/JCxtWSj.gif)
-
-Our page is located at `pages/index.tsx` so it will map the route `/`. To get the initial data for rendering we are implementing the static method `getInitialProps`, initializing the `mobx-keystone` store and returning the initial timestamp to be rendered. The root component for the render method is a React context provider that allows us to send the store down to children components so they can access to the state when required.
-
-To pass the initial timestamp from the server to the client we pass it as a prop called `lastUpdate` so then it's available when the client takes over.
-
-## Implementation
-
-The trick here for supporting universal mobx is to separate the cases for the client and the server. When we are on the server we want to create a new store every time, otherwise different users data will be mixed up. If we are in the client we want to use always the same store. That's what we accomplish on `store.ts`
-
-After initializing the store (and possibly making changes such as fetching data), `getInitialProps` must stringify the store in order to pass it as props to the client. `mobx-keystone` comes out of the box with a handy method for doing this called `getSnapshot`. The snapshot is passed down to `StoreProvider` via `snapshot` prop where it's used to rehydrate `RootStore` and provide context with `StoreContext`
-
-```tsx
-export const StoreContext = createContext(null)
-
-export const StoreProvider: FC<{ snapshot?: SnapshotInOf }> = ({
- children,
- snapshot,
-}) => {
- const [ctxStore] = useState(() => initStore(snapshot))
- return (
- {children}
- )
-}
-```
-
-The store is accessible at any depth by using the StoreContext or `useStore` hook
-
-```tsx
-export function useStore() {
- const store = useContext(StoreContext)
-
- if (!store) {
- // this is especially useful in TypeScript so you don't need to be checking for null all the time
- throw new Error('useStore must be used within a StoreProvider.')
- }
-
- return store
-}
-```
-
-The clock, under `components/Clock.tsx`, reacts to changes in the observable `store` by means of the `useObserver` hook.
-
-```tsx
-
+ )
+}
diff --git a/examples/with-overmind/pages/index.js b/examples/with-overmind/pages/index.js
index 8d340ede3e3a8..97767e5bf571c 100644
--- a/examples/with-overmind/pages/index.js
+++ b/examples/with-overmind/pages/index.js
@@ -4,38 +4,35 @@ import { config } from '../overmind'
import Header from '../components/Header'
import Items from '../components/Items'
-class Index extends React.Component {
- static async getInitialProps() {
- // If we want to produce some mutations we do so by instantiating
- // an Overmind SSR instance, do whatever datafetching is needed and
- // change the state directly. We return the mutations performed with
- // "hydrate"
- const overmind = createOvermindSSR(config)
+export async function getStaticProps() {
+ // If we want to produce some mutations we do so by instantiating
+ // an Overmind SSR instance, do whatever datafetching is needed and
+ // change the state directly. We return the mutations performed with
+ // "hydrate"
+ const overmind = createOvermindSSR(config)
- overmind.state.page = 'Index'
- overmind.state.items = [
- {
- id: 0,
- title: 'foo',
- },
- {
- id: 1,
- title: 'bar',
- },
- ]
+ overmind.state.page = 'Index'
+ overmind.state.items = [
+ {
+ id: 0,
+ title: 'foo',
+ },
+ {
+ id: 1,
+ title: 'bar',
+ },
+ ]
- return {
- mutations: overmind.hydrate(),
- }
- }
- render() {
- return (
-
+ )
}
}
diff --git a/examples/with-react-useragent/README.md b/examples/with-react-useragent/README.md
deleted file mode 100644
index 153d3efc88129..0000000000000
--- a/examples/with-react-useragent/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# react-useragent example
-
-This example shows how to add user-agent awarness to your next.js app and set it up for server side rendering using [@quentin-sommer/react-useragent](https://github.com/quentin-sommer/react-useragent). It will enable you to directly detect the device from the server side.
-
-You can then decide what to render depending on the device. For example:
-
-- Smaller image for phones
-- Dedicated download button fos iOS devices.
-
-The example uses the `pages/_app.js` file to automatically inject user-agent detection in all your pages.
-
-## Deploy your own
-
-Deploy the example using [ZEIT Now](https://zeit.co/now):
-
-[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/with-react-useragent)
-
-## How to use
-
-### Using `create-next-app`
-
-Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
-
-```bash
-npm init next-app --example with-react-useragent with-react-useragent-app
-# or
-yarn create next-app --example with-react-useragent with-react-useragent-app
-```
-
-### Download manually
-
-Download the example:
-
-```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-useragent
-cd with-react-useragent
-```
-
-Install it and run:
-
-```bash
-npm install
-npm run dev
-# or
-yarn
-yarn dev
-```
-
-Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
diff --git a/examples/with-react-useragent/package.json b/examples/with-react-useragent/package.json
deleted file mode 100644
index 61039516ba69b..0000000000000
--- a/examples/with-react-useragent/package.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "with-react-useragent",
- "version": "1.0.0",
- "scripts": {
- "dev": "next",
- "build": "next build",
- "start": "next start"
- },
- "dependencies": {
- "@quentin-sommer/react-useragent": "2.0.0",
- "next": "latest",
- "react": "^16.7.0",
- "react-dom": "^16.7.0"
- },
- "license": "ISC"
-}
diff --git a/examples/with-react-useragent/pages/_app.js b/examples/with-react-useragent/pages/_app.js
deleted file mode 100644
index 02904928f4a4b..0000000000000
--- a/examples/with-react-useragent/pages/_app.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import React from 'react'
-import App from 'next/app'
-import { UserAgentProvider } from '@quentin-sommer/react-useragent'
-
-const PageWrapper = Comp =>
- class extends React.Component {
- /*
- * Need to use args.ctx
- * See https://github.com/zeit/next.js#custom-document
- */
- static async getInitialProps(args) {
- return {
- ua: args.ctx.req
- ? args.ctx.req.headers['user-agent']
- : navigator.userAgent,
- ...(Comp.getInitialProps ? await Comp.getInitialProps(args) : null),
- }
- }
-
- render() {
- const { ua, ...props } = this.props
- return (
-
-
-
- )
- }
- }
-
-class MyApp extends App {
- render() {
- const { Component, pageProps } = this.props
- return
- }
-}
-
-export default PageWrapper(MyApp)
diff --git a/examples/with-react-useragent/pages/index.js b/examples/with-react-useragent/pages/index.js
deleted file mode 100644
index a64daeb4b6955..0000000000000
--- a/examples/with-react-useragent/pages/index.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import React, { Component } from 'react'
-import { UserAgent } from '@quentin-sommer/react-useragent'
-
-class Index extends Component {
- render() {
- return (
-
-
- The following texts render conditionally depending of your user-agent,
- try visiting with another device or using the chrome dev tools device
- emulator !
-
- )
- }
-}
-
-export default Index
diff --git a/examples/with-react-uwp/README.md b/examples/with-react-uwp/README.md
deleted file mode 100644
index 3db8104a06ca0..0000000000000
--- a/examples/with-react-uwp/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# React-UWP example
-
-This example features how you use [react-uwp](https://github.com/myxvisual/react-uwp) (React Components that Implement Microsoft's UWP Design & Fluent Design.) with Next.js.
-
-## Deploy your own
-
-Deploy the example using [ZEIT Now](https://zeit.co/now):
-
-[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/with-react-uwp)
-
-## How to use
-
-### Using `create-next-app`
-
-Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
-
-```bash
-npm init next-app --example with-react-uwp with-react-uwp-app
-# or
-yarn create next-app --example with-react-uwp with-react-uwp-app
-```
-
-### Download manually
-
-Download the example:
-
-```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-react-uwp
-cd with-react-uwp
-```
-
-Install it and run:
-
-```bash
-npm install
-npm run dev
-# or
-yarn
-yarn dev
-```
-
-Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
diff --git a/examples/with-react-uwp/components/ThemeWrapper.js b/examples/with-react-uwp/components/ThemeWrapper.js
deleted file mode 100644
index bd8a4e918351c..0000000000000
--- a/examples/with-react-uwp/components/ThemeWrapper.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import React, { Component } from 'react'
-import Theme from 'react-uwp/Theme'
-
-export class ThemeWrapper extends Component {
- render() {
- const { children, style, ...props } = this.props
- return (
-
- {children}
-
- )
- }
-}
-
-export default ThemeWrapper
diff --git a/examples/with-react-uwp/package.json b/examples/with-react-uwp/package.json
deleted file mode 100644
index 510fea0311c22..0000000000000
--- a/examples/with-react-uwp/package.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "with-react-uwp",
- "version": "1.0.0",
- "dependencies": {
- "babel-core": "^6.25.0",
- "next": "latest",
- "react": "^16.7.0",
- "react-dom": "^16.7.0",
- "react-uwp": "^1.0.9"
- },
- "scripts": {
- "dev": "next",
- "build": "next build",
- "start": "next start"
- }
-}
diff --git a/examples/with-react-uwp/pages/_document.js b/examples/with-react-uwp/pages/_document.js
deleted file mode 100644
index e20bdcc328384..0000000000000
--- a/examples/with-react-uwp/pages/_document.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import React from 'react'
-import PropTypes from 'prop-types'
-import Document, { Head, Main, NextScript } from 'next/document'
-
-export default class MyDocument extends Document {
- static getInitialProps({ renderPage }) {
- const { html, head, errorHtml, chunks } = renderPage()
- return { html, head, errorHtml, chunks }
- }
-
- static contextTypes = { theme: PropTypes.object }
-
- render() {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
- )
- }
-}
diff --git a/examples/with-react-uwp/pages/index.js b/examples/with-react-uwp/pages/index.js
deleted file mode 100644
index 654f4369ec1be..0000000000000
--- a/examples/with-react-uwp/pages/index.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import React, { Component } from 'react'
-import PropTypes from 'prop-types'
-
-import ThemeWrapper from '../components/ThemeWrapper'
-import getTheme from 'react-uwp/styles/getTheme'
-
-import { Button, ColorPicker, DatePicker, ProgressRing } from 'react-uwp'
-
-class Index extends Component {
- static async getInitialProps({ req }) {
- let userAgent
- if (typeof window !== 'undefined') {
- userAgent = navigator.userAgent
- } else {
- userAgent = req.headers['user-agent']
- }
-
- return { userAgent }
- }
- static contextTypes = { theme: PropTypes.object }
-
- render() {
- const { userAgent } = this.props
- return (
-
-
-
-
-
-
{userAgent.slice(12)}...
-
- )
- }
-}
-
-export default Index
diff --git a/examples/with-recompose/.babelrc b/examples/with-recompose/.babelrc
deleted file mode 100644
index e418f04c7780e..0000000000000
--- a/examples/with-recompose/.babelrc
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "presets": ["next/babel"],
- "plugins": [
- ["lodash", { "id": ["lodash", "recompose"] }]
- ]
-}
diff --git a/examples/with-recompose/README.md b/examples/with-recompose/README.md
deleted file mode 100644
index 04317f1c4640e..0000000000000
--- a/examples/with-recompose/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# Recompose example
-
-This example show how to use [Recompose](https://github.com/acdlite/recompose) to wrap page components using High Order Components and use `getInitialProps` without worries.
-
-It also configure Babel to change our recompose imports so we're going to actually import only the functions we need and reduce the bundle size.
-
-## Deploy your own
-
-Deploy the example using [ZEIT Now](https://zeit.co/now):
-
-[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/with-recompose)
-
-## How to use
-
-### Using `create-next-app`
-
-Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
-
-```bash
-npm init next-app --example with-recompose with-recompose-app
-# or
-yarn create next-app --example with-recompose with-recompose-app
-```
-
-### Download manually
-
-Download the example:
-
-```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-recompose
-cd with-recompose
-```
-
-Install it and run:
-
-```bash
-npm install
-npm run dev
-# or
-yarn
-yarn dev
-```
-
-Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
diff --git a/examples/with-recompose/package.json b/examples/with-recompose/package.json
deleted file mode 100644
index de0a4d91cded2..0000000000000
--- a/examples/with-recompose/package.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "scripts": {
- "dev": "next",
- "build": "next build",
- "start": "next start"
- },
- "dependencies": {
- "babel-plugin-lodash": "^3.2.11",
- "next": "latest",
- "react": "^16.7.0",
- "react-dom": "^16.7.0",
- "recompose": "^0.24.0"
- }
-}
diff --git a/examples/with-recompose/pages/index.js b/examples/with-recompose/pages/index.js
deleted file mode 100644
index 81b5dac96e27c..0000000000000
--- a/examples/with-recompose/pages/index.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import { compose, withState, setStatic } from 'recompose'
-
-// the setStatic HOC allow us to define the getInitialProps props to the enhanced component
-// it needs to be at the top of the compose
-const enhance = compose(
- // set the static async method getInitialProps
- setStatic('getInitialProps', async ({ req }) => {
- const isServer = !!req
- // log if we're server or client side
- if (isServer) console.log('from server')
- else console.log('from client')
- // return a prop to know if we're server or client side
- return { isServer }
- }),
- withState('counter', 'setCounter', 0)
-)
-
-// our enhanced page component
-export default enhance(({ counter, setCounter, isServer }) => (
-
-))
diff --git a/examples/with-redux-reselect-recompose/.gitignore b/examples/with-redux-reselect-recompose/.gitignore
deleted file mode 100644
index b512c09d47662..0000000000000
--- a/examples/with-redux-reselect-recompose/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
\ No newline at end of file
diff --git a/examples/with-redux-reselect-recompose/README.md b/examples/with-redux-reselect-recompose/README.md
deleted file mode 100644
index a8ce68377be0f..0000000000000
--- a/examples/with-redux-reselect-recompose/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# Redux with reselect and recompose example
-
-This example is based on the great work of [with-redux](https://github.com/zeit/next.js/blob/master/examples/with-redux/) example with the addition of [reselect](https://github.com/reactjs/reselect) and [recompose](https://github.com/acdlite/recompose)
-
-## Deploy your own
-
-Deploy the example using [ZEIT Now](https://zeit.co/now):
-
-[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/with-redux-reselect-recompose)
-
-## How to use
-
-### Using `create-next-app`
-
-Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
-
-```bash
-npm init next-app --example with-redux-reselect-recompose with-redux-reselect-recompose-app
-# or
-yarn create next-app --example with-redux-reselect-recompose with-redux-reselect-recompose-app
-```
-
-### Download manually
-
-Download the example:
-
-```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-redux-reselect-recompose
-cd with-redux-reselect-recompose
-```
-
-Install it and run:
-
-```bash
-npm install
-npm run dev
-# or
-yarn
-yarn dev
-```
-
-Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
diff --git a/examples/with-redux-reselect-recompose/actions/index.js b/examples/with-redux-reselect-recompose/actions/index.js
deleted file mode 100644
index b9a0bd87aa04a..0000000000000
--- a/examples/with-redux-reselect-recompose/actions/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import { TICK, ADD } from '../constants/actionTypes'
-
-export const addCount = () => ({ type: ADD })
-
-export const setClock = (light, ts) => ({ type: TICK, light, ts })
-
-export const serverRenderClock = isServer => dispatch =>
- dispatch(setClock(!isServer, Date.now()))
-
-export const startClock = () => dispatch =>
- setInterval(() => dispatch(setClock(true, Date.now())), 800)
diff --git a/examples/with-redux-reselect-recompose/components/addCount.js b/examples/with-redux-reselect-recompose/components/addCount.js
deleted file mode 100644
index b9f84c7793bd1..0000000000000
--- a/examples/with-redux-reselect-recompose/components/addCount.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import PropTypes from 'prop-types'
-import { compose, setDisplayName, pure, setPropTypes } from 'recompose'
-
-const AddCount = ({ count, addCount }) => (
-
-)
-
-export default compose(
- setDisplayName('Clock'),
- setPropTypes({
- lastUpdate: PropTypes.number,
- light: PropTypes.bool,
- }),
- pure
-)(Clock)
diff --git a/examples/with-redux-reselect-recompose/components/page.js b/examples/with-redux-reselect-recompose/components/page.js
deleted file mode 100644
index e35e353d0ac60..0000000000000
--- a/examples/with-redux-reselect-recompose/components/page.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import PropTypes from 'prop-types'
-import Link from 'next/link'
-import { compose, setDisplayName, pure, setPropTypes } from 'recompose'
-import Clock from './clock'
-import AddCount from './addCount'
-
-const Page = ({ title, linkTo, light, lastUpdate, count, addCount }) => (
-
-
{title}
-
-
-
-
-)
-
-export default compose(
- setDisplayName('Page'),
- setPropTypes({
- title: PropTypes.string,
- linkTo: PropTypes.string,
- light: PropTypes.bool,
- lastUpdate: PropTypes.number,
- count: PropTypes.number,
- addCount: PropTypes.func,
- }),
- pure
-)(Page)
diff --git a/examples/with-redux-reselect-recompose/constants/actionTypes.js b/examples/with-redux-reselect-recompose/constants/actionTypes.js
deleted file mode 100644
index bd6338c5e0c60..0000000000000
--- a/examples/with-redux-reselect-recompose/constants/actionTypes.js
+++ /dev/null
@@ -1,2 +0,0 @@
-export const ADD = 'ADD'
-export const TICK = 'TICK'
diff --git a/examples/with-redux-reselect-recompose/containers/page.js b/examples/with-redux-reselect-recompose/containers/page.js
deleted file mode 100644
index 61d14592bd041..0000000000000
--- a/examples/with-redux-reselect-recompose/containers/page.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import { connect } from 'react-redux'
-import { createSelector } from 'reselect'
-import { compose, setDisplayName, pure } from 'recompose'
-import { addCount } from '../actions'
-import { selectLight, selectLastUpdate, selectCount } from '../selectors'
-import Page from '../components/page'
-
-export default compose(
- setDisplayName('PageContainer'),
- connect(
- createSelector(
- selectLight(),
- selectLastUpdate(),
- selectCount(),
- (light, lastUpdate, count) => ({ light, lastUpdate, count })
- ),
- { addCount }
- ),
- pure
-)(Page)
diff --git a/examples/with-redux-reselect-recompose/package.json b/examples/with-redux-reselect-recompose/package.json
deleted file mode 100644
index 037661913f6f3..0000000000000
--- a/examples/with-redux-reselect-recompose/package.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "with-redux-reselect-recompose",
- "version": "1.0.0",
- "scripts": {
- "dev": "next",
- "build": "next build",
- "start": "next start"
- },
- "dependencies": {
- "next": "latest",
- "next-redux-wrapper": "^1.0.0",
- "prop-types": "^15.5.10",
- "react": "^16.7.0",
- "react-dom": "^16.7.0",
- "react-redux": "^5.0.1",
- "recompose": "^0.23.5",
- "redux": "^3.6.0",
- "redux-logger": "^3.0.6",
- "redux-thunk": "^2.2.0",
- "reselect": "^3.0.1"
- },
- "author": "Phuc Nguyen Hoang",
- "license": "MIT"
-}
diff --git a/examples/with-redux-reselect-recompose/pages/index.js b/examples/with-redux-reselect-recompose/pages/index.js
deleted file mode 100644
index ed5827c299171..0000000000000
--- a/examples/with-redux-reselect-recompose/pages/index.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import withRedux from 'next-redux-wrapper'
-import { compose, setDisplayName, pure, lifecycle, withProps } from 'recompose'
-import { startClock, addCount, serverRenderClock } from '../actions'
-import Page from '../containers/page'
-import initStore from '../store'
-
-const Counter = compose(
- setDisplayName('IndexPage'),
- withProps({
- title: 'Index page',
- linkTo: '/other',
- }),
- lifecycle({
- componentDidMount() {
- this.timer = this.props.startClock()
- },
- componentWillUnmount() {
- clearInterval(this.timer)
- },
- }),
- pure
-)(Page)
-
-Counter.getInitialProps = ({ store, isServer }) => {
- store.dispatch(serverRenderClock(isServer))
- store.dispatch(addCount())
- return { isServer }
-}
-
-export default withRedux(initStore, null, { startClock })(Counter)
diff --git a/examples/with-redux-reselect-recompose/pages/other.js b/examples/with-redux-reselect-recompose/pages/other.js
deleted file mode 100644
index 455f9deece04a..0000000000000
--- a/examples/with-redux-reselect-recompose/pages/other.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import withRedux from 'next-redux-wrapper'
-import { compose, setDisplayName, pure, lifecycle, withProps } from 'recompose'
-import { startClock, addCount, serverRenderClock } from '../actions'
-import Page from '../containers/page'
-import initStore from '../store'
-
-const Counter = compose(
- setDisplayName('OtherPage'),
- withProps({
- title: 'Other page',
- linkTo: '/',
- }),
- lifecycle({
- componentDidMount() {
- this.timer = this.props.startClock()
- },
- componentWillUnmount() {
- clearInterval(this.timer)
- },
- }),
- pure
-)(Page)
-
-Counter.getInitialProps = ({ store, isServer }) => {
- store.dispatch(serverRenderClock(isServer))
- store.dispatch(addCount())
- return { isServer }
-}
-
-export default withRedux(initStore, null, { startClock })(Counter)
diff --git a/examples/with-redux-reselect-recompose/reducers/count.js b/examples/with-redux-reselect-recompose/reducers/count.js
deleted file mode 100644
index db9642a759c5a..0000000000000
--- a/examples/with-redux-reselect-recompose/reducers/count.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import { ADD, TICK } from '../constants/actionTypes'
-
-export const initialState = {
- lastUpdate: 0,
- light: false,
- count: 0,
-}
-
-export default (state = initialState, action) => {
- const { type, ts, light } = action
-
- switch (type) {
- case TICK: {
- return Object.assign({}, state, {
- lastUpdate: ts,
- light: !!light,
- })
- }
-
- case ADD: {
- return Object.assign({}, state, {
- count: state.count + 1,
- })
- }
-
- default: {
- return state
- }
- }
-}
diff --git a/examples/with-redux-reselect-recompose/reducers/index.js b/examples/with-redux-reselect-recompose/reducers/index.js
deleted file mode 100644
index cf5750d72fb1b..0000000000000
--- a/examples/with-redux-reselect-recompose/reducers/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import { combineReducers } from 'redux'
-import count, { initialState as countState } from './count'
-
-export const initialState = {
- count: countState,
-}
-
-export default combineReducers({
- count,
-})
diff --git a/examples/with-redux-reselect-recompose/selectors/index.js b/examples/with-redux-reselect-recompose/selectors/index.js
deleted file mode 100644
index 985ab093ae896..0000000000000
--- a/examples/with-redux-reselect-recompose/selectors/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { createSelector } from 'reselect'
-
-export const selectState = () => state => state.count
-
-export const selectCount = () =>
- createSelector(selectState(), count => count.count)
-
-export const selectLight = () =>
- createSelector(selectState(), count => count.light)
-
-export const selectLastUpdate = () =>
- createSelector(selectState(), count => count.lastUpdate)
diff --git a/examples/with-redux-reselect-recompose/store.js b/examples/with-redux-reselect-recompose/store.js
deleted file mode 100644
index 172519b40f3b0..0000000000000
--- a/examples/with-redux-reselect-recompose/store.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import thunkMiddleware from 'redux-thunk'
-import { createStore, applyMiddleware, compose } from 'redux'
-import { createLogger } from 'redux-logger'
-import reducer, { initialState } from './reducers'
-
-export default (state = initialState) => {
- const middlewares = [thunkMiddleware, createLogger()]
- return createStore(reducer, state, compose(applyMiddleware(...middlewares)))
-}
diff --git a/examples/with-refnux/README.md b/examples/with-refnux/README.md
deleted file mode 100644
index 79c2475b047bc..0000000000000
--- a/examples/with-refnux/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-# Refnux example
-
-This example, just like `with-redux` and `with-mobx` examples, shows how to manage a global state in your web-application.
-In this case we are using [refnux](https://github.com/algesten/refnux) which is an alternative, simpler, purely functional store state manager.
-
-## Deploy your own
-
-Deploy the example using [ZEIT Now](https://zeit.co/now):
-
-[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/next.js/tree/canary/examples/with-refnux)
-
-## How to use
-
-### Using `create-next-app`
-
-Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
-
-```bash
-npm init next-app --example with-refnux with-refnux-app
-# or
-yarn create next-app --example with-refnux with-refnux-app
-```
-
-### Download manually
-
-Download the example:
-
-```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-refnux
-cd with-refnux
-```
-
-Install it and run:
-
-```bash
-npm install
-npm run dev
-# or
-yarn
-yarn dev
-```
-
-Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
-
-## Notes
-
-We have two very similar pages (page1.js, page2.js). They both
-
-- show the current application state, including a simple counter value
-- have a link to jump from one page to the other
-- have an 'increment' button to increment the state of the counter
- (it triggers the `counterIncrement` action)
-
-When running the example, please, increment the counter and note how moving from page 1 to page 2 and back the state is persisted.
-Reloading any of the pages will restore the initial state coming from the server.
-
-### Implementation details
-
-Each page uses `withRefnux` helper which wraps the page in a Provider component.
-Page components are connected to the state using refnux `connect` function.
-
-In the `store/` directory you can see a simple implmentation of
-
-- a `getInitialstate` function that returns the initial state of the store. It's used only on SSR
-- a `counterIncrement` action that increments the counter state whe user pushes the corresponding button
-- a `setTitle` action that's used to set page title during pages `getInitialProps`
-
-If you have any comment / question / pull requests please refer to the [original repository](https://github.com/davibe/next.js-example-with-refnux) where this example is developed and maintained.
diff --git a/examples/with-refnux/helpers/getStore.js b/examples/with-refnux/helpers/getStore.js
deleted file mode 100644
index d99b710915afc..0000000000000
--- a/examples/with-refnux/helpers/getStore.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import { createStore } from 'refnux'
-
-let storeMemoized = null
-
-const getStore = initialState => {
- let store = null
- if (typeof window === 'undefined') {
- store = createStore(initialState)
- } else {
- if (!storeMemoized) {
- storeMemoized = createStore(initialState)
- }
- store = storeMemoized
- }
- return store
-}
-
-export default getStore
diff --git a/examples/with-refnux/helpers/withRefnux.js b/examples/with-refnux/helpers/withRefnux.js
deleted file mode 100644
index 0107d12580555..0000000000000
--- a/examples/with-refnux/helpers/withRefnux.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import { Provider } from 'refnux'
-import getStore from './getStore'
-
-// The `withRefnux` "decorator"
-// - wraps the given Component in a refnux Provider component
-// - creates a `store` for the Provider handling different server side / client side cases
-// - runs wrapped component `getInitialProps` as expected
-// - passes `store` to Component's `getInitialProps` so that it can dispatch actions
-
-const withRefnux = (getInitialState, Component) => {
- const Wrapper = props => {
- var store = props.store
- // if getInitialProps was executed on the server we get a store
- // that's missing non-serializable functions.
- // Because of this we need to recreate the store based on the
- // state coming from the server.
- if (!store.dispatch) {
- store = getStore(props.store.state)
- }
- return (
- }
- />
- )
- }
-
- Wrapper.getInitialProps = async function(context) {
- const store = getStore(getInitialState())
- var componentProps = {}
- // honor wrapped component getInitialProps
- if (Component.getInitialProps) {
- componentProps = await Component.getInitialProps({ ...context, store })
- }
- return { store, componentProps }
- }
-
- return Wrapper
-}
-
-export default withRefnux
diff --git a/examples/with-refnux/package.json b/examples/with-refnux/package.json
deleted file mode 100644
index d75c68b85a55c..0000000000000
--- a/examples/with-refnux/package.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "with-refnux",
- "version": "1.0.0",
- "scripts": {
- "dev": "next",
- "build": "next build",
- "start": "next start"
- },
- "license": "ISC",
- "dependencies": {
- "next": "latest",
- "react": "^16.7.0",
- "react-dom": "^16.7.0",
- "refnux": "^1.3.0"
- }
-}
diff --git a/examples/with-refnux/pages/page1.js b/examples/with-refnux/pages/page1.js
deleted file mode 100644
index 8e7172599a28d..0000000000000
--- a/examples/with-refnux/pages/page1.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import { connect } from 'refnux'
-import Link from 'next/link'
-
-import withRefnux from '../helpers/withRefnux'
-import getInitialState from '../store/getInitialState'
-
-// actions
-import counterIncrement from '../store/counterIncrement'
-import setTitle from '../store/setTitle'
-
-const Page1 = connect((state, dispatch) => (
-
-
{state.title}
-
Current state: {JSON.stringify(state, null, 2)}
-
-
-
-
-
-))
-
-Page1.getInitialProps = async function(context) {
- const { store } = context
- // dispatch actions to store to set it up for this page / route
- store.dispatch(setTitle('Page 1'))
- return {} // we have a store, we don't need props!
-}
-
-export default withRefnux(getInitialState, Page1)
diff --git a/examples/with-refnux/pages/page2.js b/examples/with-refnux/pages/page2.js
deleted file mode 100644
index 041a1ffdc3e07..0000000000000
--- a/examples/with-refnux/pages/page2.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import { connect } from 'refnux'
-import Link from 'next/link'
-
-import withRefnux from '../helpers/withRefnux'
-import getInitialState from '../store/getInitialState'
-
-// actions
-import counterIncrement from '../store/counterIncrement'
-import setTitle from '../store/setTitle'
-
-const Page2 = connect((state, dispatch) => (
-
-
{state.title}
-
Current state: {JSON.stringify(state, null, 2)}
-
-
-
-
-
-))
-
-Page2.getInitialProps = async function(context) {
- const { store } = context
- store.dispatch(setTitle('Page 2'))
- return {}
-}
-
-export default withRefnux(getInitialState, Page2)
diff --git a/examples/with-refnux/store/counterIncrement.js b/examples/with-refnux/store/counterIncrement.js
deleted file mode 100644
index d656b01bfc82d..0000000000000
--- a/examples/with-refnux/store/counterIncrement.js
+++ /dev/null
@@ -1,5 +0,0 @@
-const counterIncrement = ({ counter }, dispatch) => {
- return { counter: counter + 1 }
-}
-
-export default counterIncrement
diff --git a/examples/with-refnux/store/getInitialState.js b/examples/with-refnux/store/getInitialState.js
deleted file mode 100644
index 24626dea37a12..0000000000000
--- a/examples/with-refnux/store/getInitialState.js
+++ /dev/null
@@ -1,8 +0,0 @@
-const getInitialState = () => {
- return {
- title: '',
- counter: 0,
- }
-}
-
-export default getInitialState
diff --git a/examples/with-refnux/store/getStore.js b/examples/with-refnux/store/getStore.js
deleted file mode 100644
index 89ed4076d5037..0000000000000
--- a/examples/with-refnux/store/getStore.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import { createStore } from 'refnux'
-
-const storeInitialState = { counter: 0, key: 'value' }
-
-const getStore = () => {
- let store = null
- if (typeof window === 'undefined') {
- store = createStore(storeInitialState)
- } else {
- store = window.store || createStore(storeInitialState)
- window.store = store
- }
- return store
-}
-
-export default getStore
diff --git a/examples/with-refnux/store/setTitle.js b/examples/with-refnux/store/setTitle.js
deleted file mode 100644
index eb90567f14487..0000000000000
--- a/examples/with-refnux/store/setTitle.js
+++ /dev/null
@@ -1,5 +0,0 @@
-const setTitle = newTitle => ({ title }) => {
- return { title: newTitle }
-}
-
-export default setTitle
diff --git a/examples/with-relay-modern-server-express/.babelrc b/examples/with-relay-modern-server-express/.babelrc
deleted file mode 100644
index c7eb72f9da570..0000000000000
--- a/examples/with-relay-modern-server-express/.babelrc
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "presets": [
- "next/babel"
- ],
- "plugins": [
- ["relay", { artifactDirectory: "__generated__" }]
- ]
-}
\ No newline at end of file
diff --git a/examples/with-relay-modern-server-express/.env b/examples/with-relay-modern-server-express/.env
deleted file mode 100644
index 997fabb476cc0..0000000000000
--- a/examples/with-relay-modern-server-express/.env
+++ /dev/null
@@ -1 +0,0 @@
-RELAY_SERVER=http://localhost:3000
diff --git a/examples/with-relay-modern-server-express/.gitignore b/examples/with-relay-modern-server-express/.gitignore
deleted file mode 100644
index 748d4f6e39c57..0000000000000
--- a/examples/with-relay-modern-server-express/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-__generated__/
-schema/schema.graphql
\ No newline at end of file
diff --git a/examples/with-relay-modern-server-express/README.md b/examples/with-relay-modern-server-express/README.md
deleted file mode 100644
index 38f4c6d229c25..0000000000000
--- a/examples/with-relay-modern-server-express/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# Relay Modern Server Express Example
-
-[Relay Modern](https://relay.dev/) is a new version of Relay designed from the ground up to be easier to use, more extensible and, most of all, able to improve performance on mobile devices. Relay Modern accomplishes this with static queries and ahead-of-time code generation.
-
-In this simple example, we integrate Relay Modern seamlessly with Next by wrapping our _pages_ inside a [higher-order component (HOC)](https://facebook.github.io/react/docs/higher-order-components.html). Using the HOC pattern we're able to pass down a query result data created by Relay into our React component hierarchy defined inside each page of our Next application. The HOC takes `options` argument that allows to specify a `query` that will be executed on the server when a page is being loaded.
-
-This example implements a simple graphql server using express, showing a custom graphql server integrated to next.js and relay modern.
-
-## How to use
-
-### Using `create-next-app`
-
-Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
-
-```bash
-npm init next-app --example with-relay-modern-server-express with-relay-modern-server-express-app
-# or
-yarn create next-app --example with-relay-modern-server-express with-relay-modern-server-express-app
-```
-
-### Download manually
-
-Download the example [or clone the repo](https://github.com/zeit/next.js):
-
-```bash
-curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-relay-modern-server-express
-cd with-relay-modern-server-express
-```
-
-Install it:
-
-```bash
-npm install
-# or
-yarn
-```
-
-Run the project (it runs automatically the Relay ahead-of-time compilation)
-
-```bash
-npm run dev
-# or
-yarn dev
-```
-
-Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
diff --git a/examples/with-relay-modern-server-express/components/BlogPostPreview.js b/examples/with-relay-modern-server-express/components/BlogPostPreview.js
deleted file mode 100644
index 07746f7e1b641..0000000000000
--- a/examples/with-relay-modern-server-express/components/BlogPostPreview.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from 'react'
-import { createFragmentContainer, graphql } from 'react-relay'
-
-const BlogPostPreview = props => {
- return (
-
-