Polymer integration with Meteor and Angular 2


#1

It appears that the Polymer library supported by Google will be a powerful tool is web development, especially with the advent of progressive web apps. However, from what I’ve seen so far, it seems that the current best practice is to use Bower in your build process if you are to include Polymer. The problem arises (correct me if I’m wrong) when you realize that Meteor has a different build processes than traditional web development, with a lot of the build process happening behind the scenes. I only have a couple years dev experience and only about a year on Meteor, so please excuse my ignorance if I am overlooking something simple. So after many a google, I leave the fate of my Meteor/Angular2/Polymer ambitions in your hands Meteor community. @Urigo


#2

In our latest 0.6.0 release of angular2-meteor we changed the default way we import templates - https://github.com/Urigo/angular2-meteor/blob/master/CHANGELOG.md#060-2016-07-09

That way supports Angular2 and polymer better so I believe urigo:static-templates should be the choice when compiling html templates whether you use Polymer, Angular 2, Angular 1 or all together


#3

I noticed the change in the updated tutorial. Oddly though, I don’t get recognition of the “import template” in any of my files. It does work, I just get IDE cannot find error and build time cannot find errors. From reading the changelog it appears I need an Angular2 typing file, which I imagine might solve this issue. However when I “typings install angular2 --save” it gives me an error saying no such typing can be found.


#4

I can’t help with Angular, but regarding Polymer.
To make it work just place /bower_components with latest Polymer to \public folder.
For Safari version, keep webcomponents-lite.min.js somewhere in \client folder.
Future vulcanization could be done via differential:vulcanize package.


#5

@tdesc Why should webcomponents-lite.min.js go in \client when the rest goes in \public?


#6

Before going production, polymer sources will need to be vulcanized, so no need to keep them.
I keep sources in public to speed up development. I run meteor with --once option and just reload site for updates.


#7

@Urigo Does “urigo:static-templates” functionality mean that no vulcanization is necessary?


#8

Regarding the meteor polymer integration here are some packages to help you

https://github.com/meteorwebcomponents/synthesis - Compiler for polymer in meteor

https://github.com/meteorwebcomponents/mixin - Reactive data source for polymer in meteor.

https://github.com/meteorwebcomponents/layout - polymer layout renderer.

Forum post - Polymer + Meteor Support With meteor webcomponents packages