r/webdev • u/budmademewiser • 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-f26ef1f3f3b126
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!"
1
u/DrummerHead Oct 11 '17
PureScript still uses Bower :/
2
u/GitHubPermalinkBot Oct 11 '17
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
7
4
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.htmlI'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
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
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
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
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
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
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
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
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
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
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
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
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.
78
u/2uneek javascript Oct 10 '17
I understand sticking to AngularJS but staying down on 1.3.2 is insane imo...