-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Source map rework #3183
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
Source map rework #3183
Conversation
Rather than repeating the original location when we exit a node, we need to restore the previous parent’s original line location, since the source map format denotes the start location.
Current coverage is
|
|
looks good to me |
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.
it says excluding _private but that doesn't seem to be the case. Also, if this functions is used once, consider using it inline. This is a public API and we should be careful with adding more thing to it.
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.
clone excludes the private properties. Would adding an options field to clone be a better option vs. a separate named function? I suspect that there are other places where this without location method will be needed, I just don't have time to identify all of the cases.
|
@sebmck can you take a look? |
|
Any chance on getting this in? I see it's conflicting now, glad to rebase if there is interest in this PR. |
|
+1 to get it fixed, please. The problem described in T6851 (https://phabricator.babeljs.io/T6851) makes my debugging almost impossible. |
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.
Why's the line here?
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 forces any after comments to be output prior to the ( in a call. The diff below has test coverage for this:
-/*before*/(0, _foo4. /*after*/bar)( /*before*/_foo2.default) /*after*/;
+/*before*/(0, _foo4.bar) /*after*/( /*before*/_foo2.default /*after*/, /*before*/_foo5.foo /*after*/);
This is a bit of whack-a-mole and is not a complete fix for the handling of aux after but helps fix one of the identified cases.
|
I think it's clear from some of the source map issues that the tests aren't exhaustive enough to catch a lot of these problems. These changes look good to me but I'm not confident giving this a 👍 without some additional tests. |
|
@kittens is there a baseline that you'd like to see in order to get this in? I'm all for expanded test coverage for source maps, but I only have so much time to focus on open source work versus trying to ship and need to balance my time. |
|
@kittens @amasad @thejameskyle a month later I'm still having to guess where my tests are failing due to this and this is causing a fair amount of pain for me. I am glad to make changes needed to get this in but it's a bit disheartening that we can't get this issue resolved or at least rejected if it won't be accepted. I had invested the time to fix this issue (along with many other open source project issues that directly impact me) in an attempt to not treat the maintainers as a commodity and in a selfish attempt to fix my own problems but now it's just leading to frustration as no one with the keys is willing to pull the trigger or provide feedback on what needs to be done to move forward. |
|
I'm sorry for the delay, it's a big change and apparently none of us are that comfortable with that part of the codebase to be able to accept this with confidence. I think we left the conversation around adding more tests. Is this something you are able to do? @kittens did you have suggestions as to what additional tests you'd like to be added? |
|
Extremely sorry for the delay @kpdecker. We're just starting to get new contributors ramped up but there's still large parts of the codebase that only I understand. After reviewing the changes this looks good. I've manually merged as there was a conflict due to some generator print stack work by @amasad. Sorry for not being very responsive. |
|
Thanks, hopefully my post from 3am my time wasn't too whiny. As always glad to help out however I can. If I get some time away from the race to release our v1 I'll see if I can get some broader source-map test coverage outside of this one case. |
Fixes a variety of fine-grained issues with source map generation, both globally and within the commonjs importer (as mentioned here).
Largest changes are: