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

Build should detect if a main is missing #19527

Closed
sigmundch opened this issue Jun 18, 2014 · 12 comments
Closed

Build should detect if a main is missing #19527

sigmundch opened this issue Jun 18, 2014 · 12 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. P3 A lower priority bug or feature request

Comments

@sigmundch
Copy link
Member

Why write
<script ...>export 'package:polymer/init.dart';</script>

when pub-serve could do that for you?

@jmesserly
Copy link

-1. That makes it hard to know how to write your own main, and it breaks serving apps from a simple server or file://

@sigmundch
Copy link
Member Author

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

@jmesserly
Copy link

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)

@justinfagnani
Copy link
Contributor

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.

@jmesserly
Copy link

to query the element, you'd need to write Dart code, right? :)

@jmesserly
Copy link

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.

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.

@sigmundch
Copy link
Member Author

Added this to the 1.6 milestone.
Removed Priority-Unassigned label.
Added Priority-Low label.

@sigmundch
Copy link
Member Author

Removed this from the 1.6 milestone.
Added Polymer-P-1 label.

@sigmundch
Copy link
Member Author

Removed Polymer-P-1 label.
Added Polymer-Milestone-Next label.

@sigmundch
Copy link
Member Author

Added PolymerMilestone-Next label.

@sigmundch
Copy link
Member Author

Removed Polymer-Milestone-Next label.

@sigmundch sigmundch added Type-Defect area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. P3 A lower priority bug or feature request labels Jul 9, 2014
@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/polymer-dart#406.

@DartBot DartBot closed this as completed Jun 5, 2015
@kevmoo kevmoo removed the triaged label Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. P3 A lower priority bug or feature request
Projects
None yet
Development

No branches or pull requests

5 participants