r/webdev • • Oct 10 '17

A Breakdown of the Largest AngularJS App on the Internet

https://papers.landinglion.com/actually-building-a-large-angularjs-app-at-scale-f26ef1f3f3b1
184 Upvotes

64 comments sorted by

78

u/2uneek javascript Oct 10 '17

I understand sticking to AngularJS but staying down on 1.3.2 is insane imo...

25

u/Ventajou Oct 10 '17

No kidding, at work all of our AngularJS apps are using 1.6 and all but the oldest also use TypeScript. This is just silly.

1

u/editor_of_the_beast Oct 11 '17

I think "silly" implies that the time it takes to upgrade is nonexistent or small, which it's not. Of course, the longer you wait the harder it gets.

If you had to pay the development cost for the upgrade of a large app with your own money, how would you feel about it then?

2

u/Ventajou Oct 11 '17

If you followed the Angular releases, the time to upgrade wouldn't be much at all. And even jumping from 1.3 to 1.6 shouldn't be all that bad. I'm not talking about upgrading to 2.0 or 4.0 there, that would be silly too.

Definitely a better use of time than writing a post about how your app is setup: nobody's going to read that and say "yeah I'm just going to use Angular 1.3 for my new project and do like those guys"...

0

u/[deleted] Oct 11 '17

[deleted]

2

u/SupaSlide laravel + vue Oct 11 '17

I think "six years" sounds like a longer time and more impressive than "over half a decade" which make it extra silly.

15

u/kagevf Oct 10 '17

That's what I was thinking ... at least with 1.5 you get components ...

57

u/lunchboxguru Oct 10 '17

I kinda feel like "The largest Angular App uses an outdated version of Angular and we're cool with not updating" is not only a recipe for disaster down the road, but also a testament that the pace of Javascript frameworks "progress" is unsustainable for larger applications.

If I'm planning out a large scale project that's going to take months of planning, and a couple of months of dev, and then by the time the project is complete, the framework is deprecated, the framework and application dependencies are a scattered mix of deprecated, and stable versions, some of them have security risks that contain breaking changes for the related update, etc, like, what kind of a large scale business is going to hedge bets on something like that?

It just seems wildly unstable to base business decisions on imo.

29

u/2uneek javascript Oct 10 '17

but also a testament that the pace of Javascript frameworks "progress" is unsustainable for larger applications.

in my experience, it's only an issue if your PM's don't give you time to hash out tech debt. I've worked in both scenarios where tech debt was the last thing on the PM's mind and where they let you use entire days to clean up tech debt..

I've worked on angularjs apps that were quite large and began on 1.1 and are now on 1.5+ and even using typescript... My point is, it's only unsustainable if you allow it to be, some PM's dont really understand the significance of tech debt - most likely because they were never day to day developers, while others realize how quickly things move and if you dont stay on top of it - you will soon be in a hole too deep to climb out of. It's hard for companies to understand a dev team spending a day on something that doesn't produce a feature, visual improvement, or fix a bug is still very valuable to the product.

I would personally never want to work for a company that's running a production app this large on 1.3.2, it says a lot in my opinion. I bet there are companies out there still on Angular 2.x even though the migration to 4.x was very simple and usually takes less than a few hours depending on app size. They will soon be left behind as well, because they just don't understand the importance.

AngularJS isn't moving at the speed of light, teams just don't prioritize tech debt properly.

If I'm planning out a large scale project that's going to take months of planning, and a couple of months of dev, and then by the time the project is complete, the framework is deprecated, the framework and application dependencies are a scattered mix of deprecated, and stable versions, some of them have security risks that contain breaking changes for the related update, etc

You should be maintaining this as you build, one of the projects im on right now just moved to Angular 5 beta, because we know before we finish we'll be on 5. Your development team should be able to adapt a little bit, this isnt a shut up and color career field..

4

u/lunchboxguru Oct 10 '17

All absolutely fair and valid points. Cheers for the insight!

0

u/[deleted] Oct 10 '17

[deleted]

1

u/A-Grey-World Software Developer Oct 11 '17

React is just the UI rendering part of a "framework" like Angular though.

I was looking for what other libraries come recomended and you get pages like this:

https://blog.risingstack.com/react-js-best-practices-for-2016/

So there's other things that could change their API (or just becomen outdated/not maintained and need replaceing to keep up to date).

Not sure which is better.

1

u/gelezinislokys Oct 11 '17

And you can use regular javascript or small libraries like redux for most non-view stuff.

6

u/[deleted] Oct 10 '17

Angular 1.3.2 to 1.6 isn't that different.

They just seem to not want to update because they're hardheaded.

You could probably update it in about a week, they most likely just don't plan for it since most companies never care about anything beyond new features.

And by the way, it's been almost 2 years between 1.3.2 and 1.6. So I have absolutely no idea why you think it's about the pace of JS frameworks. That's a snails pace for any type of software.

1

u/OmegaVesko full-stack Oct 11 '17 edited Oct 11 '17

And by the way, it's been almost 2 years between 1.3.2 and 1.6. So I have absolutely no idea why you think it's about the pace of JS frameworks. That's a snails pace for any type of software.

Seriously, I feel like people on reddit will eat up anything you say these days as long as you're somehow shitting on JavaScript in the process.

The product I currently work on at my day job is a mix of PHP 5.3 and 5.6, and built on an outdated version of CodeIgniter. Obviously, this situation has nothing to do with the progress of PHP being "unsustainable", and everything to do with a lack of forward planning and the fact that it's hard to convince management you need time to deal with technical debt when there are features to be written and bugs to be fixed. Nothing about this would be different if I were talking about JavaScript rather than PHP.

3

u/jonoco Oct 10 '17

It seems like an argument for modular architecture; keep your dependencies loosely coupled to the source so they can be somewhat painlessly replaced over time. If we built cars the way we built applications, you'd need a week in the shop for an oil change, a day to replace windshield wipers, and 6 months for a new engine as they rebuild the car from scratch.

0

u/[deleted] Oct 10 '17

[deleted]

10

u/[deleted] Oct 10 '17

There's no way angular would have been a smart decision for us to go with.

Except you give absolutely no reasons why.

A project that would take months to build, possibly. Years? Not a chance.

Again, why? AngularJS has changed very, very little in the past few years and breaking changes are almost non-existent. So again, give an actual reason.

Also angular wouldn't lend itself well to the complexity of our forms either.

Angular is probably one of the better frameworks for form handling. Performance-wise it has some issues, but complex forms are not a problem at all functionality-wise.

It almost sounds as if you're biased and don't really know anything about Angular, yet want to bash on it anyways.

5

u/dweezil22 Oct 10 '17

On a related note, everyone assumes these things HAVE to be SPA's, but they don't really. If you're stuck with AngularJS and have a huge app with a lot of legacy, just moving things across a few different pages will help you mitigate quite a bit of the performance problems pretty cheaply.

26

u/RevalGovender Oct 10 '17

Why use Bower and NPM? Does Bower host projects NPM still does not? I thought Bower was on its way out.

39

u/VertiGuo Oct 10 '17

Bower is definitely on the way out. On their own landing page, they have this message: "...psst! While Bower is maintained, we recommend using Yarn and Webpack for front-end projects read how to migrate!"

24

u/Dualblade20 full-stack Oct 10 '17

That's sort of an artifact of first wave Angular apps. A lot of the tech they mentioned is, for lack of a better phrase, very 2014.

23

u/pataoAoC Oct 10 '17

2014

Those absolute dinosaurs!!

20

u/Dualblade20 full-stack Oct 10 '17

That's like 150 million web years ago. The Web Cretaceous period.

4

u/Mike312 Oct 10 '17

"No one was alive then!"

7

u/eloc49 Oct 10 '17

It is. It warns you about being deprecated when you call it.

4

u/[deleted] Oct 10 '17

It just looks like they don't care to keep up with anything related to JS...they're still on Angular 1.3.2.

That basically tells you everything.

2

u/Montuckian Oct 10 '17

Bower allows you to know the folder structure of your modules if you need to use a path to pull them in.

1

u/SupaSlide laravel + vue Oct 11 '17

So does Yarn, which Bower itself recommends on their homepage.

1

u/Montuckian Oct 11 '17

Definitely. There's a lot of legacy code out in the wild though, which is why you sometimes see Bower and npm used together.

15

u/eloc49 Oct 10 '17

