My mobile hacker news client http://hn.premii.com/ ranks top on Google but not because of the content. Content is not indexed by Google.
305 karma · joined June 12, 2012
http://reddit.premii.com - Reddit Webapp (Mobile + Desktop) - no tracking - fast - works in congnito
http://premii.com
My mobile hacker news client http://hn.premii.com/ ranks top on Google but not because of the content. Content is not indexed by Google.
This is so common. Lot of time, they use CSS to change the design of the module, which is how it should be. But when they revert the look of the module, instead of deleting CSS, they add new rules to overwrite existing CSS. Which leads to specificity fight and !important.
At my previous job, site was rendering on server. It was old, and we wanted to redesign it. I wanted to keep rendering on the server. CTO and VP wanted to build Angular site because everyone is moving to Angular and its easy to find Angular developers. Company's 30+% of new visitors comes through SEO.
* I have bunch of helper functions (UI and non-UI). Each function define in its own file and independent (easy to unit test). Personal library like jQuery but not a jQuery replacement.
* App is route based. One route to many controllers. Each controller is a page/screen on mobile.
* There is only one model (API) that interface with 3rd party library. API layer talks to 3rd party library to get data or gets data from server directly, caches data, etc. Provides sync (Cached data) and async (Cached data or fresh from server) interface to controllers.
* There is a app class or I call it a page manager. Responsible for managing pages like ordering, loading, unloading etc (Kind of big and complex 200+ lines of logic).
- Decides which page to animate in which direction on mobile (Loading new page or going back).
- Order of pages (Back button)
- Passes events to its controllers
- Decides which pages to keep in DOM, and which to remove.
--- If you go from homepage to comments to profile page, all pages are in DOM.
--- When you go back to comments page from profile page, profile page will be destroyed and controller will be notified. Same happens when you go from comments to home page.
--- If you go to same comments page again, it will be loaded as a new page.
* Controller:
- Each controller may have multiple CSS and templates
- Controller uses its template to render
- Using sync API to get data to renders page.
- If sync API returns no data, renders empty page with loading, and makes async API call.
- Controller are idle when transitioning (animating) from one page to another on mobile. (Very important for smooth animation)
- Simple but fat controllers
- Controller handles events, UI logic
- Self cleaning so that browser can collect garbage when necessary
I package app using node/gulp. Anything that is not specific to page/app related, it becomes part of a helper library. Each app has its own model (Data layer), and controllers. I use micro templates, precompile using node for faster performance.
Just make sure you provide best user experience possible.
Author claims Bustle is one of the good JS rendered site. If you scroll down http://www.bustle.com/ and click on the item, and if you use back button, you won't be at the same position. This is one of the biggest problem with JS rendered site.
Now compare this to reddit.com. It works great without client side rendering, and not have any issues that most client side rendering sites has.
I am not oppose to JS only app. Problem is, it is hard to build a good JS only app. I do build client only apps.
Hacker news: http://hn.premii.com/
Reddit: http://reddit.premii.com/
You will be surprised that difference between the two will be less than 1%.
We are using nth-selector to style icon for nav items, which IMO is a wrong way of styling nav items.
There are some good CSS <del>selector</del> properties like position sticky but not available in most browsers :(
I have web client http://hn.premii.com/ that uses new APIs (No login).
iOS client https://itunes.apple.com/us/app/hacker-news-yc/id713733435 where you can login and upvote.
If you have a control over backend, you can optimize it further.
- You can collapse threads (children and parents).
- Use keyboard shortcuts (j-next / k-prev / x-collapse+next)
- Light/Dark Theme
Its ready, but update will remove upvoting. So trying to figure out how to keep upvoting with the new API.
Now I will have to remove that. Please keep current version of the YC site on a different subdomain.
http://dn.premii.com/ - Designer News For mobile. Lot of animations and works on Android, Safari on iOS and IE10+ on WP8.
One of the major problem with HTML5 is not HTML5/JS but how you we are trying to use those. We want to use all the libraries and frameworks. Backbone, AngularJS, bootstrap are good but using those on mobile will slow down your app. Also there is this mentality that you can only have good interaction if you build 100% client side rendering.
Everyone thinks that rendering on client will be faster as we are only sending JSON and html templates are cached. They should do compare and see if JSON that they are sending is really lighter then rendered HTML. Most of the time I found that after gzip, HTML is smaller compare to JSON.
Browser wise, Android is lagging behind when it comes to transitions. Its getting better but still not good as Safari or IE on WP8. Also Samsung is always uses wrong version of android browser. Even on galaxy S4, they screwed up big time (Browser on S3 was better than S4).
I build hacker news mobile client using HTML5, and I do have 4.5 star ratings on the both app stores.
https://play.google.com/store/apps/details?id=com.premii.hn
https://itunes.apple.com/us/app/hacker-news-yc/id713733435
or Try it on your browser
(function(window, $, otherGlobal) {
$ = window.jQuery;
otherGlobal = window.otherGlobal;
//code here
})(window);> Did you know that only a year ago it was possible tu create a native app with basically two features: push notifications and a webview. Inside the webview you could run your web app. Now appstores reject these type of apps, they require x% of the code base/features to be native (I believe x is changing, maybe is 50 now?).
Source code at http://github.com/premii/hn Or This is another awesome HN app. Scroll down to bottom for source code. http://hackerwebapp.com/
I can't believe they didn't tested orientation change with minimal-ui.
Also, in landscape mode, you loose top ~30px area. If you tap there, it will show safari chrome, and your app won't receive tap.
My HN mobile client works fine on WP8/IE, but so many hacks required to work as an HTML5 WP8 app.
I won't be able to get a job based on algorithm/standard CS interview questions.
Extra HTTP request has more overhead then few inline bytes.
if you put that code at bottom, you won't need jQuery to know if page is ready, and won't need extra HTTP request.
New chrome beta on Android allows webapps to be added to your home screen like iOS, but on android it is more usable and functional than iOS.
Try my app on chrome beta on Android: http://hn.premii.com/
I don't think HTML5 and webapps are going away.
or
iOS: https://itunes.apple.com/us/app/hacker-news-yc/id713733435
Android: https://play.google.com/store/apps/details?id=com.premii.hn