-
Notifications
You must be signed in to change notification settings - Fork 1.7k
new js interop and commonjs #24722
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
Comments
Can you please be more specific about what you want. You can load the modules in JS script tags and instantiate classes from Dart. A concrete example that shows what you try to accomplish would be helpful. |
We have library Awesome. If module from commonjs-like modules: var npmModule = require('some-npm-module');
function Awesome() {
this.obj = npmModule();
}
module.exports = Awesome; We cannot load it with global require just now. Can js interop support this format of loading modules? |
@zoechi Does this example clearify situation? |
Actually no, not for me, hopefully for the project members. |
Because I don't want global variables. I want that all my vars stays local, and not affect global window object. So Commonjs helps keep incapsulation and does not pollute global. Just script tag create all vars global. |
We don't have any support currently but this is something we will work on supporting in the future. @js('SomeAwesomeClass') |
Duplicate of #25059 |
Currently with new js interop we can load only objects that exists in global. But what about commonjs and es6 module system support? Is it planned to load them?
The text was updated successfully, but these errors were encountered: