Posts

understanding index.d.ts file

 Recently while debugging one of my code repository, I encountered this error: Warning: (ae-forgotten-export) The symbol "Unavailable" needs to be exported by the entry point index.d.ts To give more context here Unavailable is an interface introduced by me as a sub-object of an already exported interface. So, let's first understand what does this index.d.ts signify: Searching over the web it was seen than *.d.ts files are like header files which are used to store JS code for typescript usage. If you are coming from c world this is like .h file. This mechanism allows to use JS code in TS env without any conversion. e.g. import {Hello} from './Apple/index' If we have both index.ts and index.d.ts files typescript compiler will look for index.d.ts file So, let's jump back to this error, this Unavailable interface needs to be exported form index.d.ts file I see inside index.ts file

Learning typescript

 Recently, I have changed up my team and moved to a team which is extensively using typescript language. So, naturally I have to learn it up. In this post I would be discussing about my learnings: What is Typescript? Typescript is built on the top of JavaScript. It is type superset of JavaScript which compiles back to simple JavaScript. It provides object-oriented features like java and c# and is also statically typed. For those who don't know what is statically typed it means that variables are declared with their types at the time of their declaration. Hmmm.... That's interesting so I assume it's a programming layer which is built on the top of JavaScript and provides object-oriented features of statically typed languages and compiling back to JavaScript. Hence, bringing functionalities of both JS and object-oriented languages together. Installation Let's start with discussing installation of typescript. I am assuming that you might be having node js installed over yo...

Making all service APi's generic

 So, I was looking into an issue in which one our customer complaint about inconsistency of some of our interfaces. He specifically talked about status code of some of our API's and mentioned that some status codes are supported by some API's and not by others. What can I do to mitigate it? Improve up the documentation with details [asked by customer]. Look into the code: Code says that we are specifically handling this error (not found) and adding it inside the response. There might be some reason associated with it. How can I figure out the reasons? Check code commits Ask Product manager Some comments around that code Documentation of this feature or maybe issue fix for this bug  Asked for clarification from Product Manager let's see what happens.

Demystifying Error response

 So, I was looking into a bug in which my client was complaining that they are getting a generalized error message and specific message relating to that error was absent. So, I did an initial code analysis and found that the log was returned by us, but we are also sending using up an err message from backend and seems like that was coming to be as empty.  So, what can I do to mitigate it? I can raise it to my backend team. Check backends team code and figure out if something is going wrong during the parsing or mapping the response. Can something specific be added inside my code?? Things are breaking from backends' side so probably I might not be knowing the reason behind it. Unless I get it from backend. So, after going through the code investigating more, I found that point 2 was valid the issue was with parsing/mapping of response. So, I fixed it up and wrote verification test and raise a pull request.

Understanding VS code launch.json file

Image
 I have recently moved to other organization and here my team is extensively using VS code. So, I was assigned a task and after coding it up I was planning to test it. This is the button on which I clicked. Immediately after that, I start seeing a pop in which VS code asked me setup up a launch.json file in order run my tests. I was little bit confused about what exactly is this launch.json is and why it's needed? I did search for this, and this was the first article to which I found link:  Debugging in Visual Studio Code After reading it up a bit, I found that this is a configuration file needed for running up the tests and currently in my code I haven't configured it. Upon reading more I found that vs code does provide options to run current file but it's better to create a launch.json file to save and configure testing details . Info: This launch.json file would be created under .vscode folder. There are quite a lot of launch.json attributes which can be used based upon...

Kustov query language

Image
 In this post I would be talking about my experiences of learning KQL (Kustov query language). I started with this document  Kusto Query Language (KQL) overview | Kusto . From the documentation I get to know that it's a query language used for analytics purposes and uses up schema entities quite similar to SQL i.e., having database, tables, column. Then, document further talks about Kusto query which is basically a read only query for processing data. Types of querying: KQL supports 3 types of query statements. These are basically Let, Set, Tabular. Tabular: This is the most common way of querying. In this format a table is provided as an input and table is also taken up as output. Query consists of lot of operands which are connected by pipe (|). I know it's too much but let's take a look at a query and this would be crystal clear.  In this query we can see StormEvents is provided as input and then there are lot of operands which are connected using pipe (|). These pip...

Finding something inside windows

 got an error while running azure-js-sdk package: : File C:\Users\<path>\AppData\Roaming\npm\rush.ps1 cannot be loaded. The file C:\Users\<path>\AppData\Roaming found it's solution also in one of the post:  [Solved] AppData\Roaming\npm\ng.ps1 cannot be loaded because running scripts is disabled on this system (techstrology.com) it says about deleting rush.ps1 file but i wasn't able to find it's parent folder. Later I found that this inside an hidden folder, this article helped in fixing the issue: How to Find and Use the AppData Folder in Windows (lifewire.com)