Skip to content

Replacement badge visually distinguishes between less/more opinioated recommendations #3062

Description

@jhroemer

Describe the feature

The module replacements package has three different categorizations for replacements, ranking from less to more opinionated: native, micro utility and preferred. Currently npmx exclusively uses the yellow/amber variant for the badge. From my perspective we could improve the semantics here, and make them map more closely to the semantics of module replacements, by using an informational (blue) variant of the badge for the preferred replacements.

That makes the semantics nicer imo:
amber: “You should really do something different here”
And blue: “Fyi you could also go with something else here”

And it would look something like this (in this particular example there's an added benefit that you can more easily distinguish between a vulnerability warning and a replacement suggestion):

the npmx package site showing a 'preferred' module replacement suggestion, in informational blue, and thereafter a yellow warning about a security vulnerability

The manifests are exposed from the module replacements package https://npmx.dev/package-code/module-replacements/v/3.0.0/dist%2Fmain.d.ts#L7 so it’s possible to get the data. Maybe it could also be contributed upstream to module-replacements (although there’s the other distinction at play around how involved the replacement is too, but worth exploring).

Additional information

  • Would you be willing to help implement this feature?

Final checks

Metadata

Metadata

Assignees

No one assigned

    Labels

    e18eRelates to incorporating, linking to, or collaborating with https://e18e.devfrontFrontend, Designneeds discussionAn idea that needs more discussion to understand the scope and impact.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions