The short answer is you can't use a CDN. CDNs are a hole in the HTML
Imports story atm.

Imports need to resolve to the same URL to be de-duplicated correctly by
the browser. Serving the same component from two different URLs won't be
deduped properly. This is why we recommend bringing in components locally
using Bower and serving them from your own setup.

IMO, this is one of the biggest issues Polymer and the standards process
needs to solve. It prevents the most convenient reuse of components.

A bit more info here:
https://www.polymer-project.org/resources/faq.html#is-the-code-hosted-on-a-cdn


On Mon Feb 23 2015 at 12:46:13 AM <[email protected]> wrote:

> ServerB defines an element like this:
>   <link rel="import" href="../core-menu/core-menu.html">
>   <polymer-element name=„elementB“….</polymer-element>
>
> ServerA serves the index.html, which uses element B like this:
>   <link rel="import" href="../core-menu/core-menu.html">
>   <link rel="import" href="http://serverB.com/elementB.html";>
>   ...
>   <elementB></elementB>
>   ...
>
> The issue is, that HTML import adds a hostname to the imports at ServerB.
> So core-menu.html will be imported twice with two different URLs. This
> results in an polymer „element already registered“ exception.
>
> I think using elements from different URLs pr server is a usual use case,
> right.
> So, what is the correct way to handle this?
>
> We got around this by adding a polymer element server and write <link
> rel="import" href=„http://myPolymerServer/core-menu/core-menu.html“>. But
> thats not very convenient.
>
> best Christopher
>
> 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/980b43a8-48d8-4760-97f5-100c0f8f230e%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/980b43a8-48d8-4760-97f5-100c0f8f230e%40googlegroups.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/CACGqRCD6fb2%3De8UmbXK43dQ1%3DvMJ8PGW-TSrLpftsTU931TWAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to