npm-opa-wasm
npm-opa-wasm copied to clipboard
make this an ES module
Also from #36:
This module is based on commonjs and considering ES Modules is the standard, providing support for that would be great. Currently, working with esModuleInterop and importing like this:
import opa from "@open-policy-agent/opa-wasm"; const { loadPolicy } = opa;
💭 Would using some clever CDN like https://www.skypack.dev/ solve this? I.e. convert to ESM on the fly?
Parceljs.org seems like it's both able to do that and not too difficult to handle. I'll give it a try.
@tvvignesh if you're still using this, I'd appreciate feedback on the draft PR ☝️ Does it do the trick?
I can help with that. Are you agree to propose a PR?
@jorgecasar yeah that would be great. When playing with microbundle (#87), it seemed like you could have both, a commonJS and an ES module. I think that's what we'd want? 🤔
I see that tests are not working. In my case the results are: Test Suites: 5 failed, 2 passed, 7 total
. I guess we have to fix test before migrate to ESM to be sure we don't break anything.
I was using nodejs 16.9.1
So we're using 12 and 14 in CI. Is it time to enable 16? 🤔 Can you share what breaks for you? (Otherwise I'll try it next week.)
I just run npm test
and there are some issues with circular references in JSON. I will copy the full log ASAP
Isn't this done? Hmm.