Skip to content

Commit

Permalink
🏗 Remove Single Pass Pipeline (ampproject#28747)
Browse files Browse the repository at this point in the history
* Remove Single Pass Pipeline

* Remove accidentally remaining calls to single pass experiment logging

* Remove single pass test skipping

* Remove branch in closure-compile related to single file compilation

* Remove unused dependencies from single pass
  • Loading branch information
kristoferbaxter authored Jun 9, 2020
1 parent b2bc9a1 commit 63e3da1
Show file tree
Hide file tree
Showing 38 changed files with 29 additions and 1,372 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
"local/prefer-unnested-spread-objects": 2,
"local/private-prop-names": 2,
"local/query-selector": 2,
"local/split-single-pass-comment": 2,
"local/todo-format": 0,
"local/unused-private-field": 2,
"local/vsync": 0,
Expand Down
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ jobs:
name: 'Module Dist, Bundle Size'
script:
- unbuffer node build-system/pr-check/module-dist-bundle-size.js
- stage: test
name: 'Single Pass Tests'
script:
- unbuffer node build-system/pr-check/single-pass-tests.js
- stage: test
name: 'Visual Diff Tests'
script:
Expand Down
10 changes: 0 additions & 10 deletions ads/google/a4a/traffic-experiments.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ export let A4aExperimentBranches;
/** @type {string} @private */
export const MANUAL_EXPERIMENT_ID = '117152632';

/**
* Experiment IDs used to identify single pass experiments.
*
* @enum {string}
*/
export const SINGLE_PASS_EXPERIMENT_IDS = {
MULTI_PASS: '21063529',
SINGLE_PASS: '21063530',
};

/**
* @param {!Window} win
* @param {!Element} element Ad tag Element.
Expand Down
4 changes: 0 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const {
getDepCheckConfig,
getPostClosureConfig,
getPreClosureConfig,
getSinglePassDepsConfig,
getSinglePassPostConfig,
getTestConfig,
getUnminifiedConfig,
} = require('./build-system/babel-config');
Expand All @@ -45,8 +43,6 @@ const babelTransforms = new Map([
['dep-check', getDepCheckConfig()],
['post-closure', getPostClosureConfig()],
['pre-closure', getPreClosureConfig()],
['single-pass-deps', getSinglePassDepsConfig()],
['single-pass-post', getSinglePassPostConfig()],
['test', getTestConfig()],
['unminified', getUnminifiedConfig()],
]);
Expand Down
54 changes: 0 additions & 54 deletions build-system/babel-config/single-pass-config.js

This file was deleted.

19 changes: 0 additions & 19 deletions build-system/compile/bundles.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ exports.jsBundles = {
minifiedName: 'v0.js',
includePolyfills: true,
wrapper: wrappers.mainBinary,
singlePassCompilation: argv.single_pass,
esmPassCompilation: argv.esm,
includeOnlyESMLevelPolyfills: argv.esm,
},
Expand Down Expand Up @@ -1197,24 +1196,6 @@ exports.extensionAliasBundles = {
},
};

/**
* Used to generate alternative JS build targets
*/
exports.altMainBundles = [
{
path: 'src/amp-shadow.js',
name: 'shadow-v0',
version: '0.1',
latestVersion: '0.1',
},
{
path: 'src/inabox/amp-inabox.js',
name: 'amp4ads-v0',
version: '0.1',
latestVersion: '0.1',
},
];

/**
* @param {boolean} condition
* @param {string} field
Expand Down
56 changes: 19 additions & 37 deletions build-system/compile/closure-compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,6 @@ function handleTypeCheckError(err) {
emitError(err);
}

/**
* Handles a closure error during single-pass compilation
*
* @param {Error} err
*/
function handleSinglePassCompilerError(err) {
logError(red('Single pass compilation failed:'));
emitError(err);
}

/**
* Emits an error to the caller
*
Expand Down Expand Up @@ -137,34 +127,27 @@ function gulpClosureCompile(compilerOptions, nailgunPort) {
logger: (errors) => (compilerErrors = errors), // Capture compiler errors
};

if (compilerOptions.includes('SINGLE_FILE_COMPILATION=true')) {
// For single-pass compilation, use the default compiler.jar
// On Mac OS and Linux, speed up compilation using nailgun (unless the
// --disable_nailgun flag was passed in)
// See https://github.com/facebook/nailgun.
if (
!argv.disable_nailgun &&
(process.platform == 'darwin' || process.platform == 'linux')
) {
compilerOptions = [
'--nailgun-port',
nailgunPort,
'org.ampproject.AmpCommandLineRunner',
'--',
].concat(compilerOptions);
pluginOptions.platform = ['native']; // nailgun-runner isn't a java binary
initOptions.extraArguments = null; // Already part of nailgun-server
} else {
// For other platforms, or if nailgun is explicitly disabled, use AMP's
// custom runner.jar
closureCompiler.compiler.JAR_PATH = require.resolve(
'../../node_modules/google-closure-compiler-java/compiler.jar'
`../runner/dist/${nailgunPort}/runner.jar`
);
} else {
// On Mac OS and Linux, speed up compilation using nailgun (unless the
// --disable_nailgun flag was passed in)
// See https://github.com/facebook/nailgun.
if (
!argv.disable_nailgun &&
(process.platform == 'darwin' || process.platform == 'linux')
) {
compilerOptions = [
'--nailgun-port',
nailgunPort,
'org.ampproject.AmpCommandLineRunner',
'--',
].concat(compilerOptions);
pluginOptions.platform = ['native']; // nailgun-runner isn't a java binary
initOptions.extraArguments = null; // Already part of nailgun-server
} else {
// For other platforms, or if nailgun is explicitly disabled, use AMP's
// custom runner.jar
closureCompiler.compiler.JAR_PATH = require.resolve(
`../runner/dist/${nailgunPort}/runner.jar`
);
}
}

return makeSourcemapsRelative(
Expand All @@ -175,6 +158,5 @@ function gulpClosureCompile(compilerOptions, nailgunPort) {
module.exports = {
gulpClosureCompile,
handleCompilerError,
handleSinglePassCompilerError,
handleTypeCheckError,
};
5 changes: 0 additions & 5 deletions build-system/compile/compile-wrappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ exports.extension = function (
) {
opt_splitMarker = opt_splitMarker || '';

// Single pass intermediate modules do not need an AMP.push wrapper.
if (name.startsWith('_base_')) {
return '(function() {<%= contents %>}());';
}

let deps = '';
if (intermediateDeps && intermediateDeps.length) {
deps = 'i:';
Expand Down
22 changes: 0 additions & 22 deletions build-system/compile/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const {isTravisBuild} = require('../common/travis');
const {postClosureBabel} = require('./post-closure-babel');
const {preClosureBabel, handlePreClosureError} = require('./pre-closure-babel');
const {sanitize} = require('./sanitize');
const {singlePassCompile} = require('./single-pass');
const {VERSION: internalRuntimeVersion} = require('./internal-version');
const {writeSourcemaps} = require('./helpers');

Expand Down Expand Up @@ -146,27 +145,6 @@ function compile(
if (argv.pseudo_names) {
define.push('PSEUDO_NAMES=true');
}
if (options.singlePassCompilation) {
const compilationOptions = {
define,
externs: baseExterns,
hideWarningsFor,
};

// Add babel plugin to remove unwanted polyfills in esm build
if (options.esmPassCompilation) {
compilationOptions['dest'] = './dist/esm/';
define.push('ESM_BUILD=true');
}

console /*OK*/
.assert(typeof entryModuleFilenames == 'string');
return singlePassCompile(
entryModuleFilenames,
compilationOptions,
timeInfo
);
}

return new Promise(function (resolve, reject) {
if (!(entryModuleFilenames instanceof Array)) {
Expand Down
Loading

0 comments on commit 63e3da1

Please sign in to comment.