Skip to content

Commit 235ed87

Browse files
committed
EXAMPLE server actions
1 parent 0b93444 commit 235ed87

File tree

8 files changed

+65
-15
lines changed

8 files changed

+65
-15
lines changed

bench/nested-deps/app/actions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use server'
2+
3+
export async function foo() {
4+
console.log('hello!')
5+
}

bench/nested-deps/app/layout.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function Layout({ children }: { children: React.ReactNode }) {
2+
return (
3+
<html>
4+
<body>{children}</body>
5+
</html>
6+
)
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default function Page() {
2+
return <button>Click me</button>
3+
}
4+
5+
export const runtime = 'edge'

bench/nested-deps/app/page.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use client'
2+
3+
import { foo } from './actions'
4+
5+
export default function Page() {
6+
return <button onClick={foo}>Click me</button>
7+
}

bench/nested-deps/next-env.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
import "./.next/types/routes.d.ts";
4+
5+
// NOTE: This file should not be edited
6+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

bench/nested-deps/next.config.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
const idx = process.execArgv.indexOf('--cpu-prof')
2-
if (idx >= 0) process.execArgv.splice(idx, 1)
3-
41
module.exports = {
5-
eslint: {
6-
ignoreDuringBuilds: true,
2+
experimental: {
3+
turbopackMinify: false,
4+
turbopackModuleIds: 'named',
5+
turbopackScopeHoisting: false,
76
},
87
}

bench/nested-deps/pages/index.jsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

bench/nested-deps/tsconfig.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2017",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"strict": false,
8+
"noEmit": true,
9+
"incremental": true,
10+
"module": "esnext",
11+
"esModuleInterop": true,
12+
"moduleResolution": "node",
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
"jsx": "react-jsx",
16+
"plugins": [
17+
{
18+
"name": "next"
19+
}
20+
]
21+
},
22+
"include": [
23+
"next-env.d.ts",
24+
".next/types/**/*.ts",
25+
".next/dev/types/**/*.ts",
26+
"**/*.mts",
27+
"**/*.ts",
28+
"**/*.tsx"
29+
],
30+
"exclude": ["node_modules", "**/*.test.ts", "**/*.test.tsx"]
31+
}

0 commit comments

Comments
 (0)