Files
Niklas MischkulnigandGitHub 46789444d5 Remove unused layer from server actions manifest (#91425)
```
    // This is only used by Webpack to correctly output the manifest. It's value shouldn't be relied
    // upon externally. It's possible that the same action can be in different layers in a single
    // page, which cannot be modelled with this API anyway.
```
2026-03-16 14:10:22 +01:00

34 lines
1020 B
TypeScript

import {
nextTestSetupActionTreeShaking,
getActionsRoutesStateByRuntime,
} from '../_testing/utils'
// TODO: revisit when we have a better side-effect free transform approach for server action
;(process.env.IS_TURBOPACK_TEST ? describe : describe.skip)(
'actions-tree-shaking - basic',
() => {
const { next } = nextTestSetupActionTreeShaking({
files: __dirname,
})
it('should not have the unused action in the manifest', async () => {
const actionsRoutesState = await getActionsRoutesStateByRuntime(next)
expect(actionsRoutesState).toMatchInlineSnapshot(`
{
"app/client/page": [
"app/actions.js#clientComponentAction",
],
"app/inline/page": [
"app/inline/page.js#$$RSC_SERVER_ACTION_0",
],
"app/server/page": [
"app/actions.js#clientComponentAction",
"app/actions.js#serverComponentAction",
"app/actions.js#unusedExportedAction",
],
}
`)
})
}
)