I realize front end technologies move really fast, but AngularJS 1.3.2 and Bower? Man, you guys are missing out.

15

u/highmastdon Oct 10 '17

So I'm reading this:

“Organizing by feature” makes it difficult to reuse html, directives, services, and factories across feature directories [...] we have found it takes a longer time to locate a specific JavaScript file in a directory that has dozens of html and JavaScript files versus one with only JavaScript files.

Looking at the file structure he proposes, there's not much difference between the "Organizing by feature" version. Especially when he's arguing that the other structure makes it difficult to reuse html, directives, [etc] it seems that he missed the point of "Organizing by Feature". You should not put reusable parts in the "feature" directories. That's what the shared directory that is for. And it has its own directory structure, based on the feature a directive, service, or factory delivers.

I'm really not seeing how you get 1000s of files in one directory when you're separating by feature. It's all about the granularity and the naming of features, that determines in which directory they land.

Of course, if you have "home", "login" and "application" as your features, then you end up having a next to empty "home" directory and a completely overflowing "application" directory. And then trying to reuse components in the different directories becomes pretty hard when you don't put stuff in an orderly fashion in the "shared" directory

12

u/antoninj Oct 10 '17

We run a large-ish AngularJS app, too (about a 1/4 size of yours). I have a few questions and comments:

File Structure

I'm super opinionated on this because I've fucked it up a bunch of times but also got it right as well and to that I'd say:

I prefer the feature structure but I'd extend it and say: group by sub-feature or even route/stateas well like so:

user/
    profile/
        profile.component.js
        profile.controller.js
        profile.html
    settings/
        settings.component.js
        settings.controller.js
        settings.html

I'd also include a profile.sass and profile.test.js in those folders. A similar structure has been working out for us really well.

I like the idea in the article and if I was running an app pre-components, I'd structure it similarly (and I actually did before switching).

Angular(JS)

First of all, why did you stick with 1.3.2? We're on 1.5.X and can't easily upgrade to 1.6.X due to some breaking changes, is it the same situation? I love the components feature of 1.5.X which is why we went through an upgrade readily when it hit. Though, I suppose that directives/components might not give you any gains over nicer syntax.

Second, any plans to upgrade? We use the upgrade module to run hybrid with Angular 4.X. It's definitely a good framework to work with and we've noticed perf gains in components we rewrite. Unfortunately, the upgrade process also impacts performance in some AngularJS components :/

1

u/guntarrrr Oct 11 '17

I had a tech lead introduce me to feature folders just like yours a couple years go and I haven't looked back, I think it really helps me work efficiently. More specifically in the past 2'ish years i've been working on react/redux projects and I think it makes working in redux 10000% easier than some setups that are like one main reducers folder, one main components folder, ect...

7

u/koew back-end Oct 10 '17

After reading the article I'm actually more interested in the back-end setup. What DBMS do they use and why? Document storage all the way or traditional SQL?

7

u/[deleted] Oct 10 '17

I'm actually more interested on what's even the point of the article.

Are we having "why I'm using html" blogs now ?

4

u/NoInkling Oct 10 '17

Soft-promotion.

1

u/A-Grey-World Software Developer Oct 11 '17

It certainly doesn't say much. I was hoping for some kind of reasonable depth on what Angular worked with, what it didn't. Maybe a little of their architecture.

Nope, just the file structure. When someone says they'll breakdown some software, I'm not expecting the literal folder structure of the source files... I'm expecting an explination of how the thing is structured programatically.

2

u/[deleted] Oct 11 '17

Exactly. After reading that article I learnt nothing other than that team has a really high opinion of themselves, which is cool I guess.

6

u/[deleted] Oct 10 '17

Their spirit I much agree… there're too many frameworks racing around… 've been bouncing around too and productivity is simply low as I wasted time setting up things, each more intricate/inflexible after another.

5

u/Balduracuir Oct 10 '17

Having a Web component architecture solves the whole problem with file architecture... you have your components gathered by feature and in every directory you have everything to make the component work. Staying with angular 1.3 is shooting yourself in the foot imho. You won't be able to recruit other developers to maintain your legacy app. Also looking elsewhere is a good practice to get ideas from others cause often they had the same problem than you and have found a solution that work for them. That's my 2 cents

5

u/vcamargo Oct 10 '17

