Skip to content

fix: Create word-based fidelity source mapping for code transformations#513

Merged
lforst merged 2 commits into
mainfrom
lforst-no-hirest
Apr 2, 2024
Merged

fix: Create word-based fidelity source mapping for code transformations#513
lforst merged 2 commits into
mainfrom
lforst-no-hirest

Conversation

@lforst
Copy link
Copy Markdown

@lforst lforst commented Apr 2, 2024

Attempt to fix #512

It seems like we are OOMing users with the plugin. I previously wrote this off as an upstream issue, but looking at the comment #379 (comment) which narrows the OOM issue down to version 2.7.0 or 2.7.1, it seems like #383 could have introduced memory issues since hires: true will create mappings for every single character.

Now that I am wiser I don't think that is entirely necesary - especially for our use-case. Let's see if removing that option would fix it. It looks like simply removing hires: true will drastically reduce the fidelity of source maps to line based mappings, however, a newer release of magic-string includes a new option value 'boundary' which does word-based mapping. I hope this will reduce memory pressure while still preserving high quality source maps.

@lforst lforst requested a review from Lms24 April 2, 2024 07:33
@lforst lforst changed the title fix: Remove high-resolution sourcemapping from code transformations fix: Create word-based fidelity source mapping for code transformations Apr 2, 2024
@lforst lforst merged commit b87511c into main Apr 2, 2024
@lforst lforst deleted the lforst-no-hirest branch April 2, 2024 07:56
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.

sentry-vite-plugin cause javascript out of memory

2 participants