Skip to content

Commit

Permalink
Merge branch 'canary' into fix-40066
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/next/server/next-server.ts
  • Loading branch information
ijjk committed Aug 31, 2022
2 parents c5d080c + 643447e commit 8104a12
Show file tree
Hide file tree
Showing 122 changed files with 1,181 additions and 317 deletions.
12 changes: 12 additions & 0 deletions docs/api-reference/next/future/image.md
Expand Up @@ -9,6 +9,7 @@ description: Try the latest Image Optimization with the experimental `next/futur

| Version | Changes |
| --------- | -------------------------------------------- |
| `v12.3.0` | Changed `alt` property to required. |
| `v12.2.4` | Support for `fill` property added. |
| `v12.2.0` | Experimental `next/future/image` introduced. |

Expand Down Expand Up @@ -43,6 +44,7 @@ Compared to `next/image`, the new `next/future/image` component has the followin
- Removes `lazyBoundary` prop since there is no native equivalent
- Removes `lazyRoot` prop since there is no native equivalent
- Removes `loader` config in favor of [`loader`](#loader) prop
- Changed `alt` prop from optional to required

## Known Browser Bugs

Expand Down Expand Up @@ -175,6 +177,16 @@ The `height` property represents the _rendered_ height in pixels, so it will aff

Required, except for [statically imported images](/docs/basic-features/image-optimization.md#local-images) or images with the [`fill` property](#fill).

### alt

The `alt` property is used to describe the image for screen readers and search engines. It is also the fallback text if images have been disabled or an error occurs while loading the image.

It should contain text that could replace the image [without changing the meaning of the page](https://html.spec.whatwg.org/multipage/images.html#general-guidelines). It is not meant to supplement the image and should not repeat information that is already provided in the captions above or below the image.

If the image is [purely decorative](https://html.spec.whatwg.org/multipage/images.html#a-purely-decorative-image-that-doesn't-add-any-information) or [not intended for the user](https://html.spec.whatwg.org/multipage/images.html#an-image-not-intended-for-the-user), the `alt` property should be an empty string (`alt=""`).

[Learn more](https://html.spec.whatwg.org/multipage/images.html#alt)

## Optional Props

The `<Image />` component accepts a number of additional properties beyond those which are required. This section describes the most commonly-used properties of the Image component. Find details about more rarely-used properties in the [Advanced Props](#advanced-props) section.
Expand Down
38 changes: 17 additions & 21 deletions docs/basic-features/font-optimization.md
Expand Up @@ -27,28 +27,24 @@ To add a web font to your Next.js application, add the font to a [Custom `Docume
```js
// pages/_document.js

import Document, { Html, Head, Main, NextScript } from 'next/document'

class MyDocument extends Document {
render() {
return (
<Html>
<Head>
<link
href="https://fonts.googleapis.com/css2?family=Inter&display=optional"
rel="stylesheet"
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
import { Html, Head, Main, NextScript } from 'next/document'

export default function Document() {
return (
<Html>
<Head>
<link
href="https://fonts.googleapis.com/css2?family=Inter&display=optional"
rel="stylesheet"
/>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}

export default MyDocument
```
Adding fonts to `_document` is preferred over individual pages. When adding fonts to a single page with [`next/head`](/docs/api-reference/next/head.md), font optimizations included by Next.js will not work on navigations between pages client-side or when using [streaming](/docs/advanced-features/react-18/streaming.md).
Expand Down
1 change: 1 addition & 0 deletions examples/active-class-name/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
async rewrites() {
return [
Expand Down
2 changes: 1 addition & 1 deletion examples/analyze-bundles/next.config.js
@@ -1,8 +1,8 @@
/** @type {import('next').NextConfig} */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

/** @type {import('next').NextConfig} */
const nextConfig = {
// any configs you need
}
Expand Down
1 change: 1 addition & 0 deletions examples/blog-starter/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./components/**/*.tsx', './pages/**/*.tsx'],
theme: {
Expand Down
1 change: 1 addition & 0 deletions examples/blog-with-comment/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
mode: 'jit',
purge: ['./pages/**/*.js', './components/**/*.js'],
Expand Down
2 changes: 1 addition & 1 deletion examples/blog/next.config.js
@@ -1,10 +1,10 @@
/** @type {import('next').NextConfig} */
const withNextra = require('nextra')({
theme: 'nextra-theme-blog',
themeConfig: './theme.config.js',
// optional: add `unstable_staticImage: true` to enable Nextra's auto image import
})

/** @type {import('next').NextConfig} */
const nextConfig = {
// any configs you need
}
Expand Down
1 change: 1 addition & 0 deletions examples/cms-agilitycms/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-builder-io/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['cdn.builder.io'],
Expand Down
1 change: 1 addition & 0 deletions examples/cms-builder-io/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./components/**/*.js', './pages/**/*.js'],
theme: {
Expand Down
1 change: 1 addition & 0 deletions examples/cms-buttercms/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
async rewrites() {
Expand Down
1 change: 1 addition & 0 deletions examples/cms-contentful/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
loader: 'custom',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-contentful/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-cosmic/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['imgix.cosmicjs.com'],
Expand Down
1 change: 1 addition & 0 deletions examples/cms-cosmic/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-datocms/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['www.datocms-assets.com'],
Expand Down
1 change: 1 addition & 0 deletions examples/cms-datocms/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-drupal/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: [process.env.NEXT_IMAGE_DOMAIN],
Expand Down
1 change: 1 addition & 0 deletions examples/cms-drupal/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-ghost/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['static.ghost.org'],
Expand Down
1 change: 1 addition & 0 deletions examples/cms-ghost/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-graphcms/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['media.graphcms.com'],
Expand Down
1 change: 1 addition & 0 deletions examples/cms-graphcms/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-kontent/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-prepr/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['b-cdn.net'],
Expand Down
1 change: 1 addition & 0 deletions examples/cms-prepr/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-prismic/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['images.prismic.io'],
Expand Down
1 change: 1 addition & 0 deletions examples/cms-prismic/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-sanity/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
experimental: {
images: {
Expand Down
1 change: 1 addition & 0 deletions examples/cms-sanity/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-storyblok/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-strapi/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['localhost'],
Expand Down
1 change: 1 addition & 0 deletions examples/cms-strapi/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-takeshape/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-tina/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./components/**/*.js', './pages/**/*.js'],
theme: {
Expand Down
1 change: 1 addition & 0 deletions examples/cms-umbraco-heartcore/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['media.umbraco.io'],
Expand Down
1 change: 1 addition & 0 deletions examples/cms-umbraco-heartcore/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/cms-wordpress/next.config.js
Expand Up @@ -5,6 +5,7 @@ if (!process.env.WORDPRESS_API_URL) {
`)
}

/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: [
Expand Down
1 change: 1 addition & 0 deletions examples/cms-wordpress/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/github-pages/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
basePath: '/gh-pages-test',
}
1 change: 1 addition & 0 deletions examples/headers/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
async headers() {
return [
Expand Down
1 change: 1 addition & 0 deletions examples/i18n-routing/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
i18n: {
locales: ['en', 'fr', 'nl'],
Expand Down
1 change: 1 addition & 0 deletions examples/image-component/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['assets.vercel.com'],
Expand Down
1 change: 1 addition & 0 deletions examples/modularize-imports/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
experimental: {
modularizeImports: {
Expand Down
1 change: 1 addition & 0 deletions examples/react-remove-properties/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
experimental: {
reactRemoveProperties: true,
Expand Down
1 change: 1 addition & 0 deletions examples/redirects/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
// Uncomment the line below to enable basePath, pages and
// redirects will then have a path prefix (`/app` in this case)
Expand Down
1 change: 1 addition & 0 deletions examples/remove-console/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
experimental: {
removeConsole: {
Expand Down
4 changes: 1 addition & 3 deletions examples/reproduction-template/next.config.js
@@ -1,6 +1,4 @@
/** @type {import("next").NextConfig} */
const config = {
module.exports = {
reactStrictMode: true,
}

module.exports = config
1 change: 1 addition & 0 deletions examples/rewrites/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
async rewrites() {
return [
Expand Down
1 change: 1 addition & 0 deletions examples/with-compiled-css/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
webpack: (config) => {
config.module.rules.push({
Expand Down
1 change: 1 addition & 0 deletions examples/with-docker-multi-env/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
output: 'standalone',
}
1 change: 1 addition & 0 deletions examples/with-docker/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
output: 'standalone',
}
1 change: 1 addition & 0 deletions examples/with-firebase-hosting/src/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
distDir: '../.next',
}
1 change: 1 addition & 0 deletions examples/with-http2/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
/* this needs to be set to false until a bug in the compression npm module gets fixed.
reference: https://github.com/expressjs/compression/issues/122
Expand Down
1 change: 1 addition & 0 deletions examples/with-i18n-next-intl/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
i18n: {
locales: ['en', 'de'],
Expand Down
2 changes: 2 additions & 0 deletions examples/with-ionic-typescript/next.config.js
@@ -1,5 +1,7 @@
const path = require('path')
const CopyPlugin = require('copy-webpack-plugin')

/** @type {import('next').NextConfig} */
module.exports = {
webpack: (config) => {
config.plugins.push(
Expand Down
1 change: 1 addition & 0 deletions examples/with-lingui/next.config.js
@@ -1,5 +1,6 @@
const { locales, sourceLocale } = require('./lingui.config.js')

/** @type {import('next').NextConfig} */
module.exports = {
i18n: {
locales,
Expand Down
1 change: 1 addition & 0 deletions examples/with-mysql/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
}
1 change: 1 addition & 0 deletions examples/with-mysql/tailwind.config.js
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
Expand Down
1 change: 1 addition & 0 deletions examples/with-netlify-cms/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
webpack: (configuration) => {
configuration.module.rules.push({
Expand Down
1 change: 1 addition & 0 deletions examples/with-react-native-web/next.config.js
@@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
webpack: (config) => {
config.resolve.alias = {
Expand Down

0 comments on commit 8104a12

Please sign in to comment.