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

feat: Skip encoding range mappings if it's empty #86

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

kdy1
Copy link
Contributor

@kdy1 kdy1 commented Mar 25, 2024

The current code generates source map like

{
  "mappings": ";;UAAUA;MACOC,IAAI;IACV,SAASC;QACZC,QAAQC,GAAG,GAACH;IAChB;MAFgBC,IAAAA;AAGpB,GALUF,MAAAA",
  "names": [
    "A",
    "v",
    "a",
    "console",
    "log"
  ],
  "rangeMappings": ";;;;;;;;",
  "sources": [
    "../../input/index.ts"
  ],
  "sourcesContent": [
    "namespace A {\n    export const v = 25;\n    export function a() {\n        console.log(v);\n    }\n}\n"
  ],
  "version": 3
}

where rangeMappings is useless. This PR modifies the encoder to skip encoding if there's no meaningful data

tests/test_encoder.rs Outdated Show resolved Hide resolved
Co-authored-by: Arpad Borsos <swatinem@swatinem.de>
@Swatinem Swatinem merged commit 51711b9 into getsentry:master Mar 26, 2024
4 checks passed
@kdy1 kdy1 deleted the range-empty branch March 29, 2024 02:57
@kdy1 kdy1 restored the range-empty branch March 29, 2024 02:57
@kdy1 kdy1 deleted the range-empty branch March 29, 2024 02:57
@kdy1
Copy link
Contributor Author

kdy1 commented Mar 29, 2024

Can you publish a new version, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants