Skip to content

Commit

Permalink
Move /static build into /server builds
Browse files Browse the repository at this point in the history
This joins the static (prerender) builds with the server builds.
  • Loading branch information
sebmarkbage committed Sep 1, 2023
1 parent 7022e8d commit cec23f3
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 39 deletions.
8 changes: 6 additions & 2 deletions packages/react-dom/npm/static.browser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
'use strict';

var s;
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-dom-static.browser.production.min.js');
s = require('./cjs/react-dom-server.browser.production.min.js');
} else {
module.exports = require('./cjs/react-dom-static.browser.development.js');
s = require('./cjs/react-dom-server.browser.development.js');
}

exports.version = s.version;
exports.prerender = s.prerender;
8 changes: 6 additions & 2 deletions packages/react-dom/npm/static.edge.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
'use strict';

var s;
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-dom-static.edge.production.min.js');
s = require('./cjs/react-dom-server.edge.production.min.js');
} else {
module.exports = require('./cjs/react-dom-static.edge.development.js');
s = require('./cjs/react-dom-server.edge.development.js');
}

exports.version = s.version;
exports.prerender = s.prerender;
8 changes: 6 additions & 2 deletions packages/react-dom/npm/static.node.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
'use strict';

var s;
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-dom-static.node.production.min.js');
s = require('./cjs/react-dom-server.node.production.min.js');
} else {
module.exports = require('./cjs/react-dom-static.node.development.js');
s = require('./cjs/react-dom-server.node.development.js');
}

exports.version = s.version;
exports.prerenderToNodeStream = s.prerenderToNodeStream;
1 change: 1 addition & 0 deletions packages/react-dom/src/server/react-dom-server.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
*/

export * from './ReactDOMFizzServerBrowser.js';
export {prerender} from './ReactDOMFizzStaticBrowser.js';
1 change: 1 addition & 0 deletions packages/react-dom/src/server/react-dom-server.edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
*/

export * from './ReactDOMFizzServerEdge.js';
export {prerender} from './ReactDOMFizzStaticEdge.js';
1 change: 1 addition & 0 deletions packages/react-dom/src/server/react-dom-server.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
*/

export * from './ReactDOMFizzServerNode.js';
export {prerenderToNodeStream} from './ReactDOMFizzStaticNode.js';
2 changes: 1 addition & 1 deletion packages/react-dom/static.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @flow
*/

export {prerender, version} from './src/server/ReactDOMFizzStaticBrowser';
export {prerender, version} from './src/server/react-dom-server.browser';
2 changes: 1 addition & 1 deletion packages/react-dom/static.edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @flow
*/

export {prerender, version} from './src/server/ReactDOMFizzStaticEdge';
export {prerender, version} from './src/server/react-dom-server.edge';
2 changes: 1 addition & 1 deletion packages/react-dom/static.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
export {
prerenderToNodeStream,
version,
} from './src/server/ReactDOMFizzStaticNode';
} from './src/server/react-dom-server.node';
30 changes: 0 additions & 30 deletions scripts/rollup/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,36 +286,6 @@ const bundles = [
externals: ['react', 'react-dom'],
},

/******* React DOM Fizz Static *******/
{
bundleTypes: __EXPERIMENTAL__ ? [NODE_DEV, NODE_PROD] : [],
moduleType: RENDERER,
entry: 'react-dom/static.browser',
global: 'ReactDOMStatic',
minifyWithProdErrorCodes: true,
wrapWithModuleBoundaries: false,
externals: ['react', 'react-dom'],
},
{
bundleTypes: __EXPERIMENTAL__ ? [NODE_DEV, NODE_PROD] : [],
moduleType: RENDERER,
entry: 'react-dom/static.node',
name: 'react-dom-static.node',
global: 'ReactDOMStatic',
minifyWithProdErrorCodes: false,
wrapWithModuleBoundaries: false,
externals: ['react', 'util', 'async_hooks', 'stream', 'react-dom'],
},
{
bundleTypes: __EXPERIMENTAL__ ? [NODE_DEV, NODE_PROD] : [],
moduleType: RENDERER,
entry: 'react-dom/static.edge',
global: 'ReactDOMStatic',
minifyWithProdErrorCodes: true,
wrapWithModuleBoundaries: false,
externals: ['react', 'react-dom'],
},

/******* React DOM Fizz Server External Runtime *******/
{
bundleTypes: [BROWSER_SCRIPT],
Expand Down

0 comments on commit cec23f3

Please sign in to comment.