镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Future work for source-map functionality #29865

Description

@bcoe

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

  1. added
    help wantedIssues that need assistance from volunteers or PRs that need help to proceed.
    on Oct 6, 2019
  2. iansu commented on Oct 6, 2019

    @iansu
    Contributor

    Thanks @bcoe! I’m excited to help out with some of this stuff.

  3. Hamza-324 commented on Aug 26, 2020

    @Hamza-324

    Hello @bcoe I'm a first time contributor here and would love to help out with this, how can I begin ?

  4. bcoe commented on Aug 28, 2020

    @bcoe
    ContributorAuthor

    @Hamza-324 I would love for us to figure out a way for source maps to work when running in a repl, this might be the easiest place to start contributing on the feature.

  5. Hamza-324 commented on Aug 28, 2020

    @Hamza-324

    @bcoe okay, I will start work on this.
    Should I comment here if I don't understand something or need some help, regarding this issue?

  6. bcoe commented on Aug 28, 2020

    @bcoe
    ContributorAuthor

    @Hamza-324 yes 👍 happy to help coordinate here.

  7. added
    source mapsIssues and PRs related to source map support.
    on Nov 28, 2020
  8. bcoe commented on Dec 1, 2020

    @bcoe
    ContributorAuthor

    From this conversation we may want to reconsider our approach of showing both the original and transpiled call site, as it might not fit with the TC39 Error Stacks Proposal.

    We should start a conversation about the future of Node.js' stack traces/source map support, on this proposal.

    CC: @ljharb

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

Metadata

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