Skip to content

Commit 75a5351

Browse files
mischnictimneutkens
authored andcommitted
Turbopack: don't execute action loader eagerly
1 parent 589065d commit 75a5351

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

crates/next-api/src/app.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,6 @@ impl AppEndpoint {
17851785
bail!("rsc_entry must be evaluatable");
17861786
};
17871787

1788-
evaluatable_assets.push(server_action_manifest_loader);
17891788
evaluatable_assets.push(rsc_entry);
17901789

17911790
async {
@@ -1864,6 +1863,25 @@ impl AppEndpoint {
18641863
.await?;
18651864
}
18661865

1866+
{
1867+
let chunk_group = chunking_context
1868+
.chunk_group(
1869+
server_action_manifest_loader.ident(),
1870+
ChunkGroup::Entry(vec![ResolvedVc::upcast(
1871+
server_action_manifest_loader,
1872+
)]),
1873+
module_graph,
1874+
current_availability_info,
1875+
)
1876+
.await?;
1877+
1878+
current_chunks = current_chunks
1879+
.concatenate(*chunk_group.assets)
1880+
.resolve()
1881+
.await?;
1882+
current_availability_info = chunk_group.availability_info;
1883+
}
1884+
18671885
anyhow::Ok(Vc::cell(vec![
18681886
chunking_context
18691887
.entry_chunk_group_asset(

test/e2e/app-dir/actions/app-action.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('app-dir action handling', () => {
4444

4545
expect(itemInfo.filename).toBeString()
4646
// can be outside app dir but this test suite has them all in app
47-
expect(itemInfo.filename.startsWith('app/')).toBe(true)
47+
expect(itemInfo.filename).toStartWith('app/')
4848
expect(itemInfo.exportedName).toBeString()
4949
} catch (err) {
5050
require('console').error(`Invalid action entry ${item}`, err)

0 commit comments

Comments
 (0)