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(oxc_codegen): don't emit empty span mapping #7448

Merged
merged 6 commits into from
Nov 24, 2024

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Nov 24, 2024

Currently empty span SPAN is generated and this is likely problematic as it gives false mapping for original source's first line.

Here is how it affects rolldown sourcemap snapshots:


Interestingly, esbuild leaves mapping for module wrapper code (e.g. var require_xxx = __commonJS(...)), but not sure if it's designed so: esbuild.try, sourcemap viz

```
ast-grep -p '$A.add_source_mapping($B.start)' -r '$A.add_source_mapping_by_span($B, $B.start)' -U
```
Copy link

graphite-app bot commented Nov 24, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added A-codegen Area - Code Generation C-bug Category - Bug labels Nov 24, 2024
Copy link

codspeed-hq bot commented Nov 24, 2024

CodSpeed Performance Report

Merging #7448 will not alter performance

Comparing hi-ogawa:fix-no-emit-empty-span (ab6aec2) with main (00060ca)

Summary

✅ 30 untouched benchmarks

@hi-ogawa hi-ogawa marked this pull request as ready for review November 24, 2024 07:27
```
ast-grep -p '$A.add_source_mapping($B, $C.end)' -r '$A.add_source_mapping_end($B)' -U
```
```
ast-grep -p '$A.add_source_mapping($B, $C)' -r '$A.add_source_mapping($B)' -U
```
@Boshen Boshen merged commit d5df615 into oxc-project:main Nov 24, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area - Code Generation C-bug Category - Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants