Skip to content

Commit

Permalink
Rename /server to /writer
Browse files Browse the repository at this point in the history
This is mainly because "React Server Server" is weird so we need another
dimension.
  • Loading branch information
sebmarkbage committed Dec 8, 2020
1 parent bc9bb91 commit 265bc28
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion fixtures/flight-browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1>Flight Example</h1>
<script src="../../build/node_modules/react/umd/react.development.js"></script>
<script src="../../build/node_modules/react-dom/umd/react-dom.development.js"></script>
<script src="../../build/node_modules/react-dom/umd/react-dom-server.browser.development.js"></script>
<script src="../../build/node_modules/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js"></script>
<script src="../../build/node_modules/react-server-dom-webpack/umd/react-server-dom-webpack-writer.browser.server.development.js"></script>
<script src="../../build/node_modules/react-server-dom-webpack/umd/react-server-dom-webpack.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
<script type="text/babel">
Expand Down
7 changes: 0 additions & 7 deletions packages/react-server-dom-webpack/npm/server.browser.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/react-server-dom-webpack/npm/server.js

This file was deleted.

7 changes: 0 additions & 7 deletions packages/react-server-dom-webpack/npm/server.node.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-server-dom-webpack-writer.browser.server.production.min.js');
} else {
module.exports = require('./cjs/react-server-dom-webpack-writer.browser.server.development.js');
}
3 changes: 3 additions & 0 deletions packages/react-server-dom-webpack/npm/writer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = require('./writer.node.server');
7 changes: 7 additions & 0 deletions packages/react-server-dom-webpack/npm/writer.node.server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-server-dom-webpack-writer.node.server.production.min.js');
} else {
module.exports = require('./cjs/react-server-dom-webpack-writer.node.server.development.js');
}
14 changes: 7 additions & 7 deletions packages/react-server-dom-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"README.md",
"index.js",
"plugin.js",
"server.js",
"server.browser.js",
"server.node.js",
"writer.js",
"writer.browser.server.js",
"writer.node.server.js",
"node-register.js",
"cjs/",
"umd/",
Expand All @@ -25,15 +25,15 @@
"exports": {
".": "./index.js",
"./plugin": "./plugin.js",
"./server": "./server.js",
"./server.browser": "./server.browser.js",
"./server.node": "./server.node.js",
"./writer": "./writer.js",
"./writer.browser.server": "./writer.browser.server.js",
"./writer.node.server": "./writer.node.server.js",
"./node-loader": "./esm/react-server-dom-webpack-node-loader.js",
"./node-register": "./node-register.js",
"./package.json": "./package.json"
},
"browser": {
"./server.js": "./server.browser.js"
"./writer.js": "./writer.browser.server.js"
},
"main": "index.js",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('ReactFlightDOM', () => {
Stream = require('stream');
React = require('react');
ReactDOM = require('react-dom');
ReactServerDOMWriter = require('react-server-dom-webpack/server');
ReactServerDOMWriter = require('react-server-dom-webpack/writer');
ReactServerDOMReader = require('react-server-dom-webpack');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('ReactFlightDOMBrowser', () => {
beforeEach(() => {
jest.resetModules();
React = require('react');
ReactServerDOMWriter = require('react-server-dom-webpack/server.browser');
ReactServerDOMWriter = require('react-server-dom-webpack/writer.browser.server');
ReactServerDOMReader = require('react-server-dom-webpack');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @flow
*/

export * from './server.node';
export * from './writer.node.server';
4 changes: 2 additions & 2 deletions scripts/rollup/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,14 @@ const bundles = [
{
bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
moduleType: RENDERER,
entry: 'react-server-dom-webpack/server.browser',
entry: 'react-server-dom-webpack/writer.browser.server',
global: 'ReactServerDOMWriter',
externals: ['react', 'react-dom/server'],
},
{
bundleTypes: [NODE_DEV, NODE_PROD],
moduleType: RENDERER,
entry: 'react-server-dom-webpack/server.node',
entry: 'react-server-dom-webpack/writer.node.server',
global: 'ReactServerDOMWriter',
externals: ['react', 'react-dom/server'],
},
Expand Down
19 changes: 8 additions & 11 deletions scripts/shared/inlinedHostConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = [
'react-dom',
'react-dom/testing',
'react-dom/unstable-fizz.node',
'react-server-dom-webpack/server.node',
'react-server-dom-webpack/writer.node.server',
'react-server-dom-webpack',
],
paths: [
Expand All @@ -22,9 +22,9 @@ module.exports = [
'react-dom/unstable-fizz.node',
'react-dom/src/server/ReactDOMFizzServerNode.js', // react-dom/unstable-fizz.node
'react-server-dom-webpack',
'react-server-dom-webpack/server',
'react-server-dom-webpack/server.node',
'react-server-dom-webpack/src/ReactFlightDOMServerNode.js', // react-server-dom-webpack/server.browser
'react-server-dom-webpack/writer',
'react-server-dom-webpack/writer.node.server',
'react-server-dom-webpack/src/ReactFlightDOMServerNode.js', // react-server-dom-webpack/writer.node.server
'react-client/src/ReactFlightClientStream.js', // We can only type check this in streaming configurations.
'react-interactions',
],
Expand All @@ -37,7 +37,7 @@ module.exports = [
'react-dom',
'react-dom/testing',
'react-dom/unstable-fizz.browser',
'react-server-dom-webpack/server.browser',
'react-server-dom-webpack/writer.browser.server',
'react-server-dom-webpack',
],
paths: [
Expand All @@ -46,8 +46,8 @@ module.exports = [
'react-dom/unstable-fizz.browser',
'react-dom/src/server/ReactDOMFizzServerBrowser.js', // react-dom/unstable-fizz.browser
'react-server-dom-webpack',
'react-server-dom-webpack/server.browser',
'react-server-dom-webpack/src/ReactFlightDOMServerBrowser.js', // react-server-dom-webpack/server.browser
'react-server-dom-webpack/writer.browser.server',
'react-server-dom-webpack/src/ReactFlightDOMServerBrowser.js', // react-server-dom-webpack/writer.browser.server
'react-client/src/ReactFlightClientStream.js', // We can only type check this in streaming configurations.
],
isFlowTyped: true,
Expand Down Expand Up @@ -83,10 +83,7 @@ module.exports = [
},
{
shortName: 'dom-relay',
entryPoints: [
'react-server-dom-relay',
'react-server-dom-relay/server',
],
entryPoints: ['react-server-dom-relay', 'react-server-dom-relay/server'],
paths: ['react-dom', 'react-server-dom-relay'],
isFlowTyped: true,
isServerSupported: true,
Expand Down

0 comments on commit 265bc28

Please sign in to comment.