Skip to content

Commit af81be9

Browse files
authored
Merge branch 'canary' into cms-builder-io-example
2 parents dd94426 + 82adaee commit af81be9

File tree

88 files changed

+1235
-328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1235
-328
lines changed

.github/workflows/stale.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
with:
1515
only-labels: 'please add a complete reproduction'
1616
close-issue-message: 'This issue has been automatically closed after 30 days of inactivity with no reproduction. If you are running into a similar issue, please open a new issue with a reproduction. Thank you.'
17-
days-before-issue-close: 30
17+
days-before-issue-close: 1
18+
days-before-issue-stale: 30
1819
days-before-pr-close: -1
1920
days-before-pr-stale: -1
2021
exempt-issue-labels: 'blocked,must,should,keep'

docs/advanced-features/react-18.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Ensure you have the `rc` npm tag of React installed:
1212
npm install next@latest react@rc react-dom@rc
1313
```
1414

15+
That's all! You can now start using React 18's new APIs like `startTransition` and `Suspense` in Next.js.
16+
1517
### Enable SSR Streaming (Alpha)
1618

1719
Concurrent features in React 18 include built-in support for server-side Suspense and SSR streaming support, allowing you to server-render pages using HTTP streaming.

docs/api-reference/next/link.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ The default behavior of the `Link` component is to `push` a new URL into the `hi
204204
The default behavior of `Link` is to scroll to the top of the page. When there is a hash defined it will scroll to the specific id, like a normal `<a>` tag. To prevent scrolling to the top / hash `scroll={false}` can be added to `Link`:
205205

206206
```jsx
207-
<Link href="/?counter=10" scroll={false}>
207+
<Link href="/#hashid" scroll={false}>
208208
<a>Disables scrolling to the top</a>
209209
</Link>
210210
```

docs/basic-features/eslint.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Next.js provides an ESLint plugin, [`eslint-plugin-next`](https://www.npmjs.com/
9090
| ✔️ | [next/no-head-import-in-document](https://nextjs.org/docs/messages/no-head-import-in-document) | Disallow importing next/head in pages/document.js |
9191
| ✔️ | [next/no-html-link-for-pages](https://nextjs.org/docs/messages/no-html-link-for-pages) | Prohibit HTML anchor links to pages without a Link component |
9292
| ✔️ | [next/no-img-element](https://nextjs.org/docs/messages/no-img-element) | Prohibit usage of HTML &lt;img&gt; element |
93+
| ✔️ | [next/no-head-element](https://nextjs.org/docs/messages/no-head-element) | Prohibit usage of HTML &lt;head&gt; element |
9394
| ✔️ | [next/no-page-custom-font](https://nextjs.org/docs/messages/no-page-custom-font) | Prevent page-only custom fonts |
9495
| ✔️ | [next/no-sync-scripts](https://nextjs.org/docs/messages/no-sync-scripts) | Forbid synchronous scripts |
9596
| ✔️ | [next/no-title-in-document-head](https://nextjs.org/docs/messages/no-title-in-document-head) | Disallow using &lt;title&gt; with Head from next/document |
@@ -202,11 +203,15 @@ Then, add `prettier` to your existing ESLint config:
202203
If you would like to use `next lint` with [lint-staged](https://github.com/okonet/lint-staged) to run the linter on staged git files, you'll have to add the following to the `.lintstagedrc.js` file in the root of your project in order to specify usage of the `--file` flag.
203204

204205
```js
206+
const path = require('path')
207+
208+
const buildEslintCommand = (filenames) =>
209+
`next lint --fix --file ${filenames
210+
.map((f) => path.relative(process.cwd(), f))
211+
.join(' --file ')}`
212+
205213
module.exports = {
206-
'**/*.js?(x)': (filenames) =>
207-
`next lint --fix --file ${filenames
208-
.map((file) => file.split(process.cwd())[1])
209-
.join(' --file ')}`,
214+
'*.{js,jsx,ts,tsx}': [buildEslintCommand],
210215
}
211216
```
212217

errors/manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@
447447
"path": "/errors/link-multiple-children.md"
448448
},
449449
{ "title": "no-img-element", "path": "/errors/no-img-element.md" },
450+
{ "title": "no-head-element", "path": "/errors/no-head-element.md" },
450451
{
451452
"title": "non-dynamic-getstaticpaths-usage",
452453
"path": "/errors/non-dynamic-getstaticpaths-usage.md"

errors/no-head-element.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# No Head Element
2+
3+
### Why This Error Occurred
4+
5+
An HTML `<head>` element was used to include page-level metadata, but this can cause unexpected behavior in a Next.js application. Use Next.js' built-in `<Head />` component instead.
6+
7+
### Possible Ways to Fix It
8+
9+
Import and use the `<Head />` component:
10+
11+
```jsx
12+
import Head from 'next/head'
13+
14+
function Index() {
15+
return (
16+
<>
17+
<Head>
18+
<title>My page title</title>
19+
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
20+
</Head>
21+
</>
22+
)
23+
}
24+
25+
export default Index
26+
```
27+
28+
### Useful Links
29+
30+
- [next/head](https://nextjs.org/docs/api-reference/next/head)

examples/with-docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ RUN yarn install --frozen-lockfile
99
# Rebuild the source code only when needed
1010
FROM node:16-alpine AS builder
1111
WORKDIR /app
12-
COPY . .
1312
COPY --from=deps /app/node_modules ./node_modules
14-
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline
13+
COPY . .
14+
RUN yarn build
1515

1616
# Production image, copy all the files and run next
1717
FROM node:16-alpine AS runner

examples/with-segment-analytics/pages/_app.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ function MyApp({ Component, pageProps }) {
2424
return (
2525
<Page>
2626
{/* Inject the Segment snippet into the <head> of the document */}
27-
<Script dangerouslySetInnerHTML={{ __html: renderSnippet() }} />
27+
<Script
28+
id="segment-script"
29+
dangerouslySetInnerHTML={{ __html: renderSnippet() }}
30+
/>
2831
<Component {...pageProps} />
2932
</Page>
3033
)

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"registry": "https://registry.npmjs.org/"
1818
}
1919
},
20-
"version": "12.0.8-canary.13"
20+
"version": "12.0.8-canary.14"
2121
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@
8787
"async-sema": "3.0.1",
8888
"browserslist": "4.18.1",
8989
"cheerio": "0.22.0",
90-
"clone": "2.1.2",
9190
"cookie": "0.4.1",
9291
"cors": "2.8.5",
9392
"coveralls": "3.0.3",
9493
"critters": "0.0.6",
9594
"cross-env": "6.0.3",
9695
"cross-spawn": "6.0.5",
96+
"es5-ext": "0.10.53",
9797
"escape-string-regexp": "2.0.0",
9898
"eslint": "7.24.0",
9999
"eslint-plugin-import": "2.22.1",

0 commit comments

Comments
 (0)