Skip to content

Commit

Permalink
Merge branch 'canary' into refactor-data-fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
molebox committed Dec 14, 2021
2 parents 5178810 + 8f9aed6 commit babe693
Show file tree
Hide file tree
Showing 84 changed files with 827 additions and 956 deletions.
1 change: 0 additions & 1 deletion docs/advanced-features/custom-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ description: Start a Next.js app programmatically using a custom server.
<details>
<summary><b>Examples</b></summary>
<ul>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/custom-server">Basic custom server</a></li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/custom-server-express">Express integration</a></li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/custom-server-hapi">Hapi integration</a></li>
<li><a href="https://github.com/vercel/next.js/tree/canary/examples/custom-server-koa">Koa integration</a></li>
Expand Down
6 changes: 3 additions & 3 deletions docs/advanced-features/react-18.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

[React 18](https://reactjs.org/blog/2021/06/08/the-plan-for-react-18.html) adds new features including, Suspense, automatic batching of updates, APIs like `startTransition`, and a new streaming API for server rendering with support for `React.lazy`.

React 18 is still in beta. Read more about React 18's [release plan](https://github.com/reactwg/react-18/discussions) and discussions from the [working group](https://github.com/reactwg/react-18/discussions).
React 18 is in RC now. Read more about React 18's [release plan](https://github.com/reactwg/react-18/discussions) and discussions from the [working group](https://github.com/reactwg/react-18/discussions).

### React 18 Usage in Next.js

Ensure you have the `beta` version of React installed:
Ensure you have the `rc` npm tag of React installed:

```jsx
npm install next@latest react@beta react-dom@beta
npm install next@latest react@rc react-dom@rc
```

### Enable SSR Streaming (Alpha)
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/next/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Should only be used when the image is visible above the fold. Defaults to `false

A placeholder to use while the image is loading. Possible values are `blur` or `empty`. Defaults to `empty`.

When `blur`, the [`blurDataURL`](#blurdataurl) property will be used as the placeholder. If `src` is an object from a [static import](#local-images) and the imported image is `.jpg`, `.png`, `.webp`, or `.avif`, then `blurDataURL` will be automatically populated.
When `blur`, the [`blurDataURL`](#blurdataurl) property will be used as the placeholder. If `src` is an object from a [static import](/docs/basic-features/image-optimization.md#local-images) and the imported image is `.jpg`, `.png`, `.webp`, or `.avif`, then `blurDataURL` will be automatically populated.

For dynamic images, you must provide the [`blurDataURL`](#blurdataurl) property. Solutions such as [Plaiceholder](https://github.com/joe-bell/plaiceholder) can help with `base64` generation.

Expand Down
2 changes: 1 addition & 1 deletion errors/webpack5.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ In case you do have custom webpack configuration, either through custom plugins

- When using `next-transpile-modules` make sure you use the latest version which includes [this patch](https://github.com/martpie/next-transpile-modules/pull/179)
- When using `@zeit/next-css` / `@zeit/next-sass` make sure you use the [built-in CSS/Sass support](https://nextjs.org/docs/basic-features/built-in-css-support) instead
- When using `@zeit/next-preact` use [this example](https://github.com/vercel/next-plugins/tree/master/packages/next-preact) instead
- When using `@zeit/next-preact` use [this example](https://github.com/vercel/next.js/tree/canary/examples/using-preact) instead
- When using `@zeit/next-source-maps` use the [built-in production Source Map support](https://nextjs.org/docs/advanced-features/source-maps)
- When using webpack plugins make sure they're upgraded to the latest version, in most cases the latest version will include webpack 5 support. In some cases these upgraded webpack plugins will only support webpack 5.

Expand Down
2 changes: 1 addition & 1 deletion examples/blog-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&ut

# Notes

This blog-starter uses [Tailwind CSS](https://tailwindcss.com). To control the generated stylesheet's filesize, this example uses Tailwind CSS' v2.0 [`purge` option](https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css) to remove unused CSS.
This blog-starter uses [Tailwind CSS](https://tailwindcss.com) [(v3.0)](https://tailwindcss.com/blog/tailwindcss-v3).
6 changes: 3 additions & 3 deletions examples/blog-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"remark-html": "13.0.1"
},
"devDependencies": {
"autoprefixer": "^10.2.1",
"postcss": "^8.2.4",
"tailwindcss": "^2.0.2"
"autoprefixer": "^10.4.0",
"postcss": "^8.4.4",
"tailwindcss": "^3.0.1"
}
}
12 changes: 0 additions & 12 deletions examples/blog-starter/styles/index.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
@tailwind base;

/* Write your own custom base styles here */

/* Start purging... */
@tailwind components;
/* Stop purging. */

/* Write you own custom component styles here */

/* Start purging... */
@tailwind utilities;
/* Stop purging. */

/* Your own custom utilities */
2 changes: 1 addition & 1 deletion examples/blog-starter/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
purge: ['./components/**/*.js', './pages/**/*.js'],
content: ['./components/**/*.js', './pages/**/*.js'],
theme: {
extend: {
colors: {
Expand Down
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dependencies": {
"gray-matter": "^4.0.2",
"next": "latest",
"nextra": "^0.4.4",
"nextra": "^2.0.0-beta.5",
"nextra-theme-blog": "^0.1.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/using-preact/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This example uses [Preact](https://github.com/preactjs/preact) instead of React.

## Preview

Preview the example live on [StackBlitz](http://stackblitz.com/):
Preview the example live on [StackBlitz](https://stackblitz.com/):

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/using-preact)

Expand Down
14 changes: 7 additions & 7 deletions examples/using-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
},
"devDependencies": {},
"dependencies": {
"next": "^10.0.0",
"next-plugin-preact": "^3.0.3",
"preact": "^10.5.5",
"preact-render-to-string": "^5.1.11",
"react": "npm:@preact/compat",
"react-dom": "npm:@preact/compat",
"react-ssr-prepass": "npm:preact-ssr-prepass@^1.1.2"
"next": "^12.0.0",
"next-plugin-preact": "^3.0.6",
"preact": "^10.5.15",
"preact-render-to-string": "^5.1.19",
"react": "npm:@preact/compat@^17.0.2",
"react-dom": "npm:@preact/compat@^17.0.2",
"react-ssr-prepass": "npm:preact-ssr-prepass@^1.2.0"
}
}
17 changes: 10 additions & 7 deletions examples/with-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Install dependencies only when needed
FROM node:14-alpine AS deps
FROM node:alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

# Rebuild the source code only when needed
FROM node:14-alpine AS builder
FROM node:alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN yarn build
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline

# Production image, copy all the files and run next
FROM node:14-alpine AS runner
FROM node:alpine AS runner
WORKDIR /app

ENV NODE_ENV production
Expand All @@ -25,10 +25,13 @@ RUN adduser -S nextjs -u 1001
# You only need to copy next.config.js if you are NOT using the default configuration
# COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000
Expand All @@ -40,4 +43,4 @@ ENV PORT 3000
# Uncomment the following line in case you want to disable telemetry.
# ENV NEXT_TELEMETRY_DISABLED 1

CMD ["node_modules/.bin/next", "start"]
CMD ["node", "server.js"]
5 changes: 5 additions & 0 deletions examples/with-docker/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
experimental: {
outputStandalone: true,
},
}
3 changes: 0 additions & 3 deletions examples/with-typescript-eslint-jest/.babelrc

This file was deleted.

3 changes: 0 additions & 3 deletions examples/with-typescript-eslint-jest/.eslintignore

This file was deleted.

47 changes: 0 additions & 47 deletions examples/with-typescript-eslint-jest/.eslintrc.json

This file was deleted.

34 changes: 0 additions & 34 deletions examples/with-typescript-eslint-jest/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions examples/with-typescript-eslint-jest/.prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions examples/with-typescript-eslint-jest/.prettierrc

This file was deleted.

33 changes: 0 additions & 33 deletions examples/with-typescript-eslint-jest/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions examples/with-typescript-eslint-jest/jest.config.js

This file was deleted.

5 changes: 0 additions & 5 deletions examples/with-typescript-eslint-jest/next-env.d.ts

This file was deleted.

49 changes: 0 additions & 49 deletions examples/with-typescript-eslint-jest/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions examples/with-typescript-eslint-jest/pages/api/hello.ts

This file was deleted.

0 comments on commit babe693

Please sign in to comment.