Skip to content

Commit

Permalink
Merge pull request #1206 from NationalBankBelgium/greenkeeper/stark-a…
Browse files Browse the repository at this point in the history
…pps/core-js-3.0.0

Update core-js in group stark-apps to the latest version 🚀
  • Loading branch information
SuperITMan authored Apr 30, 2019
2 parents 0f466bf + 8da6515 commit 152f5d3
Show file tree
Hide file tree
Showing 19 changed files with 151 additions and 58 deletions.
18 changes: 18 additions & 0 deletions docs/POLYFILLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ The following polyfills are suitable for most of the cases, especially when targ
* IE11 requires all of the following polyfills.
*
* Polyfill: https://github.com/zloirock/core-js
* Add the specific lines below corresponding to the version of core-js you want to use: 2.x or 3.x
*/
/* tslint:disable:no-import-side-effect */

/******************** core-js 2.x ********************/
import "core-js/es6";
import "core-js/es7/reflect";
import "core-js/es7/string";
Expand All @@ -51,6 +54,21 @@ import "core-js/stage/4";
* More info: https://github.com/angular/angular/issues/27887
*/
import "core-js/modules/web.dom.iterable";
/*****************************************************/

/******************** core-js 3.x ********************
* Make sure you add the 'paths' workaround to the tsconfig.json to support core-js 3.x with Angular CLI 7.x
* See: https://github.com/angular/angular-cli/issues/13954#issuecomment-475452588
*/
import "core-js/es";
import "core-js/proposals/reflect-metadata";
/**
* IE11 does not support iteration on certain DOM collections (NodeList).
* This polyfill is specifically needed for the animation on mat-menu used in stark-table.
* More info: https://github.com/angular/angular/issues/27887
*/
import "core-js/modules/web.dom-collections.iterator";
/*****************************************************/

/**
* IE11 and Edge require this to support Server-sent events
Expand Down
30 changes: 25 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"codelyzer": "^4.5.0",
"commitizen": "^3.0.5",
"conventional-changelog-cli": "^2.0.11",
"core-js": "^3.0.0",
"cz-customizable": "^6.0.0",
"hammerjs": "^2.0.8",
"husky": "^2.1.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/stark-core/base.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use strict";

import "core-js/es6";
import "core-js/es7/reflect";
import "core-js/stage/4";
import "core-js/es";
import "core-js/proposals/reflect-metadata";

/* tslint:disable:no-import-side-effect */
// FIXME: change when https://github.com/monounity/karma-typescript/issues/320 is resolved
Expand Down
6 changes: 4 additions & 2 deletions packages/stark-core/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
"@angular/common": ["../../node_modules/@angular/common"],
"@angular/core": ["../../node_modules/@angular/core"],
"@angular/router": ["../../node_modules/@angular/router"],
"rxjs/*": ["../../node_modules/rxjs/*"],
"@nationalbankbelgium/stark-core": ["."],
"core-js/*": ["../../node_modules/core-js/*"],
"environments/environment": ["./src/common/environment"],
"@nationalbankbelgium/stark-core": ["."]
"rxjs/*": ["../../node_modules/rxjs/*"],
"zone.js/*": ["../../node_modules/zone.js/*"]
},
"outDir": "../../dist/packages/stark-core"
},
Expand Down
6 changes: 2 additions & 4 deletions packages/stark-rbac/base.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use strict";

import "core-js/es6";
import "core-js/es7/reflect";
import "core-js/es7/string";
import "core-js/stage/4";
import "core-js/es";
import "core-js/proposals/reflect-metadata";

// IE polyfills

Expand Down
12 changes: 7 additions & 5 deletions packages/stark-rbac/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
"@angular/common": ["../../node_modules/@angular/common"],
"@angular/core": ["../../node_modules/@angular/core"],
"@angular/router": ["../../node_modules/@angular/router"],
"@nationalbankbelgium/stark-core": ["../../dist/packages/stark-core"],
"@nationalbankbelgium/stark-rbac": ["."],
"@ng-idle/*": ["../stark-core/node_modules/@ng-idle/*"],
"@ngrx/*": ["../stark-core/node_modules/@ngrx/*"],
"@ngx-translate/*": ["../stark-core/node_modules/@ngx-translate/*"],
"@uirouter/*": ["../stark-core/node_modules/@uirouter/*"],
"cerialize": ["../stark-core/node_modules/cerialize"],
"class-validator": ["../stark-core/node_modules/class-validator"],
"moment": ["../stark-core/node_modules/moment"],
"core-js/*": ["../../node_modules/core-js/*"],
"environments/environment": ["../../dist/packages/stark-core/src/common/environment"],
"ibantools": ["../stark-core/node_modules/ibantools"],
"lodash": ["../stark-core/node_modules/lodash"],
"lodash-es/*": ["../stark-core/node_modules/lodash-es/*"],
"moment": ["../stark-core/node_modules/moment"],
"rxjs/*": ["../../node_modules/rxjs/*"],
"environments/environment": ["../../dist/packages/stark-core/src/common/environment"],
"@nationalbankbelgium/stark-core": ["../../dist/packages/stark-core"],
"@nationalbankbelgium/stark-rbac": ["."]
"zone.js/*": ["../../node_modules/zone.js/*"]
},
"outDir": "../../dist/packages/stark-rbac"
},
Expand Down
6 changes: 2 additions & 4 deletions packages/stark-ui/base.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use strict";

import "core-js/es6";
import "core-js/es7/reflect";
import "core-js/es7/string";
import "core-js/stage/4";
import "core-js/es";
import "core-js/proposals/reflect-metadata";

// IE polyfills

