polymer-dart
polymer-dart copied to clipboard
Dart Polymer element + dart2js: let me import into a Polymer JS project
<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="96" height="96"hspace="10"> Issue by kevmoo Originally opened as dart-lang/sdk#15227
No clue if this is practical, but it'd be great.
- Create polymer element with foo.dart + foo.html
- dart2js to foo.js
- Deploy foo.html + foo.js ... somewhere
- Polymer JS app can <link rel="import" href="foo.html">
- It works!
<img src="https://avatars.githubusercontent.com/u/5449880?v=3" align="left" width="48" height="48"hspace="10"> Comment by iposva-google
Added Triaged label.
<img src="https://avatars.githubusercontent.com/u/3276024?v=3" align="left" width="48" height="48"hspace="10"> Comment by anders-sandholm
Added Area-Polymer label.
<img src="https://avatars.githubusercontent.com/u/1081711?v=3" align="left" width="48" height="48"hspace="10"> Comment by jmesserly
so it will work now, but might not give you the result you expect. :)
two issues:
- dart2js output will be very large. I'd guess at least ~400k minified. But it will grow slowly for each added widget, so might be okay for a really big widget library compiled together.
- you'll need JS -> Dart interop to talk to the Dart element. I don't know how that is accomplished but Justin probably does.
So it works but ... is probably not usable in practice.
Not sure how to proceed, due to issue dart-lang/sdk#1 above. Open to suggestions...
cc @justinfagnani. cc @dgrove. Added NeedsInfo label.
<img src="https://avatars.githubusercontent.com/u/1206632?v=3" align="left" width="48" height="48"hspace="10"> Comment by a14n
(Divagating and assuming I never dive into dart2js) For issue dart-lang/sdk#1 it would be interesting if dart2js could create a js file containing the bases for Dart + polymer runtime emulation. This file could be imported in the generated polymer-element (with <link tel="import" src="dart-polymer-base.html"> or something like that) and shared between dart polymer-elements. The polymer-element would thus contain only a limited js file that would be based on. It looks like the deferred loading. I really don't know if this is possible. What do you think ?
<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd
This is a good question for the dart2js team.
<img src="https://avatars.githubusercontent.com/u/1081711?v=3" align="left" width="48" height="48"hspace="10"> Comment by jmesserly
Removed Area-Polymer label. Added area-pkg, Pkg-Polymer labels.
<img src="https://avatars.githubusercontent.com/u/1081711?v=3" align="left" width="48" height="48"hspace="10"> Comment by jmesserly
Removed Library-Polymer label.
<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch
Added this to the Later milestone.
<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch
Removed Priority-Unassigned label. Added Priority-Medium label.
<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch
Added Polymer-P-2 label.
<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch
Removed this from the Later milestone.
<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch
Removed Polymer-P-2 label. Added Polymer-Milestone-Later label.
<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch
Removed Polymer-Milestone-Later label. Added PolymerMilestone-Later label.