Skip to content

Commit

Permalink
test app
Browse files Browse the repository at this point in the history
Fix bad modRequest in flight entry manifest (#68888)

While going through the logic of flight manifest, found the `modRequest`
sometimes accidentally become `"undefined"` string due to composing with
another potential undefined value. This caused extra traversal, fixing
this will improve a bit on the performance.

test app
  • Loading branch information
huozhi committed Aug 20, 2024
1 parent 15aeb92 commit 2a6ff5f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/e2e/app-dir/actions-tree-shaking/app/actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use server'

export async function action() {
return 'hello'
}

export async function unusedExportedAction() {
return 'unused-exported-action'
}
7 changes: 7 additions & 0 deletions test/e2e/app-dir/actions-tree-shaking/app/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Layout({ children }) {
return (
<html>
<body>{children}</body>
</html>
)
}
21 changes: 21 additions & 0 deletions test/e2e/app-dir/actions-tree-shaking/app/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use client'

import { useState } from 'react'
import { action } from './actions'

export default function Page() {
const [text, setText] = useState('initial')
return (
<div>
<button
id="action-1"
onClick={async () => {
setText(await action())
}}
>
Action 1
</button>
<span>{text}</span>
</div>
)
}

0 comments on commit 2a6ff5f

Please sign in to comment.