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
Build should detect if a main is missing #19527
Comments
-1. That makes it hard to know how to write your own main, and it breaks serving apps from a simple server or file:// |
I had a similar inclination. Justin votes for doing this automatically though. I'm inclined to detect when a main is missing and report a warning (just updated the title to reflect this) Maybe in the future once we have an answer about how multiple script tags work, this might be less of an issue. At that point it might be possible to include the initialization on each polymer-element, so the call to initPolymer will no longer be necessary. Changed the title to: "Build should detect if a main is missing". |
Agree Siggi :D. In the example Justin showed it would work if we had just run the code in Dartium (since the exception was caused by "pub serve" kicking in) |
It only worked because we weren't interacting with the widget via the Dart proxy. I'm pretty sure the proxy was never registered because there was no code invoked to find the @CustomTag annotations. If we query()ed the element it would have come back a HtmlElement. I'll still argue that we shouldn't require the page author to know that their elements are implemented with Polymer. I see removing the requirement for a main() as a step in that direction, even though it still requires a Polymer build configuration. Hopefully that can be solved with some pub transformer work. |
to query the element, you'd need to write Dart code, right? :) |
I agree with you on that point: Dart elements should be usable in a JavaScript app simply by importing them. The current design reflects constraints placed in Dartium. Kasper and Vijay are working on a design to improve it. |
Added this to the 1.6 milestone. |
Removed this from the 1.6 milestone. |
Removed Polymer-P-1 label. |
Added PolymerMilestone-Next label. |
Removed Polymer-Milestone-Next label. |
This issue has been moved to dart-archive/polymer-dart#406. |
Why write
<script ...>export 'package:polymer/init.dart';</script>
when pub-serve could do that for you?
The text was updated successfully, but these errors were encountered: