Photo by Marc-Olivier Jodoin on Unsplash

In my last post I went over how gRPC fares against the REST services.

Today I want to walk you through on what’s it like to call them from frontend apps and show how to create a web gRPC JavaScript client!

  • the whole point of gRPC services is that they conform to a schema/contract which is defined in a protobuf file (a new binary format)
  • this makes it easier to consume those services from other services; as they can infer exactly not only the request/response payloads but what different services there are to call!

This is amazing for

  • discoverability: you…


Photo by Michael Dziedzic on Unsplash

Problem

The question gives us the input in the form of a file path

dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext

which represents the following

The directory dir contains an empty sub-directory subdir1 and a sub-directory subdir2 containing a file file.ext.

The length of absolute length of the longest file path. This includes:

  • string length
  • \t length, each tab character is considered as 1 length unit

So for the above input example, the answer would be adding up the length of dir -> subdir2 -> file.txt

Solution

The directory structure looks like the classic folder structure on our laptops, where each file is nested under a folder…


Photo by Guillaume Jaillet on Unsplash

REST is the ubiquitous way of writing APIs for as long as I can remember. Today I want to introduce you to a new way of writing APIs.

Have you met gRPC?

gRPC is a relatively new way to write APIs and consume them as if you’re just calling a function.

  • gRPC originated from RPC (Remote Procedure Call). The client can just call a stubbed method which will invoke the method at the server side
  • all the connection details are abstracted at the client with this stub
  • it doesn’t use everyone’s favourite JSON to send the data over the wire…


I recently was asked to help on a project where the team was trying to get the test coverage for e2e tests also known as component tests. I initially tried to say that component tests run on the actual application process and not in the context of a test/source file. So the app is a black box to the running tests and can’t be instrumented for getting coverage.

I was wrong!

Running a java app: basics

The way a Java app runs is quite similar to a NodeJS app. A bundle in Java world is called a jar. …


OMG, I know right!

This was my reaction too when I took this path. I’ve been a frontend engineer for as long as I can remember and I absolutely love it to the core.

When I started my career in 2010 and learnt a handful of functions of jQuery with which I could add, remove or animate stuff on the browser screen it almost felt like magic. I have never been more excited to work/debug web apps within a browser, it feels home.

Last year I happened to work on projects which were infra heavy, and they introduced me to technologies like Docker and…


Note-taking is a highly underrated ability to preserve context over time. You might have heard about RoamResearch and Foam (which is similar but open source and lets you write notes, categorize them, link them all from inside VSCode).

It also lets you publish them for easy viewing on a browser.

I recently went down this rabbit-hole to try and find the best setup for it. I liked the plain foam-template but I wanted the published version to look like a Digital Garden.

What’s a digital garden?

Digital garden is a collection of notes, that gets refined over time. You link your notes and thoughts…


My ebook cover :)

I recently wrote my first e-book Building JavaScript A+ Promises in 10 steps and self-published it on both Gumroad and Amazon.

If you asked me a month back that would I ever write a book?, I would have answered with a resounding NO. As I thought writing and publishing a book would be so much work and you’d need editors/reviewers and publishing houses to back it!

JavaScript Promises have always been a fun topic for me and I'd always try and experiment with its gotchas and different ways you can use it to accomplish my use-cases. …


Don’t believe me??

Redux has been infamous lately for bringing a lot of boilerplate and ceremony, which we’ll see isn’t quite true. It really shines when you add Types to it but writing Types take time. And who has time when you’ve to ship a ton of features?

I’ve been doing some experiments on how to reduce the types, plus all third-party dependencies to something simple and yet tight.

Actions and their problems

Redux actions are plain objects which are sent(dispatched) to the store and ultimately end up changing state via reducers. …


PWAs have been gaining popularity for quite sometime now. Crafting a good, performant experience is continuous journey.

So before even embarking on the PWA journey, we should invest time on setting up the development workflow.

This separates great apps from apps that were great once.

For example let’s consider a GitHub repository which has Hacker News front end implemented. This is not a PWA yet. It’s made with React and Redux.

I want every Pull Request on this repository from now on to be tested and audited for performance issues.

How do I do that? Using a CI server, like…

Ankeet Maini

junior dev, always.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store