Skip to content

Commit 7082d5a

Browse files
authored
Don't build non-experimental www bundles (#17139)
Reduces the likelihood we'll accidentally sync the wrong ones.
1 parent c47f593 commit 7082d5a

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

scripts/rollup/build.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const {asyncCopyTo, asyncRimRaf} = require('./utils');
2525
const codeFrame = require('babel-code-frame');
2626
const Wrappers = require('./wrappers');
2727

28+
const __EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental';
29+
2830
// Errors in promises should be fatal.
2931
let loggedErrors = new Set();
3032
process.on('unhandledRejection', err => {
@@ -304,8 +306,7 @@ function getPlugins(
304306
bundleType,
305307
globalName,
306308
moduleType,
307-
pureExternalModules,
308-
isExperimentalBuild
309+
pureExternalModules
309310
) {
310311
const findAndRecordErrorCodes = extractErrorCodes(errorCodeOpts);
311312
const forks = Modules.getForks(bundleType, entry, moduleType);
@@ -363,7 +364,7 @@ function getPlugins(
363364
__PROFILE__: isProfiling || !isProduction ? 'true' : 'false',
364365
__UMD__: isUMDBundle ? 'true' : 'false',
365366
'process.env.NODE_ENV': isProduction ? "'production'" : "'development'",
366-
__EXPERIMENTAL__: isExperimentalBuild,
367+
__EXPERIMENTAL__,
367368
}),
368369
// We still need CommonJS for external deps like object-assign.
369370
commonjs(),
@@ -487,8 +488,6 @@ async function createBundle(bundle, bundleType) {
487488
module => !importSideEffects[module]
488489
);
489490

490-
const isExperimentalBuild = process.env.RELEASE_CHANNEL === 'experimental';
491-
492491
const rollupConfig = {
493492
input: resolvedEntry,
494493
treeshake: {
@@ -512,8 +511,7 @@ async function createBundle(bundle, bundleType) {
512511
bundleType,
513512
bundle.global,
514513
bundle.moduleType,
515-
pureExternalModules,
516-
isExperimentalBuild
514+
pureExternalModules
517515
),
518516
// We can't use getters in www.
519517
legacy:
@@ -656,16 +654,22 @@ async function buildEverything() {
656654
[bundle, NODE_DEV],
657655
[bundle, NODE_PROD],
658656
[bundle, NODE_PROFILING],
659-
[bundle, FB_WWW_DEV],
660-
[bundle, FB_WWW_PROD],
661-
[bundle, FB_WWW_PROFILING],
662657
[bundle, RN_OSS_DEV],
663658
[bundle, RN_OSS_PROD],
664659
[bundle, RN_OSS_PROFILING],
665660
[bundle, RN_FB_DEV],
666661
[bundle, RN_FB_PROD],
667662
[bundle, RN_FB_PROFILING]
668663
);
664+
665+
if (__EXPERIMENTAL__) {
666+
// www uses experimental builds only.
667+
bundles.push(
668+
[bundle, FB_WWW_DEV],
669+
[bundle, FB_WWW_PROD],
670+
[bundle, FB_WWW_PROFILING]
671+
);
672+
}
669673
}
670674

671675
if (!shouldExtractErrors && process.env.CIRCLE_NODE_TOTAL) {

scripts/rollup/validate/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ function checkFilesExist(bundle) {
5454
}
5555

5656
const bundles = [
57-
{
58-
format: 'fb',
59-
filePatterns: [`./build/facebook-www/*.js`],
60-
},
6157
{
6258
format: 'rn',
6359
filePatterns: [`./build/react-native/implementations/*.js`],
@@ -75,4 +71,11 @@ const bundles = [
7571
},
7672
];
7773

74+
if (process.env.RELEASE_CHANNEL === 'experimental') {
75+
bundles.push({
76+
format: 'fb',
77+
filePatterns: [`./build/facebook-www/*.js`],
78+
});
79+
}
80+
7881
bundles.map(checkFilesExist).map(lint);

0 commit comments

Comments
 (0)