Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make this an ES module #38

Closed
srenatus opened this issue Dec 18, 2020 · 9 comments
Closed

make this an ES module #38

srenatus opened this issue Dec 18, 2020 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@srenatus
Copy link
Contributor

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;
@srenatus srenatus added the help wanted Extra attention is needed label May 14, 2021
@srenatus
Copy link
Contributor Author

💭 Would using some clever CDN like https://www.skypack.dev/ solve this? I.e. convert to ESM on the fly?

@srenatus
Copy link
Contributor Author

Parceljs.org seems like it's both able to do that and not too difficult to handle. I'll give it a try.

@srenatus srenatus mentioned this issue Oct 19, 2021
2 tasks
srenatus referenced this issue in srenatus/npm-opa-wasm Oct 21, 2021
I had been trying to use parcel before, but it didn't properly
build our types... this seems to do the trick.

Fixes #38.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
@srenatus
Copy link
Contributor Author

@tvvignesh if you're still using this, I'd appreciate feedback on the draft PR ☝️ Does it do the trick?

srenatus referenced this issue in srenatus/npm-opa-wasm Oct 21, 2021
I had been trying to use parcel before, but it didn't properly
build our types... this seems to do the trick.

Fixes #38.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
@jorgecasar
Copy link
Contributor

I can help with that. Are you agree to propose a PR?

@srenatus
Copy link
Contributor Author

@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? 🤔

@jorgecasar
Copy link
Contributor

jorgecasar commented Dec 18, 2021

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

@srenatus
Copy link
Contributor Author

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.)

@jorgecasar
Copy link
Contributor

I just run npm test and there are some issues with circular references in JSON. I will copy the full log ASAP

@srenatus
Copy link
Contributor Author

Isn't this done? Hmm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants