Skip to content

Loading…

ES6: vulcanize + babel produces errors b/c of strict mode issue(s) #2363

Closed
ebidel opened this Issue · 1 comment

3 participants

@ebidel
Owner

Atm, building an element in ES6 classes requires a transpiler like babel to work x-browser. That workflow looks something like this:

  1. vulcanize | cripser (to get separate output.js file)
  2. babel output.js

The full command is below. BabelJS adds "use strict"; to the top of the transpiled output:

screen shot 2015-08-24 at 4 26 47 pm

Unfortunately, this means JS errors, as parts of core 'use strict' and other parts do not.

Fix
Easiest fix is to get ride of this global, make it window.Polymer = {.... I've confirmed changing this one line in the transpiled output works!

vulcanize polymer.html --inline-script | crisper -h polymer.v.html -j polymer.v.b.js; babel --compact false polymer.v.b.js -o polymer.v.b.js

@ebidel ebidel added the p1 label
@ebidel ebidel changed the title from ES6 classes: vulcanize + babel produces errors b/c of strict mode issue(s) to ES6: vulcanize + babel produces errors b/c of strict mode issue(s)
@ebidel ebidel added es6 summit labels
@sjmiles sjmiles self-assigned this
@addyosmani
Owner

Fixed as of a75133d?

@sorvell sorvell closed this in #2365
@MartinMoizard MartinMoizard referenced this issue from a commit in MartinMoizard/polymer
@sjmiles sjmiles specifically create `Polymer` object on `window` to satisfy strict mo…
…de (fixes #2363)
218f530
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.