-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fix HBC_SOURCEMAP_FILE
in scripts/react-native-xcode.sh
#34111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
Addresses #32497
The assigned HBC_SOURCEMAP_FILE path is incorrect as it does not reference the hermes bundle source map file
See: #32497 (comment)
Base commit: 33dbb6c |
Base commit: b4f6262 |
@dmitryrykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hey @kidroca, could you please rebase this PR on top of |
Rebased |
@dmitryrykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
…#34111) Summary: ## Summary Fixes facebook#32497 Fixes facebook#34212 The assigned HBC_SOURCEMAP_FILE path is incorrect as it does not reference the hermes bundle source map file See: facebook#32497 (comment) ## Changelog [General] [Fixed] - using SOURCEMAP_FILE during xcode build phase with Hermes enabled Pull Request resolved: facebook#34111 Test Plan: 1. In a blank react-native project 1. Enable Hermes 1. Go to xCode -> Project -> Build Phases -> Bundle React Native code and images 3. Add `export SOURCEMAP_FILE="$(pwd)/../ios.jsbundle.map"` before `react-native-xcode.sh` e.g. ```sh export NODE_BINARY=node export SOURCEMAP_FILE="$(pwd)/../ios.jsbundle.map" ../node_modules/react-native/scripts/react-native-xcode.sh ``` 4. Make a release build `npx react-native run-ios --configuration Release` or `CMD + I` in xCode 5. Verify the build is successful 6. Verify the `.map` file is outputted at the specified path (`ios.jsbundle.map` in project root for the example above) Reviewed By: cipolleschi Differential Revision: D38460586 Pulled By: dmitryrykun fbshipit-source-id: 54c1594b37fa2253896ce9739c1a9a712deecd0f
…#34111) Summary: ## Summary Fixes facebook#32497 Fixes facebook#34212 The assigned HBC_SOURCEMAP_FILE path is incorrect as it does not reference the hermes bundle source map file See: facebook#32497 (comment) ## Changelog [General] [Fixed] - using SOURCEMAP_FILE during xcode build phase with Hermes enabled Pull Request resolved: facebook#34111 Test Plan: 1. In a blank react-native project 1. Enable Hermes 1. Go to xCode -> Project -> Build Phases -> Bundle React Native code and images 3. Add `export SOURCEMAP_FILE="$(pwd)/../ios.jsbundle.map"` before `react-native-xcode.sh` e.g. ```sh export NODE_BINARY=node export SOURCEMAP_FILE="$(pwd)/../ios.jsbundle.map" ../node_modules/react-native/scripts/react-native-xcode.sh ``` 4. Make a release build `npx react-native run-ios --configuration Release` or `CMD + I` in xCode 5. Verify the build is successful 6. Verify the `.map` file is outputted at the specified path (`ios.jsbundle.map` in project root for the example above) Reviewed By: cipolleschi Differential Revision: D38460586 Pulled By: dmitryrykun fbshipit-source-id: 54c1594b37fa2253896ce9739c1a9a712deecd0f
Not to hijack a merged issue, but after reading this and wanting to debug some Hermes source maps I can't find a single official source for enabling basic sourcemaps on ios w/ Hermes. Which is possible - I'm just blind, but I've spent a few hours on this.
I ended up trying this via reading this merge.
Prior to "Bundle React Native code and images" step where the exported vars are being set. This seemed to work great, but I'm unsure if 4 sources say 4 different things what is expected. I can assure you with any official help here to point to what is officially recommend - I will turn around and PR the docs for the process. |
@iBotPeaches, yeah, defining SOURCEMAP_FILE envvar is the right way for enabling source maps. |
thanks @dmitryrykun Working on a doc pr now. |
Started a brand new doc for sourcemaps - facebook/react-native-website#3293 - ready for feedback. |
Summary: ## Summary Fixes #32497 Fixes #34212 The assigned HBC_SOURCEMAP_FILE path is incorrect as it does not reference the hermes bundle source map file See: #32497 (comment) ## Changelog [General] [Fixed] - using SOURCEMAP_FILE during xcode build phase with Hermes enabled Pull Request resolved: #34111 Test Plan: 1. In a blank react-native project 1. Enable Hermes 1. Go to xCode -> Project -> Build Phases -> Bundle React Native code and images 3. Add `export SOURCEMAP_FILE="$(pwd)/../ios.jsbundle.map"` before `react-native-xcode.sh` e.g. ```sh export NODE_BINARY=node export SOURCEMAP_FILE="$(pwd)/../ios.jsbundle.map" ../node_modules/react-native/scripts/react-native-xcode.sh ``` 4. Make a release build `npx react-native run-ios --configuration Release` or `CMD + I` in xCode 5. Verify the build is successful 6. Verify the `.map` file is outputted at the specified path (`ios.jsbundle.map` in project root for the example above) Reviewed By: cipolleschi Differential Revision: D38460586 Pulled By: dmitryrykun fbshipit-source-id: 54c1594b37fa2253896ce9739c1a9a712deecd0f
Summary
Fixes #32497
Fixes #34212
The assigned HBC_SOURCEMAP_FILE path is incorrect as it does not reference the hermes bundle source map file
See: #32497 (comment)
Changelog
[General] [Fixed] - using SOURCEMAP_FILE during xcode build phase with Hermes enabled
Test Plan
export SOURCEMAP_FILE="$(pwd)/../ios.jsbundle.map"
beforereact-native-xcode.sh
e.g.
npx react-native run-ios --configuration Release
orCMD + I
in xCode.map
file is outputted at the specified path (ios.jsbundle.map
in project root for the example above)