Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
augustinde opened this issue May 30, 2024 · 0 comments
Open
Assignees
Labels
checkers Hackathon 2024 New issues tagged during the hackathon 2024

Comments

@augustinde
Copy link

augustinde commented May 30, 2024

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)

  • carbon: 60
  • water: 34
  • energy: 69
  • performance: 86
  • carbon (kt co2): 307
  • water (hm3): 29,9
  • energy (gwh): 469

With datefns: (75,9kb)

  • carbon: 60
  • water: 34
  • energy: 69
  • performance: 84
  • carbon (kt co2): 307
  • water (hm3): 29,9
  • energy (gwh): 469

With luxon: (78,1kb)

  • carbon: 61
  • water: 34
  • energy: 69
  • performance: 85
  • carbon (kt co2): 306
  • water (hm3): 29,9
  • energy (gwh): 468

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.

@augustinde augustinde added checkers Hackathon 2024 New issues tagged during the hackathon 2024 labels May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checkers Hackathon 2024 New issues tagged during the hackathon 2024
Projects
None yet
Development

No branches or pull requests

2 participants