heatmap.js icon indicating copy to clipboard operation
heatmap.js copied to clipboard

ECMAScript module (ESM) bundle support

Open LoganDupont opened this issue 5 years ago • 2 comments

Currently using heatmap.js in an Angular version 10+ application gives the following build warning:

WARNING in [filename] depends on 'heatmap.js'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Starting with Angular 10 the Angular CLI now provide warnings for CommonJS modules. Read more about it here: https://blog.angular.io/version-10-of-angular-now-available-78960babd41

When you use a dependency that is packaged with CommonJS, it can result in larger slower applications. Starting with version 10, we now warn you when your build pulls in one of these bundles. If you’ve started seeing these warnings for your dependencies, let your dependency know that you’d prefer an ECMAScript module (ESM) bundle.

And here: https://angular.io/guide/build#configuring-commonjs-dependencies

It is recommended that you avoid depending on CommonJS modules in your Angular applications. Depending on CommonJS modules can prevent bundlers and minifiers from optimizing your application, which results in larger bundle sizes. Instead, it is recommended that you use ECMAScript modules in your entire application. For more information, see How CommonJS is making your bundles larger

Is it possible to add ESM support?

LoganDupont avatar Sep 07 '20 10:09 LoganDupont

+1

StephenOTT avatar Jul 02 '21 17:07 StephenOTT

You can use this bug-fixed version:npm install @mars3d/heatmap.js

Corresponding source address: https://github.com/muyao1987/heatmap.js

mars3d update

  • fix: An error "Cannot assign to read only property 'data' of object '#'"
  • add: Added support for typescript in index.d.ts
  • The NPM package was released @mars3d/heatmap.js

muyao1987 avatar Jan 30 '22 06:01 muyao1987