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: Create word-based fidelity source mapping for code transformations #513

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

lforst
Copy link
Member

@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
16 checks passed
@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