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

util: add sourcemap support to getCallSites #55589

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

marco-ippolito
Copy link
Member

Fixes: #55109

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/typescript

@nodejs-github-bot nodejs-github-bot added module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. labels Oct 29, 2024
@marco-ippolito marco-ippolito marked this pull request as ready for review October 30, 2024 10:54
@marco-ippolito marco-ippolito added the semver-minor PRs that contain new features and should be released in the next minor version. label Oct 30, 2024
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.40%. Comparing base (68dc15e) to head (8a14517).
Report is 253 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55589      +/-   ##
==========================================
- Coverage   88.40%   88.40%   -0.01%     
==========================================
  Files         654      654              
  Lines      187637   187640       +3     
  Branches    36098    36103       +5     
==========================================
- Hits       165887   165879       -8     
- Misses      14994    15002       +8     
- Partials     6756     6759       +3     
Files with missing lines Coverage Δ
lib/util.js 97.75% <100.00%> (+0.43%) ⬆️

... and 33 files with indirect coverage changes

doc/api/module.md Outdated Show resolved Hide resolved
lib/internal/source_map/source_map_cache.js Outdated Show resolved Hide resolved
lib/internal/source_map/source_map_cache.js Outdated Show resolved Hide resolved
lib/internal/source_map/source_map_cache.js Outdated Show resolved Hide resolved
lib/internal/source_map/source_map_cache.js Outdated Show resolved Hide resolved
test/fixtures/typescript/ts/test-callsite.ts Outdated Show resolved Hide resolved
doc/api/module.md Outdated Show resolved Hide resolved
lib/internal/source_map/source_map_cache.js Outdated Show resolved Hide resolved
lib/internal/source_map/source_map_cache.js Outdated Show resolved Hide resolved
lib/internal/source_map/source_map_cache.js Outdated Show resolved Hide resolved
lib/internal/source_map/source_map_cache.js Outdated Show resolved Hide resolved
test/es-module/test-module-get-callsite.mjs Outdated Show resolved Hide resolved
@marco-ippolito marco-ippolito force-pushed the mapCallSite branch 5 times, most recently from 2bc03cf to fe8f181 Compare October 30, 2024 19:09
@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 31, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 31, 2024
@nodejs-github-bot

This comment was marked as outdated.

Copy link
Member

@RafaelGSS RafaelGSS left a comment

Choose a reason for hiding this comment

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

I agree that if we want to fix #55109 instead of adding a new function, we should just improve the support of the existing util.getCallSite(). What about accepting a config and then proceeding with module mapping inside node:util?

@marco-ippolito
Copy link
Member Author

marco-ippolito commented Oct 31, 2024

I agree that if we want to fix #55109 instead of adding a new function, we should just improve the support of the existing util.getCallSite(). What about accepting a config and then proceeding with module mapping inside node:util?

With a new function it is more flexibile because you can decide which frame to map, instead of mapping all of them, and you can also mock.
It doesn't exclude that we could also improve support in util.getCallSite by adding an option.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment has been minimized.

@legendecas
Copy link
Member

Not a big fan of the polymorphism that derived from the ambiguity of the name util.getCallSite which actually returns an array of call site object.

Submitted #55626 to not hijacking this thread.

doc/api/module.md Outdated Show resolved Hide resolved
@marco-ippolito marco-ippolito force-pushed the mapCallSite branch 2 times, most recently from 507688e to c1bc9e4 Compare November 2, 2024 11:23
@marco-ippolito marco-ippolito marked this pull request as draft November 2, 2024 11:36
aduh95 pushed a commit that referenced this pull request Nov 16, 2024
PR-URL: #55589
Fixes: #55109
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Nov 19, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) #55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) #55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) #55626

PR-URL: TODO
RafaelGSS pushed a commit that referenced this pull request Nov 19, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) #55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) #55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) #55626

PR-URL: #55921
RafaelGSS added a commit that referenced this pull request Nov 19, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) #55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) #55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) #55626

PR-URL: #55921
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: https://github.com/nodejs/aduh95/pull/1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit to aduh95/node that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
RafaelGSS added a commit that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) #55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) #55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) #55626

PR-URL: #55921
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
PR-URL: nodejs#55589
Fixes: nodejs#55109
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#55921
github-actions bot pushed a commit to RafaelGSS/node that referenced this pull request Nov 22, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
sqlite:
  * (SEMVER-MINOR) add support for SQLite Session Extension (Bart Louwers) nodejs#54181
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: TODO
github-actions bot pushed a commit to RafaelGSS/node that referenced this pull request Nov 22, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
sqlite:
  * (SEMVER-MINOR) add support for SQLite Session Extension (Bart Louwers) nodejs#54181
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: TODO
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Nov 26, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: nodejs#55921
@ruyadorno
Copy link
Member

This commit does not land cleanly on v22.x-staging and will need manual backport in case we want it in v22.x.

@ruyadorno ruyadorno added the backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. label Nov 27, 2024
marco-ippolito added a commit to marco-ippolito/node that referenced this pull request Dec 10, 2024
PR-URL: nodejs#55589
Fixes: nodejs#55109
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
@marco-ippolito marco-ippolito added the backport-open-v22.x Indicate that the PR has an open backport label Dec 10, 2024
marco-ippolito added a commit that referenced this pull request Dec 14, 2024
PR-URL: #55589
Backport-PR-URL: #56209
Fixes: #55109
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-open-v22.x Indicate that the PR has an open backport backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[22.9.0] util.getCallSite() doesn't report original line number for TS files
8 participants