Skip to content

Commit

Permalink
feat(@angular-devkit/build-angular): update to core-js 3
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin committed Mar 26, 2019
1 parent 4c375fd commit b1d3f45
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 40 deletions.
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"circular-dependency-plugin": "5.0.2",
"clean-css": "4.2.1",
"copy-webpack-plugin": "5.0.2",
"core-js": "3.0.0",
"file-loader": "3.0.1",
"glob": "7.1.3",
"istanbul-instrumenter-loader": "3.0.1",
Expand Down Expand Up @@ -68,7 +69,6 @@
"@angular/router": "^8.0.0-beta.9",
"@angular/service-worker": "^8.0.0-beta.9",
"codelyzer": "^4.2.1",
"core-js": "^2.4.1",
"bootstrap": "^4.0.0",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import 'core-js/es6/reflect';
import 'core-js/es/reflect';
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import 'core-js/es/symbol';
import 'core-js/es/object';
import 'core-js/es/function';
import 'core-js/es/parse-int';
import 'core-js/es/parse-float';
import 'core-js/es/number';
import 'core-js/es/math';
import 'core-js/es/string';
import 'core-js/es/date';
import 'core-js/es/array';
import 'core-js/es/regexp';
import 'core-js/es/map';
import 'core-js/es/weak-map';
import 'core-js/es/set';
import 'core-js/es/promise';
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import 'core-js/es7/reflect';
import 'core-js/proposals/reflect-metadata';
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
}

if (buildOptions.es5BrowserSupport) {
entryPoints['polyfills.es5'] = [path.join(__dirname, '..', 'es2015-polyfills.js')];
entryPoints['polyfills.es5'] = [path.join(__dirname, '..', 'es5-polyfills.js')];
}

if (buildOptions.polyfills) {
Expand All @@ -70,7 +70,7 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
if (buildOptions.es5BrowserSupport) {
entryPoints['polyfills.es5'] = [
...entryPoints['polyfills.es5'],
path.join(__dirname, '..', 'es2015-jit-polyfills.js'),
path.join(__dirname, '..', 'es5-jit-polyfills.js'),
];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'core-js/es7/reflect';
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'core-js/es7/reflect';
import 'core-js/proposals/reflect-metadata';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppModule} from './app.module';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@angular/platform-server": "^5.0.0-rc.8",
"@angular/router": "^5.0.0-rc.8",
"@ngtools/webpack": "0.0.0",
"core-js": "^2.4.1",
"core-js": "^3.0.0",
"rxjs": "^5.5.0",
"zone.js": "^0.8.14"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'core-js/es7/reflect';
import 'core-js/proposals/reflect-metadata';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppModule} from './app.module';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@angular/platform-server": "^5.0.0-rc.8",
"@angular/router": "^5.0.0-rc.8",
"@ngtools/webpack": "0.0.0",
"core-js": "^2.4.1",
"core-js": "^3.0.0",
"rxjs": "^5.5.0",
"zone.js": "^0.8.14"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'core-js/es7/reflect';
import 'core-js/proposals/reflect-metadata';
import {platformDynamicServer, renderModule} from '@angular/platform-server';
import {AppModule} from './app.module';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@angular/platform-server": "^5.0.0",
"@angular/router": "^5.0.0",
"@ngtools/webpack": "0.0.0",
"core-js": "^2.4.1",
"core-js": "^3.0.0",
"rxjs": "^5.4.2",
"zone.js": "^0.8.14"
},
Expand Down
4 changes: 2 additions & 2 deletions tests/legacy-cli/e2e/tests/build/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { expectToFail } from '../../utils/utils';
export default async function () {
await ng('build');
// files were created successfully
await expectFileToMatch('dist/test-project/polyfills.js', 'core-js/es7/reflect');
await expectFileToMatch('dist/test-project/polyfills.js', 'core-js/proposals/reflect-metadata');
await expectFileToMatch('dist/test-project/polyfills.js', 'zone.js');
expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
Expand All @@ -24,7 +24,7 @@ export default async function () {
// files were created successfully
await expectFileToExist('dist/test-project/polyfills.js');
await expectFileSizeToBeUnder('dist/test-project/polyfills.js', jitPolyfillSize);
await expectToFail(() => expectFileToMatch('dist/test-project/polyfills.js', 'core-js/es7/reflect'));
await expectToFail(() => expectFileToMatch('dist/test-project/polyfills.js', 'core-js/proposals/reflect-metadata'));
await expectFileToMatch('dist/test-project/polyfills.js', 'zone.js');
expectFileToMatch('dist/test-project/index.html', oneLineTrim`
<script src="runtime.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions tests/legacy-cli/e2e/tests/packages/webpack/test-ng5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export default function(skipCleaning: () => void) {
return Promise.resolve()
.then(() => createProjectFromAsset('webpack/test-app-ng5'))
.then(() => exec(normalize('node_modules/.bin/webpack-cli')))
.then(() => expectFileSizeToBeUnder('dist/app.main.js', 375000))
.then(() => expectFileSizeToBeUnder('dist/0.app.main.js', 25000))
.then(() => expectFileSizeToBeUnder('dist/1.app.main.js', 2000))
.then(() => expectFileSizeToBeUnder('dist/app.main.js', 375 * 1024))
.then(() => expectFileSizeToBeUnder('dist/0.app.main.js', 25 * 1024))
.then(() => expectFileSizeToBeUnder('dist/1.app.main.js', 2 * 1024))
// test resource urls without ./
.then(() => replaceInFile('app/app.component.ts',
'./app.component.html', 'app.component.html'))
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,12 @@ [email protected]:
serialize-javascript "^1.4.0"
webpack-log "^2.0.0"

core-js@^2.2.0, core-js@^2.4.0, core-js@^2.4.1:
[email protected]:
version "3.0.0"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.0.tgz#a8dbfa978d29bfc263bfb66c556d0ca924c28957"
integrity sha512-WBmxlgH2122EzEJ6GH8o9L/FeoUKxxxZ6q6VUxoTlsE4EvbTWKJb447eyVxTEuq0LpXjlq/kCB2qgBvsYRkLvQ==

core-js@^2.2.0, core-js@^2.4.0:
version "2.5.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e"
integrity sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==
Expand Down

0 comments on commit b1d3f45

Please sign in to comment.