-
Notifications
You must be signed in to change notification settings - Fork 30k
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
repl: unflag --experimental-repl-await #39142
Conversation
I think we should use the debugger repl api instead of unflagging this. |
@devsnek what is that? |
@guybedford it's a mode in v8 that allows redeclaration of |
@devsnek have you considered upstreaming this? |
yeah, I just never find the time to write tests and such. |
Duplicate of #34733? |
@devsnek I definitely agree it would be ideal to land the new repl project, but given we don't know how much longer this will take, it may still be worth landing this to benefit current users. Would you still object to this as a temporary measure? What can be done to improve progress on the new repl work? |
I think a better short term project would be using the repl inspector api in our current repl code, not unflagging this. |
@devsnek I agree it would be better to land the repl inspector api but we must be weary of hampering user workflows today as well unnecessarily. Specifically are there any reasons not to unflag this for users? If so, could you clarify what you see those as being? Then in terms of moving the repl inspector api forward, what can be done to help with this process? Are there specific tracking issues remaining here? |
it just randomly breaks stuff: For the specific use case of a repl, breaking on odd inputs seems especially bad.
If you mean integrating into the existing code, @BridgeAR probably knows the most about that. |
The Do you have that shortlist of issues for upstreaming the new repl project? I think clarifying the roadmap would help get others on board with this process and potentially get you some help on it too. |
@guybedford maybe just rolling it up and adding it as a dependency? someone mentioned the lack of tests made them uneasy. i'm not sure what other requirements collabs might have.
In the context of a repl i think it is. It isn't even immediately clear if this is due to the completion value getting lost or because it somehow didn't throw an exception. A repl you can't trust the output of is kind of useless imo. |
Do you have a link to the previous tests comment? IMO it is far far more important to support the native module system in the REPL than it is to have perfect repl completions. Most JS developers aren't even aware of these completion value details anyway. I'm going to see if I can PR a fix to output the acorn parse error when there are await parsing errors. Let me know if that might work for you here. |
i dunno, i'm sure if i used it more i could find more broken stuff. i'm not sure it is a helpful exercise either way. |
@devsnek it's certainly not an ideal approach, but this is about getting something out. Perfect and good and all. Can you try and let me know if there is anything else you'd specifically want to block this PR on? |
Could we use regenerator transpiler logic or something to handle statements better? Losing the return value kinda sucks. |
I think that is a clear limitation with the current approach entirely. The return values still work out fine for standard last statement semantics - it's the more complex control flows that this only seems to apply to where console.log can still suffice as a workflow for these. Agreed its sub optimal, but I don't think it would be worth blocking this entire feature on that, especially when we have the better improvements here in the works. |
@devsnek I've just landed #39154 to address your first concern here. I won't be able to address the other concern though personally here due to the complexity of creating a custom runtime transform to handle return locations, although I agree with the future directions of upstreaming the debugger API. If you are still against this PR can you make it explicit again on this issue given this PR is to the latest rebases etc. Ping for further reviewers as well. |
Related: #39259. |
@guybedford ^ this is the sort of thing i mean. i won't block this but i think it would be an overall bad direction to unflag this. |
@devsnek agreed that isn't great at all. Ideally these transforms should be comprehensively working for basic execution semantics down to only not supporting eg const or perfect return values if we do want to unflag. But having let vars as globals should be fixed to unflag here... |
Closing as a duplicate of #34733. |
This enables the
--experimental-repl-await
flag automatically.Personally I find the
await import('module')
pattern indispensible here and keep forgetting that the--experimental-repl-await
flag exists. This really makes modules experimentation much much easier, amongst many other things.I would propose we keep the feature itself classed as unstable, but the REPL should in theory be able to accommodate more churn than most outward Node.js APIs anyway.
//cc @nodejs/modules @nodejs/repl @devsnek