Skip to content

Commit

Permalink
Merge branch 'canary' into docs/dynamic-import-update
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Sep 5, 2020
2 parents 0c6e68d + a7a6aa5 commit c3d4905
Show file tree
Hide file tree
Showing 137 changed files with 793 additions and 328 deletions.
2 changes: 1 addition & 1 deletion examples/analyze-bundles/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "with-webpack-bundle-analyzer",
"name": "analyze-bundles",
"version": "1.0.0",
"scripts": {
"dev": "next",
Expand Down
4 changes: 2 additions & 2 deletions examples/auth0/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nextjs-auth0-example",
"name": "auth0",
"scripts": {
"dev": "next",
"build": "next build",
Expand All @@ -8,7 +8,7 @@
"author": "",
"license": "MIT",
"dependencies": {
"@auth0/nextjs-auth0": "^0.6.0",
"@auth0/nextjs-auth0": "^0.8.0",
"next": "latest",
"react": "^16.12.0",
"react-dom": "^16.12.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-export/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "hello-world",
"name": "basic-export",
"version": "1.0.0",
"scripts": {
"dev": "next",
Expand Down
1 change: 1 addition & 0 deletions examples/custom-server-actionhero/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "custom-server-actionhero",
"engines": {
"node": ">=8.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-server-koa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"start": "cross-env NODE_ENV=production node server.js"
},
"dependencies": {
"@koa/router": "^8.0.7",
"cross-env": "^5.2.0",
"koa": "^2.0.1",
"@koa/router": "^8.0.7",
"next": "latest",
"react": "^16.7.0",
"react-dom": "^16.7.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-world/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nextjs-hello-world",
"name": "hello-world",
"version": "1.0.0",
"scripts": {
"dev": "next",
Expand Down
1 change: 1 addition & 0 deletions examples/with-absolute-imports/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "with-absolute-imports",
"scripts": {
"dev": "next",
"build": "next build",
Expand Down
5 changes: 5 additions & 0 deletions examples/with-algolia-react-instantsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ npx create-next-app --example with-algolia-react-instantsearch with-algolia-reac
yarn create next-app --example with-algolia-react-instantsearch with-algolia-react-instantsearch-app
```

To set up Algolia:

- create an [algolia](https://www.algolia.com/) account or use this already [configured index](https://community.algolia.com/react-instantsearch/Getting_started.html#before-we-start)
- update the `appId`, `apikey` and `indexName` you want to search on in [`components/instantsearch.js`](components/instantsearch.js)

Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
2 changes: 1 addition & 1 deletion examples/with-algolia-react-instantsearch/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "create-next-example-app",
"name": "with-algolia-react-instantsearch",
"scripts": {
"dev": "next",
"build": "cross-env NODE_ENV=development next build",
Expand Down
Empty file modified examples/with-ant-design/package.json
100755 → 100644
Empty file.
1 change: 0 additions & 1 deletion examples/with-apollo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
"react": "^16.7.0",
"react-dom": "^16.7.0"
},
"devDependencies": {},
"license": "MIT"
}
2 changes: 1 addition & 1 deletion examples/with-aws-amplify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"aws-amplify": "2.1.0",
"immer": "3.1.3",
"nanoid": "2.0.3",
"next": "^latest",
"next": "latest",
"react": "16.13.1",
"react-dom": "16.13.1"
}
Expand Down
6 changes: 3 additions & 3 deletions examples/with-babel-macros/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import Document, { Head, Main, NextScript } from 'next/document'
import Document, { Html, Head, Main, NextScript } from 'next/document'

export default class MyDocument extends Document {
render() {
return (
<html>
<Html>
<Head>
<style dangerouslySetInnerHTML={{ __html: this.props.css }} />
</Head>
<body>
<Main />
<NextScript />
</body>
</html>
</Html>
)
}
}
4 changes: 2 additions & 2 deletions examples/with-cookie-auth-fauna/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "with-cookie-auth",
"name": "with-cookie-auth-fauna",
"scripts": {
"dev": "next",
"build": "next build",
Expand All @@ -8,7 +8,7 @@
"dependencies": {
"cookie": "^0.4.0",
"faunadb": "2.10.0",
"next": "^latest",
"next": "latest",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"swr": "0.2.3"
Expand Down
8 changes: 8 additions & 0 deletions examples/with-cssed/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": [
"next/babel"
],
"plugins": [
"babel-plugin-macros"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ yarn-error.log*

# vercel
.vercel

# cssed compilation artifacts
.*.module.css
23 changes: 23 additions & 0 deletions examples/with-cssed/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Example app with cssed

This example shows how to use [cssed](https://github.com/okotoki/cssed), a CSS-in-JS library, with Next.js.

We are creating `div` element with local scoped styles. The styles includes the use of pseudo-selector.

## Deploy your own

Deploy the example using [Vercel](https://vercel.com):

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/next.js/tree/canary/examples/with-cssed)

## How to use

Execute [`create-next-app`](https://github.com/vercel/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
npx create-next-app --example with-cssed with-cssed-app
# or
yarn create next-app --example with-cssed with-cssed-app
```

Deploy it to the cloud with [Vercel](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
2 changes: 2 additions & 0 deletions examples/with-cssed/lib/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const dark = '#333'
export const light = '#ddd'
18 changes: 18 additions & 0 deletions examples/with-cssed/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "with-cssed",
"version": "1.0.0",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@types/react": "^16.9.48",
"babel-plugin-macros": "^2.8.0",
"cssed": "^1.1.2",
"next": "latest",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"license": "MIT"
}
47 changes: 47 additions & 0 deletions examples/with-cssed/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { css } from 'cssed/macro'
import Head from 'next/head'
import { useState } from 'react'

import { dark, light } from '../lib/theme'

const styles = css`
.box {
height: 200px;
width: 200px;
margin: 0 auto;
margin-top: 40px;
display: flex;
align-items: center;
justify-content: center;
}
.dark {
background-color: ${dark};
}
.dark::before {
content: '🌚';
}
.light {
background-color: ${light};
}
.light::before {
content: '🌞';
}
`

export default function Home() {
const [isDark, setDark] = useState(false)
return (
<>
<Head>
<title>With cssed</title>
</Head>
<div
onClick={() => setDark(!isDark)}
className={styles.box + ' ' + (isDark ? styles.dark : styles.light)}
>
Cssed demo
</div>
</>
)
}
6 changes: 3 additions & 3 deletions examples/with-cxs/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Document, { Head, Main, NextScript } from 'next/document'
import Document, { Html, Head, Main, NextScript } from 'next/document'
import cxs from 'cxs/lite'

export default class MyDocument extends Document {
Expand All @@ -10,7 +10,7 @@ export default class MyDocument extends Document {

render() {
return (
<html>
<Html>
<Head>
<style
id="cxs-style"
Expand All @@ -21,7 +21,7 @@ export default class MyDocument extends Document {
<Main />
<NextScript />
</body>
</html>
</Html>
)
}
}
2 changes: 1 addition & 1 deletion examples/with-electron-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "electron-next-skeleton",
"name": "with-electron-typescript",
"productName": "ElectronTypescriptNext",
"version": "1.0.0",
"main": "main/index.js",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-electron/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "electron-next-skeleton",
"name": "with-electron",
"productName": "ElectronNext",
"version": "1.0.0",
"main": "main/index.js",
Expand Down
6 changes: 3 additions & 3 deletions examples/with-emotion-11/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Document, { Head, Main, NextScript } from 'next/document'
import Document, { Html, Head, Main, NextScript } from 'next/document'
import { extractCritical } from '@emotion/server'

export default class MyDocument extends Document {
Expand All @@ -21,13 +21,13 @@ export default class MyDocument extends Document {

render() {
return (
<html>
<Html>
<Head />
<body>
<Main />
<NextScript />
</body>
</html>
</Html>
)
}
}
2 changes: 1 addition & 1 deletion examples/with-emotion/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "with-emotion-10",
"name": "with-emotion",
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand Down
6 changes: 3 additions & 3 deletions examples/with-emotion/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Document, { Head, Main, NextScript } from 'next/document'
import Document, { Html, Head, Main, NextScript } from 'next/document'
import { extractCritical } from 'emotion-server'

export default class MyDocument extends Document {
Expand All @@ -21,13 +21,13 @@ export default class MyDocument extends Document {

render() {
return (
<html>
<Html>
<Head />
<body>
<Main />
<NextScript />
</body>
</html>
</Html>
)
}
}
2 changes: 1 addition & 1 deletion examples/with-env-from-next-config-js/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "with-env-from-next-config",
"name": "with-env-from-next-config-js",
"version": "1.0.0",
"scripts": {
"dev": "next",
Expand Down
4 changes: 2 additions & 2 deletions examples/with-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
},
"dependencies": {
"expo": "~37.0.3",
"next": "latest",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-web": "~0.11.7",
"next": "latest"
"react-native-web": "~0.11.7"
},
"devDependencies": {
"@expo/next-adapter": "2.1.5"
Expand Down
6 changes: 3 additions & 3 deletions examples/with-fela/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Document, { Main, NextScript } from 'next/document'
import Document, { Html, Main, NextScript } from 'next/document'
import { renderToNodeList } from 'react-fela'

import getFelaRenderer from '../getFelaRenderer'
Expand All @@ -23,12 +23,12 @@ export default class MyDocument extends Document {

render() {
return (
<html>
<Html>
<body>
<Main />
<NextScript />
</body>
</html>
</Html>
)
}
}
18 changes: 17 additions & 1 deletion examples/with-firebase-hosting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,23 @@ npx create-next-app --example with-firebase-hosting with-firebase-hosting-app
yarn create next-app --example with-firebase-hosting with-firebase-hosting-app
```

Update `.firebaserc`: adding your firebase project ID
**Important:** Update `.firebaserc` and add your firebase project ID.

To run Firebase locally for testing:

```bash
npm run serve
# or
yarn serve
```

To deploy it to the cloud with Firebase:

```bash
npm run deploy
# or
yarn deploy
```

## Typescript

Expand Down
Loading

0 comments on commit c3d4905

Please sign in to comment.