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

fix(es/codegen): Set sourceRoot of sourcemaps #6086

Merged
merged 16 commits into from
Jan 24, 2024
Merged

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Oct 8, 2022

@kdy1 kdy1 added this to the Planned milestone Oct 8, 2022
@kdy1 kdy1 self-assigned this Oct 8, 2022
@kdy1 kdy1 marked this pull request as ready for review October 8, 2022 03:59
@kdy1 kdy1 enabled auto-merge (squash) October 8, 2022 03:59
kodiakhq[bot]
kodiakhq bot previously approved these changes Oct 8, 2022
Copy link
Member Author

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

swc-bump:

  • swc_common

@kdy1 kdy1 marked this pull request as draft October 8, 2022 04:06
auto-merge was automatically disabled October 8, 2022 04:06

Pull request was converted to draft

@kdy1 kdy1 marked this pull request as ready for review October 8, 2022 04:06
@kdy1 kdy1 enabled auto-merge (squash) October 8, 2022 04:06
@kdy1 kdy1 marked this pull request as draft October 8, 2022 04:07
auto-merge was automatically disabled October 8, 2022 04:07

Pull request was converted to draft

@kdy1 kdy1 marked this pull request as ready for review October 8, 2022 06:08
kodiakhq[bot]
kodiakhq bot previously approved these changes Oct 8, 2022
@kdy1 kdy1 enabled auto-merge (squash) October 8, 2022 06:08
Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

Comment on lines 9 to 10
"sourceRoot": "$DIR/tests/fixture/deno/deno-10014/case1/input",
"sources": [
"../../input/index.ts"
Copy link
Contributor

@jridgewell jridgewell Oct 8, 2022

Choose a reason for hiding this comment

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

This looks invalid. To resolve a source file, you take the concatenation of the sourceRoot (treating it always as a directory) and the individual source[i]. In this case, we'd get the result "$DIR/tests/fixture/deno/deno-10014/case1/input" + "/" + "../../input/index.ts" which resolves to "$DIR/tests/fixture/deno/deno-10014/input/index.ts".

crates/swc_common/src/source_map.rs Outdated Show resolved Hide resolved
Copy link

changeset-bot bot commented Jan 24, 2024

⚠️ No Changeset found

Latest commit: 5085458

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member Author

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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


swc-bump:

  • swc_compiler_base --breaking

@kdy1 kdy1 changed the title fix(common): Set sourceRoot of sourcemaps fix(es/codegen): Set sourceRoot of sourcemaps Jan 24, 2024
@kdy1 kdy1 marked this pull request as ready for review January 24, 2024 05:24
@kdy1 kdy1 requested review from a team as code owners January 24, 2024 05:24
kodiakhq[bot]
kodiakhq bot previously approved these changes Jan 24, 2024
@kdy1 kdy1 enabled auto-merge (squash) January 24, 2024 05:24
@kdy1 kdy1 disabled auto-merge January 24, 2024 05:24
@kdy1 kdy1 enabled auto-merge (squash) January 24, 2024 05:24
kodiakhq[bot]
kodiakhq bot previously approved these changes Jan 24, 2024
kodiakhq[bot]
kodiakhq bot previously approved these changes Jan 24, 2024
@kdy1 kdy1 merged commit ae78669 into swc-project:main Jan 24, 2024
142 checks passed
@kdy1 kdy1 deleted the issue-2362 branch January 24, 2024 09:18
@kdy1 kdy1 modified the milestones: Planned, v1.3.106 Jan 24, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Source maps aren't loaded correctly in Chrome Node DevTools
3 participants