Hmm, styling is a big deal- I'll keep a close eye on it. Thanks for the
heads up. It's actually this x-platform style selector thing that caused us
a lot of woes in 0.5.5 (we, like many other small-scale web teams,
developed mostly on chrome and then were kind of nonplussed by the look and
feel when we started testing on browserstack). So maybe unscoped styling
isn't even the end of the world at this point, given the amount of /deep/
stuff we were doing earlier (just try and theme a paper-dialog where
layered="true").

That mutation observer thing would help a *lot* - there's only a few
containers that I really change at run-time, and I could just flag them
with an angular element so <div watch-subtree></div> would set up and tear
down the mutation observers. Given the push away from two-way binding
anyway, this feels like a reasonable thing to do - flag the dom subtrees
that are mutable via model events and only watch there.

e

On Wed, May 20, 2015 at 1:01 PM Arthur Evans <[email protected]> wrote:

> Hi Eric,
>
> One thing that is going to bite you is styling. If you don't use the
> Polymer.dom APIs, the children added imperatively won't have the correct
> style-scope class added, so you may see styling anomalies. (For example,
> those children will behave as if they aren't in shadow DOM, and be styled
> by document-level CSS.)
>
> There is an scopeSubtree method that may help you here. It's designed for
> situations where you have a plugin or third-party library that just wants
> to squirt some DOM nodes into a container. You'd do something like this:
>
>    this.scopeSubtree(myContainerNode, observe);
>
> If observe is true, it creates a mutation observer and scopes descendants
> as they're added and removed from the container. If observe is false,
> only the current descendants are scoped.
>
> This is certainly not a cure-all, but it may help in certain cases.
>
> OK
> Arthur
>
>
> On Wed, May 20, 2015 at 9:51 AM, Eric Eslinger <[email protected]>
> wrote:
>
>> Hmm, the good news is that just shutting my eyes, going "la la la" and
>> pretending that Polymer.dom doesn't exist seems to work just fine. I built
>> a test angular application that uses paper-drawer-panel,
>> paper-header-panel, and paper-icon-button to add paper-icon-buttons to a
>> list on a timeout using angular's $interval callback to append items to an
>> array and angular's ng-repeat and ng-if directives to manipulate the DOM.
>>
>> My hypothesis here is that I'm only ever really adding new child nodes in
>> the already-distributed DOM elements.
>>
>> I whipped up a simple bunch of test cases for most of my UI elements here:
>>
>> https://github.com/ericeslinger/paulAnka
>>
>> in the event anyone cares to keep score at home. I'd love someone to
>> point out areas where the Polymer shady DOM is going to bite me in the ..
>> well any place would be a bad place to be bitten. If I can get this working
>> for all of the polymer elements I currently use in production, I'll move
>> forward on it.
>>
>> e
>>
>> On Tue, May 19, 2015 at 12:48 PM 'Steve Orvell' via Polymer <
>> [email protected]> wrote:
>>
>>> We have experimented with patching dom traversal and mutation api's, and
>>> there's an experimental import in Polymer that does this. It can let some
>>> libraries interoperate more smoothly with Shady DOM powered elements that,
>>> for example, perform distribution. We're continuing to work on it and
>>> explore if it should be integrated out of the box or be available as an opt
>>> in layer.
>>>
>>> On Tue, May 19, 2015 at 6:09 AM, <[email protected]> wrote:
>>>
>>>> Was there a reason that the built-in versions of the Polymer.dom API
>>>> couldn't be monkeypatched?  In other words, why not make
>>>> document.querySelector or element.querySelector behave like Polymer.dom's
>>>> version?  Wouldn't this increase interoperability with third party
>>>> libraries?
>>>>
>>>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Polymer" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/polymer-dev/2ed4c38f-8544-4a29-b79d-aad0ee0c40aa%40googlegroups.com
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  Follow Polymer on Google+: plus.google.com/107187849809354688692
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Polymer" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/polymer-dev/CA%2BrMWZhJJtkY_jKm8mSaLavGj3tRSk8Gonka%3DVfgEdD%2BoUaBeQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/polymer-dev/CA%2BrMWZhJJtkY_jKm8mSaLavGj3tRSk8Gonka%3DVfgEdD%2BoUaBeQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>  Follow Polymer on Google+: plus.google.com/107187849809354688692
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Polymer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>>
> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/polymer-dev/CABsi40%2Bf2zvKe3annQgqer8Pq06wwLGM3xgFYt7af%2Be5cbDZVw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/polymer-dev/CABsi40%2Bf2zvKe3annQgqer8Pq06wwLGM3xgFYt7af%2Be5cbDZVw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>
>
>> For more options, visit https://groups.google.com/d/optout.
>>
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CABsi40KSMnTXxaza%3DRJkMHFfuyLAxdaAVrK9iuVg83z%2Bct958w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to