Skip to content

Sourcemaps: populate names for identifiers #178

Description

@zloirock

Feature request. map.names is always empty. Tooling that renames identifiers and prints through esrap loses the devtools "original name" reverse-resolution that text-splicing pipelines get from magic-string's storeName: true.

With boundaryTokens: true (which is excellent - it closed the mapping-density gap for us) the remaining delta to a hires text-splice map is exactly the names array: record the source identifier's text on the mapping segment when a node with a name is printed.

Context: found by a parse -> print -> reparse structural gate over a ~8.5k-file TS/JS corpus while adopting esrap in core-js's build plugin, then re-verified in isolation. esrap 2.3.5; the ASTs below come from @typescript-eslint/typescript-estree 8.67 with loc/range enabled, so the repros are independent of our own (oxc-based) pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions