Skip to content

Commit 5d7d272

Browse files
huozhiKikobeats
authored andcommitted
Upgrade react-server-dom-webpack and precompiled assets (vercel#41547)
Upgrade `react-server-dom-webpack` for exports renaming purpose x-ref: facebook/react#25504
1 parent 2b5cf10 commit 5d7d272

File tree

60 files changed

+5282
-7427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5282
-7427
lines changed

packages/next/build/webpack-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function isResourceInPackages(resource: string, packageNames?: string[]) {
125125
const builtInReactImports = [
126126
'react',
127127
'react/jsx-runtime',
128-
'next/dist/compiled/react-server-dom-webpack/writer.browser.server',
128+
'next/dist/compiled/react-server-dom-webpack/server.browser',
129129
]
130130

131131
export function getDefineEnv({

packages/next/build/webpack/loaders/next-app-loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ const nextAppLoader: webpack.LoaderDefinitionFunction<{
201201
202202
export const serverHooks = require('next/dist/client/components/hooks-server-context.js')
203203
204-
export const renderToReadableStream = require('next/dist/compiled/react-server-dom-webpack/writer.browser.server').renderToReadableStream
204+
export const renderToReadableStream = require('next/dist/compiled/react-server-dom-webpack/server.browser').renderToReadableStream
205205
export const __next_app_webpack_require__ = __webpack_require__
206206
`
207207

packages/next/build/webpack/plugins/nextjs-require-cache-hot-reloader.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ export class NextJsRequireCacheHotReloader implements WebpackPluginInstance {
8282
if (hasAppPath) {
8383
// ensure we reset the cache for sc_server components
8484
// loaded via react-server-dom-webpack
85-
const reactWebpackModId = require.resolve(
86-
'next/dist/compiled/react-server-dom-webpack'
85+
const reactServerDomModId = require.resolve(
86+
'next/dist/compiled/react-server-dom-webpack/client'
8787
)
88-
const reactWebpackMod = require.cache[reactWebpackModId]
88+
const reactServerDomMod = require.cache[reactServerDomModId]
8989

90-
if (reactWebpackMod) {
91-
for (const child of reactWebpackMod.children) {
90+
if (reactServerDomMod) {
91+
for (const child of reactServerDomMod.children) {
9292
child.parent = null
9393
delete require.cache[child.id]
9494
}
9595
}
96-
delete require.cache[reactWebpackModId]
96+
delete require.cache[reactServerDomModId]
9797
}
9898

9999
entries.forEach((page) => {

packages/next/client/app-index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import '../build/polyfills/polyfill-module'
44
import ReactDOMClient from 'react-dom/client'
55
// TODO-APP: change to React.use once it becomes stable
66
import React, { experimental_use as use } from 'react'
7-
import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack'
7+
import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack/client'
88

99
import measureWebVitals from './performance-relayer'
1010
import { HeadManagerContext } from '../shared/lib/head-manager-context'

packages/next/client/components/app-router.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type { ReactNode } from 'react'
44
import React, { useEffect, useMemo, useCallback } from 'react'
5-
import { createFromFetch } from 'next/dist/compiled/react-server-dom-webpack'
5+
import { createFromFetch } from 'next/dist/compiled/react-server-dom-webpack/client'
66
import {
77
AppRouterContext,
88
LayoutRouterContext,

packages/next/compiled/react-dom/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) Facebook, Inc. and its affiliates.
3+
Copyright (c) Meta Platforms, Inc. and affiliates.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)