cartant / rxjs-spy

A debugging library for RxJS
https://cartant.github.io/rxjs-spy/
MIT License
702 stars 22 forks source link

Feature Request: Add esm support #55

Closed xiaoxiangmoe closed 4 years ago

xiaoxiangmoe commented 4 years ago

Add esm output and module mainField.

I'm using Angular 10 and see warning:

WARNING in my-lib depends on 'rxjs-spy/operators'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
cartant commented 4 years ago

This won't happen anytime soon. Maybe never. This package has three dependencies that do not themselves have ESM support:

"circular-json": "^0.5.0",
"error-stack-parser": "^2.0.1",
"stacktrace-gps": "^3.0.2"

So, AFAICT, there is little point in adding ESM support - which would otherwise be relatively straightforward - to this this package.

FWIW, the RxJS Tools that I'm working on don't have this problem and work just fine with Angular 10 - without effecting the can cause optimization bailouts message that you mentioned. IMO, my time is better spent on said tools.

xiaoxiangmoe commented 4 years ago

It seems that vite and snowpack users are inconvenient to use this library. 😭

cartant commented 4 years ago

Anyone wanting/needing ESM will have to use a tool like https://github.com/getify/moduloze - that's what I'd have to use for the dependencies listed above, but I have other priorities.

cartant commented 4 years ago

Actually, I can probably fix this using Rollup. I might look at it on the weekend.

cartant commented 4 years ago

7.5.3 should include Rollup-generated, flattened ESM bundles.