Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't build non-experimental www bundles #17139

Merged
merged 1 commit into from
Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);