Skip to content

Commit

Permalink
Don't build non-experimental www bundles (#17139)
Browse files Browse the repository at this point in the history
Reduces the likelihood we'll accidentally sync the wrong ones.
  • Loading branch information
acdlite authored Oct 18, 2019
1 parent c47f593 commit 7082d5a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
24 changes: 14 additions & 10 deletions scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const {asyncCopyTo, asyncRimRaf} = require('./utils');
const codeFrame = require('babel-code-frame');
const Wrappers = require('./wrappers');

const __EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental';

// Errors in promises should be fatal.
let loggedErrors = new Set();
process.on('unhandledRejection', err => {
Expand Down Expand Up @@ -304,8 +306,7 @@ function getPlugins(
bundleType,
globalName,
moduleType,
pureExternalModules,
isExperimentalBuild
pureExternalModules
) {
const findAndRecordErrorCodes = extractErrorCodes(errorCodeOpts);
const forks = Modules.getForks(bundleType, entry, moduleType);
Expand Down Expand Up @@ -363,7 +364,7 @@ function getPlugins(
__PROFILE__: isProfiling || !isProduction ? 'true' : 'false',
__UMD__: isUMDBundle ? 'true' : 'false',
'process.env.NODE_ENV': isProduction ? "'production'" : "'development'",
__EXPERIMENTAL__: isExperimentalBuild,
__EXPERIMENTAL__,
}),
// We still need CommonJS for external deps like object-assign.
commonjs(),
Expand Down Expand Up @@ -487,8 +488,6 @@ async function createBundle(bundle, bundleType) {
module => !importSideEffects[module]
);

const isExperimentalBuild = process.env.RELEASE_CHANNEL === 'experimental';

const rollupConfig = {
input: resolvedEntry,
treeshake: {
Expand All @@ -512,8 +511,7 @@ async function createBundle(bundle, bundleType) {
bundleType,
bundle.global,
bundle.moduleType,
pureExternalModules,
isExperimentalBuild
pureExternalModules
),
// We can't use getters in www.
legacy:
Expand Down Expand Up @@ -656,16 +654,22 @@ async function buildEverything() {
[bundle, NODE_DEV],
[bundle, NODE_PROD],
[bundle, NODE_PROFILING],
[bundle, FB_WWW_DEV],
[bundle, FB_WWW_PROD],
[bundle, FB_WWW_PROFILING],
[bundle, RN_OSS_DEV],
[bundle, RN_OSS_PROD],
[bundle, RN_OSS_PROFILING],
[bundle, RN_FB_DEV],
[bundle, RN_FB_PROD],
[bundle, RN_FB_PROFILING]
);

if (__EXPERIMENTAL__) {
// www uses experimental builds only.
bundles.push(
[bundle, FB_WWW_DEV],
[bundle, FB_WWW_PROD],
[bundle, FB_WWW_PROFILING]
);
}
}

if (!shouldExtractErrors && process.env.CIRCLE_NODE_TOTAL) {
Expand Down
11 changes: 7 additions & 4 deletions scripts/rollup/validate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ function checkFilesExist(bundle) {
}

const bundles = [
{
format: 'fb',
filePatterns: [`./build/facebook-www/*.js`],
},
{
format: 'rn',
filePatterns: [`./build/react-native/implementations/*.js`],
Expand All @@ -75,4 +71,11 @@ const bundles = [
},
];

if (process.env.RELEASE_CHANNEL === 'experimental') {
bundles.push({
format: 'fb',
filePatterns: [`./build/facebook-www/*.js`],
});
}

bundles.map(checkFilesExist).map(lint);

0 comments on commit 7082d5a

Please sign in to comment.