platform.js used to be included in polymer.html, but now you need to include it yourself. This split helps have a clear separation between polymer and the polyfills. platform.js has polyfills for many features that are not available yet natively in browsers (like html imports, and template binding). One day, when browsers implement all these new standards, platform.js will not be necessary, but everything loaded by polymer.html will continue to be useful.
dart_support.js also used to be included as part of polymer.html. It's main purpose is to complement what we have in platform.js to make it work well with Dart. It contains hooks to make dart2js understand how platform.js patches the DOM, and it contains extra logic to provide a Dart API for custom elements written in Javascript (see web_components/interop.dart for details).By having dart_support.js separate from platform.js we were able to keep platform.js identical to the one used in polymer.js projects. So you can easily swap out one version of platform.js for another if you want.
polymer.html defines the <polymer-element> element, so you should import it before defining polymer elements. Unless you define a polymer-element in the entry point of your app, you no longer need to include polymer.html there (platform.js and dart_support.js is all you need).
this follows a change in dart:html that affect all custom elements. Unfortunately, you wont see a deprecation message. @deprecated is great to announce that you should call a different method, but it can't indicate that you need to change a declaration.
web/index.html:<link rel="import" href="packages/polymer/polymer.html"> <link rel="import" href="x_tag.html"> <body> <x-tag></x-tag> <script type="application/dart">export "package:polymer/init.dart";</script>
web/x_tag.html:<polymer-element name="x-tag">...</polymer-element> <script type="application/dart" src="x_tag.dart"></script>
web/index.html:
<script src="packages/web_components/platform.js"></script> <script src="packages/web_components/dart_support.js"></script> <link rel="import" href="x_tag.html"> <body> <x-tag></x-tag> <script type="application/dart">export "package:polymer/init.dart";</script>web/x_tag.html:<link rel="import" href="packages/polymer/polymer.html"> <polymer-element name="x-tag">...</polymer-element> <script type="application/dart" src="x_tag.dart"></script>
A quick follow up, 0.11.0 is now available.Please note that, while the previous email might seem like there are a lot of changes, the changes are pretty small and easy to make, we just wanted to give you more details so you know why these changes are happening.The summary version is:
- add platform.js and dart_support.js before any HTML imports in your app
I just downloaded the latest dev version of Dart Editor (version 1.5.0.dev_04_23 (DEV)) and created a polymer project.In there the lines<script type="application/dart">export 'package:polymer/init.dart';</script<script src="packages/browser/dart.js"></script>Are in the <head> section, above the css inclusion.Should both be moved to the bottom of the body section?
Is<script src="packages/browser/dart.js"></script>Still necessary?
--
You received this message because you are subscribed to the Google Groups "Dart Web Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web+uns...@dartlang.org.
Visit this group at http://groups.google.com/a/dartlang.org/group/web/.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/2a6cd011-8b3b-422f-b550-be405af7d38c%40dartlang.org.
<!--<link rel="import" href="../../../packages/polymer/polymer.html">-->
<polymer-element name="my-element">
<template>
...
No getter for '$'.
--
You received this message because you are subscribed to a topic in the Google Groups "Dart Web Development" group.
To unsubscribe from this topic, visit https://groups.google.com/a/dartlang.org/d/topic/web/bFdGbFRVVwA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web+uns...@dartlang.org.
Visit this group at http://groups.google.com/a/dartlang.org/group/web/.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/29e352df-fd25-4988-9a8a-02dd3b051346%40dartlang.org.
I filed https://github.com/angular/angular.dart/issues/1227
On Monday, July 14, 2014 9:16:42 AM UTC+2, Günter Zöchbauer wrote:I never had similar problems when all done like recommended with or without paper_elements.But I wasn't yet able to find a workaround forNo getter for '$'.
when Angular.dart is used with Polymer and paper_elements http://stackoverflow.com/questions/24724848
On Monday, July 14, 2014 1:45:04 AM UTC+2, davenotik wrote:Ok, progress.I commented out all elements being imported into index.html. The moment I re-enabled my-element.html, I got the "Possible attempt to load Polymer twice".I comment out the polymer.html so it looks like:
<!--<link rel="import" href="../../../packages/polymer/polymer.html">-->
<polymer-element name="my-element">
<template>
...And it starts working. This is the same for all elements – it does not like the polymer.html import at the top.I recall seeing somewhere that this is implied from the index.html and not needed in the element? @Siggi?
But it goes further: I can't even implement other elements within elements. For example if my-element.html wanted to import core-overlay.html, I'd get the same "Possible attempt..." error.The workaround is to import cover-overlay.html from index.html, not from my-element.html.That just seems wrong. Did I come across some kind of bug?This isn't an issue all the time – in my add-stuff component I am able to import my x-dialog component at the top.I pushed in the state I got it working in: https://github.com/DaveNotik/dart-stack
--
You received this message because you are subscribed to the Google Groups "Dart Web Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web+uns...@dartlang.org.
--
You received this message because you are subscribed to a topic in the Google Groups "Dart Web Development" group.
To unsubscribe from this topic, visit https://groups.google.com/a/dartlang.org/d/topic/web/bFdGbFRVVwA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/CAJmP2_o85DXEShmN6EjZ45OhPDerr1QS32QBe42yWc%3DO%3DvnQ-A%40mail.gmail.com.
Thank you Siggi.I've updated as you suggest. (I didn't know this /packages/myapp/ trick – is that documented somewhere?)
All seems to work, but I do get 404 errors in the console:
3warning: http://localhost:63342/woven-app/web/packages/packages/polymer/polymer.html not found.warning: http://localhost:63342/woven-app/web/packages/packages/polymer/polymer.html not found.I've pushed the latest.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/CACekCD%3D56og9D-S%3D2Li465TVDjT1C%2But1sSZJT9i_JqfnZcNFQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/CAJmP2_ojDfM%3DunOB%2Bc2ZbfqxpbTY%2Bw%3DGN9qQ7Q1taMoGvDSMkg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/CAJmP2_ojDfM%3DunOB%2Bc2ZbfqxpbTY%2Bw%3DGN9qQ7Q1taMoGvDSMkg%40mail.gmail.com.
Ok, I updated and now I can finally include the child elements in the parent elements that depend on them, versus in the index.html.Is this correct?
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/web/CACekCDnDEPWtVHAxwAiLy7tW4k-YewQx30Y8N6kwZFX50%3DOaYQ%40mail.gmail.com.