-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add a way to generate JS libraries from Dart code #37617
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
This would be nice to have, but we have no near term plans for it. |
I understand totally. Pehaps one day :) |
I should point out that Sass is probably the best example of a Dart library that's callable from JS. They do a fair bit of heavy-lifting themselves to setup entry points, package as a Node module, etc. E.g.,: https://github.com/sass/dart-sass/blob/master/lib/src/node.dart#L41 |
note that @jakemac53 gave some very good arguments for why Dart might not be suitable for the task of creating libraries. |
@shinayser - thanks again for following up on this in #46378 As the others mentioned, this is a hard problem and unfortunately in tension with other project goals, so just for transparency, I want to be clear that I don't believe we'll be looking at this problem any time soon. The one recommended way to use Dart from JavaScript applications is to explicitly export the APIs via JS-interop. Today, that entails adding a |
This is a feature request.
Today Dart can be compiled to javascript via
dart2js
or viadartdevc
but both does not provide a nice way to externalize the code for other developers to use, akalibrary
.Pehaps this could be an parameter addition to dartdevc, like
dartdevc --library ...
and then it generates the code in a externable format even easier to read, for humans .That would complete even more tha Dart JS world and give it even more power due to the great rise of Node.Js nowadays.
The text was updated successfully, but these errors were encountered: