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

[PLAT-5950] Store source maps in $TMPDIR during Xcode build phases #1289

Merged
merged 4 commits into from
Feb 17, 2021

Conversation

nickdowell
Copy link
Contributor

@nickdowell nickdowell commented Feb 11, 2021

Goal

Fix building projects whose build directory path contains whitespace.

The underlying issue is that react native's script cannot accept any paths containing spaces in $EXTRA_PACKAGER_ARGS

Design

A new location has been designated for the source map: $TMPDIR/$UID-main.jsbundle.map

This path is guaranteed to not contain any whitespace, which will fix compatibility with react-native-xcode.sh

Use md5 to generate a unique $UID from the build path; unique for that project, build configuration and target.

The script will fall back to the previous location to remain compatible with the old source map location, for Xcode projects that have not been updated.

Testing

Manually tested using sample RN projects.

Tested by following instructions from #1140 against a freshly created react native app.

@github-actions
Copy link

github-actions bot commented Feb 11, 2021

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 40.76 kB 12.57 kB
After 40.76 kB 12.57 kB
± No change No change

code coverage diff

Coverage values did not change👌.

Total:

Lines Branches Functions Statements
0%(+0%) 0%(+0%) 0%(+0%) 0%(+0%)

Generated by 🚫 dangerJS against ae17565

@nickdowell nickdowell force-pushed the nickdowell/fix-rn-xcode-source-map-path branch from 8069d1a to 9c50373 Compare February 11, 2021 13:11
@nickdowell nickdowell force-pushed the nickdowell/fix-rn-xcode-source-map-path branch from 9c50373 to e74ec6f Compare February 11, 2021 13:41
@nickdowell nickdowell marked this pull request as draft February 16, 2021 10:53
@nickdowell nickdowell marked this pull request as ready for review February 16, 2021 11:32
@nickdowell nickdowell changed the title [PLAT-5950] Read source map from TMPDIR in Xcode build phase [PLAT-5950] Store source maps in $TMPDIR during Xcode build phases Feb 16, 2021
Copy link
Contributor

@bengourley bengourley left a comment

Choose a reason for hiding this comment

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

Looks good. I tested with a project set up with the old version of the cli, using the new version of the notifier and it falls back nicely.

Just needs a changelog entry.

@nickdowell nickdowell merged commit b310678 into next Feb 17, 2021
@nickdowell nickdowell deleted the nickdowell/fix-rn-xcode-source-map-path branch February 17, 2021 10:16
xljones pushed a commit that referenced this pull request Jul 27, 2021
xljones pushed a commit that referenced this pull request Jul 27, 2021
(fix)changelog: retroactively add changelog for #1289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants