Kiru Kobire

Germany-based freelance generalist with a focus on Full Stack! Currently exploring DLT/Ethereum/Web3....  
Read more

2021

Nov 20, 2021
Nov 20, 2021
Wrote a new feature
Used Firebase
Wrote JavaScript
Used React Native
+ 2
I've always wanted to develop something with Firebase. Never had the chance to. My clients also prefer to avoid uncontrollably scaling solutions as well.

But today, I wrote a small & optional Firestore feature: a small "query miss tracker". Whenever the search query of a user yields a miss, we store & count this miss across all users (anonymously). It's JS code is insanely compact:

async function storeDictMiss(query: string): Promise<void> {
  const doc = firestore.doc('/querymiss/', firestore.toPath(word))
  const snapshot = await firestore.getDoc(doc)
  if (!snapshot.exists()) {
    await firestore.setDoc(doc, {
      query,
      count: 1,
    })
  }
  else {
    await firestore.updateDoc(doc, {
      count: snapshot.data().count + 1,
    })
  }
}
Don't mind firestore.toPath(...), it's a simple helper function to strip the user input of illegal characters such as / to avoid XSS injection.

But now, with just a couple lines of code (and another 2 for anonymous authentication), we can easily track which queries in our app lead to missing results. Much easier than anticipated!


Note: using Firebase JS SDK for this project, despite existence of react-native-firebase, to avoid more complex setup.
Oct 25, 2021
Oct 25, 2021
Learned a library
Built UI components
Finally got the opportunity to mess around with Redux Toolkit under React Native! It's very powerful and boosted my app's performance manifold with asynchronous content. 👀

Although learning within the confines of an existing framework didn't exactly make things easier.

Wouldn't exactly say I'm confident with it yet, though.
Oct 09, 2021
Oct 09, 2021
Built UI components
Spent the past couple days cleaning up my codebase, refactoring, reusing, normalizing...

Getting the hang of this React Native thingie! Finally approaching release soon.

Especially, learnt to leverage Contexts to simplify my theming. 👀 Or to pass clean error messages back up the vDOM for display.
Oct 09, 2021
Oct 09, 2021
Fixed a bug
Had a serious hiccup in my React Native project last week. Project wouldn't build. Twas a late consequence of Bintray sunsetting. Had to fix dependencies & repos... yay...

That also came with a bug in RN-Voice - a wrapper around Android's SpeechRecognizer service. Did you know that with API 30 you now need to announce package visibility in your AndroidManifest.xml? Took me a whole week to figure out...

But now it's all working again. Wooh! :)
Oct 02, 2021
Oct 02, 2021
Learned Vue.js
Web 3.0
Imho, Vue is more suited for Web 3 than React due to fundamental differences in their architectures. Albeit relevant only when deploying truly serverless Dapps.

React feels designed from a server perspective. Needless to say, in a serverless environment, being focused on a server is suboptimal. That is not to say counterproductive, but the brilliance of React simply doesn't shine in such environments. 

Of course, your Web 3 Dapp doesn't have to be serverless - but it would be in the spirit of decentralization. 
Loading...
Get your own page like this