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
polymer-element with noscript behaves wrongly compared to Polymer.js #17426
Comments
Added Area-Polymer, Triaged labels. |
I guess there are 2 issues in this bug. (a) attributes without corresponding fields are not supported (that's why 'bar' doesn't show up) This is actually by design. Unlike Javascript, in Dart we can't add fields to classes unless they are declared. So if you want to have an attribute "word" in the custom element, you don't support doing that with noscript. You need to declare a class with a field called The good news is that in polymer 0.10.0 this will be "fixed" in a way. It will no longer be a problem because 'noscript' elements will be implemented entirely using polymer.js (you can actually test it out if you are curious by depending on the pre-release version 0.10.0-pre.2). (b) lightdom seems broken (shows as bazFoo instead of Foo baz) This is a bit more tricky and we'd have to take a look. My understanding though is that lightdom is not a well supported feature in polymer.js either and it might be going away in the near future. |
This comment was originally written by @zoechi Polymer/old-docs-site#243 (Remove lightdom attribute - fixed) |
In the noscript case, though, there is no class no not be able to add fields to. Could you back the template binding with a map in that case, or is that too much special-casing? Having a class and no noscript will work fine in my case; I was just trying to avoid creating a lot of classes that had no purpose other than to liven an element that just formats a message.
So when running in Dartium, both Polymer.dart and Polymer.js will be loaded in the same application? (I feel like I'm missing something there.) |
Ah, I guess it's gone :). Seems that we don't have any action items for (b) then.
Yes, exactly. We use js-interop to get them running together. Part of the challenge was that the <polymer-element> declaration was shared by both JS and Dart, but browsers only allow one owner for a registered element. So, one change we did was to let <polymer-element> be owned by polymer.js and use js-interop to call into Dart and register definitions that have a Dart class behind it. It might be that we discover this is too heavy and we really want to bring back noscript into the Dart implementation. If we do so, I think your idea of backing up the element with a map would be worth exploring. |
Thanks. 0.10.0 gets me working apart from styles. Without lightdom, I'm not sure how to allow for a stylesheet that styles the internals of my custom elements. Neither ^ nor /shadow/ seem to work in Dartium. Is either supported by it, and are there polyfills? |
This comment was originally written by @zoechi The ^ and ^^ work fine for me in Dartium since a few weeks. |
Removed Area-Polymer label. |
Closing this issue. Regarding style: the notation changed again since we last posted here, you can find several examples where people got it working using /deep/. Added AssumedStale label. |
This issue has been moved to dart-archive/polymer-dart#130. |
What steps will reproduce the problem?
<polymer-element name="test-element" attributes="word" lightdom noscript>
<template>Foo {{word}} <content></content></template>
</polymer-element>
<test-element word="bar">baz</test-element>
What is the expected output? What do you see instead?
Expected: "Foo bar baz"
Result with lightdom: "bazFoo"
Result without lightdom: "Foo baz"
What version of the product are you using? On what operating system?
0.9.5 of Polymer.dart
Please provide any additional information below.
JS Fiddle for the JS version: http://jsfiddle.net/vV3yS/
The text was updated successfully, but these errors were encountered: