-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
remove core-js/ import #1030
remove core-js/ import #1030
Conversation
@bleuscyther - I'm tending to agree - though I might go one step further and remove the regenerator-runtime/runtime require as well, leaving the whole task of polyfill support to the app in question. What do you think? |
that would be perfect. |
@bleuscyther I've just merged - I'm going to make one further change... In order to avoid breaking changes, I'm going to copy exceljs.browser.js to exceljs.bare.js that removes all polyfills and restore exceljs.browser.js to keep them. To include the exceljs bundle without pollys, just change the import from dist/exceljs.min.js to dist/exceljs.bare.min.js |
Nice i am going to test this week |
There was a new error:
from what i see this is a babel issue related to how the file was built. babel/babel#9849 As a quick fix, I installed the missing package :
and put the import in the polyfill for now: // ./src/polyfill.ts
import "regenerator-runtime/runtime"; Using angular i had to do the usual additional changes (tested on version 8), it works fine after that // ./tsconfig.json
...
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"allowSyntheticDefaultImports": true,
"target": "es2015",
"paths": {
"exceljs": [
"../node_modules/exceljs/dist/exceljs.bare"
],
.. Check this (link) for additional configs and updated values/fields. ...
// ./angular.json
...
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
...
"scripts": [
...
"./node_modules/exceljs/dist/exceljs.bare.js"
]
... //my .component.ts
import * as ExcelJS from 'exceljs/dist/exceljs.bare.js';
import {Row, Workbook, Worksheet} from 'exceljs';
...
const workbook: Workbook = new ExcelJS.Workbook(); // Important don' t use Class directly the wrong module will be loaded |
@bleuscyther |
Probably add it on the Readme. Thank you for your help. |
This affects angular. Because core-js is imported inside the library , the Promise polyfill is in conflict with zone.js. Since Excel.js puts browsers compatibility on the hands of the devs. (link) , we can add it manually in a way that does not conflict with Angular.
this PR should fix : #1008
This was fixe din many other package and is referenced here:
angular/zone.js#783