worker-loader and comlink are two solution which make web-workers a joy to use. This short post summarizes how to make them play well with each other in a typescript codebase.
What is comlink ?
Comlink is a Google project that implements a proxy based RPC mechanism to invoke methods on objects pr...
I have been using VSCode as my primary editor for a couple of months. However it has been a recurring pain point for me that we have to switch back and forth between the arrow keys and primary rows when editing code. This post outlines a somewhat non-conventional approach for this by abusing the whe...
When we define a typescript class, we are actually defining two things, a constructor function, and a type. The instances constructed using the constructor defined by a class will have the type of the class.
One might wonder, if it is possible, say from a library, to expose only the type of the cla...
One of the recurring annoyances when designing websites is ensuring alignment of elements on a web page.
Most design applications have the provision of an overlay grid. With very little effort we can add a simple grid to any web page and use it to ensure alignment of elements.
As illustrated in ...
Writing generics-heavy code code in Typescript can sometimes be arduous, especially because typescript doesn’t facilitate higher kinded types at language level.
So, a function that accepts multiple arguments of generic types often has to accept type parameters of all these generic types in order to...
This post outlines the use of Google’s diff-match-patch library to generate patches that can be translated to operations against an AutoMerge.Text CRDT for situations when deriving the operations directly from user interactions is cumbersome.
Automerge is a so-called Conflict-Free Replicated Data...
GraphQL multi-part request spec outlines a specification for multipart form requests in GraphQL. Jayden Seric, the author of the spec, has also authored two libraries apollo-upload-client and apollo-upload-server which makes it effortless to integrate file uploads in Apollo Server.
GridFS is a simp...
It is fairly straightforward to add a GraphQL API powered by Apollo Server to a Next.js application through a koa middleware.
The abbreviated snippet below summarizes the setup along with the libraries involved:...
One of the interesting aspects in Typescript is that it is easy to extract out individual types from composite types.
In case of Array, Tuple and Object types, this is really simple, as the type extraction syntax mimic member access syntax.
1234567891011121314type Person = {name: string;age: ...
This post is intended to primarily benefit people coming from other, so called “modern” editors to Emacs. Emacs veterans are likely to find most of the tips here very elementary.
I have observed that many programmers habituated to newer editors have many implicit assumptions about editing workflows...