r/programming • • Sep 15 '16

Angular 2.0.0 officially released

https://www.npmjs.com/~angular
1.3k Upvotes

535 comments sorted by

View all comments

24

u/m3wm3wm3wm Sep 15 '16

I'm surprised people only mention React as an alternative here, and no one mentions Polymer. The next version of Youtube is built with Polymer.

I'm enjoying the zero build tools and have had a good time staying not running the npm clusterfuck in a long time.

45

u/sanskarimoron Sep 15 '16

Polymer fucked our product really good, plenty of memory leak in IE and most of our customer base uses IE. We had no other option than to remove Polymer.

6

u/evilish Sep 15 '16

Damn mate, would love to hear more about what you guys experienced.

I was talking to a workmate a couple days ago about Polymer and the general idea behind it.

Haven't used it for a serious "work-related" project yet.

What version of Polymer where you guys trying to use?

7

u/sanskarimoron Sep 15 '16

We tried two to three versions of polymer starting from 1.0, 1.1 and the latest as well. All of them had the same behavior with IE. We had raised a ticket with Microsoft knowing they won't solve it. They replied back saying it's a third party library which we won't support.

3

u/evilish Sep 15 '16

What version of IE was it? How did you guys come across the memory leak? Where you running a profiler? Was the browser locking up?

Did you mean that Microsoft wouldn't support Polymer? Or was it another third-party library?

5

u/sanskarimoron Sep 15 '16 edited Sep 15 '16

Since Polymer is supported in IE9+ we tested in all IE 9+ browsers, apart from IE 11 memory leaks were there for all browsers.

I don't remember exactly whether IE 11 had the issue or not.

Polymer was just another third party library for them, so they said they don't care about third party library which doesn't work in IE.

Edit: Memory leak was discovered because browser used to crash after few navigation inside the website; Every time polymer controls are loaded it used to leak few MB of memories in our case it was around 30 MB.

Once the browser memory reaches some 1GB it used to crash, then we realized the issue.

You can have a look at the long pending issue for more details here

→ More replies (11)

5

u/m3wm3wm3wm Sep 15 '16

That's really a Webcomponents bug, not Polymer:

https://github.com/Polymer/polymer/issues/3430#issuecomment-239629974

Most ever green browsers will support shadow DOM and webcomponents soon.

And, honestly, when was IE not a pain in the ass?

1

u/davydog187 Sep 15 '16

Same exact thing with my previous company. We built our navigation in Polymer, and it made the site crash if you left it open in IE

0

u/[deleted] Sep 15 '16

[deleted]

1

u/sanskarimoron Sep 15 '16

Memory leaks becomes noticeable if you use a huge number of Polymer elements which have references to many more.

For example if i want to use a Phone element it will internally have many elements like screen, keypad, speaker etc and screen will have its own elements like display, color processor, brightness controller etc

We were using such complex elements so that could have led to this.

And IIRC IE behavior isn't good for rel=import since we had many elements obviously imports were huge so that could have led to memory leak.

→ More replies (2)

14

u/vinnl Sep 15 '16

Polymer in my opinion doesn't have that much going for it. I mean, I really like Web Components, and using the polyfill can make sense (depending on your performance and browser support requirements), but as a framework, it doesn't really challenge or help you architect your application in a better way.

5

u/m3wm3wm3wm Sep 15 '16

The nice thing about polymer is that it's not a framework, it's more like a library. The only pattern required to do component composition is mediator:

https://www.youtube.com/watch?v=ZDjiUmx51y8

That's it. You can make complex apps by composing simple isolated components.

You don't have to learn how to spell fancy terms like transfuckingclusion.

2

u/vinnl Sep 15 '16

So what is the advantage of using the Polymer library?

To provide some perspective: I like React because it taught me to model the view as a function of the state, and the pulling the two apart makes both easier to reason about.

What does Polymer teach me?

→ More replies (19)

2

u/ergo14 Sep 15 '16

It does - my code in polymer was much cleaner than angular one. You think in terms of components and their interactions. It feels like the right way for building JS applications.

1

u/vinnl Sep 16 '16

Thanks, I think the component-based thinking and the resulting encapsulation is a good argument for using Polymer if e.g. you've only used Angular, so I guess it does have that going for it. (I think React might have the edge here with its focus on stateless components, but if you're not already familiar with React, Polymer does indeed probably shape your thinking in a good way.)

→ More replies (6)

18

u/Doctuh Sep 15 '16

React? That was soooo Early-2016. Aren't we doing Inferno now?

16

u/human_trash_ Sep 15 '16

That was yesterday

3

u/bonestamp Sep 15 '16

Yup, today we're migrating everything to PlaidSocks and then tomorrow we're thinking it's going to be Infinitub.js, but it's possible that Punch will be the leader by then so we're just sitting back until tomorrow afternoon to see what shakes out.

3

u/castro1987 Sep 15 '16

Or Aurelia. No one has even heard of Aurelia.

0

u/[deleted] Sep 15 '16

[deleted]

1

u/ergo14 Sep 15 '16

Also Youtube gaming, google music, slalesforce stuff, ibm panels - Battlefield 1 (and other EA sites) are built in polymer - works really well.

1

u/fenduru Sep 16 '16

Vuejs is a much better alternative for people that liked angular 1.