Skip to content

fix(@angular-devkit/build-angular): update babel to 7.8.7 #17267

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

Merged
merged 3 commits into from
Mar 24, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"@angular-devkit/build-optimizer": "0.0.0",
"@angular-devkit/build-webpack": "0.0.0",
"@angular-devkit/core": "0.0.0",
"@babel/core": "7.8.3",
"@babel/preset-env": "7.8.3",
"@babel/core": "7.8.7",
"@babel/preset-env": "7.8.7",
"@ngtools/webpack": "0.0.0",
"ajv": "6.10.2",
"autoprefixer": "9.6.1",
"browserslist": "4.8.6",
"browserslist": "4.10.0",
"cacache": "12.0.2",
"caniuse-lite": "1.0.30001024",
"caniuse-lite": "1.0.30001035",
"circular-dependency-plugin": "5.2.0",
"clean-css": "4.2.1",
"coverage-istanbul-loader": "2.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
let downlevelCode;
let downlevelMap;
if (downlevel) {
const {supportedBrowsers: targets = []} = options;

// todo: revisit this in version 10, when we update our defaults browserslist
// Without this workaround bundles will not be downlevelled because Babel doesn't know handle to 'op_mini all'
// See: https://github.com/babel/babel/issues/11155
if (Array.isArray(targets) && targets.includes('op_mini all')) {
targets.push('ie_mob 11');
} else if ('op_mini' in targets) {
targets['ie_mob'] = '11';
}

// Downlevel the bundle
const transformResult = await transformAsync(sourceCode, {
filename: options.filename,
Expand All @@ -113,7 +124,7 @@ export async function process(options: ProcessBundleOptions): Promise<ProcessBun
require.resolve('@babel/preset-env'),
{
// browserslist-compatible query or object of minimum environment versions to support
targets: options.supportedBrowsers,
targets,
// modules aren't needed since the bundles use webpack's custom module loading
modules: false,
// 'transform-typeof-symbol' generates slower code
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/update/update-1.0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default async function() {
await ng('update', '@angular/cli');
await useBuiltPackages();
await silentNpm('install');
await ng('update', '@angular/core', ...extraUpdateArgs);
await ng('update', '@angular/core@8', ...extraUpdateArgs);
await useCIDefaults('one-oh-project');
await ng('generate', 'component', 'my-comp');
await ng('test', '--watch=false');
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/update/update-1.7-longhand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export default async function() {
await ng('update', '@angular/cli', '--migrate-only', '--from=1.7.1');
await useBuiltPackages();
await silentNpm('install');
await ng('update', '@angular/core', ...extraUpdateArgs);
await ng('update', '@angular/core@8', ...extraUpdateArgs);
await ng('build');
}
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/update/update-1.7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function() {
await ng('update', '@angular/cli');
await useBuiltPackages();
await silentNpm('install');
await ng('update', '@angular/core', ...extraUpdateArgs);
await ng('update', '@angular/core@8', ...extraUpdateArgs);
await useCIDefaults('latest-project');
await ng('generate', 'component', 'my-comp');
await ng('test', '--watch=false');
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/update/update-7.0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default async function() {
await silentNpm('install');

// Update Angular.
await ng('update', '@angular/core', ...extraUpdateArgs);
await ng('update', '@angular/core@8', ...extraUpdateArgs);

// Run CLI commands.
await ng('generate', 'component', 'my-comp');
Expand Down
Loading