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

Perf Monitor - persist visibility over reload #24024

Closed
usrbowe opened this issue Mar 19, 2019 · 2 comments
Closed

Perf Monitor - persist visibility over reload #24024

usrbowe opened this issue Mar 19, 2019 · 2 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@usrbowe
Copy link
Contributor

usrbowe commented Mar 19, 2019

🐛 Bug Report

When I toggle Perf Monitor ON, it will not be visible after I reload/refresh the JS bundle (CMD+R), but option in Dev Menu will persist the state correctly.

To Reproduce

  1. Open iOS Simulator
  2. Press CMD+D
  3. Select Show Perf Monitor
  4. Reload CMD+R

Expected Behavior

Perf Monitor should be visible after reloading. The Dev Menu is correctly showing Hide Perf Monitor.

Quick Fix

Persist the Perf Monitor:

  1. Open RCTPerfMonitor.m find devMenuItem and put this line
 if (devSettings.isPerfMonitorShown) [weakSelf show];

after:

__weak __typeof__(self) weakSelf = self;
__weak RCTDevSettings *devSettings = self.bridge.devSettings;
 // PUT NEW CODE HERE

Since I'm no expert on Objective-C, I didn't want to create PR with this. But if this approach is good, I can create one.

Environment

React Native Environment Info:
    System:
      OS: macOS 10.14.3
      CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
      Memory: 738.29 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.15.0 - ~/.nvm/versions/node/v10.15.0/bin/node
      Yarn: 1.10.1 - ~/.yarn/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v10.15.0/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    IDEs:
      Android Studio: 3.1 AI-173.4819257
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.1 => 16.6.1
      react-native: 0.57.7 => 0.57.7
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.59 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.

@elicwhite
Copy link
Member

It would be great if you could create a PR with this solution, discussion on the change can happen there. Thanks for investigating this!

facebook-github-bot pushed a commit that referenced this issue Mar 21, 2019
Summary:
Fix for this issue I rasied: #24024
When I toggle `Show Perf Monitor` and reload JS `CMD+R` the Perf Monitor will be hidden, but settings in dev menu will persist. So to fix this state and need to `Hide Perf Monitor` and `Show Perf Monitor` again to see it.

[iOS] [Fixed] - Show Perf Monitor, after reloading JS
Pull Request resolved: #24073

Differential Revision: D14560025

Pulled By: cpojer

fbshipit-source-id: cd5602bd6ee041b8b3e61d163d10bd8bc47237b9
kelset pushed a commit that referenced this issue Mar 29, 2019
Summary:
Fix for this issue I rasied: #24024
When I toggle `Show Perf Monitor` and reload JS `CMD+R` the Perf Monitor will be hidden, but settings in dev menu will persist. So to fix this state and need to `Hide Perf Monitor` and `Show Perf Monitor` again to see it.

[iOS] [Fixed] - Show Perf Monitor, after reloading JS
Pull Request resolved: #24073

Differential Revision: D14560025

Pulled By: cpojer

fbshipit-source-id: cd5602bd6ee041b8b3e61d163d10bd8bc47237b9
@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants