Skip to content
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

[DevTools] Support hook names for inline and standalone targets #21983

Closed
bvaughn opened this issue Jul 28, 2021 · 7 comments
Closed

[DevTools] Support hook names for inline and standalone targets #21983

bvaughn opened this issue Jul 28, 2021 · 7 comments
Labels
Component: Developer Tools Resolution: Stale Automatically closed due to inactivity

Comments

@bvaughn
Copy link
Contributor

bvaughn commented Jul 28, 2021

Named hooks is currently only enabled for DevTools browser extensions. This is because the source map parsing library ('source-map') requires a WASM bundle to be supplied at runtime, and DevTools currently loads that using a browser API (chrome.extension.getURL):

// $FlowFixMe
const wasmMappingsURL = chrome.extension.getURL('mappings.wasm');

Maybe we could refactor this so that non-browser targets copied the WASM from node_modules and bundled it along with the DevTools package? It would be nice to support this functionality for e.g. React Native (which uses react-devtools-core) and Code Sandbox (which uses react-devtools-inline).

@bvaughn bvaughn changed the title Named Hooks: Support functionality for inline and standalone targets [DevTools] Support hook names for inline and standalone targets Jul 28, 2021
@fbartho
Copy link

fbartho commented Jul 28, 2021

I find myself surprised that WASM is at all involved with RN, but that probably just means I don't know how RN works at a deep enough level.

Despite this, I'm super interested in this feature for RN.

@bvaughn
Copy link
Contributor Author

bvaughn commented Jul 29, 2021

WASM isn't involved with RN. WASM is used by the 'source-map' module, which DevTools runs internally to parse source maps.

If you'd like to work on this feature, please do! :)

@kkragoth
Copy link

Trying to read about this and starting with: https://github.com/mozilla/source-map#sourcemapconsumerinitializeoptions

points to second option of using ArrayBuffer with contents of 'mappings.wasm'. Not experienced enough but maybe it could be unified that way for both targets. Or if that's not the case I assume this would work something like:

if web then
use url
else it needs file access
readFileAsArrayBuffer('mappings.wasm').

I wonder if build system could figure out to work like this
import mappingsWasmArrayBuffer from 'source-maps/lib/mappings.wasm'

@vibhorgupta-gh
Copy link
Contributor

Hi @bvaughn
Has this been addressed in #22126 ? Seems like the runtime dependency on the WASM bundle isn't required anymore with source-map-js. If that is so, can RN and Code Sandbox utilise this functionality yet?

@bvaughn
Copy link
Contributor Author

bvaughn commented Aug 24, 2021

There are plans to add support for inline and standalone packages soon.

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 9, 2022
Copy link

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Developer Tools Resolution: Stale Automatically closed due to inactivity
Projects
None yet
Development

No branches or pull requests

4 participants