[Vuejs]-Is polymer routing suitable for large scale website?

0👍

Answer could be yes. You can use all of the modern framerworks/libraries like Angular, React, Polymer and so on.

If you want to develop in Polymer big website, you will have to take care of few things. Otherwise your website will be very slow.

First, lazy load necessary elements for the current screen.

Second, build process (minify, uglify)

Third, service workers

These thing are important if you will do them right, your application will be very fast. For example, I have an administration with more than 30 screens and it’s going very well (I didn’t find any problem with the size of the website)

Another thing is routing. I am using page.js , because I like it’s routing instead of app-route where it is a little bit confusing (at least for me).

You asked something about iron-ajax. I don’t understand why are you asking just for this element? this one is used to call XHTTP requests on your server. It’s a great element if you get used to it.

Polymer is very easy to use (propably the easiest one of the mentioned frameworks above) and has many elements already built and ready to use with nice documentation. If you really want to develop your website in Polymer, use version 2.x. DO NOT TRY TO USE 1.x (it will become obsolete and unsupported in browsers soon)

0👍

Polymer can be used to build large scale applications using <app-route> and would work similar to reactJs, angular or Vue. However, Polymer is not the same as these javascript frameworks. It is build for a different need.

Polymer is a framework to create HTML5 WebComponents, which is different from a javascript virtual component or light dom component (light dom is the dom we normaly use). HTML5 WebComponents are already supported natively by common browsers, if the browser dose not support WebComponents yet, when using polymer it will load Polyfills to give the same behavior in the browser.

Polymer creates reusable WebComponents in the shadow dom, which means the component created cannot or should not be interactive from other JavaScript or CSS. This can be seen when you inspect the HTML dom tree of a polymer component.

enter image description here

Libraries such as jQuery or native JavaScript querySelector can’t look though the dom and find the component because it is not in the (Light) DOM tree. Thus making the component act and behave the same throughout all web applications it’s being used.

Think of it as the select button on your file inputs in web application
enter image description here

If you want to style the button using normal CSS and javascript, you will have to use tweaks to do it. This is similer to a HTML5 WebComponents behavior

Now that being said, coming back to your question, Polymer can be used to create large scale websites. This means the whole application will become one polymer component. Polymer uses Lazy Loading of components, so the application wont be too heavy and will load relatively.

When creating your application, you have to keep in mind that you are using WebComponents and most JavaScript libraries that work on conventional WebApplications might not support WebComponents.

Leave a comment