5 ms·
Yeah I know, another Hacker News client? There seems to be a new one everyday. I wanted to build one with a responsive UI that would provide a `native` feel re
by MrAwesomeSauce 10y ago
Yeah I know, another Hacker News client? There seems to be a new one everyday.
I wanted to build one with a responsive UI that would provide a `native` feel regardless of which device you use. Decided to use Angular CLI, RxJS and Webpack to do the job.
There are definitely areas of improvement and I would love some feedback :)
- viraptor 10y agoFor mobile I care about data usage and speed without WiFi, before native feel. This version downloads each comment in a separate request and the total is huge. Even the main page (with everything already cached) takes ~7KB on original site and ~28KB on your client.
- MrAwesomeSauce 10y agoThank you, you're right I'm loading every item individually async from the official API. Not only are the requests unnecessarily large, it can take a while to load with a large number of comments. Definitely something to work on and fix.
- ben_jones 10y agoWrite a couple hundred lines of your favorite language and throw it up on Google App Engine. Have the code query all relevant threads/comments and store them in GAE's free memcached service. It should fall perfectly into the free tier, and if not the $300 free trial should last you a full year. Finally have the angular2 app query your GAE project directly and you should be looking at < 50 ms loads of much more efficient json data. Wish I worked for Google, but I just like GCP (currently migrating my company's infrastructure to it).
- MrAwesomeSauce 10y agoOh thanks for that mate will definitely look into this, especially the free tier
- boulos 10y agoThanks for the shout out, Ben! I sadly have to correct you though: our $300 free trial for all of GCP is time limited to two months. That said, you're right about App Engine and it's free tier, it goes a long way! Since Firebase is built on Google Cloud, you can easily still use Firebase for the "front end" / client, and serve it up as a json response as suggested. Disclosure: I work on Cloud at Google.
- MrAwesomeSauce 10y agoJust fixed this. Each comment/post doesn't download through a separate request anymore. The main page now takes ~ 3.8 KB on my site, almost half of the original site :)
- zackify 10y agoWould be nice if the client side state prevented the loading indicator when going back and forth on the same post. Looks nice though:)
- MrAwesomeSauce 10y agoThank you! Yeah I was thinking that too, I need to look into caching the requests so it doesn't get hit every single time.