microsoft / microsoft/react-native-windows
Developer settings aren't restored on app startup
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 17.3k
- Forks
- 1.2k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 33
Description
Developer settings are not restored on app startup like on other platforms. This can be annoying for developers since they have to setup their work flow on every startup, e.g. disabling remote debugging or enabling direct debugging.
Environment
npx react-native --version: 4.10.1npx react-native run-windows --info:System: OS: Windows 10 10.0.18362 CPU: (4) x64 Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz Memory: 6.09 GB / 15.45 GB Binaries: Node: 12.18.3 - ~\scoop\apps\nodejs-lts\current\node.EXE Yarn: 1.22.4 - ~\scoop\apps\yarn\current\Yarn\bin\yarn.CMD npm: 6.14.6 - ~\source\repos\react-native-test-app\node_modules\.bin\npm.CMD npmPackages: @react-native-community/cli: ^4.5.1 => 4.10.1 react: 16.11.0 => 16.11.0 react-native: 0.62.2 => 0.62.2 react-native-windows: 0.62.2 => 0.62.2 Installed UWP SDKs: 10.0.18362.0reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock AllowDevelopmentWithoutDevLicense REG_DWORD 0x1 AllowAllTrustedApps REG_DWORD 0x1
- Target Platform Version(s): 10.0.18362
- Target Device(s): Desktop
- Visual Studio Version: Community 2019
- Build Configuration: Debug
Steps To Reproduce
- Press
Ctrl+Shift+Dand enable direct debugging - Restart the app
Observe that remote debugging has been re-enabled.
Expected Results
Developer settings should be restored on app restart.
Snack, code example, screenshot, or link to a repository:
https://github.com/microsoft/react-native-test-app/tree/tido/rn-62
- Apply the patch below
- Run
yarnin/example - Run
yarn start:windowsin/example - Open another terminal and run
yarnin project root - Open
/windows/ReactTestApp.sln
diff --git a/windows/ReactTestApp/ReactInstance.cpp b/windows/ReactTestApp/ReactInstance.cpp
index 0910672..c5bf878 100644
--- a/windows/ReactTestApp/ReactInstance.cpp
+++ b/windows/ReactTestApp/ReactInstance.cpp
@@ -15,9 +15,9 @@ namespace ReactTestApp
void ReactInstance::LoadJSBundleFrom(JSBundleSource source)
{
auto instanceSettings = reactNativeHost_.InstanceSettings();
- instanceSettings.UseLiveReload(source == JSBundleSource::DevServer);
- instanceSettings.UseWebDebugger(source == JSBundleSource::DevServer);
- instanceSettings.UseFastRefresh(source == JSBundleSource::DevServer);
+ //instanceSettings.UseLiveReload(source == JSBundleSource::DevServer);
+ //instanceSettings.UseWebDebugger(source == JSBundleSource::DevServer);
+ //instanceSettings.UseFastRefresh(source == JSBundleSource::DevServer);
switch (source) {
case JSBundleSource::DevServer:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with windows/ReactTestApp/ReactInstance.cpp and the LoadJSBundleFrom method, then follow the issue's Windows reproduction steps from /example. Compare startup behavior with the developer settings changed through Ctrl+Shift+D; done means those settings, including direct or remote debugging choices, remain restored after restarting the app.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, react-native
- Domain
- desktop, developer-experience
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100