Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(turbopack): Align behavior for link rel="preconnect" with webpack mode #64011

Merged
merged 22 commits into from
Apr 8, 2024
1 change: 1 addition & 0 deletions packages/next-swc/crates/next-api/src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub(crate) async fn create_font_manifest(

let has_fonts = !font_paths.is_empty();
let using_size_adjust = font_paths.iter().any(|path| path.contains("-s"));

let font_paths = font_paths
.into_iter()
.filter(|path| path.contains(".p."))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ impl NextFontGoogleReplacer {
async fn import_map_result(&self, query: String) -> Result<Vc<ImportMapResult>> {
let request_hash = get_request_hash(&query).await?;
let qstr = qstring::QString::from(query.as_str());

let query_vc = Vc::cell(query);

let font_data = load_font_data(self.project_path);
Expand Down
1 change: 1 addition & 0 deletions packages/next/src/server/dev/turbopack-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ export async function handleRouteType({
} else {
manifestLoader.deleteMiddlewareManifest(serverKey)
}
await manifestLoader.loadFontManifest('/_app', 'pages')
await manifestLoader.loadFontManifest(page, 'pages')
await manifestLoader.loadLoadableManifest(page, 'pages')

Expand Down
5 changes: 3 additions & 2 deletions test/turbopack-dev-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6567,9 +6567,10 @@
"passed": [
"next/font/google no preloads with _app without preload",
"next/font/google without-preloaded-fonts without _app without fonts",
"next/font/google without-preloaded-fonts without _app without preload"
"next/font/google without-preloaded-fonts without _app without preload",
"next/font/google no preloads with _app without fonts"
],
"failed": ["next/font/google no preloads with _app without fonts"],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
Expand Down