Skip to content

Commit

Permalink
feat(stark-demo): adapt polyfills (app and tests) according to the ne…
Browse files Browse the repository at this point in the history
…w structure in core-js 3.0.0
  • Loading branch information
christophercr committed Apr 1, 2019
1 parent ba5032d commit a3987b6
Show file tree
Hide file tree
Showing 12 changed files with 761 additions and 439 deletions.
1,136 changes: 727 additions & 409 deletions package-lock.json

Large diffs are not rendered by default.

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": "^5.3.0",
"hammerjs": "^2.0.8",
"husky": "^1.3.1",
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
4 changes: 3 additions & 1 deletion packages/stark-core/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"@angular/router": ["../../node_modules/@angular/router"],
"rxjs/*": ["../../node_modules/rxjs/*"],
"environments/environment": ["./src/common/environment"],
"@nationalbankbelgium/stark-core": ["."]
"@nationalbankbelgium/stark-core": ["."],
"core-js/*" : ["../../node_modules/core-js/*"],
"zone.js/*": ["../../node_modules/zone.js/*"]
},
"outDir": "../../dist/packages/stark-core"
},
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
4 changes: 3 additions & 1 deletion packages/stark-ui/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"rxjs/*": ["../../node_modules/rxjs/*"],
"environments/environment": ["../../dist/packages/stark-core/src/common/environment"],
"@nationalbankbelgium/stark-core": ["../../dist/packages/stark-core"],
"@nationalbankbelgium/stark-ui": ["."]
"@nationalbankbelgium/stark-ui": ["."],
"core-js/*" : ["../../node_modules/core-js/*"],
"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
10 changes: 5 additions & 5 deletions showcase/src/polyfills.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
* Polyfill: https://github.com/zloirock/core-js
*/
/* tslint:disable:no-import-side-effect */
import "core-js/es6";
import "core-js/es7/reflect";
import "core-js/es7/string";
import "core-js/stage/4";
// FIXME: remove the workaround added to the tsconfig.json to support core-js 3.0.0 with Angular CLI 7.x (https://github.com/angular/angular-cli/issues/13954)
// it will be fixed most likely in Angular 8
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.iterable";
import "core-js/modules/web.dom-collections.iterator";

/**
* IE11 and Edge require this to support Server-sent events
Expand Down
4 changes: 3 additions & 1 deletion showcase/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
],
"paths": {
"@angular/*": ["../node_modules/@angular/*"],
"@nationalbankbelgium/*": ["../node_modules/@nationalbankbelgium/*"]
"@nationalbankbelgium/*": ["../node_modules/@nationalbankbelgium/*"],
"core-js/es7/reflect": ["../node_modules/core-js/proposals/reflect-metadata"],
"core-js/es6/*": ["../node_modules/core-js/es/*"]
}
},
"exclude": ["node_modules", "dist", "src/assets"]
Expand Down
6 changes: 2 additions & 4 deletions starter/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
14 changes: 8 additions & 6 deletions starter/src/polyfills.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,25 @@
* Polyfill: https://github.com/zloirock/core-js
*/
/* tslint:disable:no-import-side-effect */
import "core-js/es6";
import "core-js/es7/reflect";
import "core-js/es7/string";
import "core-js/stage/4";
// FIXME: remove the workaround added to the tsconfig.json to support core-js 3.0.0 with Angular CLI 7.x (https://github.com/angular/angular-cli/issues/13954)
// it will be fixed most likely in Angular 8
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.iterable";
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 @@ -52,7 +54,6 @@ import "event-source-polyfill";
* Polyfill: https://github.com/eligrey/classList.js
*/
import "eligrey-classlist-js-polyfill";
import "zone.js/dist/zone";

/**
* Web Animations polyfill is no longer needed for standard animation support as of Angular 6
Expand All @@ -69,6 +70,7 @@ import "zone.js/dist/zone";
*/
// workaround for IE11 before loading zone.ks (see: https://github.com/angular/zone.js/issues/933)
(window as any).__Zone_enable_cross_context_check = true;
import "zone.js/dist/zone";
// async stack traces with zone.js included for dev
// import 'zone.js/dist/long-stack-trace-zone'
/* tslint:enable */
Expand Down
4 changes: 3 additions & 1 deletion starter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
],
"paths": {
"@angular/*": ["../node_modules/@angular/*"],
"@nationalbankbelgium/*": ["../node_modules/@nationalbankbelgium/*"]
"@nationalbankbelgium/*": ["../node_modules/@nationalbankbelgium/*"],
"core-js/es7/reflect": ["../node_modules/core-js/proposals/reflect-metadata"],
"core-js/es6/*": ["../node_modules/core-js/es/*"]
}
},
"exclude": ["node_modules", "dist", "src/assets"]
Expand Down

0 comments on commit a3987b6

Please sign in to comment.