Skip to content

package:js: How to use libraries that have modules.export #32016

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

Closed
stevenroose opened this issue Jan 31, 2018 · 3 comments
Closed

package:js: How to use libraries that have modules.export #32016

stevenroose opened this issue Jan 31, 2018 · 3 comments
Labels
closed-duplicate Closed in favor of an existing report web-js-interop Issues that impact all js interop

Comments

@stevenroose
Copy link

I'm trying to use a very simple JS package (or at least one with a very simple interface): https://github.com/mohsen1/json-formatter-js

Apart from trying with "nodejs interop" packages, I tried a simple js interop like this:

@JS()
class JSONFormatter {
  external JSONFormatter(JsObject json);
  external render();
}

Nothing seems to work, though.

@matanlurey
Copy link
Contributor

I don't believe we support the ES6 module format at this time, at least not in Dart2JS.

/cc @jmesserly would know best, I think.

@jmesserly
Copy link

@jacob314 might know more about this. I believe folks have gotten node.js interop to work (at least in Electron), though I'm not entirely sure how that is accomplished.

But yes I don't believe DDC/dart2js have the capability of generating the appropriate import or require(...) for a JS module (should be straightforward to implement, though).

@kevmoo kevmoo added web-js-interop Issues that impact all js interop and removed js-interop labels Feb 14, 2018
@jmesserly
Copy link

merging into #25059

@jmesserly jmesserly added the closed-duplicate Closed in favor of an existing report label Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report web-js-interop Issues that impact all js interop
Projects
None yet
Development

No branches or pull requests

4 participants