Relative Content

Tag Archive for javascripttypescript

How to group spans under specific traceId in openTelemetry node sdk?

I have a distributed system where certain operations happen asynchronously over the course of several messages being processed by different actors. Each message has a correlation id of the message that originated the whole flow, so they can be easily traced toghether. Given the idea behind of open telemetry is to provide a standard way to trace computations across different systems, this should be simple to achieve, but the reality is that I’m really struggling with it.

Choosing between CommonJS and ES modules

There are apparently two main approaches to structuring apps that use TypeScript, namely CommonJS modules and ES modules. Based on many lines in the manual, this is a critical factor in how you write things and particularly how you import and export things like type aliases and interfaces which I expect to use.

Typescript newbie needs help choosing between CommonJS modules and ES modules

There are apparently two main approaches to structuring apps that use Typescript, namely CommonJS modules and ES modules. Based on many many lines in the manual, this is a critical factor in how you write things and particularly how you import and export things like type aliases and interfaces which I expect to use.

Can I use ts files the exactly same way I use js files?

I’ve heard about TypeScript and I liked it, because I’ve always liked making annotations on my code. However, I would have to rename all my .js files to .ts files. I would like to add annotations to my functions with all TypeScript capabilities without renaming my files. But, as I learned later, that is not possible. So, my question is: Can I continue typing js code normally after renaming them to .ts extension?