Prototype Tree

Anyone who has worked with JS long enough knows something or the other about delegation, prototype chains, dunder proto and other similar things. There are times when I wonder how complex and deep this chaining can be. This past week, however, my curiosity got the best of me and I just had to find the answer for myself.

Read more

Making CRA apps work with SSR

This is a multi-post series about how to server-side-render react apps that were built using create-react-app. You can read more about how and why I came up with this below.

Part 1: Off to a simple start I start off simple. A barebones app can’t even deal with css, but helps explain the process involved.

Part 1.5: Amending mistakes Once the base system is up and running, it was time to patch it up. Make it work with css and other stuff.

Part 2: Integrating Redux Redux works great with react. So I had to fit it in. But instead of simply embedding the data. I moved things up a notch.

Part 3: Routing with react-router We’ll explore static and dynamic routing with react-router, along with handling route params and redux integration.

You can read more on this on hackernoon. The code used in the series is here on github.


Stream capturing with MediaRecorder

The new MediaRecorder WebAPI makes media recording super easy. It allows storing chunks of data from a media stream as blobs, which can later be concatenated and saved as a single file. As time passes, more sources of media streams are added. We can capture media from:

  • Media Devices
  • Canvas
  • Media Elements:
    • <video />
    • <audio />
Read more

Tiny transfers

It’s hard to pin down why JSON transfers is so popular. But one thing’s for sure, it is not the most efficient when it comes to data transfers.

The nested nature of JSON makes it prone to redundant storage and transferring redundant JSON files only puts strain on the server’s and the client’s bandwidth.

It is always a good idea to deflate your JSON data before transferring to the other side.

Read more

The correct blur

In the past week, I learned that the RGB values stored in digital media are not the same as they were recorded. This isn’t some lossy compression algorithm artifact, but rather a clever tactic. The range of all possible intensity values is reduced.

In the days when storage spaces were tiny and these adjustments helped. But the same adjustments can hinder photo editing processes.

Read more