HTML Imports fallback?

207 views
Skip to first unread message

kevin....@gmail.com

unread,
May 17, 2014, 11:09:31 PM5/17/14
to polym...@googlegroups.com
Is there a recommendation for fallbacks when using HTML imports? It seems pretty all or nothing, but I could easily be misunderstanding. 

Rob Dodson

unread,
May 18, 2014, 12:32:23 PM5/18/14
to kevin....@gmail.com, polymer-dev
Do you mean for browsers that don't support imports? If you're using Polymer then it uses XHR to polyfill imports in legacy browsers. If you don't want to use Polymer you could use the HTML Imports polyfill by itself. It's often easiest to just load platform.js which bundles all of the polyfills together since some polyfills have dependencies.


On Sat, May 17, 2014 at 8:09 PM, <kevin....@gmail.com> wrote:
Is there a recommendation for fallbacks when using HTML imports? It seems pretty all or nothing, but I could easily be misunderstanding. 

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 polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/a5c0f1df-61d6-4c10-be0e-c518b852b8f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kevin....@gmail.com

unread,
May 18, 2014, 4:22:49 PM5/18/14
to polym...@googlegroups.com, kevin....@gmail.com
I left out the most important part: what happens sans-JS? Is there a recommended fallback/progressive enhancement strategy or are we just expecting the user will always have JS enabled?

Rob Dodson

unread,
May 18, 2014, 4:52:03 PM5/18/14
to Kevin Suttle, polymer-dev
If you're loading a custom element definition you can style the unresolved element using the :unresolved attribute in browsers that support it. Just add an unresolved attribute to the elements you want to provide a fallback for

<x-foo unresolved>

and if Polymer manages to load it will remove it once the element upgrades. If it doesn't upgrade, then you can style the un-upgraded element with a CTA to tell the user to enable JavaScript.




Reply all
Reply to author
Forward
0 new messages