Adding JS writer to source map filter #1393
Merged
+333
−118
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.