Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc72f41

Browse files
authored
[backport] revert: add ?dpl to fonts in/_next/static/media (#83062) (#83066)
Backports:-#83062
1 parentc8faf68 commitbc72f41

File tree

13 files changed

+21
-59
lines changed

13 files changed

+21
-59
lines changed

‎packages/font/src/google/loader.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ describe('next/font/google loader', () => {
124124
mockFetchResource.mockResolvedValue(Buffer.from('OK'))
125125
const{ css}=awaitnextFontGoogleFontLoader({
126126
functionName,
127-
deploymentId:undefined,
128127
data:[
129128
{
130129
adjustFontFallback:false,

‎packages/font/src/local/loader.test.ts‎

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ describe('next/font/local loader', () => {
55
test('Default CSS',async()=>{
66
const{ css}=awaitnextFontLocalFontLoader({
77
functionName:'',
8-
deploymentId:undefined,
98
data:[{src:'./my-font.woff2'}],
109
emitFontFile:()=>'/_next/static/media/my-font.woff2',
1110
resolve:jest.fn(),
@@ -29,37 +28,9 @@ describe('next/font/local loader', () => {
2928
`)
3029
})
3130

32-
test('with dpl query string',async()=>{
33-
const{ css}=awaitnextFontLocalFontLoader({
34-
functionName:'',
35-
deploymentId:'dpl_123',
36-
data:[{src:'./my-font.woff2'}],
37-
emitFontFile:()=>'/_next/static/media/my-font.woff2',
38-
resolve:jest.fn(),
39-
isDev:false,
40-
isServer:true,
41-
variableName:'myFont',
42-
loaderContext:{
43-
fs:{
44-
readFile:(_:string,cb:any)=>cb(null,'fontdata'),
45-
},
46-
}asany,
47-
})
48-
49-
expect(css).toMatchInlineSnapshot(`
50-
"@font-face {
51-
font-family: myFont;
52-
src: url(/_next/static/media/my-font.woff2?dpl=dpl_123) format('woff2');
53-
font-display: swap;
54-
}
55-
"
56-
`)
57-
})
58-
5931
test('Weight and style',async()=>{
6032
const{ css}=awaitnextFontLocalFontLoader({
6133
functionName:'',
62-
deploymentId:undefined,
6334
data:[{src:'./my-font.woff2',weight:'100 900',style:'italic'}],
6435
emitFontFile:()=>'/_next/static/media/my-font.woff2',
6536
resolve:jest.fn(),
@@ -88,7 +59,6 @@ describe('next/font/local loader', () => {
8859
test('Other properties',async()=>{
8960
const{ css}=awaitnextFontLocalFontLoader({
9061
functionName:'',
91-
deploymentId:undefined,
9262
data:[
9363
{
9464
src:'./my-font.woff2',
@@ -125,7 +95,6 @@ describe('next/font/local loader', () => {
12595
test('Multiple weights default style',async()=>{
12696
const{ css}=awaitnextFontLocalFontLoader({
12797
functionName:'',
128-
deploymentId:undefined,
12998
data:[
13099
{
131100
style:'italic',
@@ -202,7 +171,6 @@ describe('next/font/local loader', () => {
202171
test('Multiple styles default weight',async()=>{
203172
const{ css}=awaitnextFontLocalFontLoader({
204173
functionName:'',
205-
deploymentId:undefined,
206174
data:[
207175
{
208176
weight:'400',
@@ -265,7 +233,6 @@ describe('next/font/local loader', () => {
265233
test('Custom font-family in declarations',async()=>{
266234
const{ css}=awaitnextFontLocalFontLoader({
267235
functionName:'',
268-
deploymentId:undefined,
269236
data:[
270237
{
271238
src:'./my-font.woff2',

‎packages/font/src/local/loader.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const nextFontLocalFontLoader: FontLoader = async ({
1919
data,
2020
emitFontFile,
2121
resolve,
22-
deploymentId,
2322
loaderContext,
2423
})=>{
2524
const{
@@ -46,10 +45,6 @@ const nextFontLocalFontLoader: FontLoader = async ({
4645
preload,
4746
typeofadjustFontFallback==='undefined'||!!adjustFontFallback
4847
)
49-
// Should match behavior in get-asset-query-string.ts
50-
constqs=deploymentId
51-
?`${fontUrl.includes('?') ?'&' :'?'}dpl=${deploymentId}`
52-
:''
5348

5449
// Try to load font metadata from the font file using fontkit.
5550
// The data is used to calculate the fallback font override values.
@@ -71,7 +66,7 @@ const nextFontLocalFontLoader: FontLoader = async ({
7166
?declarations.map(({ prop, value})=>[prop,value])
7267
:[]),
7368
...(hasCustomFontFamily ?[] :[['font-family',variableName]]),
74-
['src',`url(${fontUrl+qs}) format('${format}')`],
69+
['src',`url(${fontUrl}) format('${format}')`],
7570
['font-display',display],
7671
...(weight??defaultWeight
7772
?[['font-weight',weight??defaultWeight]]

‎packages/next/font/index.d.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export type FontLoader = (options: {
1919
resolve:(src:string)=>string
2020
isDev:boolean
2121
isServer:boolean
22-
deploymentId:string|undefined
2322
loaderContext:any
2423
})=>Promise<{
2524
css:string

‎packages/next/src/build/webpack-config.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2451,7 +2451,6 @@ export default async function getBaseWebpackConfig(
24512451
isEdgeRuntime:isEdgeServer,
24522452
targetWeb:isClient||isEdgeServer,
24532453
assetPrefix:config.assetPrefix||'',
2454-
deploymentId:config.deploymentId,
24552454
sassOptions:config.sassOptions,
24562455
productionBrowserSourceMaps:config.productionBrowserSourceMaps,
24572456
future:config.future,

‎packages/next/src/build/webpack/config/blocks/css/loaders/next-font.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export function getNextFontLoader(
6262
isDev:ctx.isDevelopment,
6363
isServer:ctx.isServer,
6464
assetPrefix:ctx.assetPrefix,
65-
deploymentId:ctx.deploymentId,
6665
fontLoaderPath,
6766
postcss,
6867
},

‎packages/next/src/build/webpack/config/index.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export async function buildConfiguration(
1919
isEdgeRuntime,
2020
targetWeb,
2121
assetPrefix,
22-
deploymentId,
2322
sassOptions,
2423
productionBrowserSourceMaps,
2524
future,
@@ -37,7 +36,6 @@ export async function buildConfiguration(
3736
isEdgeRuntime:boolean
3837
targetWeb:boolean
3938
assetPrefix:string
40-
deploymentId:string|undefined
4139
sassOptions:any
4240
productionBrowserSourceMaps:boolean
4341
transpilePackages:NextConfigComplete['transpilePackages']
@@ -63,7 +61,6 @@ export async function buildConfiguration(
6361
?assetPrefix.slice(0,-1)
6462
:assetPrefix
6563
:'',
66-
deploymentId,
6764
sassOptions,
6865
productionBrowserSourceMaps,
6966
transpilePackages,

‎packages/next/src/build/webpack/config/utils.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export type ConfigurationContext = {
1919
targetWeb:boolean
2020

2121
assetPrefix:string
22-
deploymentId:string|undefined
2322

2423
sassOptions:any
2524
productionBrowserSourceMaps:boolean

‎packages/next/src/build/webpack/loaders/next-font-loader/index.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export default async function nextFontLoader(this: any) {
4545
assetPrefix,
4646
fontLoaderPath,
4747
postcss:getPostcss,
48-
deploymentId,
4948
}=this.getOptions()
5049

5150
if(assetPrefix&&!/^\/|https?:\/\//.test(assetPrefix)){
@@ -67,7 +66,7 @@ export default async function nextFontLoader(this: any) {
6766
* NextFontManifestPlugin uses this to see if fallback fonts are being used.
6867
* This is used to collect stats on fallback fonts usage by the Google Aurora team.
6968
*/
70-
constemitFontFile:Parameters<FontLoader>[0]['emitFontFile']=(
69+
constemitFontFile=(
7170
content:Buffer,
7271
ext:string,
7372
preload:boolean,
@@ -110,7 +109,6 @@ export default async function nextFontLoader(this: any) {
110109
),
111110
isDev,
112111
isServer,
113-
deploymentId,
114112
loaderContext:this,
115113
})
116114
)

‎packages/next/src/pages/_document.tsx‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ function getAmpPath(ampPath: string, asPath: string): string {
363363
functiongetNextFontLinkTags(
364364
nextFontManifest:DeepReadonly<NextFontManifest>|undefined,
365365
dangerousAsPath:string,
366-
assetPrefix:string='',
367-
assetQueryString:string=''
366+
assetPrefix:string=''
368367
){
369368
if(!nextFontManifest){
370369
return{
@@ -404,7 +403,7 @@ function getNextFontLinkTags(
404403
<link
405404
key={fontFile}
406405
rel="preload"
407-
href={`${assetPrefix}/_next/${encodeURIPath(fontFile)}${assetQueryString}`}
406+
href={`${assetPrefix}/_next/${encodeURIPath(fontFile)}`}
408407
as="font"
409408
type={`font/${ext}`}
410409
crossOrigin="anonymous"
@@ -756,8 +755,7 @@ export class Head extends React.Component<HeadProps> {
756755
constnextFontLinkTags=getNextFontLinkTags(
757756
nextFontManifest,
758757
dangerousAsPath,
759-
assetPrefix,
760-
this.context.assetQueryString
758+
assetPrefix
761759
)
762760

763761
consttracingMetadata=getTracedMetadata(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp