diff --git a/.github/actions/next-stats-action/native/.gitignore b/.github/actions/next-stats-action/native/.gitignore new file mode 100644 index 0000000000000..86d0cb2726c6c --- /dev/null +++ b/.github/actions/next-stats-action/native/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/.github/actions/next-stats-action/src/prepare/repo-setup.js b/.github/actions/next-stats-action/src/prepare/repo-setup.js index a5fef07ce7ef2..a4ce1062cc237 100644 --- a/.github/actions/next-stats-action/src/prepare/repo-setup.js +++ b/.github/actions/next-stats-action/src/prepare/repo-setup.js @@ -65,7 +65,11 @@ module.exports = (actionInfo) => { * @param {{ repoDir: string, nextSwcVersion: null | string }} options Required options * @returns {Promise>} List packages key is the package name, value is the path to the packed tar file.' */ - async linkPackages({ repoDir, nextSwcVersion, parentSpan }) { + async linkPackages({ + repoDir, + nextSwcVersion: nextSwcVersionSpecified, + parentSpan, + }) { if (!parentSpan) { // Not all callers provide a parent span parentSpan = mockSpan() @@ -118,6 +122,11 @@ module.exports = (actionInfo) => { } }) + const nextSwcVersion = + nextSwcVersionSpecified ?? + pkgDatas.get('@next/swc')?.packedPackageTarPath ?? + null + await parentSpan .traceChild('write-packagejson') .traceAsyncFn(async () => { @@ -171,9 +180,11 @@ module.exports = (actionInfo) => { }) if (nextSwcVersion) { Object.assign(packageJson.dependencies, { + // CI '@next/swc-linux-x64-gnu': nextSwcVersion, + // Vercel issued laptops + '@next/swc-darwin-arm64': nextSwcVersion, }) - } else { } } diff --git a/packages/next/src/server/render.tsx b/packages/next/src/server/render.tsx index 1631b67764115..810998ca61fb4 100644 --- a/packages/next/src/server/render.tsx +++ b/packages/next/src/server/render.tsx @@ -41,7 +41,7 @@ import type { Revalidate, SwrDelta } from './lib/revalidate' import type { COMPILER_NAMES } from '../shared/lib/constants' import React, { type JSX } from 'react' -import ReactDOMServer from 'react-dom/server.browser' +import ReactDOMServerEdge from 'react-dom/server.edge' import { StyleRegistry, createStyleRegistry } from 'styled-jsx' import { GSP_NO_RETURNED_VALUE, @@ -128,7 +128,7 @@ function noRouter() { } async function renderToString(element: React.ReactElement) { - const renderStream = await ReactDOMServer.renderToReadableStream(element) + const renderStream = await ReactDOMServerEdge.renderToReadableStream(element) await renderStream.allReady return streamToString(renderStream) } @@ -1320,7 +1320,7 @@ export async function renderToHTMLImpl( ) => { const content = renderContent(EnhancedApp, EnhancedComponent) return await renderToInitialFizzStream({ - ReactDOMServer, + ReactDOMServer: ReactDOMServerEdge, element: content, }) } diff --git a/test/.stats-app/package.json b/test/.stats-app/package.json index 45bdbd3a667f6..27e65a82a242b 100644 --- a/test/.stats-app/package.json +++ b/test/.stats-app/package.json @@ -3,7 +3,7 @@ "private": true, "license": "MIT", "dependencies": { - "next": "19.0.0-rc-6230622a1a-20240610", + "next": "latest", "react": "19.0.0-rc-6230622a1a-20240610", "react-dom": "19.0.0-rc-6230622a1a-20240610" },