-
Notifications
You must be signed in to change notification settings - Fork 316
[ xdebug ] Add --experimental-devtools
option in Playground CLI
#2411
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
[ xdebug ] Add --experimental-devtools
option in Playground CLI
#2411
Conversation
@adamziel I'm not sure if the result I got is what you expected. I assume we should find a way to avoid going through the |
@mho22 good question! Let's think about the user journey – they likely want to debug a plugin. That may involve making multiple requests but they're likely only interested in one of them. In an IDE, you'd see all your code you'd put a breakpoint in one of the files directly. In here, we don't have that code preview upfront. One helpful workflows would be to break on the first line of a non-internal executed PHP file. Technically, that's tricky. We need to run the If there's no way around that, we could add a comment at the top of the cc @brandonpayton and @zaerl for thoughts. Also CC @sejas @wojtekn since that's relevant for Studio as well. |
@adamziel does the above mean we use |
This is about a browser webtools integration. You need to start the devtools before you can set the breakpoint. |
@adamziel I think I found a way for (Sorry about the disabled breakpoints — I can't remove them anymore. I added a checkbox for that bug in the follow-up.) Anyway, I was thinking of separating this pull request from my current findings. Granting access to this PR would let more people experiment with the "experimental devtools", right? |
Yay 🎉! Sounds good - LMK when we're good to review and merge |
@adamziel I think we're good now! Let's review and merge, possibly! |
#2422) ## Motivation for the change, related issues Resolves the [problem introduced](https://github.com/WordPress/wordpress-playground/pull/2411/files#r2229819528) in #2411: > The promise returned by `getPHPFile()` is never resolved and the PHP source code never loads in devtools
Motivation for the change, related issues
This pull request adds a
--experimental-devtools
option inwp-playground/cli
.Roadmap
Related issues and pull requests
--experimental-devtools
option in php-wasm CLI #2408--xdebug
option in php-wasm CLI and wp-playground CLI #2346Implementation details
experimentalDevtools
argument that starts thexdebug-to-cdp-bridge
process.StartBridgeConfig
getPHPFile
property type from(path: string) => string
to(path: string) => Promise<string>
and adapt the related code.Testing Instructions
In WordPress-Playground repository
cli.ts
:In a non-related Playground project
cli.ts
:Note: It will need 23 step overs before leaving the
auto_prepend_file.php
and entering thexdebug.php
script.