-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
lib,src: extract sourceMappingURL from module #51690
Conversation
Review requested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if tests pass, left a few nits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we extract the sourceURL using the V8 API as well?
This is what I want to do. In fact I initiated this PR after identifying several issues with the source map support in Node.js, notably:
This PR specifically addresses the handling of sourceMappingURL without delving into sourceURL-related changes. This limitation is intentional to keep the scope manageable for my first contribution to Node.js. Moving forward, I'm going to resolve the identified issues, including the extraction of sourceURL. |
I think it's okay to leave the source URL for a follow-up. Can you leave a TODO/FIXME comment for them? |
@joyeecheung |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this!
Note for who lands this PR: please amend the commit message with the PR title as the message of the first commit was not aligned with it.
Landed in fc0f2cf |
PR-URL: nodejs#51690 Refs: nodejs#51522 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Node.js used regex to extract sourceMappingURL from the source code
of ESM files. This method led to inaccuracies, notably the erroneous
extraction of url from strings. This change attempts to retrieving the
correct url from V8 for ESM files.
Refs: #51522