Expand Down
16 changes: 7 additions & 9 deletions packages/stark-ui/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
"compilerOptions": {
"baseUrl": ".",
"rootDir": ".",
"typeRoots": [
"./node_modules/@types",
"../stark-build/typings",
"./typings"
],
"typeRoots": ["./node_modules/@types", "../stark-build/typings", "./typings"],
"lib": ["dom", "dom.iterable", "es2017"],
"paths": {
"@angularclass/hmr": ["../stark-core/node_modules/@angularclass/hmr"],
Expand All @@ -17,19 +13,21 @@
"@angular/core": ["../../node_modules/@angular/core"],
"@angular/material": ["../../node_modules/@angular/material"],
"@angular/router": ["../../node_modules/@angular/router"],
"@nationalbankbelgium/stark-core": ["../../dist/packages/stark-core"],
"@nationalbankbelgium/stark-ui": ["."],
"@ng-idle/*": ["../stark-core/node_modules/@ng-idle/*"],
"@ngrx/*": ["../stark-core/node_modules/@ngrx/*"],
"@ngx-translate/*": ["../stark-core/node_modules/@ngx-translate/*"],
"@uirouter/*": ["../stark-core/node_modules/@uirouter/*"],
"cerialize": ["../stark-core/node_modules/cerialize"],
"class-validator": ["../stark-core/node_modules/class-validator"],
"moment": ["../stark-core/node_modules/moment"],
"core-js/*": ["../../node_modules/core-js/*"],
"environments/environment": ["../../dist/packages/stark-core/src/common/environment"],
"ibantools": ["../stark-core/node_modules/ibantools"],
"lodash-es/*": ["../stark-core/node_modules/lodash-es/*"],
"moment": ["../stark-core/node_modules/moment"],
"rxjs/*": ["../../node_modules/rxjs/*"],
"environments/environment": ["../../dist/packages/stark-core/src/common/environment"],
"@nationalbankbelgium/stark-core": ["../../dist/packages/stark-core"],
"@nationalbankbelgium/stark-ui": ["."]
"zone.js/*": ["../../node_modules/zone.js/*"]
},
"outDir": "../../dist/packages/stark-ui"
},
Expand Down
6 changes: 2 additions & 4 deletions showcase/base.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use strict";

import "core-js/es6";
import "core-js/es7/reflect";
import "core-js/es7/string";
import "core-js/stage/4";
import "core-js/es";
import "core-js/proposals/reflect-metadata";

// IE polyfills

Expand Down
30 changes: 27 additions & 3 deletions showcase/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion showcase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"@uirouter/visualizer": "~7.0.0",
"angular-in-memory-web-api": "~0.8.0",
"basscss": "~8.0.10",
"core-js": "~2.6.3",
"core-js": "~3.0.0",
"eligrey-classlist-js-polyfill": "~1.2.20180112",
"event-source-polyfill": "~1.0.5",
"http-server": "~0.11.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export const starkStylesCss = `
@import "~@nationalbankbelgium/stark-ui/src/modules/session-ui/pages/login/login-page.component";
@import "~@nationalbankbelgium/stark-ui/src/modules/session-ui/pages/preloading/preloading-page.component";
`;

export const polyfillsBrowsersContent = `
/**
* This file includes polyfills needed by Angular and is loaded before the app.
Expand All @@ -199,28 +200,56 @@ export const polyfillsBrowsersContent = `
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*
* See: https://angular.io/guide/browser-support#optional-browser-features-to-polyfill
*/
/**
* IE11 requires all of the following polyfills.
*
* Polyfill: https://github.com/zloirock/core-js
* Add the specific lines below corresponding to the version of core-js you want to use: 2.x or 3.x
*/
/* tslint:disable:no-import-side-effect */
/******************** core-js 2.x ********************/
import "core-js/es6";
import "core-js/es7/reflect";
import "core-js/es7/string";
import "core-js/stage/4";
/**
* IE11 does not support iteration on certain DOM collections (NodeList).
* This polyfill is specifically needed for the animation on mat-menu used in stark-table.
* More info: https://github.com/angular/angular/issues/27887
*/
import "core-js/modules/web.dom.iterable";
/*****************************************************/
/******************** core-js 3.x ********************
* Make sure you add the 'paths' workaround to the tsconfig.json to support core-js 3.x with Angular CLI 7.x
* See: https://github.com/angular/angular-cli/issues/13954#issuecomment-475452588
*/
import "core-js/es";
import "core-js/proposals/reflect-metadata";
/**
* IE11 does not support iteration on certain DOM collections (NodeList).
* This polyfill is specifically needed for the animation on mat-menu used in stark-table.
* More info: https://github.com/angular/angular/issues/27887
*/
import "core-js/modules/web.dom-collections.iterator";
/*****************************************************/
/**
* IE11 and Edge require this to support Server-sent events
* https://caniuse.com/#feat=eventsource
*
* Polyfill: https://github.com/Yaffle/EventSource
*/
import "event-source-polyfill";
/**
* IE11 requires Element.classList for NgClass support on SVG elements
* See: https://caniuse.com/#feat=classlist
Expand All @@ -230,6 +259,7 @@ import "event-source-polyfill";
* Polyfill: https://github.com/eligrey/classList.js
*/
import "eligrey-classlist-js-polyfill";
/**
* Web Animations polyfill is no longer needed for standard animation support as of Angular 6
* IMPORTANT: It is only needed in case you use the AnimationBuilder from '@angular/animations' in the application
Expand All @@ -239,6 +269,7 @@ import "eligrey-classlist-js-polyfill";
* Polyfill: https://github.com/web-animations/web-animations-js
*/
// import "web-animations-js";
/***************************************************************************************************
* Zone JS is required by Angular itself.
*/
Expand Down
Loading

0 comments on commit 152f5d3

Please sign in to comment.