Skip to content

Comments

fix(oxc_codegen): don't emit empty span mapping#7448

Merged
Boshen merged 6 commits intooxc-project:mainfrom
hi-ogawa:fix-no-emit-empty-span
Nov 24, 2024
Merged

fix(oxc_codegen): don't emit empty span mapping#7448
Boshen merged 6 commits intooxc-project:mainfrom
hi-ogawa:fix-no-emit-empty-span

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
```
@graphite-app
Copy link
Contributor

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
@codspeed-hq
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
```
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