Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue with breakpoints in RN 76 apps.
There were two core issues related to the breakpoints:
As the reason for (1) was simply that we didn't add the implementation for watch folders, the reason for the bug related to (2) is more evolved: the culprit was in
updateBreakpointsInSource
method, were we'd usemapping.source
directly from the source-map consumer to locate existing breakpoints. Because the stored breakpoints would always use local filesystem URLs, with the source using aliased name, we'd never locate the breakpoint that we should update. As a consequence, the breakpoints that were set for the files which then got hot reloaded, would never be set to stop at those newly loaded scripts.To solve (2), we are now transforming source from the source map consumer into the absolute file path before we perform breakpoint lookup.
In order to fix (1), we are adding a more sophisticated mapping mechanims:
absoluteProjectPath
andprojectPathAlias
we now keep an array of source map aliases pairsHow Has This Been Tested: