Skip to content

Commit

Permalink
Remove /dist/ UMD builds (facebook#18473)
Browse files Browse the repository at this point in the history
* Remove /dist/ UMD builds

We publish UMDs to npm (and we're considering stopping even that).

This means we'll stop publishing to http://react.zpao.com/builds/master/latest/

* Update fixture paths
  • Loading branch information
sebmarkbage committed Apr 3, 2020
1 parent 91c9d69 commit 3c16baf
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 55 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ aliases:
- *restore_yarn_cache
- *run_yarn
- run: node ./scripts/rollup/consolidateBundleSizes.js
- run: ./scripts/circleci/upload_build.sh
- run: ./scripts/circleci/pack_and_store_artifact.sh
- store_artifacts:
path: ./node_modules.tgz
Expand Down
4 changes: 2 additions & 2 deletions fixtures/fizz-ssr-browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ <h1>Fizz Example</h1>
If you checked out the source from GitHub make sure to run <code>npm run build</code>.
</p>
</div>
<script src="../../build/dist/react.development.js"></script>
<script src="../../build/dist/react-dom-unstable-fizz.browser.development.js"></script>
<script src="../../build/node_modules/react/umd/react.development.js"></script>
<script src="../../build/node_modules/react-dom/umd/react-dom-unstable-fizz.browser.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
<script type="text/babel">
let stream = ReactDOMFizzServer.renderToReadableStream(<body>Success</body>);
Expand Down
10 changes: 5 additions & 5 deletions fixtures/flight-browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ <h1>Flight Example</h1>
If you checked out the source from GitHub make sure to run <code>npm run build</code>.
</p>
</div>
<script src="../../build/dist/react.development.js"></script>
<script src="../../build/dist/react-dom.development.js"></script>
<script src="../../build/dist/react-dom-server.browser.development.js"></script>
<script src="../../build/dist/react-flight-dom-webpack-server.browser.development.js"></script>
<script src="../../build/dist/react-flight-dom-webpack.development.js"></script>
<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-flight-dom-webpack/umd/react-flight-dom-webpack-server.browser.development.js"></script>
<script src="../../build/node_modules/react-flight-dom-webpack/umd/react-flight-dom-webpack.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
<script type="text/babel">
let Suspense = React.Suspense;
Expand Down
3 changes: 2 additions & 1 deletion fixtures/packaging/rjs/dev/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
react: '../../../../build/node_modules/react/umd/react.development',
'react-dom':
'../../../../build/node_modules/react-dom/umd/react-dom.development',
schedule: '../../../../build/dist/schedule.development',
schedule:
'../../../../build/node_modules/scheduler/umd/schedule.development',
},
};
3 changes: 2 additions & 1 deletion fixtures/packaging/rjs/prod/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
react: '../../../../build/node_modules/react/umd/react.production.min',
'react-dom':
'../../../../build/node_modules/react-dom/umd/react-dom.production.min',
schedule: '../../../../build/dist/schedule.development',
schedule:
'../../../../build/node_modules/scheduler/umd/schedule.development',
},
};
3 changes: 2 additions & 1 deletion fixtures/packaging/systemjs-builder/dev/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ System.config({
react: '../../../../build/node_modules/react/umd/react.development.js',
'react-dom':
'../../../../build/node_modules/react-dom/umd/react-dom.development.js',
schedule: '../../../../build/dist/schedule.development',
schedule:
'../../../../build/node_modules/scheduler/umd/schedule.development',
},
});
3 changes: 2 additions & 1 deletion fixtures/packaging/systemjs-builder/prod/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ System.config({
react: '../../../../build/node_modules/react/umd/react.production.min.js',
'react-dom':
'../../../../build/node_modules/react-dom/umd/react-dom.production.min.js',
schedule: '../../../../build/dist/schedule.development',
schedule:
'../../../../build/node_modules/scheduler/umd/schedule.development',
},
});
20 changes: 0 additions & 20 deletions scripts/circleci/upload_build.sh

This file was deleted.

10 changes: 2 additions & 8 deletions scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const useForks = require('./plugins/use-forks-plugin');
const stripUnusedImports = require('./plugins/strip-unused-imports');
const extractErrorCodes = require('../error-codes/extract-errors');
const Packaging = require('./packaging');
const {asyncCopyTo, asyncRimRaf} = require('./utils');
const {asyncRimRaf} = require('./utils');
const codeFrame = require('babel-code-frame');
const Wrappers = require('./wrappers');

Expand Down Expand Up @@ -627,7 +627,7 @@ async function createBundle(bundle, bundleType) {
esModule: false,
},
};
const [mainOutputPath, ...otherOutputPaths] = Packaging.getBundleOutputPaths(
const mainOutputPath = Packaging.getBundleOutputPath(
bundleType,
filename,
packageName
Expand All @@ -649,9 +649,6 @@ async function createBundle(bundle, bundleType) {
console.log(`${chalk.bgYellow.black(' BUILDING ')} ${logKey}`);
break;
case 'BUNDLE_END':
for (let i = 0; i < otherOutputPaths.length; i++) {
await asyncCopyTo(mainOutputPath, otherOutputPaths[i]);
}
console.log(`${chalk.bgGreen.black(' COMPLETE ')} ${logKey}\n`);
break;
case 'ERROR':
Expand All @@ -671,9 +668,6 @@ async function createBundle(bundle, bundleType) {
handleRollupError(error);
throw error;
}
for (let i = 0; i < otherOutputPaths.length; i++) {
await asyncCopyTo(mainOutputPath, otherOutputPaths[i]);
}
console.log(`${chalk.bgGreen.black(' COMPLETE ')} ${logKey}\n`);
}
}
Expand Down
25 changes: 10 additions & 15 deletions scripts/rollup/packaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,26 @@ function getPackageName(name) {
return name;
}

function getBundleOutputPaths(bundleType, filename, packageName) {
function getBundleOutputPath(bundleType, filename, packageName) {
switch (bundleType) {
case NODE_DEV:
case NODE_PROD:
case NODE_PROFILING:
return [`build/node_modules/${packageName}/cjs/${filename}`];
return `build/node_modules/${packageName}/cjs/${filename}`;
case UMD_DEV:
case UMD_PROD:
case UMD_PROFILING:
return [
`build/node_modules/${packageName}/umd/${filename}`,
`build/dist/${filename}`,
];
return `build/node_modules/${packageName}/umd/${filename}`;
case FB_WWW_DEV:
case FB_WWW_PROD:
case FB_WWW_PROFILING:
return [`build/facebook-www/${filename}`];
return `build/facebook-www/${filename}`;
case RN_OSS_DEV:
case RN_OSS_PROD:
case RN_OSS_PROFILING:
switch (packageName) {
case 'react-native-renderer':
return [`build/react-native/implementations/${filename}`];
return `build/react-native/implementations/${filename}`;
default:
throw new Error('Unknown RN package.');
}
Expand All @@ -65,12 +62,10 @@ function getBundleOutputPaths(bundleType, filename, packageName) {
case RN_FB_PROFILING:
switch (packageName) {
case 'react-native-renderer':
return [
`build/react-native/implementations/${filename.replace(
/\.js$/,
'.fb.js'
)}`,
];
return `build/react-native/implementations/${filename.replace(
/\.js$/,
'.fb.js'
)}`;
default:
throw new Error('Unknown RN package.');
}
Expand Down Expand Up @@ -155,6 +150,6 @@ async function prepareNpmPackages() {
module.exports = {
copyAllShims,
getPackageName,
getBundleOutputPaths,
getBundleOutputPath,
prepareNpmPackages,
};

0 comments on commit 3c16baf

Please sign in to comment.