Users of Polymer 2.0 should not have to compile the source that's distributed by us in order to run in supported browsers.
They should only have to compile their own code, with their compiler of choice, if they're writing JavaScript features that aren't supported by their target browsers. If they write in subset of JavaScript that is supported target browsers, they shouldn't have to compile at all.
Suggestion: publish on npm.
Let's keep this thread on the topic of compiling ES6. We have plenty of other npm-related discussions going on.
maybe this is slightly off topic, but how can I try out the 2.0 preview?
I've tried to clone the project and build it without luck, because your gulp file needs to be changed etc...
thanks in advance
@Hotell bower install --save Polymer/Polymer#2.0-preview
thanks, although I don't use bower.
for any npm user out there:
npm i -S polymer/polymer#2.0-preview
This is our plan of record regarding ES5 compilation:
We do _not_ plan to distribute an ES5-compiled version of Polymer or elements, because native Custom Elements are actually incompatible with ES5 compiled classes (in short, HTMLElement is not callable, which is what super calls are transpiled to in ES5); instead compiling needs to be pushed downstream depending on target browsers and deployment scenarios. That said, the following should practically mitigate this for the vast majority of use cases:
polymer serve (currently version polymer-cli@next) supports on-the-fly ES6->ES5 compilation when needed for target browser)polymer build (currently version polymer-cli@next) supports ES6->ES5 compilation output optionsweb-component-tester's server also provides ES5 compilation when needed for target browsercustom-elements polyfill includes a "native shim" which can be used in scenarios where you want to serve ES5-compiled source statically to all browsers. However, best performance will be achieved by building both ES5 and ES6 outputs (via polymer build) and serving different sources to ES5 & ES6 browsers.
Most helpful comment
Let's keep this thread on the topic of compiling ES6. We have plenty of other npm-related discussions going on.