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

[0.72] Allow RCTBundleURLProvider to request an inline source map #39033

Merged
merged 1 commit into from
Sep 4, 2023

Commits on Aug 16, 2023

  1. Allow RCTBundleURLProvider to request an inline source map (facebook#…

    …37878)
    
    Summary:
    See: http://blog.nparashuram.com/2019/10/debugging-react-native-ios-apps-with.html
    When using direct debugging with JavaScriptCore, Safari Web Inspector doesn't pick up the source map over the network. Instead, as far as I can tell, it expects you to pass the source URL at the time you load your bundle:  https://developer.apple.com/documentation/javascriptcore/jscontext/1451384-evaluatescript?language=objc . This leads to a very sub-par developer experience debugging the JSbundle directly. It will however, pick up an inline source map. Therefore, let's add a way to have React Native tell metro to request an inline source map.
    
    I did this by modifying `RCTBundleURLProvider` to have a new query parameter for `inlineSourceMap`, and set to true by default for JSC.
    
    [IOS] [ADDED] - Added support to inline the source map via RCTBundleURLProvider
    
    Pull Request resolved: facebook#37878
    
    Test Plan:
    I can put a breakpoint in RNTester, via Safari Web Inspector, in human readable code :D
    
    <img width="1728" alt="Screenshot 2023-06-14 at 4 09 03 AM" src="https://github.com/facebook/react-native/assets/6722175/055277fa-d887-4566-9dc6-3ea07a1a60b0">
    
    Reviewed By: motiz88
    
    Differential Revision: D46855418
    
    Pulled By: huntie
    
    fbshipit-source-id: 2134cdbcd0a3e81052d26ed75f83601ae4ddecfe
    Saadnajmi committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    dc8a103 View commit details
    Browse the repository at this point in the history