FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lib,src: extract sourceMappingURL from module by unbyte · Pull Request #51690 · nodejs/node · GitHub

/ node Public

lib,src: extract sourceMappingURL from module - #51690

Closed
unbyte wants to merge 7 commits into
nodejs:mainfrom
unbyte:fix/source-map-url-in-string
Closed

lib,src: extract sourceMappingURL from module#51690
unbyte wants to merge 7 commits into
nodejs:mainfrom
unbyte:fix/source-map-url-in-string

Conversation

unbyte commented Feb 7, 2024

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/vm

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. labels Feb 7, 2024

aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM if tests pass, left a few nits

unbyte requested a review from aduh95 February 7, 2024 15:30
Comment thread lib/internal/modules/esm/translators.js Outdated

joyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Shouldn't we extract the sourceURL using the V8 API as well?

unbyte commented Feb 7, 2024

Copy link
Copy Markdown
Contributor Author

@joyeecheung

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:

  1. Node.js utilizes regex to extract sourceURLs in all files and sourceMappingURLs in ESM files,
  2. Node.js requires the eval-ed code text to include both sourceURL and sourceMappingURL for stack trace rewriting.

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.

joyeecheung commented Feb 7, 2024
edited
Loading

Copy link
Copy Markdown
Member

I think it's okay to leave the source URL for a follow-up. Can you leave a TODO/FIXME comment for them?

unbyte commented Feb 7, 2024

Copy link
Copy Markdown
Contributor Author

@joyeecheung
Of course! Done.

legendecas added request-ci Add this label to start a Jenkins CI on a PR. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Feb 8, 2024

legendecas left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 14, 2024

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

legendecas added the source maps Issues and PRs related to source map support. label Feb 26, 2024

Copy link
Copy Markdown
Collaborator

legendecas pushed a commit that referenced this pull request Feb 26, 2024
PR-URL: #51690
Refs: #51522
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

Copy link
Copy Markdown
Member

Landed in fc0f2cf

legendecas closed this Feb 26, 2024
marco-ippolito pushed a commit that referenced this pull request Feb 26, 2024
PR-URL: #51690
Refs: #51522
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Feb 27, 2024
PR-URL: #51690
Refs: #51522
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
marco-ippolito mentioned this pull request Mar 1, 2024
richardlau pushed a commit that referenced this pull request Mar 25, 2024
PR-URL: #51690
Refs: #51522
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
richardlau mentioned this pull request Mar 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. source maps Issues and PRs related to source map support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL