3 ms·
It pretty much requires you to use the babel/crisper/vulcanize toolchain, which in my limited experience doesn't do nearly a good a job of minifying Javascript
by david-given 10y ago
It pretty much requires you to use the babel/crisper/vulcanize toolchain, which in my limited experience doesn't do nearly a good a job of minifying Javascript than other tools (because it can't do symbol renaming). I haven't found a way to use browserify with web components, for example, so no ES6 modules.
Polymer is made of magic. It uses magic cutting-edge browser features where available, and where they aren't it fakes them using magic. Some of its APIs like Polymer.dom(x) are completely magic. When it works, it works really well. When it doesn't you are going to waste so much time trying to find out why.
It also assumes that everything you're doing is through Polymer; so you won't get much mileage out of, say, JQuery. While it admits the existence of other Javascript libraries it tends to blank them at parties.
If I were to do my current project again... I'd probably still choose Polymer, although I'd take another look at the other Javascript UI toolkits. Web components are so, so nice for designing UIs --- I can finally use actual computer science techniques like abstraction and modularity for building UIs! --- and it's got the best consistent look and feel that I've ever seen in a Javascript UI toolkit.
- jrmerz 10y agoHere's an experiment for ES6 and Polymer via Browserify + Babel: https://www.npmjs.com/package/poly-next https://www.npmjs.com/package/poly-next
- balloob 10y agoYou can totally use ES6 modules, you just have to split the web component JavaScript and HTML into separate files. That's what we did for Home Assistant, which we documented here: https://github.com/home-assistant/home-assistant-polymer#building-the-app https://github.com/home-assistant/home-assistant-polymer#bui...
- sgtpep 10y ago>which in my limited experience doesn't do nearly a good a job of minifying Javascript than other tools (because it can't do symbol renaming). It's possible to extract js-code from the vulcanized html file to the separate js-file using the crisper command, than run the uglifyjs command with appropriate minification arguments. Example: vulcanize --inline-css --inline-scripts ./index.html | crisper -h ./build/index.html -j ./build/script.js cd ./build uglifyjs -m -c warnings=false -o ./script.js --source-map=./script.js.map ./script.js