Polymer is production ready - what does this mean? Can we truly use webcomponents in production?

150 views
Skip to first unread message

andreas...@hotmail.de

unread,
Jul 24, 2015, 1:32:07 PM7/24/15
to Polymer

In the past two weeks I've been looking into using Polymer and lots of the elements that are made available by Google for a Meteor app and there are some issues that I've encountered:

 

The biggest problems that I see, though there might be more:

  1. Web Components / Polymer doesn't offer server side rendering. Does this mean we can't have any SEO at all for SPA apps?
  2. Web Components seem to have problems with custom initializing when you change routes on an app with a different framework than Polymer (meteor at least does have that issue, paper-buttons break for example)
  3. Changing DOM is not yet steramlined. If I want to change the text of a paper-button for example I need to select the paper-material inside it with querySelector and change its text there (shouldn't this be impossible actually? Is this due to shadyDOM?)

 

Those challenges make me wonder if it's safe to use polymer in production right now. 

 

1) and 2) are serious showstoppers. I can live with 3)

 

Does SEO work properly with custom elements? There are problems with using Polymer with other frameworks that I wasn't aware of (though there were others instead) prior to switching from 0.5 to 1.0. I'm assuming getting away with the complete shadow DOM polyfill has created those issues. The question is: Will those be resolved, if so when? From the looks of it we'll be stuck with polyfills for at least another year, so resolving the current issues when using Polymer need to be resolved if it has to be used in production. As is right now I am uncertain of continuing development with Polymer and switching to React while I don't have too many components in use yet.

 

Any thoughts? It would be really great to get feedback from the Polymer team on this.

 

Eric Bidelman

unread,
Jul 28, 2015, 6:30:35 PM7/28/15
to andreas...@hotmail.de, Polymer
On Fri, Jul 24, 2015 at 10:32 AM <andreas...@hotmail.de> wrote:

In the past two weeks I've been looking into using Polymer and lots of the elements that are made available by Google for a Meteor app and there are some issues that I've encountered:

 

The biggest problems that I see, though there might be more:

  1. Web Components / Polymer doesn't offer server side rendering. Does this mean we can't have any SEO at all for SPA apps?

The Google I/O web app this year was a SPA built in Polymer 0.5. We were careful to make it crawlable (schedule results). The important bit is that the common best practices still apply to SPAs and SPAs written in web components: meta data, canonical links, use light dom where it makes sense for content, views should be linked to using <a> and not click/tap handlers.
  1. Web Components seem to have problems with custom initializing when you change routes on an app with a different framework than Polymer (meteor at least does have that issue, paper-buttons break for example)
Can you provide an example/demo/more info?

One thing to check: Be sure that you're loading the elements' HTML Import with their definitions. Custom elements are upgraded after their definitions are document.registerElement'd by the browser. So, if you try to use an element's API (properties/methods) before this time, you won't be interacting with the upgraded version, but it's generic HTMLElement self.
  1. Changing DOM is not yet steramlined. If I want to change the text of a paper-button for example I need to select the paper-material inside it with querySelector and change its text there (shouldn't this be impossible actually? Is this due to shadyDOM?)

This should work:
document.querySelector('paper-button').textContent = 'new text'; 

However, I see that this works under native shadow dom but not under shady dom. I've opened https://github.com/Polymer/paper-button/issues/59 to address it.

 

Those challenges make me wonder if it's safe to use polymer in production right now. 

 

1) and 2) are serious showstoppers. I can live with 3)

 

Does SEO work properly with custom elements? There are problems with using Polymer with other frameworks that I wasn't aware of (though there were others instead) prior to switching from 0.5 to 1.0. I'm assuming getting away with the complete shadow DOM polyfill has created those issues. The question is: Will those be resolved, if so when? From the looks of it we'll be stuck with polyfills for at least another year, so resolving the current issues when using Polymer need to be resolved if it has to be used in production. As is right now I am uncertain of continuing development with Polymer and switching to React while I don't have too many components in use yet.

 

Any thoughts? It would be really great to get feedback from the Polymer team on this.

 

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/879462ff-1bd5-44d1-b4c1-49274595f948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages