Kiwi Dev Journal Day 8 - API Details

  • I finished the check, fetch, update cycle for the primary timeline. The API provides a “hint” to suggest a polling frequency. I like this compromise between full streaming and basic polling.
  • I moved the new post button to the top-right of the source list (left sidebar). I really like it… but oh shit when the source-list gets narrow it’s got nowhere to go and gets squished. So… that’s why Tweetie and now Tweetbot always put theirs in the bottom corner. duh! LOL. But i think i have some nice ideas to try.
  • Built a cache of user objects. This allows user lookups to have some of the info immediately. But I’m really feeling the pain of JS on this one. There’s no great way to build a system of unique objects that can do slow addition and O(1) “contains” operation. What is normally a Set class. I mean, this is on a desktop and i’m not storing millions of items – but i’m sensitive to perceived performance issues of JS and want to make sure i don’t encourage that negative view any more.
  • Don’t get me wrong, JS has a Set class, it’s just a really shitty one. LOL. It can only determine uniqueness of objects by value. In other words there’s no way to define a Hash or isEqual that can compare objects by UUID. I can, of course, build my own – but it will not benefit from the native code in the Set class. Hopefully this will be in ES7.
  • The cache means viewing any user that has been bumped into recently loads avatar and basic info immediately – with the posts filling in after a couple seconds. nice! could use some animation. but maybe later.
  • It should be relatively easy to persist this info too – so posts of previous viewed users will load previously cached items, and then be updated with recent info.

This is kind of a milestone. The client is now fairly useful and functional for reading the main timeline. Nice!

Day 8

#dotblog #devjournal

What is this: these are random snippets from my dev journal working on a simple client app for fun. This is a non-serious side project, progresses very slowly, and will probably never see the light of day. The images may not perfectly correspond to the journal entry. In most cases I’ve added them later based on the relative time of git checkins.

isaiah @isaiah