CommonJS or AMD dependencies can cause optimization bailouts

Tags: #<Tag:0x00007efc64d43cc8>

Hi,
First I’d like to say how much I like Handsontable it’s definitely best in class.

When I create an Angular 11 project using the following deps:
@handsontable/angular”: “^7.0.0”,
“handsontable”: “8.3.2”,

I get a lot of warnings about optimization bailouts e.g.

Warning: /home/user/workspace/app/node_modules/handsontable/index.mjs depends on ‘core-js/modules/es.object.get-own-property-names.js’. CommonJS or AMD dependencies can cause optimization bailouts.

Are all these warnings related to core-js which doesn’t support ES modules and there’s nothing that can be done until core-js adds support?

I just want to be sure I haven’t missed a workaround

(I know I can hide the warnings using allowedCommonJsDependencies in angular.json)

Thanks.

Hi @barrybevel
These core-js warnings are related to the fact that we attach polyfills to the ES/CJS files (e.g., https://cdn.jsdelivr.net/npm/handsontable@8.3.2/dataMap.js and https://cdn.jsdelivr.net/npm/handsontable@8.3.2/dataMap.mjs) that you import to the Angular project along with wrapper.

Angular has its own polyfills configuration. And warnings point that using polyfills in Handsontable code is unnecessary and might duplicate some of the polyfills in the building process.
Ideally would be to have a pure build of Handsontable core-js-free - although it would also affect non-angular users.

Hi Pitor, thanks for the explanation much appreciated.

1 Like