Skip to content

Commit

Permalink
Merge branch 'canary' into wbinnssmith/rm-flatmap
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Oct 10, 2023
2 parents 5373771 + 52356a0 commit 290c1a7
Show file tree
Hide file tree
Showing 390 changed files with 27,909 additions and 3,100 deletions.
4 changes: 0 additions & 4 deletions .cargo/config.toml
Expand Up @@ -35,8 +35,4 @@ rustflags = [
"-Zshare-generics=y",
"-Csymbol-mangling-version=v0",
"-Aclippy::too_many_arguments",
# Clippy's needless mut lint is buggy: https://github.com/rust-lang/rust-clippy/issues/11299
"-Aclippy::needless_pass_by_ref_mut",
# Clippy's partial_eq lint is buggy: https://github.com/rust-lang/rust-clippy/issues/11178
"-Aclippy::non_canonical_partial_ord_impl",
]
12 changes: 12 additions & 0 deletions .eslintrc.json
Expand Up @@ -213,6 +213,18 @@
],
"eslint-plugin/require-meta-docs-url": "error"
}
},
{
"files": ["packages/**/*.tsx", "packages/**/*.ts"],
"rules": {
"@typescript-eslint/consistent-type-imports": [
"error",
{
"disallowTypeAnnotations": false
}
],
"@typescript-eslint/no-import-type-side-effects": "error"
}
}
],
"rules": {
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/next-stats-action/package.json
Expand Up @@ -20,7 +20,7 @@
},
"engines": {
"node": ">=16.14.0",
"pnpm": "8.7.1"
"pnpm": "8.9.0"
},
"packageManager": "pnpm@8.7.1"
"packageManager": "pnpm@8.9.0"
}
3 changes: 0 additions & 3 deletions .github/actions/next-stats-action/src/index.js
Expand Up @@ -127,9 +127,6 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
)
.catch(console.error)

console.log(await exec(`ls ${path.join(__dirname, '../native')}`))
console.log(await exec(`cd ${dir} && ls ${dir}/packages/next-swc/native`))

logger(`Linking packages in ${dir}`)
const isMainRepo = dir === mainRepoDir
const pkgPaths = await linkPackages({
Expand Down
146 changes: 73 additions & 73 deletions azure-pipelines.yml
Expand Up @@ -111,76 +111,76 @@ stages:
env:
NEXT_TEST_MODE: 'dev'

# - job: test_e2e_dev
# pool:
# vmImage: 'windows-2019'
# steps:
# - task: NodeTool@0
# inputs:
# versionSpec: $(node_16_version)
# displayName: 'Install Node.js'

# - bash: |
# node scripts/run-for-change.js --not --type docs --exec echo "##vso[task.setvariable variable=isDocsOnly]No"
# displayName: 'Check Docs Only Change'

# - script: corepack enable
# condition: eq(variables['isDocsOnly'], 'No')
# displayName: 'Enable Corepack'

# - script: pnpm config set store-dir $(PNPM_CACHE_FOLDER)
# condition: eq(variables['isDocsOnly'], 'No')

# - script: pnpm store path
# condition: eq(variables['isDocsOnly'], 'No')

# - script: pnpm install && pnpm run build
# condition: eq(variables['isDocsOnly'], 'No')
# displayName: 'Install and build'

# - script: npx playwright@1.35.1 install chromium
# condition: eq(variables['isDocsOnly'], 'No')

# - script: |
# node run-tests.js -c 1 --debug test/e2e/app-dir/app/index.test.ts
# condition: eq(variables['isDocsOnly'], 'No')
# displayName: 'Run tests (E2E Development)'
# env:
# NEXT_TEST_MODE: 'dev'

# - job: test_e2e_prod
# pool:
# vmImage: 'windows-2019'
# steps:
# - task: NodeTool@0
# inputs:
# versionSpec: $(node_16_version)
# displayName: 'Install Node.js'

# - bash: |
# node scripts/run-for-change.js --not --type docs --exec echo "##vso[task.setvariable variable=isDocsOnly]No"
# displayName: 'Check Docs Only Change'

# - script: corepack enable
# condition: eq(variables['isDocsOnly'], 'No')
# displayName: 'Enable Corepack'

# - script: pnpm config set store-dir $(PNPM_CACHE_FOLDER)
# condition: eq(variables['isDocsOnly'], 'No')

# - script: pnpm store path
# condition: eq(variables['isDocsOnly'], 'No')

# - script: pnpm install && pnpm run build
# condition: eq(variables['isDocsOnly'], 'No')
# displayName: 'Install and build'

# - script: npx playwright@1.35.1 install chromium
# condition: eq(variables['isDocsOnly'], 'No')

# - script: |
# node run-tests.js -c 1 --debug test/e2e/app-dir/app/index.test.ts
# condition: eq(variables['isDocsOnly'], 'No')
# displayName: 'Run tests (E2E Production)'
# env:
# NEXT_TEST_MODE: 'start'
- job: test_e2e_dev
pool:
vmImage: 'windows-2019'
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_16_version)
displayName: 'Install Node.js'

- bash: |
node scripts/run-for-change.js --not --type docs --exec echo "##vso[task.setvariable variable=isDocsOnly]No"
displayName: 'Check Docs Only Change'
- script: corepack enable
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Enable Corepack'

- script: pnpm config set store-dir $(PNPM_CACHE_FOLDER)
condition: eq(variables['isDocsOnly'], 'No')

- script: pnpm store path
condition: eq(variables['isDocsOnly'], 'No')

- script: pnpm install && pnpm run build
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Install and build'

- script: npx playwright@1.35.1 install chromium
condition: eq(variables['isDocsOnly'], 'No')

- script: |
node run-tests.js -c 1 --debug test/e2e/app-dir/app/index.test.ts test/e2e/app-dir/app-edge/app-edge.test.ts
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Run tests (E2E Development)'
env:
NEXT_TEST_MODE: 'dev'
- job: test_e2e_prod
pool:
vmImage: 'windows-2019'
steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_16_version)
displayName: 'Install Node.js'

- bash: |
node scripts/run-for-change.js --not --type docs --exec echo "##vso[task.setvariable variable=isDocsOnly]No"
displayName: 'Check Docs Only Change'
- script: corepack enable
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Enable Corepack'

- script: pnpm config set store-dir $(PNPM_CACHE_FOLDER)
condition: eq(variables['isDocsOnly'], 'No')

- script: pnpm store path
condition: eq(variables['isDocsOnly'], 'No')

- script: pnpm install && pnpm run build
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Install and build'

- script: npx playwright@1.35.1 install chromium
condition: eq(variables['isDocsOnly'], 'No')

- script: |
node run-tests.js -c 1 --debug test/e2e/app-dir/app/index.test.ts test/e2e/app-dir/app-edge/app-edge.test.ts
condition: eq(variables['isDocsOnly'], 'No')
displayName: 'Run tests (E2E Production)'
env:
NEXT_TEST_MODE: 'start'
Expand Up @@ -310,7 +310,7 @@ export const getItem = cache(async (id) => {

Although the `getItem` function is called twice, only one query will be made to the database.

```tsx filename="app/item/layout.tsx" switcher
```tsx filename="app/item/[id]/layout.tsx" switcher
import { getItem } from '@/utils/get-item'

export default async function Layout({
Expand All @@ -323,7 +323,7 @@ export default async function Layout({
}
```

```jsx filename="app/item/layout.js" switcher
```jsx filename="app/item/[id]/layout.js" switcher
import { getItem } from '@/utils/get-item'

export default async function Layout({ params: { id } }) {
Expand Down
@@ -1,4 +1,4 @@
---
title: Data Fetching
description: Learn how to fetch, cache, revalidate, and mutate of data React and Next.js.
description: Learn how to fetch, cache, revalidate, and mutate data with Next.js.
---
Expand Up @@ -18,7 +18,7 @@ There are a couple of benefits to doing the rendering work on the client, includ

To use Client Components, you can add the React [`"use client"` directive](https://react.dev/reference/react/use-client) at the top of a file, above your imports.

`"use client"` is used to declare a [boundary](/docs/app/building-your-application/rendering#network-boundary) between a Server and Client Component modules. This means that by defining a `"use client"` in a file, all other modules imported into it, including child components, are considered part of the client bundle - and will be rendered by React on the client.
`"use client"` is used to declare a [boundary](/docs/app/building-your-application/rendering#network-boundary) between a Server and Client Component modules. This means that by defining a `"use client"` in a file, all other modules imported into it, including child components, are considered part of the client bundle.

```tsx filename="app/counter.tsx" highlight={1} switcher
'use client'
Expand Down Expand Up @@ -91,7 +91,7 @@ Then, on the client:

> **What is hydration?**
>
> Hydration is process of attaching event listeners to the DOM, to make the static HTML interactive. Behind the scenes, hydration is done with the [`hydrateRoot`](https://react.dev/reference/react-dom/client/hydrateRoot) React API.
> Hydration is the process of attaching event listeners to the DOM, to make the static HTML interactive. Behind the scenes, hydration is done with the [`hydrateRoot`](https://react.dev/reference/react-dom/client/hydrateRoot) React API.
### Subsequent Navigations

Expand Down
Expand Up @@ -13,7 +13,7 @@ When you don't know the exact segment names ahead of time and want to create rou

## Convention

A Dynamic Segment can be created by wrapping a folder's name in square brackets: `[folderName]`. For example, `[id]` or `[slug]`.
A Dynamic Segment can be created by wrapping a file or folder name in square brackets: `[segmentName]`. For example, `[id]` or `[slug]`.

Dynamic Segments can be accessed from [`useRouter`](/docs/pages/api-reference/functions/use-router).

Expand All @@ -38,7 +38,7 @@ export default function Page() {

## Catch-all Segments

Dynamic Segments can be extended to **catch-all** subsequent segments by adding an ellipsis inside the brackets `[...folderName]`.
Dynamic Segments can be extended to **catch-all** subsequent segments by adding an ellipsis inside the brackets `[...segmentName]`.

For example, `pages/shop/[...slug].js` will match `/shop/clothes`, but also `/shop/clothes/tops`, `/shop/clothes/tops/t-shirts`, and so on.

Expand All @@ -50,7 +50,7 @@ For example, `pages/shop/[...slug].js` will match `/shop/clothes`, but also `/sh

## Optional Catch-all Segments

Catch-all Segments can be made **optional** by including the parameter in double square brackets: `[[...folderName]]`.
Catch-all Segments can be made **optional** by including the parameter in double square brackets: `[[...segmentName]]`.

For example, `pages/shop/[[...slug]].js` will **also** match `/shop`, in addition to `/shop/clothes`, `/shop/clothes/tops`, `/shop/clothes/tops/t-shirts`.

Expand Down
Expand Up @@ -217,7 +217,10 @@ The following example sends a JSON response with the status code `200` (`OK`) an
```ts filename="pages/api/hello.ts" switcher
import type { NextApiRequest, NextApiResponse } from 'next'

export default function handler(req: NextApiRequest, res: NextApiResponse) {
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
try {
const result = await someAsyncOperation()
res.status(200).json({ result })
Expand All @@ -228,7 +231,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
```

```js filename="pages/api/hello.js" switcher
export default function handler(req, res) {
export default async function handler(req, res) {
try {
const result = await someAsyncOperation()
res.status(200).json({ result })
Expand All @@ -247,7 +250,10 @@ The following example sends a HTTP response with the status code `200` (`OK`) an
```ts filename="pages/api/hello.ts" switcher
import type { NextApiRequest, NextApiResponse } from 'next'

export default function handler(req: NextApiRequest, res: NextApiResponse) {
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
try {
const result = await someAsyncOperation()
res.status(200).send({ result })
Expand All @@ -258,7 +264,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
```

```js filename="pages/api/hello.js" switcher
export default function handler(req, res) {
export default async function handler(req, res) {
try {
const result = await someAsyncOperation()
res.status(200).send({ result })
Expand All @@ -277,7 +283,10 @@ The following example redirects the client to the `/` path if the form is succes
```ts filename="pages/api/hello.ts" switcher
import type { NextApiRequest, NextApiResponse } from 'next'

export default function handler(req: NextApiRequest, res: NextApiResponse) {
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
const { name, message } = req.body

try {
Expand All @@ -290,7 +299,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
```

```js filename="pages/api/hello.js" switcher
export default function handler(req, res) {
export default async function handler(req, res) {
const { name, message } = req.body

try {
Expand Down
2 changes: 1 addition & 1 deletion docs/05-community/01-contribution-guide.mdx
Expand Up @@ -111,7 +111,7 @@ The following fields are **required**:

```yaml filename="required-fields.mdx"
---
tile: Page Title
title: Page Title
description: Page Description
---
```
Expand Down
6 changes: 3 additions & 3 deletions examples/next-forms/app/actions.ts
Expand Up @@ -11,7 +11,7 @@ import { z } from 'zod'

export async function createTodo(prevState: any, formData: FormData) {
const schema = z.object({
todo: z.string().nonempty(),
todo: z.string().min(1),
})
const data = schema.parse({
todo: formData.get('todo'),
Expand All @@ -32,8 +32,8 @@ export async function createTodo(prevState: any, formData: FormData) {

export async function deleteTodo(prevState: any, formData: FormData) {
const schema = z.object({
id: z.string().nonempty(),
todo: z.string().nonempty(),
id: z.string().min(1),
todo: z.string().min(1),
})
const data = schema.parse({
id: formData.get('id'),
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "13.5.5-canary.4"
"version": "13.5.5-canary.5"
}
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -199,7 +199,7 @@
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-d900fadbf-20230929",
"react-experimental-builtin": "npm:react@0.0.0-experimental-d900fadbf-20230929",
"react-server-dom-turbopack": "18.3.0-canary-d900fadbf-20230929",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-d900fadbf-20230929",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-d900fadbf-20230929",
"react-server-dom-webpack": "18.3.0-canary-d900fadbf-20230929",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-d900fadbf-20230929",
"react-ssr-prepass": "1.0.8",
Expand Down Expand Up @@ -249,7 +249,7 @@
},
"engines": {
"node": ">=16.14.0",
"pnpm": "8.7.1"
"pnpm": "8.9.0"
},
"packageManager": "pnpm@8.7.1"
"packageManager": "pnpm@8.9.0"
}

0 comments on commit 290c1a7

Please sign in to comment.