Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future work for source-map functionality #29865

Closed
5 of 7 tasks
bcoe opened this issue Oct 6, 2019 · 6 comments
Closed
5 of 7 tasks

Future work for source-map functionality #29865

bcoe opened this issue Oct 6, 2019 · 6 comments
Labels
help wanted Issues that need assistance from volunteers or PRs that need help to proceed. source maps Issues and PRs related to source map support.

Comments

@bcoe
Copy link
Contributor

bcoe commented Oct 6, 2019

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.

@bcoe bcoe added help wanted Issues that need assistance from volunteers or PRs that need help to proceed. Hacktoberfest labels Oct 6, 2019
@iansu
Copy link
Contributor

iansu commented Oct 6, 2019

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

@Hamza-324
Copy link

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

@bcoe
Copy link
Contributor Author

bcoe commented Aug 28, 2020

@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.

@Hamza-324
Copy link

@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?

@bcoe
Copy link
Contributor Author

bcoe commented Aug 28, 2020

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

@bcoe bcoe added the source maps Issues and PRs related to source map support. label Nov 28, 2020
@bcoe
Copy link
Contributor Author

bcoe commented Dec 1, 2020

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
Labels
help wanted Issues that need assistance from volunteers or PRs that need help to proceed. source maps Issues and PRs related to source map support.
Projects
None yet
Development

No branches or pull requests

4 participants