crisper icon indicating copy to clipboard operation
crisper copied to clipboard

Don't do scriptInHead by default

Open robdodson opened this issue 9 years ago • 2 comments

If you use a tool like Babel with Crisper then the scriptInHead bit will cause all kinds of hard to debug race conditions. Because the option feels like a performance tuning thing, it seems like you'd want to make in opt-in for advanced users. cc @ebidel

robdodson avatar Mar 16 '16 00:03 robdodson

What sort of race conditions? Defer will load but not execute until the parser is done.

On Tue, Mar 15, 2016, 5:08 PM Rob Dodson [email protected] wrote:

If you use a tool like Babel with Crisper then the scriptInHead bit will cause all kinds of hard to debug race conditions. Because the option feels like a performance tuning thing, it seems like you'd want to make in opt-in for advanced users. cc @ebidel https://github.com/ebidel

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/PolymerLabs/crisper/issues/35

ebidel avatar Mar 16 '16 04:03 ebidel

It's a bit easier to show by going through the ES2015 code lab. With the script tag moved outside of dom-module and placed at the head of the page with defer, elements start throwing ReferenceErrors saying Polymer is not defined.

It may be because only my elements are deferred, whereas all the Polymer elements continue to use their original structure. Really not sure. But to make ES2015 work with Crisper I think you have to do scriptInHead (unless maybe you're vulcanizing first and then crispering everything).

robdodson avatar Mar 17 '16 20:03 robdodson