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

Add Debug Id reference to Hermes Bundle from the Source Map #1667

Merged
merged 23 commits into from
Sep 13, 2023

Conversation

krystofwoldrich
Copy link
Member

@krystofwoldrich krystofwoldrich commented Jul 5, 2023

This PR adds support for RN Hermes bundles with debug IDs. As we can't read Hermes byte code we need to fill the debug id from the referenced source map to the headers of the Hermes bundle.

This PR also updates Xcode Call functionality to be able to intercept hermesc and compose-source-maps.js calls by RN tooling. This is needed for recording the path of the Hermes Bundle and final Composed Hermes source maps.

Xcode Call has now also ability to copy debug if from the packager source map to the composed Hermes source map. This way the debug ids will work with both JSC and Hermes builds without directly changing the Hermes bundle. Metro packager plugin will inject the debug id into the plain JS the same we do it on the web.

Note: In the future, we might be able to inject debug id directly into the Hermes bundle but for now, these changes are needed.

@github-actions
Copy link

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@krystofwoldrich krystofwoldrich marked this pull request as ready for review September 12, 2023 20:26
Copy link
Contributor

@loewenheim loewenheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! I have some notes, though, most of them stylistic.

src/commands/react_native/gradle.rs Outdated Show resolved Hide resolved
src/commands/react_native/gradle.rs Outdated Show resolved Hide resolved
src/commands/react_native/gradle.rs Outdated Show resolved Hide resolved
src/commands/react_native/gradle.rs Outdated Show resolved Hide resolved
src/commands/react_native/xcode.rs Outdated Show resolved Hide resolved
src/utils/sourcemaps.rs Show resolved Hide resolved
src/utils/sourcemaps.rs Outdated Show resolved Hide resolved
src/utils/sourcemaps.rs Outdated Show resolved Hide resolved
src/utils/sourcemaps.rs Outdated Show resolved Hide resolved
src/utils/sourcemaps.rs Outdated Show resolved Hide resolved
@krystofwoldrich
Copy link
Member Author

@loewenheim Thank you for all the comments, I updated everything besides the fuse, I assume it's unnecessary overhead? I just used it as it was in the other if-else branch.

@loewenheim
Copy link
Contributor

@loewenheim Thank you for all the comments, I updated everything besides the fuse, I assume it's unnecessary overhead? I just used it as it was in the other if-else branch.

I don't even think it's overhead at runtime, it should literally do nothing.

@krystofwoldrich krystofwoldrich merged commit 570c1ad into master Sep 13, 2023
16 checks passed
@krystofwoldrich krystofwoldrich deleted the kw-add-debug-id-react-native branch September 13, 2023 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Hermes bytecode bundle and source maps are not automatically uploaded on iOS
3 participants