Best way to detect if webcomponents supported?

352 views
Skip to first unread message

andreas...@hotmail.de

unread,
Sep 9, 2015, 1:02:41 PM9/9/15
to Polymer
I have launched my MVP earlier, or rather my pre MVP to test with friends. A friend of mine wouldn't get anything rendered due to an old Firefox and Chrome, so it really makes me anxious about releasing this to some customers next week. That's why I want to track webcomponents support and save it in my database so I can see for whom it worked properly and for whom only polyfilled or not at all. 

Is there a reliable way to check for webcomponents as a whole, seperately and/or to do a check if (Polymer) components rendered properly?

Eric Bidelman

unread,
Sep 9, 2015, 2:17:12 PM9/9/15
to andreas...@hotmail.de, Polymer
var webComponentsSupported = ('registerElement' in document
    && 'import' in document.createElement('link')
    && 'content' in document.createElement('template'));

is the current feature detect. That checks for custom elements, imports, and <template>. As browsers implement
the different APIs, you'll have to adapt this snippet.

On Wed, Sep 9, 2015 at 10:02 AM <andreas...@hotmail.de> wrote:
I have launched my MVP earlier, or rather my pre MVP to test with friends. A friend of mine wouldn't get anything rendered due to an old Firefox and Chrome, so it really makes me anxious about releasing this to some customers next week. That's why I want to track webcomponents support and save it in my database so I can see for whom it worked properly and for whom only polyfilled or not at all. 

Is there a reliable way to check for webcomponents as a whole, seperately and/or to do a check if (Polymer) components rendered properly?

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/1786ded7-6b75-4d6d-b1dc-27a1f20a10d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

andreas...@hotmail.de

unread,
Sep 10, 2015, 12:32:56 AM9/10/15
to Polymer, andreas...@hotmail.de
Thanks, works great :)! By the way, I'm curious since the lite shadow dom polyfill works differently and to my understanding emulates web components less strict, does that also mean backwards compatibility with browsers is better? The two biggest issues I am seeing right now with my MVP is a) CPU usage and b) not so perfect browser support, since I have to rely on the old polyfill since the new one doesn't work with meteor yet.
Reply all
Reply to author
Forward
0 new messages