Forum Discussion

erikm's avatar
erikm
Guide
10 years ago

Polymer web components

Hi everyone,   I'd like to start designing my Lithium community with a responsive approach, developing for desktop and mobile simultaneously. I've used Polymer components in the past with good succ...
  • AndrewF's avatar
    10 years ago

    Hey Erik, we definitely support Polymer in the way we support any library -- you have a lot of customization flexibility with the platform to use almost any JS and markup that you like. But as to whether we specifically have any hooks for Polymer -- we don't at this time. We provide our out-of-the-box functionality through our own component system.

     

    Polymer is all about Web Components, a set of recent/upcoming specs that are supposed (intended?) to change the way the Web will be built — designers can put together complex things from parts without knowing the fine technical details. In theory, the future will be made of "component stores" where you can grab modular UI functionality made by other people and easily incorporate that functionality into whatever you're building. (Sounds a little bit like Studio!)

     

    It always seemed to me that Polymer's main goal was to bootstrap the Web Components spec -- to get people excited about the new concepts and capabilities before the spec was fully mature and before browsers had decided to implement everything. I've heard Rob Dodson call it an "opinionated polyfill" on a couple of occasions. But when you're just building your own stuff on the Lithium platform, a lot of the modularity and composition features of Web Components don't really apply as well. Custom elements, templates, HTML imports -- the utility of these things is mostly in helping you share your UI with others so that they can use it more easily. Freemarker components actually serve the same purpose, and they can be more performant because the server gets to do what it's good at (building most of the page). Then the browser has less to prepare once it downloads the page, which could result in a better experience for your users.

     

    I did notice that Polymer is being suggested for implementing Material Design. It seems they have a lot of ready-to-use custom elements. That seems like something that would be interesting to play with, although I don't think there's anything specific in that library that would be required to do Material Design. Try it out and let us know how it goes!