Skip to content

Commit

Permalink
Merge branch 'canary' into 09-23-Move_experimental.runtime_warning_to…
Browse files Browse the repository at this point in the history
…_config_loading
  • Loading branch information
kodiakhq[bot] committed Sep 23, 2023
2 parents e82a21c + ba5524d commit 2b2bd57
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 38 deletions.
49 changes: 20 additions & 29 deletions packages/next/src/build/webpack-config.ts
Expand Up @@ -284,35 +284,26 @@ function getOptimizedAliases(): { [pkg: string]: string } {
const stubObjectAssign = path.join(__dirname, 'polyfills', 'object-assign.js')

const shimAssign = path.join(__dirname, 'polyfills', 'object.assign')
return Object.assign(
{},
{
unfetch$: stubWindowFetch,
'isomorphic-unfetch$': stubWindowFetch,
'whatwg-fetch$': path.join(
__dirname,
'polyfills',
'fetch',
'whatwg-fetch.js'
),
},
{
'object-assign$': stubObjectAssign,

// Stub Package: object.assign
'object.assign/auto': path.join(shimAssign, 'auto.js'),
'object.assign/implementation': path.join(
shimAssign,
'implementation.js'
),
'object.assign$': path.join(shimAssign, 'index.js'),
'object.assign/polyfill': path.join(shimAssign, 'polyfill.js'),
'object.assign/shim': path.join(shimAssign, 'shim.js'),

// Replace: full URL polyfill with platform-based polyfill
url: require.resolve('next/dist/compiled/native-url'),
}
)
return {
unfetch$: stubWindowFetch,
'isomorphic-unfetch$': stubWindowFetch,
'whatwg-fetch$': path.join(
__dirname,
'polyfills',
'fetch',
'whatwg-fetch.js'
),
'object-assign$': stubObjectAssign,
// Stub Package: object.assign
'object.assign/auto': path.join(shimAssign, 'auto.js'),
'object.assign/implementation': path.join(shimAssign, 'implementation.js'),
'object.assign$': path.join(shimAssign, 'index.js'),
'object.assign/polyfill': path.join(shimAssign, 'polyfill.js'),
'object.assign/shim': path.join(shimAssign, 'shim.js'),

// Replace: full URL polyfill with platform-based polyfill
url: require.resolve('next/dist/compiled/native-url'),
}
}

// Alias these modules to be resolved with "module" if possible.
Expand Down
15 changes: 6 additions & 9 deletions test/e2e/app-dir/rsc-basic/rsc-basic.test.ts
Expand Up @@ -31,19 +31,16 @@ createNextDescribe(
},
({ next, isNextDev, isNextStart, isTurbopack }) => {
if (isNextDev && !isTurbopack) {
// TODO: Fix this test, it no longer uses stringified JSON.
it.skip('should have correct client references keys in manifest', async () => {
it('should have correct client references keys in manifest', async () => {
await next.render('/')
await check(async () => {
// Check that the client-side manifest is correct before any requests
const clientReferenceManifest = JSON.parse(
JSON.parse(
(
await next.readFile(
'.next/server/app/page_client-reference-manifest.js'
)
).match(/]=(.+)$/)[1]
)
(
await next.readFile(
'.next/server/app/page_client-reference-manifest.js'
)
).match(/]=(.+)$/)[1]
)
const clientModulesNames = Object.keys(
clientReferenceManifest.clientModules
Expand Down

0 comments on commit 2b2bd57

Please sign in to comment.