Skip to content

[api-documenter] Fix ae-ambiguous-ids meta issue #1308

@octogonz

Description

@octogonz

This issue tracks the fix for a set of related bugs tagged by ae-ambiguous-ids. These issues all involve IDs that are generated using a surjective mapping that results in naming collisions (e.g. a file being ovewritten) or instability (e.g. a hyperlink being broken after a SemVer MINOR change).

The problem was summarized in #1252 (comment):

we need a naming pattern that ideally would satisfy several requirements:

  1. be unambiguous, i.e. provide a one-to-one mapping for all possible inputs
  2. be stable, e.g. adding a new function overload should not cause the UID to change for a preexisting function overload (since that could lead to broken hyperlinks)
  3. look "nice" to humans (particularly for the name field)

(Elsewhere I pointed out that the TSDoc declaration reference notation meets 1 and 2, but perhaps not 3.)

Examples of problematic TypeScript constructs:

  • a static member with the same name as an instance member
  • a function with multiple overloads
  • a merged declarations (e.g. an enum X { ... } alongside namespace X { ... })
  • an indexer (defined using symbols without any name) (e.g. [key: string] : string; as a member of an interface)

Certain IDs are case-insensitive, which means that e.g. noTallPeople and NotAllPeople may collide.

And here's a summary of the specific kinds of IDs that we need to solve this for:

  • Markdown URLs: case insensitive, no special characters
  • DocFX YAML URLs: case insensitive, no special characters
  • DocFX YAML IDs: case sensitive, allows some special characters
  • Titles that appear in docs: needs to look nice to a human

Metadata

Metadata

Assignees

No one assigned

    Labels

    ae-ambiguous-idsThis issue belongs to a set of bugs tracked by PetebugSomething isn't working as intended

    Type

    No type

    Projects

    Status

    AE/AD

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions