Unverified Commit 5736391c authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Turbopack Build: Fix metadata dynamic force-dynamic (#80167)

## What?

`export const dynamic` was not being re-exported when creating the route
handler wrapper so it wasn't picked up during builds, causing the tests
to fail. Added the re-exports.
parent 16d9f702
...@@ -239,6 +239,8 @@ async fn dynamic_text_route_source(path: Vc<FileSystemPath>) -> Result<Vc<Box<dy ...@@ -239,6 +239,8 @@ async fn dynamic_text_route_source(path: Vc<FileSystemPath>) -> Result<Vc<Box<dy
}}, }},
}}) }})
}} }}
export * from {resource_path}
"#, "#,
resource_path = StringifyJs(&format!("./{stem}.{ext}")), resource_path = StringifyJs(&format!("./{stem}.{ext}")),
content_type = StringifyJs(&content_type), content_type = StringifyJs(&content_type),
...@@ -330,6 +332,8 @@ async fn dynamic_site_map_route_source( ...@@ -330,6 +332,8 @@ async fn dynamic_site_map_route_source(
}}) }})
}} }}
export * from {resource_path}
{static_generation_code} {static_generation_code}
"#, "#,
resource_path = StringifyJs(&format!("./{stem}.{ext}")), resource_path = StringifyJs(&format!("./{stem}.{ext}")),
...@@ -395,6 +399,8 @@ async fn dynamic_image_route_source(path: Vc<FileSystemPath>) -> Result<Vc<Box<d ...@@ -395,6 +399,8 @@ async fn dynamic_image_route_source(path: Vc<FileSystemPath>) -> Result<Vc<Box<d
return handler({{ params: restParams, id }}) return handler({{ params: restParams, id }})
}} }}
export * from {resource_path}
"#, "#,
resource_path = StringifyJs(&format!("./{stem}.{ext}")), resource_path = StringifyJs(&format!("./{stem}.{ext}")),
}; };
......
...@@ -1949,11 +1949,10 @@ ...@@ -1949,11 +1949,10 @@
"test/e2e/app-dir/dynamic-in-generate-params/index.test.ts": { "test/e2e/app-dir/dynamic-in-generate-params/index.test.ts": {
"passed": [ "passed": [
"app-dir - dynamic in generate params should be able to call fetch while generating multiple dynamic pages", "app-dir - dynamic in generate params should be able to call fetch while generating multiple dynamic pages",
"app-dir - dynamic in generate params should be able to call while generating multiple dynamic sitemaps" "app-dir - dynamic in generate params should be able to call while generating multiple dynamic sitemaps",
],
"failed": [
"app-dir - dynamic in generate params should render sitemap with generateSitemaps in force-dynamic config dynamically" "app-dir - dynamic in generate params should render sitemap with generateSitemaps in force-dynamic config dynamically"
], ],
"failed": [],
"pending": [], "pending": [],
"flakey": [], "flakey": [],
"runtimeError": false "runtimeError": false
...@@ -2974,11 +2973,10 @@ ...@@ -2974,11 +2973,10 @@
"app dir - metadata dynamic routes social image routes should render og image with opengraph-image dynamic routes", "app dir - metadata dynamic routes social image routes should render og image with opengraph-image dynamic routes",
"app dir - metadata dynamic routes social image routes should render og image with twitter-image dynamic routes", "app dir - metadata dynamic routes social image routes should render og image with twitter-image dynamic routes",
"app dir - metadata dynamic routes social image routes should support generate multi images with generateImageMetadata", "app dir - metadata dynamic routes social image routes should support generate multi images with generateImageMetadata",
"app dir - metadata dynamic routes social image routes should support params as argument in dynamic routes" "app dir - metadata dynamic routes social image routes should support params as argument in dynamic routes",
],
"failed": [
"app dir - metadata dynamic routes route segment config should generate dynamic route if dynamic config is force-dynamic" "app dir - metadata dynamic routes route segment config should generate dynamic route if dynamic config is force-dynamic"
], ],
"failed": [],
"pending": [], "pending": [],
"flakey": [], "flakey": [],
"runtimeError": false "runtimeError": false
...@@ -18500,10 +18498,10 @@ ...@@ -18500,10 +18498,10 @@
"runtimeError": false "runtimeError": false
}, },
"test/production/app-dir/metadata-revalidate/metadata-revalidate.test.ts": { "test/production/app-dir/metadata-revalidate/metadata-revalidate.test.ts": {
"passed": [], "passed": [
"failed": [
"app-dir - metadata-revalidate should contain the routes in prerender manifest" "app-dir - metadata-revalidate should contain the routes in prerender manifest"
], ],
"failed": [],
"pending": [], "pending": [],
"flakey": [], "flakey": [],
"runtimeError": false "runtimeError": false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment