metro icon indicating copy to clipboard operation
metro copied to clipboard

fix: handle http scenario for pathToSource in _processDebuggerGetScri…

Open wood1986 opened this issue 2 years ago • 6 comments

fix #832

image

Summary

Test plan

wood1986 avatar Jun 17 '22 08:06 wood1986

@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Jun 17 '22 16:06 facebook-github-bot

Hey @wood1986, thanks for the PR! Unfortunately I don't think this is the right solution - the client should perform this fetch, not the inspector proxy (which is part of the server). This only works based on assumptions on external conditions, e.g. that http://localhost:8081 on the client device happens to be forwarded to port 8081 on the server.

motiz88 avatar Jun 17 '22 16:06 motiz88

I deleted my previous comment because it was wrong.

Hey @motiz88

I have just realized Debugger.getScriptSource is a standard Chrome DevTool protocol.

Flipper < - > Chrome DevTool < - > metro

Chrome DevTool is just an iframe inside Flipper. Flipper initializes Chrome DevTool. After that, Flipper does not have a role. Chrome DevTool will directly deal with Metro via ws and it does not hit metro middleware

How to tell flipper to hit http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.rn0682&modulesOnly=false&runModule=true&cachePrevention=1 directly?

wood1986 avatar Jun 18 '22 19:06 wood1986

Just ping again in case you forget after the weekend

wood1986 avatar Jun 20 '22 20:06 wood1986

Any update??

wood1986 avatar Jun 22 '22 08:06 wood1986

Hey @motiz88, could you please follow up this PR and my latest reply? Thanks

wood1986 avatar Jun 28 '22 08:06 wood1986

This seems to be fixed from v0.73.0.

https://github.com/facebook/metro/commit/db19b06bdd6d2fbbe109e4f3be4b3af3489c1f1c

raon0211 avatar Feb 03 '23 07:02 raon0211