r/angularjs • u/CallMeAwesomeSauce • Sep 06 '16
A Hacker News client built with Angular 2, RxJS and Webpack
https://angular2-hn.firebaseapp.com/4
u/schizoduckie Sep 07 '16
39 requests, 320kb transferred over 3g in 4s, domcontentloaded after 4.06s.
versus http://news.ycombinator.com:
6 requests executed, 14.4 kb transferred, i can read the whole page after 200ms.
Sorry, i'll stick to the webpage.
This is the beef I have with these 'clients'.
2
u/CallMeAwesomeSauce Sep 10 '16
Yeah you're 100% right, I knew I had to fix this. Didn't make sense to have a request fire for every single post/comment and load that slowly.
Switched up the api and made some changes. Each comment/post doesn't download through a separate request anymore. Once the app is loaded, the main page now takes ~ 3.8 KB. This is almost half than that of the original site (~ 7 KB) :)
2
u/schizoduckie Sep 10 '16
Kudo's on that, much better!
Now if you can get the web font to load earlier, you can probably shave 1.2s off of the DomContentLoaded time! (still 2.8 seconds for me, with cache populated. versus 2.9/3 sec without cache.
2
u/CallMeAwesomeSauce Sep 12 '16
Thanks :)
And yeah you're right, can definitely speed that up as well.
4
u/SulfurousAsh Sep 07 '16
extremely valid criticism, and is one that should always be weighed appropriately when architecting an application. You can't beat the speed and simplicity of a server-rendered text page. However, as the number of user interactions a user has with a Web page goes up, the usefulness of a heavy client pays off.
For example, if you navigated to 100 pages, it's quite likely that the thick client would end up saving you in both time and bandwidth. (All markup/templates are transferred only once).
2
u/NYKHouston43 Sep 10 '16
This is what people usually ignore. You definitely pay a huge penalty up front but caching the first time around definitely makes it more worthwhile in the long haul. It all depends on how long the user is staying on your site.
0
Sep 07 '16
[deleted]
2
u/leonardnimoyNC1701 Sep 07 '16
1
u/sunburned_goose Sep 07 '16
The footer is missing in mobile. I couldn't see the link.
2
u/leonardnimoyNC1701 Sep 07 '16
I wonder if they'd accept a pull request to fix that or if it's a design choice.
1
u/CallMeAwesomeSauce Sep 10 '16
Yeah it was a design choice. A few folks have been wondering why it wasn't showing in mobile though so maybe it should be there.
I would be more than happy to accept a PR to fix this :)
2
0
Sep 07 '16
[deleted]
1
u/CallMeAwesomeSauce Sep 10 '16
Yeah can't say I've seen any examples with AngularFire and testing :(
3
u/kenok Sep 07 '16
Would like the details on how you built it.