Is there an updated reference for use polyfill/use native flags?

79 views
Skip to first unread message

Dominic Cooney

unread,
Jan 24, 2014, 3:02:47 AM1/24/14
to polymer-dev
Hi Polymerase,

How do I flip into a particular configuration of polyfills or native implementations?

I want to do this to measure the relative performance (time, memory, etc.) of using polyfills, because some Chromium contributors expressed interest in quantifying that.

In the past I've tickled Polymer to use a particular native feature or not with querystrings like ?register. However the platform has outgrown the documentation (for example, we have Imports now.) I'm *mostly* interested in "all polyfill" or "as native as possible" but would find it useful to be able to mix-and-match these. (Which configurations are expected to work?)

Thanks,

Dominic

Steve Orvell

unread,
Jan 27, 2014, 4:00:45 PM1/27/14
to Dominic Cooney, polymer-dev
Currently the flags are settable only when using a debug version of platform, i.e. loading from the platform-dev component.

The easiest way to toggle these settings is via url query string:

?shadow: use the ShadowDOM polyfill even when native ShadowDOM is supported; note this also uses the CustomElements polyfill.
?register: use the Custom Elements polyfill even when native Custom Elements is supported.

You can check what's enabled this way:

if window.ShadowDOMPolyfill is defined, the ShadowDOM polyfill is in use.
if CustomElements.useNative is true, the native version of CustomElements is in use.
if HTMLImports.useNative is true, the native version of HTMLImports is in use.

I've asked @dfreedm to improve this a bit such that these flags can be used with the non-debug version of platform.js.


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/CAHnmYQ9cn%2BbF-njPXgwR-PY75ACaeH7v1J9BKPrm%2BTL5SSz6mQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Daniel Freedman

unread,
Jan 27, 2014, 8:48:24 PM1/27/14
to Steve Orvell, Dominic Cooney, polymer-dev
Reply all
Reply to author
Forward
0 new messages