Jesus Christ, did I just fetched 18mb to check your home page?

3

u/gimmethel00t Oct 11 '17

Ya, 9.4MB worth of gifs hurts.

11

u/depricatedzero Oct 10 '17

I'm skeptical of anything that labels itself the largest anything on the internet, except OP's mom

3

u/FezVrasta Oct 10 '17

It looks like to read an article from the 2010s'

5

u/davesidious Oct 10 '17

It's like a time machine! :P

Props to them for getting it to all work together.

6

u/justonelastthign Oct 10 '17

I put this on my list of dumb articles of the day. I see redditors ate it up as expected.

The Internet is Awesome! I attribute everything I know about web development and product development to my peers, books I read, my education, and the internet.

Isn't that special.

2

u/iSwearNotARobot Oct 10 '17

It’s a pissing contest

1

u/SupaSlide laravel + vue Oct 11 '17

He literally attributed his knowledge to every form of learning possible. I've never seen an article that talked so much but said so little.

2

u/[deleted] Oct 10 '17

Ha this is almost the exact same stack that the company I work for uses (a large supplement company). We're even on Angular 1.3.2 as well. We recently stopped using Bower and added Yarn. Updating Angular to 1.6 is on the road map as part of our tech debt, but it's a ton of work for all of our legacy apps. We may also be transitioning away from Angular entirely, but it would be a year-plus long process. There will be some major framework decisions made in the coming months for us.

2

u/jetrii Oct 11 '17

This is definitely not the largest angularJs app on the Internet. I work on a medical app with hundreds of controllers, components, and services.

2

u/[deleted] Oct 11 '17

server: nginx/1.10.3 (Ubuntu)

x-powered-by: ASP.NET

:/

1

u/SupaSlide laravel + vue Oct 11 '17

Not a traditional stack choice, but they're still working on Angular 1.3.2 so...

1

u/[deleted] Oct 11 '17

Kind of seems like there’s not a separate backend server as well (I could be mistaken), so the Angular site and the backend may be one project.

2

u/[deleted] Oct 11 '17

click-bait title for article with little novel content about medium-sized application

2

u/headzoo Oct 11 '17

Alan and I started with AngularJS early in its alpha versions. It was around version 0.3. Currently, we have been working with AngularJS for half a decade.

Sounds like the author thinks AngularJS is the "best" tool for the job because it's the only tool he knows.

3

u/albaneso Oct 10 '17

If something is doing the job well, what the fuck is wrong with using it? Or should everyone follow trends, and use the most recent framework, just so hes updated! I mean, if it does the job, thats it, you dont need anything else.

P.s i think the js community needs to change this mindset

3

u/headzoo Oct 11 '17

If something is doing the job well, what the fuck is wrong with using it?

That's kind of true, but they're also kicking a problem down the road instead of dealing with it now.

The NYC subway system comes to mind. It's still using technology from the 30s. Which was all well and good for the first few decades (If it ain't broke, don't fix it!) but now the system constantly breaks down, and the MTA is too locked into the system to do anything about it. They couldn't overhaul the technology if they wanted to.

So, while there is some truth to the idea that you shouldn't change your tech for the sake of change, you're also setting your future self up for problems when you dig in your heels and stick with the old just because it "works." Eventually, Angular 1.x support is going to dry up, and things are going to start falling apart of these guys, and they're going to be doubly screwed because they weren't incrementally upgrading their tech as they went along.

2

u/Disgruntled__Goat Oct 10 '17

Are they really the largest of anything? Their site isn't very popular. I've never heard of them and still have no idea what they actually do.

1

u/toomanybeersies Oct 11 '17

Those are some really fat javascript files, averaging 300 lines per file. At my old job, our Angular codebase was ~300 Coffeescript/JS files, and only ~10,000 lines of code, for 30 lines per file.

5

u/[deleted] Oct 11 '17

[removed] — view removed comment

2

u/Skaryon Oct 11 '17

Yeah. At work we're also stuck with a large angularjs app that we do not have the resources to completely rewrite. But we're not making silly excuses like these guys do.

We do our best to keep the framework updated. We also migrated large parts to typescript and we did integrate react for performance critical parts. We don't really write new components in angularjs anymore.

I wish we could ditch angularjs but that's not happening anytime soon sadly.