Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions packages/next/src/build/flying-shuttle/stitch-builds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
APP_BUILD_MANIFEST,
APP_PATH_ROUTES_MANIFEST,
APP_PATHS_MANIFEST,
AUTOMATIC_FONT_OPTIMIZATION_MANIFEST,
BUILD_MANIFEST,
CLIENT_REFERENCE_MANIFEST,
FUNCTIONS_CONFIG_MANIFEST,
Expand Down Expand Up @@ -366,22 +365,6 @@ export async function stitchBuilds(
)}`
)

// for server/font-manifest.json we just merge the arrays
for (const file of [AUTOMATIC_FONT_OPTIMIZATION_MANIFEST]) {
const [restoreFontManifest, currentFontManifest] = await Promise.all(
[
path.join(shuttleDir, 'server', file),
path.join(distDir, 'server', file),
].map(async (f) => JSON.parse(await fs.promises.readFile(f, 'utf8')))
)
const mergedFontManifest = [...restoreFontManifest, ...currentFontManifest]

await fs.promises.writeFile(
path.join(distDir, 'server', file),
JSON.stringify(mergedFontManifest, null, 2)
)
}

// for server/functions-config-manifest.json we just merge
// the functions field
const [restoreFunctionsConfigManifest, currentFunctionsConfigManifest] =
Expand Down
11 changes: 0 additions & 11 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import {
CLIENT_STATIC_FILES_PATH,
EXPORT_DETAIL,
EXPORT_MARKER,
AUTOMATIC_FONT_OPTIMIZATION_MANIFEST,
IMAGES_MANIFEST,
PAGES_MANIFEST,
PHASE_PRODUCTION_BUILD,
Expand Down Expand Up @@ -2349,12 +2348,6 @@ export default async function build(
]
: []),
REACT_LOADABLE_MANIFEST,
config.optimizeFonts
? path.join(
SERVER_DIRECTORY,
AUTOMATIC_FONT_OPTIMIZATION_MANIFEST
)
: null,
BUILD_ID_FILE,
path.join(SERVER_DIRECTORY, NEXT_FONT_MANIFEST + '.js'),
path.join(SERVER_DIRECTORY, NEXT_FONT_MANIFEST + '.json'),
Expand Down Expand Up @@ -2476,10 +2469,6 @@ export default async function build(
featureName: 'experimental/nextScriptWorkers',
invocationCount: config.experimental.nextScriptWorkers ? 1 : 0,
},
{
featureName: 'optimizeFonts',
invocationCount: config.optimizeFonts ? 1 : 0,
},
{
featureName: 'experimental/ppr',
invocationCount: config.experimental.ppr ? 1 : 0,
Expand Down
15 changes: 0 additions & 15 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1856,20 +1856,6 @@ export default async function getBaseWebpackConfig(
clientRouterFilters,
}),
new ProfilingPlugin({ runWebpackSpan, rootDir: dir }),
config.optimizeFonts &&
!dev &&
isNodeServer &&
(function () {
const { FontStylesheetGatheringPlugin } =
require('./webpack/plugins/font-stylesheet-gathering-plugin') as {
FontStylesheetGatheringPlugin: typeof import('./webpack/plugins/font-stylesheet-gathering-plugin').FontStylesheetGatheringPlugin
}
return new FontStylesheetGatheringPlugin({
adjustFontFallbacks: config.experimental.adjustFontFallbacks,
adjustFontFallbacksWithSizeAdjust:
config.experimental.adjustFontFallbacksWithSizeAdjust,
})
})(),
new WellKnownErrorsPlugin(),
isClient &&
new CopyFilePlugin({
Expand Down Expand Up @@ -2071,7 +2057,6 @@ export default async function getBaseWebpackConfig(
buildActivityPosition: config.devIndicators.buildActivityPosition,
productionBrowserSourceMaps: !!config.productionBrowserSourceMaps,
reactStrictMode: config.reactStrictMode,
optimizeFonts: config.optimizeFonts,
optimizeCss: config.experimental.optimizeCss,
nextScriptWorkers: config.experimental.nextScriptWorkers,
scrollRestoration: config.experimental.scrollRestoration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ export function getDefineEnv({
'process.env.__NEXT_STRICT_MODE_APP':
// When next.config.js does not have reactStrictMode it's enabled by default.
config.reactStrictMode === null ? true : config.reactStrictMode,
'process.env.__NEXT_OPTIMIZE_FONTS': !dev && config.optimizeFonts,
'process.env.__NEXT_OPTIMIZE_CSS':
(config.experimental.optimizeCss && !dev) ?? false,
'process.env.__NEXT_SCRIPT_WORKERS':
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions packages/next/src/export/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import { loadEnvConfig } from '@next/env'
import { isAPIRoute } from '../lib/is-api-route'
import { getPagePath } from '../server/require'
import type { Span } from '../trace'
import type { FontConfig } from '../server/font-utils'
import type { MiddlewareManifest } from '../build/webpack/plugins/middleware-plugin'
import { isAppRouteRoute } from '../lib/is-app-route-route'
import { isAppPageRoute } from '../lib/is-app-page-route'
Expand Down Expand Up @@ -340,7 +339,6 @@ async function exportAppImpl(
optimizeCss: nextConfig.experimental.optimizeCss,
nextConfigOutput: nextConfig.output,
nextScriptWorkers: nextConfig.experimental.nextScriptWorkers,
optimizeFonts: nextConfig.optimizeFonts as FontConfig,
largePageDataBytes: nextConfig.experimental.largePageDataBytes,
serverActions: nextConfig.experimental.serverActions,
serverComponents: enabledDirectories.app,
Expand Down
10 changes: 2 additions & 8 deletions packages/next/src/export/routes/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,10 @@ export async function exportPagesPage(
}
} else {
/**
* This sets environment variable to be used at the time of static export by head.tsx.
* This sets environment variable to be used at the time of SSR by head.tsx.
* Using this from process.env allows targeting SSR by calling
* `process.env.__NEXT_OPTIMIZE_FONTS`.
* TODO(prateekbh@): Remove this when experimental.optimizeFonts are being cleaned up.
* `process.env.__NEXT_OPTIMIZE_CSS`.
*/
if (renderOpts.optimizeFonts) {
process.env.__NEXT_OPTIMIZE_FONTS = JSON.stringify(
renderOpts.optimizeFonts
)
}
if (renderOpts.optimizeCss) {
process.env.__NEXT_OPTIMIZE_CSS = JSON.stringify(true)
}
Expand Down
Loading