sliit-foss / npm-catalogue

A curated list of NPM packages developed by the SLIIT FOSS community. Additionally, it houses the core libraries of the Timekeeper ecosystem
https://www.npmjs.com/~sliit.foss
MIT License
2 stars 6 forks source link

Annotation based tracing - @sliit-foss/babel-plugin-transform-trace #88

Open Akalanka47000 opened 1 year ago

Akalanka47000 commented 1 year ago

Requirement :- As a developer, rather than ignoring the functions which I do not need tracing for by specifying them in the babel config, it would be much more feasible to mark only those which needs to be traced with an annotation in the source code.

Example solution :-

@timekeeper
const foo = () => {
  console.log("Inside foo");
}

Note:- decorators are not natively supported in JavaScript, a plugin such as @babel/plugin-proposal-decorators will need to be incorporated