a full stack enthusiast interested in Javascript / Typescript / Kotlin / Python / React / React Native / (Android & iOS) native / Cloud

0%

Apollo local cache (InMemoryCache) works super great, but recently I have a problem with it, the UI re-renders when updating the cache after a GraphQL mutation, but not after I calling a traditional REST api and try to update the cache directly. The intention is simple, I want to update the local cache directly and re-render the UI. Let’s see how to solve it.

Read more »

When use React router, sometimes we need to define the route path as constants like const USER = /user/:userId, and the render the <Route path={USER} /> later. However, when we try to navigate, for example history.push(), we have a problem which we need to replace that :userId with real user id. And when we do it every time we calling history.push, it won’t be any prettier. This is how I solved it with several lines of code.

Read more »

I think I have a talent to make such a verbose title… xD

Anyway, error handling is tedious or hard, just like naming your blog. But you can’t miss it, because it makes your code robust. AWS lambda is a great way to write your code, and its simple nature enables us to do something very interesting, and make your code clean, I previously looked a lot about best practice of error handling in lambda, but either they mentions other AWS services integration or just lambda-API gateway configuration. Today, let’s talk about the code. How to make this part clean. Even more, we will use Typescript.

Read more »

Serverless framework is a fantastic framework to simplified your serverless management. Most of the time, we have some configurations which are different among different environments. Let’s say how could we achieve this with Serverless framework. Including manage tests in Jest.

Read more »

I have a side project using dokku, it works well. But then I want to dump the production data to local in order to test some cases. I thought it should be as simple as dump and restore, but I was wrong. It took me a while, I think write it down might help someone else or future me.

Read more »

Dokku is good, and I wrote a blog for whole setup of Dokku + Node + React + MongoDB. This blog, we will address the issue where if you use the default buildpack for building, it will download Node and NPM everytime, which will make it very long in some circumstance, in this blog, we will Dockerfile to replace it, make it much more faster, because we will multi-stage build with its cache mechanism.

Read more »