Skip to content

Commit

Permalink
Merge branch 'canary' of github.com:zeit/next.js into dynamic-granula…
Browse files Browse the repository at this point in the history
…r-chunking
  • Loading branch information
janicklas-ralph committed Oct 29, 2019
2 parents 8405c24 + 07b46d7 commit 180a5ae
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 71 deletions.
15 changes: 0 additions & 15 deletions examples/with-next-sass/pages/_document.js

This file was deleted.

2 changes: 1 addition & 1 deletion examples/with-static-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ yarn dev

## The idea behind the example

This example show how to export to static HTML files your Next.js application fetching data from an API to generate a dynamic list of pages. This use a custom Express server in development to configure custom routing and then generate a map of pages to export for production.
This example show how to export to static HTML files your Next.js application fetching data from an API to generate a dynamic list of pages.

When trying to run `npm start` it will build and export your pages into the `out` folder and serve them on `localhost:5000`.
12 changes: 4 additions & 8 deletions examples/with-static-export/components/post.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import Link from 'next/link'

export default props => (
export default ({ title, body, id }) => (
<article>
<h2>{props.title}</h2>
<p>{props.body}</p>
{/* render the URL as /post/:id */}
<Link
href={{ pathname: '/post', query: { id: props.id } }}
as={`/post/${props.id}`}
>
<h2>{title}</h2>
<p>{body}</p>
<Link href='/post/[id]' as={`/post/${id}`}>
<a>Read more...</a>
</Link>
</article>
Expand Down
2 changes: 1 addition & 1 deletion examples/with-static-export/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
(pages, post) =>
Object.assign({}, pages, {
[`/post/${post.id}`]: {
page: '/post',
page: '/post/[id]',
query: { id: post.id }
}
}),
Expand Down
12 changes: 5 additions & 7 deletions examples/with-static-export/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"name": "with-static-export",
"main": "server.js",
"dependencies": {
"express": "^4.15.3",
"isomorphic-unfetch": "^2.0.0",
"isomorphic-unfetch": "^3.0.0",
"next": "latest",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"serve": "9.4.0"
"react": "^16.11.0",
"react-dom": "^16.11.0",
"serve": "11.2.0"
},
"scripts": {
"dev": "node .",
"dev": "next",
"build": "next build",
"preexport": "npm run build",
"export": "next export",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ export default class extends Component {
}

render () {
const { title, body } = this.props

return (
<main>
<Head>
<title>{this.props.title}</title>
<title>{title}</title>
</Head>

<h1>{this.props.title}</h1>
<h1>{title}</h1>

<p>{this.props.body}</p>
<p>{body}</p>

<Link href='/'>
<a>Go back to home</a>
Expand Down
27 changes: 0 additions & 27 deletions examples/with-static-export/server.js

This file was deleted.

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "9.1.2-canary.9"
"version": "9.1.2-canary.10"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "9.1.2-canary.9",
"version": "9.1.2-canary.10",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "9.1.2-canary.9",
"version": "9.1.2-canary.10",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "9.1.2-canary.9",
"version": "9.1.2-canary.10",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
27 changes: 23 additions & 4 deletions packages/next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2317,16 +2317,35 @@ To learn more about TypeScript checkout its [documentation](https://www.typescri
> When you feel comfortable with TypeScript, you may turn this option on in your `tsconfig.json`.

> **Note**: By default, Next.js reports TypeScript errors during development for pages you are actively working on.
> TypeScript errors for inactive pages do not block the development process.
> Trying to run `next build` for an app that has TypeScript errors on any page will fail.
>
> If you don't want to leverage this behavior and prefer to do type checks manually, set the following options in your `next.config.js`:
> TypeScript errors for inactive pages **do not** block the development process.
>
> If you don't want to leverage this behavior and instead, e.g. prefer your editor's integration, you can set the following option in `next.config.js`:
>
> ```js
> // next.config.js
> module.exports = {
> typescript: {
> ignoreDevErrors: true,
> },
> }
> ```
>
> Next.js will still fail your **production build** (`next build`) when TypeScript errors are present in your project.
>
> If you'd like Next.js to dangerously produce production code even when your application is broken, you can set the following option in your `next.config.js`.
> Be sure you are running type checks as part of your build or deploy process!
>
> ```js
> // next.config.js
> module.exports = {
> typescript: {
> // !! WARN !!
> // Dangerously allow production builds to successfully complete even if
> // your project has type errors.
> //
> // This option is rarely needed, and should be reserved for advanced
> // setups. You may be looking for `ignoreDevErrors` instead.
> // !! WARN !!
> ignoreBuildErrors: true,
> },
> }
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "9.1.2-canary.9",
"version": "9.1.2-canary.10",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down

0 comments on commit 180a5ae

Please sign in to comment.