Live data from Hacker News

Ask HN: Should I use Polymer for my next project?

news.ycombinator.com

21–30 of 82 posts

Re: Ask HN: Should I use Polymer for my next project?

#21

Why would you? I’ve never been a fan of adopting technology for technology’s sake without a problem that you’re trying to solve with it. (n.b. that problem could acceptably be ‘I want to learn more about this technology’)

1) If Web Components work as-advertised, we'll be able to build our own primitives for the first time in the history of the web stack; no more shoehorning rich Internet apps into a framework that was designed for academics to share term papers. This is both fantastic and a fundamental shift in the way apps are written.

2) You can make web apps that look and feel native (on Android) for free.

Re: Ask HN: Should I use Polymer for my next project?

#22
post #6

A couple of down sides of web components: - they interact poorly with requirejs and amd in general. - they flat out dont work at all in IE8 - there's no 'good' solution for the request hell you get from loading 50 components; although some of the tooling is getting there (vulcanize). - the tooling in general is currently rubbish; no way to easily combine sass + jade + coffee into a web component (eg. with gulp, no th…

If you keep everything external it works fine. We have a large project in Polymer, and we use CoffeeScript and Sass, with no problem.

got an example? I've not seen any decent 'assembly' tools that pull all the bits together (ie. specifically post compile, turning your separate elements into one self contained .html include)

Re: Ask HN: Should I use Polymer for my next project?

#23
It depends on what kind of website or web app you are working on.

I noticed that polymer is not really suitable for highly dynamic web applications. With ReactJS you can use all of the javascript control structures (if/then/else, conditions, loops, functions etc). With polymer you are restricted to bind, repeat and ref, which are not enough to adequately cover the requirements of a complex application.

My recomendation is to use polymer if it's a mostly static website with just a few moving parts, and ReactJS otherwise.

Re: Ask HN: Should I use Polymer for my next project?

#24

The only reason to use polymer is if you need the L style UIs they discussed at Google I/O. While Google's really good at Java apis, they're really terrible at JS apis. I love Google, but I would be very hesitant to use their JavaScript libraries or frameworks. A lot of people I've talked to (on irc, es-discus, etc.) don't agree with web components, but Google's pushing it hard. Web components are poorly based good i…

I don't know if it's fair to say an entire organization is good or bad at an individually-attributable skill. The Polymer team wrote the app framework for WebOS. They're not some generic Java guys who got put on a web project. They have a pretty deep background in JS.

Re: Ask HN: Should I use Polymer for my next project?

#25

Why would you? I’ve never been a fan of adopting technology for technology’s sake without a problem that you’re trying to solve with it. (n.b. that problem could acceptably be ‘I want to learn more about this technology’)

1) If Web Components work as-advertised, we'll be able to build our own primitives for the first time in the history of the web stack; no more shoehorning rich Internet apps into a framework that was designed for academics to share term papers. This is both fantastic and a fundamental shift in the way apps are written. 2) You can make web apps that look and feel native (on Android) for free.

Sorry, I phrased my original post badly. That wasn’t a rhetorical question, it was posed to the OP. They didn’t give any reasoning as to why they wanted to adopt Polymer, just a blanket ‘should I?’. Your reasons are both valid though.

Re: Ask HN: Should I use Polymer for my next project?

#26

The Polymer website uses Polymer and it is slooooow. That's a huge red flag to me. I have nothing but good things to say about React. Try that instead.

When it was brought up 5 days ago here: https://news.ycombinator.com/item?id=7945084 there was also lots rendering issues in most every browser except Chrome. I'd stay away from using it in production until they've ironed out the kinks.

Re: Ask HN: Should I use Polymer for my next project?

#27
Pros: Because Polyfill is who web should be built. It's the best way to develop a web applications. It's future friendly.

It's better to have one file for a component. Example: https://github.com/PolymerLabs/google-map Where they have everything. CSS, JS and Template in one page.

Cons: You shouldn't be using it for everything and of course not for the next project. Google doesn't use it for production. It makes tons of requests.

Comments:

Try to use it for few demo projects test the performance and take a decision. If you want to use it. It works best with require.js and you can't just dive into it Polymer(Deep Sea) without having experience(Wearing a oxygen cylinder). https://gist.github.com/tantaman/7222599

Re: Ask HN: Should I use Polymer for my next project?

#28
post #4

I used it for a project about a year ago ( https://github.com/STRML/securesha.re-client/tree/master/pol... ). I found that it was difficult to keep the service up and working; while older browsers still seem to load it quite well, Chrome continues to natively implement parts of the (changing) spec. When Polymer detects native capability for a given feature, it turns its polyfills off. But if the spec has changed, you…

Sorry to hear about that. Thankfully the specs are done now that everything is shipping in Chrome 36.

I hope you'll find some useful web components in the future that you can just drop in to whatever project you're working on and save some time!

Re: Ask HN: Should I use Polymer for my next project?

#29
post #11

We are using it for implementing a rather large project. I plan on writing a few articles on our experiences with it in the next couple of months. What you need to keep in mind that Polymer is largely experimental software, I would not recommend it yet for generic audience websites. The polyfills are nice, but you have to keep a tight eye on performance, and a new browser release could very easily pull out the rug fr…

I agree with this - to add on though: Polymer DOES NOT replace models and controllers, use this to render, and continue to use a MV* or MVC. Polymer gives you access to web components now providing a polyfill. I love web components, but there when we have logic inside a html is were I start to regret using it. example is [core-ajax]( https://github.com/Polymer/core-ajax ) There is literally no reason to have this, th…

Yes exactly, this is one of the lessons we learned early on. The polymer team have build a bunch of elements that actually represent services or models. Their philosophy is that everything can be a web component.

We experimented with this a bit, but quickly found this to be rather worthless, it effectively means you have changed the location of your services from the Javascript namespace to the DOM.

I'm not saying that's terrible, just that it does not have any clear advantage to me, and a clear disadvantage would be that your services have to be accessed through the dom using for example element.getElementById() instead of just accessing them as they are defined on window or however the angular people do it with their fancy dependency injections.

That said, we do pull of some nice tricks that involve a bit of logic through combining components, and we do use web components as controllers. It is a bit like old school ASP.net code behind, but I like it.

edit: I have to be fair, I just remembered the advantage they aim for. When your services and models are also webcomponents, then you can make your dependency on them explicit using html imports, which would be the HTML5 solution for the problem RequireJS solves.

Re: Ask HN: Should I use Polymer for my next project?

#30

It depends on what kind of website or web app you are working on. I noticed that polymer is not really suitable for highly dynamic web applications. With ReactJS you can use all of the javascript control structures (if/then/else, conditions, loops, functions etc). With polymer you are restricted to bind, repeat and ref, which are not enough to adequately cover the requirements of a complex application. My recomendati…

Polymer has if (not else yet), repeats loops, functions, and expressions: http://www.polymer-project.org/docs/polymer/expressions.html
Post reply on HN