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
Visualize source maps in tests #15931
Visualize source maps in tests #15931
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/55392/ |
@@ -0,0 +1,41 @@ | |||
(1:0) var t <-- (1:0) var t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format is (line:column) SOURCE <-- (line:column) OUTPUT
What format would you prefer? (a) mappings point at a character
(b) mappings point between two characters (note: this inserts a
(c) mappings point between two characters, adding
(d) mappings point between two characters, adding
The spec defines columns in mappings as follows:
|
77f5ff8
to
9606dd1
Compare
Actually, I prefer this with ranges rather than just markers:
|
b43b243
to
2d29f7c
Compare
2a911df
to
9eef13a
Compare
(91:0-39) msg: 'Welcome to Your Vue.js App' <-- (96:6-9) msg: 'W | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ | ||
|
||
(91:0-39) msg: 'Welcome to Your Vue.js App' <-- (96:9-39) msg: 'Welcome to Your Vue.js App' | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is actually really interesting, looks like source map is not correct here
not a bug in this PR tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this file is all very weird. It's the result of merging the generated source map with an existing one, so the problem might be there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing!
Perhaps we can add visualization of identifier names
in the future.
Fixes #1, Fixes #2
Source maps are difficult to debug, especially because our current snapshots are useless. I built a small tool that is like source-map-visualizer, but based on text rather than interactive.
I only enabled it for one test, but I could also enable it automatically for all the tests that use source maps.