Skip to content

Upgrade react-server-dom-webpack and precompiled assets #41547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 19, 2022
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
2 changes: 1 addition & 1 deletion packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function isResourceInPackages(resource: string, packageNames?: string[]) {
const builtInReactImports = [
'react',
'react/jsx-runtime',
'next/dist/compiled/react-server-dom-webpack/writer.browser.server',
'next/dist/compiled/react-server-dom-webpack/server.browser',
]

export function getDefineEnv({
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/webpack/loaders/next-app-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const nextAppLoader: webpack.LoaderDefinitionFunction<{

export const serverHooks = require('next/dist/client/components/hooks-server-context.js')

export const renderToReadableStream = require('next/dist/compiled/react-server-dom-webpack/writer.browser.server').renderToReadableStream
export const renderToReadableStream = require('next/dist/compiled/react-server-dom-webpack/server.browser').renderToReadableStream
export const __next_app_webpack_require__ = __webpack_require__
`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ export class NextJsRequireCacheHotReloader implements WebpackPluginInstance {
if (hasAppPath) {
// ensure we reset the cache for sc_server components
// loaded via react-server-dom-webpack
const reactWebpackModId = require.resolve(
'next/dist/compiled/react-server-dom-webpack'
const reactServerDomModId = require.resolve(
'next/dist/compiled/react-server-dom-webpack/client'
)
const reactWebpackMod = require.cache[reactWebpackModId]
const reactServerDomMod = require.cache[reactServerDomModId]

if (reactWebpackMod) {
for (const child of reactWebpackMod.children) {
if (reactServerDomMod) {
for (const child of reactServerDomMod.children) {
child.parent = null
delete require.cache[child.id]
}
}
delete require.cache[reactWebpackModId]
delete require.cache[reactServerDomModId]
}

entries.forEach((page) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/client/app-index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '../build/polyfills/polyfill-module'
import ReactDOMClient from 'react-dom/client'
// TODO-APP: change to React.use once it becomes stable
import React, { experimental_use as use } from 'react'
import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack'
import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack/client'

import measureWebVitals from './performance-relayer'
import { HeadManagerContext } from '../shared/lib/head-manager-context'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/client/components/app-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { ReactNode } from 'react'
import React, { useEffect, useMemo, useCallback } from 'react'
import { createFromFetch } from 'next/dist/compiled/react-server-dom-webpack'
import { createFromFetch } from 'next/dist/compiled/react-server-dom-webpack/client'
import {
AppRouterContext,
LayoutRouterContext,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/compiled/react-dom/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Facebook, Inc. and its affiliates.
Copyright (c) Meta Platforms, Inc. and affiliates.

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