Adding JS writer to source map filter#1393
Merged
grantnelson-wf merged 1 commit intogopherjs:masterfrom Oct 29, 2025
Merged
Conversation
c19ae7a to
c3c2abb
Compare
nevkontakte
approved these changes
Oct 24, 2025
Member
nevkontakte
left a comment
There was a problem hiding this comment.
This is quite neat, thank you!
c3c2abb to
1e1960b
Compare
1e1960b to
ee125f6
Compare
nevkontakte
approved these changes
Oct 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding JS writer to source map filter so that we can also map the JS files (prelude and .inc.js) into the source map. When doing this, it moved more of the source mapping code into
sourcemapx. This will help with debugging when the error comes from the preludes. For example, if we call"Hello"[1:800]it will panic for the out-of-bounds index, but that error comes from the prelude JS files it wasn't being mapped. To make the mapping work, I reused theesbuilddependency that was added to the prelude for minimization for creating a source map for JS even when not minimized.esbuilddoes some stuff to the JS code when not being minimized. I turned as much of that off as I could figure out how to do. It looks like most of the added stuff is to define properties and help with tree shaking. There will still be some differences between the prelude and output, but they are negligible. The minimized version is nearly identical with the JS changes turned off as they were prior to this PR.This might be related to #943
I also fixed the lint issue that got into master (I'm not sure why lint issues aren't being reported all the time in PRs and we should probably fix that so we don't get a red
xon master just because of an extra line).The change in the js size is not significant but obviously it will increase the js.map size.