Skip to content

Commit

Permalink
Merge branch 'canary' into 09-17-test_add_next-types-plugin_test
Browse files Browse the repository at this point in the history
  • Loading branch information
devjiwonchoi authored Sep 17, 2024
2 parents 2d49c78 + 4e14037 commit d8c383a
Show file tree
Hide file tree
Showing 53 changed files with 216 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
NAPI_CLI_VERSION: 2.16.2
TURBO_VERSION: 2.0.9
TURBO_VERSION: 2.1.2
NODE_LTS_VERSION: 20
CARGO_PROFILE_RELEASE_LTO: 'true'
TURBO_TEAM: 'vercel'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 2.0.9
TURBO_VERSION: 2.1.2
NODE_MAINTENANCE_VERSION: 18
NODE_LTS_VERSION: 20
TEST_CONCURRENCY: 8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ on:

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 2.0.3
TURBO_VERSION: 2.1.2
NODE_LTS_VERSION: 20.9.0
TEST_CONCURRENCY: 8
# disable backtrace for test snapshots
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: Code Freeze

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 2.0.9
TURBO_VERSION: 2.1.2
NODE_LTS_VERSION: 20

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Generate Pull Request Stats

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 2.0.9
TURBO_VERSION: 2.1.2
NODE_LTS_VERSION: 20
TEST_CONCURRENCY: 6

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ name: Trigger Release

env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 2.0.9
TURBO_VERSION: 2.1.2
NODE_LTS_VERSION: 20

jobs:
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This document has been moved to [nextjs.org/docs/upgrading](https://nextjs.org/docs/upgrading). It's also available in this repository on [/docs/02-app/01-building-your-application/10-upgrading](/docs/02-app/01-building-your-application/10-upgrading).
This document has been moved to [nextjs.org/docs/upgrading](https://nextjs.org/docs/upgrading). It's also available in this repository on [/docs/02-app/01-building-your-application/11-upgrading](/docs/02-app/01-building-your-application/11-upgrading).
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ export default async function middleware(req) {
## Runtime
Middleware currently only supports the [Edge runtime](/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes). The Node.js runtime can not be used.
Middleware currently only supports APIs compatible with the [Edge runtime](/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes). APIs exclusive to Node.js are [unsupported](/docs/app/api-reference/edge#unsupported-apis).
## Version History
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,14 @@ interface Post {
}

async function getPost(id: string) {
let res = await fetch(`https://api.example.com/posts/${id}`)
let res = await fetch(`https://api.vercel.app/blog/${id}`)
let post: Post = await res.json()
if (!post) notFound()
return post
}

export async function generateStaticParams() {
let posts = await fetch('https://api.example.com/posts').then((res) =>
let posts = await fetch('https://api.vercel.app/blog').then((res) =>
res.json()
)

Expand Down Expand Up @@ -315,14 +315,14 @@ export default async function Page({ params }: { params: { id: string } }) {
import { notFound } from 'next/navigation'

async function getPost(id) {
let res = await fetch(`https://api.example.com/posts/${id}`)
let res = await fetch(`https://api.vercel.app/blog/${id}`)
let post = await res.json()
if (!post) notFound()
return post
}

export async function generateStaticParams() {
let posts = await fetch('https://api.example.com/posts').then((res) =>
let posts = await fetch('https://api.vercel.app/blog').then((res) =>
res.json()
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function create() {}
import { create } from '@/app/actions'

export function Button() {
return <button onClick={create}>Create</button>
return <button onClick={() => create()}>Create</button>
}
```

Expand All @@ -76,7 +76,7 @@ export function Button() {
import { create } from '@/app/actions'

export function Button() {
return <button onClick={create}>Create</button>
return <button onClick={() => create()}>Create</button>
}
```

Expand Down Expand Up @@ -450,7 +450,7 @@ The [`useFormStatus`](https://react.dev/reference/react-dom/hooks/useFormStatus)
```tsx filename="app/submit-button.tsx" highlight={6} switcher
'use client'

import { useFormStatus } from 'react'
import { useFormStatus } from 'react-dom'

export function SubmitButton() {
const { pending } = useFormStatus()
Expand All @@ -466,7 +466,7 @@ export function SubmitButton() {
```jsx filename="app/submit-button.js" highlight={6} switcher
'use client'

import { useFormStatus } from 'react'
import { useFormStatus } from 'react-dom'

export function SubmitButton() {
const { pending } = useFormStatus()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function EventButton() {
return (
<div>
<button
onClick={() => sendGTMEvent('event', 'buttonClicked', { value: 'xyz' })}
onClick={() => sendGTMEvent({ event: 'buttonClicked', value: 'xyz' })}
>
Send Event
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,27 @@ app.prepare().then(() => {
```

```js filename="server.js" switcher
import { createServer } from "http";
import { parse } from "url";
import next from "next";
import { createServer } from 'http'
import { parse } from 'url'
import next from 'next'

const port = parseInt(process.env.PORT || "3000", 10);
const dev = process.env.NODE_ENV !== "production";
const app = next({ dev });
const handle = app.getRequestHandler();
const port = parseInt(process.env.PORT || '3000', 10)
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()

app.prepare().then(() => {
createServer((req, res) => {
const parsedUrl = parse(req.url!, true);
handle(req, res, parsedUrl);
}).listen(port);
const parsedUrl = parse(req.url, true)
handle(req, res, parsedUrl)
}).listen(port)

console.log(
`> Server listening at http://localhost:${port} as ${
dev ? "development" : process.env.NODE_ENV
}`,
);
});
dev ? 'development' : process.env.NODE_ENV
}`
)
})
```

> `server.js` does not run through the Next.js Compiler or bundling process. Make sure the syntax and source code this file requires are compatible with the current Node.js version you are using. [View an example](https://github.com/vercel/next.js/tree/canary/examples/custom-server).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ related:
title: Next Steps
description: See the API reference for more information on how to use Draft Mode.
links:
- app/building-your-application/configuring/draft-mode
- app/api-reference/functions/draft-mode
---

**Draft Mode** allows you to preview draft content from your headless CMS in your Next.js application. This is useful for static pages that are generated at build time as it allows you to switch to [dynamic rendering](/docs/app/building-your-application/rendering/server-components#dynamic-rendering) and see the draft changes without having to rebuild your entire site.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Back in your `<SignupForm />`, you can use React's `useFormState` hook to displa
```tsx filename="app/ui/signup-form.tsx" switcher highlight={7,15,21,27-39}
'use client'

import { useFormState, useFormStatus } from 'react'
import { useFormState, useFormStatus } from 'react-dom'
import { signup } from '@/app/actions/auth'

export function SignupForm() {
Expand Down Expand Up @@ -258,7 +258,7 @@ function SubmitButton() {
```jsx filename="app/ui/signup-form.js" switcher highlight={7,15,21,27-39}
'use client'

import { useFormState, useFormStatus } from 'react'
import { useFormState, useFormStatus } from 'react-dom'
import { signup } from '@/app/actions/auth'

export function SignupForm() {
Expand All @@ -270,19 +270,19 @@ export function SignupForm() {
<label htmlFor="name">Name</label>
<input id="name" name="name" placeholder="John Doe" />
</div>
{state.errors.name && <p>{state.errors.name}</p>}
{state?.errors?.name && <p>{state.errors.name}</p>}

<div>
<label htmlFor="email">Email</label>
<input id="email" name="email" placeholder="john@example.com" />
</div>
{state.errors.email && <p>{state.errors.email}</p>}
{state?.errors?.email && <p>{state.errors.email}</p>}

<div>
<label htmlFor="password">Password</label>
<input id="password" name="password" type="password" />
</div>
{state.errors.password && (
{state?.errors?.password && (
<div>
<p>Password must:</p>
<ul>
Expand Down
4 changes: 2 additions & 2 deletions docs/02-app/02-api-reference/01-components/image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ When using an external URL, you must add it to [remotePatterns](#remotepatterns)

### `width`

The `width` property represents the _intrinsic_ image width in pixels.
The `width` property represents the _intrinsic_ image width in pixels. This property is used to infer the correct aspect ratio of the image and avoid layout shift during loading. It does not determine the rendered size of the image, which is controlled by CSS, similar to the `width` attribute in the HTML `<img>` tag.

Required, except for [statically imported images](/docs/app/building-your-application/optimizing/images#local-images) or images with the [`fill` property](#fill).

### `height`

The `height` property represents the _intrinsic_ image height in pixels.
The `height` property represents the _intrinsic_ image height in pixels. This property is used to infer the correct aspect ratio of the image and avoid layout shift during loading. It does not determine the rendered size of the image, which is controlled by CSS, similar to the `height` attribute in the HTML `<img>` tag.

Required, except for [statically imported images](/docs/app/building-your-application/optimizing/images#local-images) or images with the [`fill` property](#fill).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ description: Learn about how to configure options for Next.js route segments.

The Route Segment options allows you to configure the behavior of a [Page](/docs/app/building-your-application/routing/layouts-and-templates), [Layout](/docs/app/building-your-application/routing/layouts-and-templates), or [Route Handler](/docs/app/building-your-application/routing/route-handlers) by directly exporting the following variables:

| Option | Type | Default |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| [`experimental_ppr`](#dynamic) | `'true' \| 'false'` |
| [`dynamic`](#dynamic) | `'auto' \| 'force-dynamic' \| 'error' \| 'force-static'` | `'auto'` |
| [`dynamicParams`](#dynamicparams) | `boolean` | `true` |
| [`revalidate`](#revalidate) | `false \| 0 \| number` | `false` |
| [`fetchCache`](#fetchcache) | `'auto' \| 'default-cache' \| 'only-cache' \| 'force-cache' \| 'force-no-store' \| 'default-no-store' \| 'only-no-store'` | `'auto'` |
| [`runtime`](#runtime) | `'nodejs' \| 'edge'` | `'nodejs'` |
| [`preferredRegion`](#preferredregion) | `'auto' \| 'global' \| 'home' \| string \| string[]` | `'auto'` |
| [`maxDuration`](#maxduration) | `number` | Set by deployment platform |
| Option | Type | Default |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| [`experimental_ppr`](#experimental_ppr) | `'true' \| 'false'` |
| [`dynamic`](#dynamic) | `'auto' \| 'force-dynamic' \| 'error' \| 'force-static'` | `'auto'` |
| [`dynamicParams`](#dynamicparams) | `boolean` | `true` |
| [`revalidate`](#revalidate) | `false \| 0 \| number` | `false` |
| [`fetchCache`](#fetchcache) | `'auto' \| 'default-cache' \| 'only-cache' \| 'force-cache' \| 'force-no-store' \| 'default-no-store' \| 'only-no-store'` | `'auto'` |
| [`runtime`](#runtime) | `'nodejs' \| 'edge'` | `'nodejs'` |
| [`preferredRegion`](#preferredregion) | `'auto' \| 'global' \| 'home' \| string \| string[]` | `'auto'` |
| [`maxDuration`](#maxduration) | `number` | Set by deployment platform |

## Options

Expand Down
3 changes: 2 additions & 1 deletion examples/github-pages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ pnpm create next-app --example github-pages nextjs-github-pages
### Deploy to GitHub Pages

1. Create a new public GitHub repository.
1. Edit `next.config.js` to match your GitHub repository name.
1. Edit `next.config.js` to match your GitHub repository name:
- Given the pattern `https://github.com/<user>/<repo>`, update your `basePath` config to `/repo`.
1. Push the starter code to the `main` branch.
1. Run the `deploy` script (e.g. `npm run deploy`) to create the `gh-pages` branch.
1. On GitHub, go to **Settings** > **Pages** > **Branch**, and choose `gh-pages` as the branch with the `/root` folder. Hit **Save**.
Expand Down
2 changes: 0 additions & 2 deletions examples/with-docker-compose/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

services:
next-app:
container_name: next-app
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

services:
next-app:
container_name: next-app
Expand Down
2 changes: 0 additions & 2 deletions examples/with-docker-compose/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

services:
next-app:
container_name: next-app
Expand Down
2 changes: 0 additions & 2 deletions examples/with-docker/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ node_modules
npm-debug.log
README.md
.next
!.next/static
!.next/standalone
.git
2 changes: 1 addition & 1 deletion examples/with-strict-csp/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function middleware(request) {
const nonce = Buffer.from(crypto.randomUUID()).toString("base64");
const cspHeader = `
default-src 'self';
script-src 'self' 'nonce-${nonce}' 'strict-dynamic' https: http: 'unsafe-inline' ${
script-src 'self' 'nonce-${nonce}' 'strict-dynamic' https: http: ${
process.env.NODE_ENV === "production" ? "" : `'unsafe-eval'`
};
style-src 'self' 'nonce-${nonce}';
Expand Down
2 changes: 1 addition & 1 deletion examples/with-supabase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ If you wish to just develop locally and not deploy to Vercel, [follow the steps
cd name-of-new-app
```
4. Rename `.env.local.example` to `.env.local` and update the following:
4. Rename `.env.example` to `.env.local` and update the following:
```
NEXT_PUBLIC_SUPABASE_URL=[INSERT SUPABASE PROJECT URL]
Expand Down
4 changes: 2 additions & 2 deletions examples/with-supabase/app/(auth-pages)/smtp-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export function SmtpMessage() {
<InfoIcon size={16} className="mt-0.5" />
<div className="flex flex-col gap-1">
<small className="text-sm text-secondary-foreground">
<strong> Note:</strong> Emails are limited to 4 per hour. Enable a
custom SMTP endpoint to increase the rate limit.
<strong> Note:</strong> Emails are rate limited. Enable Custom SMTP to
increase the rate limit.
</small>
<div>
<Link
Expand Down
2 changes: 1 addition & 1 deletion examples/with-supabase/components/deploy-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function DeployButton() {
>
<Button className="flex items-center gap-2" size={"sm"}>
<svg
className="h-3 h-3"
className="h-3 w-3"
viewBox="0 0 76 65"
fill="hsl(var(--background)/1)"
xmlns="http://www.w3.org/2000/svg"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "15.0.0-canary.156"
"version": "15.0.0-canary.157"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
"taskr": "1.1.0",
"tree-kill": "1.2.2",
"tsec": "0.2.1",
"turbo": "2.0.9",
"turbo": "2.1.2",
"typescript": "5.5.3",
"unfetch": "4.2.0",
"wait-port": "0.2.2",
Expand Down
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": "15.0.0-canary.156",
"version": "15.0.0-canary.157",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "15.0.0-canary.156",
"version": "15.0.0-canary.157",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "15.0.0-canary.156",
"@next/eslint-plugin-next": "15.0.0-canary.157",
"@rushstack/eslint-patch": "^1.3.3",
"@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
Expand Down
Loading

0 comments on commit d8c383a

Please sign in to comment.