ReactiveX / IxJS

The Interactive Extensions for JavaScript
https://reactivex.io/IxJS/
MIT License
1.33k stars 74 forks source link

Usage with Skypack CDN? #339

Open andersstorhaug opened 2 years ago

andersstorhaug commented 2 years ago

I am attempting to use a package via Skypack that depends on IxJS.

This package understandably depends on the main ix package, but that doesn't work with Skypack because as far as I can tell, IxJS's package.json doesn't have any ESM properties.

If I try to use the ix package directly via Skypack with import { from } from "https://cdn.skypack.dev/ix/iterable"; this also doesn't work, because an ESM isn't exported. However, using import { from } from "https://cdn.skypack.dev/@reactivex/ix-es5-esm"; does work.

Wondering how this could be resolved -- should the library instead depend on @reactivex/ix-es5-esm / @reactivex/ix-esnext-esm, or is it possible to make changes to IxJS's package.json so that Skypack works correctly with the main ix package?

andersstorhaug commented 2 years ago

A little more info, I can get this library that's dependent on IxJS to work through JSPM which utilizes import maps (+shim). This seems to show that it is indeed IxJS's package.json that makes it incompatible with ESM-based CDNs, such as Skypack, esm.sh, JsDelivr with /+esm.

I'm hoping that a simple change to package.json would allow for these CDNs to be used, but, I'm a little hesitant to attempt a PR myself to that end, given the multiple builds that IxJS has.

trxcllnt commented 2 years ago

We should be able to update the published package.json to be compatible. I'll add it to my mental todo list.