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

Pre-publish changes before making a PR to RN CLI #7

Merged
merged 10 commits into from
Aug 13, 2020

Conversation

jessieAnhNguyen
Copy link
Member

@jessieAnhNguyen jessieAnhNguyen commented Aug 13, 2020

Summary:


Implemented a new command to download Hermes Sampling Profiler to a local machine

1. Purpose:

  • This new command helps users convert a Hermes tracing profile to Chrome tracing profile and pull it to the local machine
  • Instructions on how to use Hermes: Using Hermes
  • The hermes-profile-transformer tool that converts Hermes tracing profile to Chrome tracing profile Hermes-profile-transformer package

2. Usage:

react-native profile-hermes [destinationDir] <flag>
  • destinationDir is optional, if provided, pull the file to that directory

    default: pull to the current React Native app root directory

Options

  • --fileName [string]

File name of the profile to be downloaded, eg. sampling-profiler-trace8593107139682635366.cpuprofile.

default: pull the latest file

  • --verbose

Lists commands and steps that are run internally to pull the file from Android device

  • --raw

Pulls the original Hermes tracing profile without any transformation

  • --sourcemap-path [string]

The local path to your source map file if you generated it manually, ex. /tmp/sourcemap.json

  • --generate-sourcemap

Generate the JS bundle and source map in os.tmpdir()

Notes on source map

This step is recommended in order for the source map to be generated:

If you are planning on building a debug APK, that will run without the packager, by invoking ./gradlew assembleDebug you can simply set bundleInDebug: true in your app/build.gradle file, inside the project.ext.react map.

Test Plan:


  • yarn
  • yarn lint
  • Test on a React Native app: use yarn link as instructed by the CLI's Testing Plan.
  • Command react-native profile-hermes as per instruction above

Example output of running the command

image

image

@jessieAnhNguyen jessieAnhNguyen self-assigned this Aug 13, 2020
@jessieAnhNguyen jessieAnhNguyen merged commit e086ec9 into master Aug 13, 2020
@jessieAnhNguyen jessieAnhNguyen deleted the chore/pre-publish branch August 13, 2020 12:22
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.

2 participants