Skip to content

Future work for source-map functionality #29865

Closed
@bcoe

Description

This thread documents some of the known limitations of the recently released Source Map V3 support in Node.js.

I would greatly appreciate help testing and improving this feature, and this is a great opportunity to land some commits in Node.js.

If you begin work on a specific task, create a corresponding issue and reference this thread.

Feature Work

  • source-maps are not applied to GetErrorSource, this is the logic that Node.js uses to place a ^ pointing to the source location where an exception occurred. (@bcoe might be able to help).
  • source-maps are not applied when running in repl (talk to @devsnek and @bcoe about this work).
  • develop public API for fetching and manipulating source-maps (it would be good to engage folks like @SimenB, and @boneskull, about the current needs of tools like Mocha and Jest).
  • a source-map is not serialized to disk if an exception occurs while loading (this issue is deceptively difficult, and will require some refactoring related to how we serialize the cache, talk to @bcoe); see: module: refactor to use iterable-weak-map #35915 for solution.

Bug Fixes

  • partial source-map/coverage is written to disk when running Node's test suite (make -j4 coverage-run-js, results in warning SyntaxError: Unexpected end of JSON input) (potentially talk to @joyeecheung about this issue).

  • missing branch coverage displayed for covered catch statements (the fix for this is most likely in v8, and similar to this, @schuay would be a good person to talk to about this).

    Screen Shot 2019-10-06 at 1 07 28 PM

Refactoring

  • the caching of ESM and CJS is currently different code paths, it would be nice to figure out a way to consolidate them (can we find out a way to use a WeakMap for both, and still serialize to disk?).

CC: @iansu, @azasypkin
Related: related Node tooling conversation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    help wantedIssues that need assistance from volunteers or PRs that need help to proceed.source mapsIssues and PRs related to source map support.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions