prometheus / prometheus/client_js

Truthiness Reduction Program 2026

Open
#823 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue performance
Dominant language
JavaScript
Stars
3.5k
Forks
429
Avg merge
3d 3h
Merged PRs (30d)
22

Description

A number of PRs have reduced or removed truthiness checks over time, particularly once nullish operators were added to the code. Truthy checks force object coercion, which is both extra clock cycles and additional GC overhead. Even if there aren't many of these left on hot paths, there are for sure a few and the rest still hurt, just not as much. Also nullish and coalescing operators all date back to 14 (one is on 16 but I can't recall which) and we support >=20 so it's overdue.

If anyone would like to do a PR to remove most of the rest, I'd like to see that. Please however be aware of the existing open PRs as merge conflicts slow the review process down more than just about anything else.

Don't forget to look for ternary operators. There are a few hiding there.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for remaining truthiness checks and ternary operators, then review the existing open PRs before choosing a scope. Focus on checks that can use nullish operators without changing behavior, while avoiding overlapping edits that could create merge conflicts. Done means the selected reductions are applied consistently and remain compatible with the supported Node.js versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
observability-sre
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.