green-code-initiative / ecoCode-challenge

Emboard in the hackhatons serie for improving ecoCode
3 stars 4 forks source link

[Hackaton 2024][Prométhium][Javascript] Replacing momentjs with datefns #107

Open augustinde opened 1 month ago

augustinde commented 1 month ago

Replacing momentjs with datefs or another libraries

The title of the associated rule is measured in this ticket.

Associated rule link

The link to the existing rule measured referenced into the "rules specifications" repository
BP40 Javascript

Language and platform

The language and platform of the associated rule.
It's supposed to be described in the rule itself.

Measure justification

With momentjs: (294,9kb)

With datefns: (75,9kb)

With luxon: (78,1kb)

This rule has an environmental impact. When we load a heavier library, in this case momentjs, which is over 4 times heavier than datefns or luxon, this has an environmental impact. Users have to download more data. In our case, using a heavier library is not justified, as we're only looking to manipulate dates ...

Validation

We validate this rule 75%, but it would be relevant to carry out measurements with other tools.