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
Requeue parent path after processing optionals #12389
Conversation
existentialism
commented
Nov 23, 2020
•
edited by gitpod-io
bot
edited by gitpod-io
bot
Q | A |
---|---|
Fixed Issues? | Fixes #12386 |
Patch: Bug Fix? | Y |
License | MIT |
} | ||
|
||
if (needsRequeue) { | ||
parentPath.requeue(); |
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.
Not a blocker, but we should figure out why the test passes without requeuing parent path on @babel/traverse
7.12.3.
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.
For sure, in the middle of digging actually
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 looks like: #12302, still digging
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 26c522e:
|
} | ||
|
||
if (needsRequeue) { | ||
parentPath.requeue(); |
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.
I think we should requeue replacementPath
and not parentPath
, since they are not always the same thing.
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.
That was my first thought too, but there's some non obvious thing going on, still digging further.
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.
Oh ok. Do you think that it's better to merge this PR since "it works", and then revisit for another release? Or should we wait?
556d7c0
to
26c522e
Compare
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/33121/ |
Please wait for merging this PR, I might have a fix that handles this at the |
Hey @nicolo-ribaudo and @existentialism ... the fix at NodePath level might fix the issues that were raised but doesn't still fully fix another issue I'm having which this PR fixes ...
If you put this piece of code on REPL of this build it's fine but if you put the exact same code on latest version REPL it still has some optional chaining that was not correctly transpiled.. Thoughts? |
Sorry, I didn't open my PR yet 😅 I think that the problem I found while investigating and #12391 are two different bugs that can both cause this incorrect output (from my experiments, fixing one of them is enough to fix the optional chaining thing). It seems like #12391 fixes your example: https://babeljs.io/repl/build/33151/#?browsers=chrome%2070&build=&builtIns=usage&spec=false&loose=false&code_lz=MYewdgzgLgBAZgSzAEwIJSgJwQIwK5QCmMAvDABQSEA2hwRyACpiMnvQDQwLKFhQJEhTFwBuAQ2p5CASWQBKUgD4AUDHUwqteoSYs29APwA6SdQAyhUTQjNW7KOiy4ChCCcQpy4jNnxFlGABvNQ0wzEIoPEwwGB9nf0ITHj4BIUxSEjIU_kEEYRgAMkK43xciYwkpNxMAbQAGAF1k3lz0zLIq6TkAblD1AF95HqA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=false&timeTravel=false&sourceType=module&lineWrap=false&presets=env&prettier=false&targets=&version=7.12.7%2Bpr.12391&externalPlugins= |
Ahhh, misunderstood the nodePath fix then.. I saw in the latest changelog that a bug related with nodePath was fixed and thought that was the one... Sorry, my bad! 😅 |
Fixed in |