Skip to content

Commit

Permalink
Remove unused nccd node-fetch (#76241)
Browse files Browse the repository at this point in the history
This vendored packaged is no longer needed as we removed the last usage
of it.

x-ref: #75741
  • Loading branch information
ijjk authored Feb 20, 2025
1 parent 47f3500 commit d1c9aec
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/next/src/compiled/node-fetch/index.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/next/src/compiled/node-fetch/package.json

This file was deleted.

11 changes: 0 additions & 11 deletions packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const externals = {
'caniuse-lite': 'caniuse-lite',
'/caniuse-lite(/.*)/': 'caniuse-lite$1',

'node-fetch': 'node-fetch',
postcss: 'postcss',
// Ensure latest version is used
'postcss-safe-parser': 'next/dist/compiled/postcss-safe-parser',
Expand Down Expand Up @@ -241,15 +240,6 @@ export async function copy_vercel_og(task, opts) {
)
}

// eslint-disable-next-line camelcase
externals['node-fetch'] = 'next/dist/compiled/node-fetch'
export async function ncc_node_fetch(task, opts) {
await task
.source(relative(__dirname, require.resolve('node-fetch')))
.ncc({ packageName: 'node-fetch', externals })
.target('src/compiled/node-fetch')
}

externals['anser'] = 'next/dist/compiled/anser'
externals['next/dist/compiled/anser'] = 'next/dist/compiled/anser'
export async function ncc_node_anser(task, opts) {
Expand Down Expand Up @@ -2310,7 +2300,6 @@ export async function ncc(task, opts) {
'ncc_image_size',
'ncc_hapi_accept',
'ncc_commander',
'ncc_node_fetch',
'ncc_node_anser',
'ncc_node_stacktrace_parser',
'ncc_node_data_uri_to_buffer',
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/next-font/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ describe('next/font', () => {
})
}

it('should not have deprecation warning', async () => {
expect(next.cliOutput.toLowerCase()).not.toContain('deprecation')
})

describe('import values', () => {
test('page with font', async () => {
const html = await renderViaHTTP(next.url, '/with-fonts')
Expand Down
4 changes: 4 additions & 0 deletions test/integration/amphtml/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ describe('AMP Usage', () => {
return killApp(app)
})

it('should not have deprecation warning', async () => {
expect(output.toLowerCase()).not.toContain('deprecation')
})

it('should have amp optimizer in trace', async () => {
const trace = JSON.parse(
readFileSync(join(appDir, '.next/next-server.js.nft.json'), 'utf8')
Expand Down

0 comments on commit d1c9aec

Please sign in to comment.