-
Notifications
You must be signed in to change notification settings - Fork 955
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow switching between internal and OSS DevTools (#3139)
Summary: Pull Request resolved: #3139 This commit adds new UI in the top level toolbar to allow internal FB users to switch between the internal build of devtools and the OSS one. ## Scenarios **Internal (when `client.isFB`)** - DevTools version will default to the internal version, and will render a `Select` component with option to switch to the OSS version. - If a global install of DevTools is present, the selection menu will also offer the option to switch to the global DevTools version. **External (when `!client.isFB`)** Will preserve previous behavior: - Uses the OSS version by default, and doesn't provide option to switch to internal version. - If a global installation is present, will render a `Switch` component that allows switching between OSS and global installation. ### Implementation This commit refactors some parts of the DevTools plugin to provide a bit more clarity in the loading sequence by renaming and modifying some of the messaging, and fixing lint warnings. A change introduced here is that when switching or loading devtools, when we attempt to reload the device via Metro, don't immediately show a "Retry" button, since at that point nothing has gone wrong, and the Retry button will only occur if the Metro reload doesn't occur after a few seconds. In a future commit, this [PR in Devtools](facebook/react#22848) will allow us to clear any loading messages once DevTools has successfully connected. Reviewed By: lunaruan, mweststrate Differential Revision: D32773200 fbshipit-source-id: aa15ffecba7b2b2ea74e109e9f16334d47bf5868
- Loading branch information
1 parent
618670d
commit f9547e0
Showing
2 changed files
with
204 additions
and
67 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
desktop/plugins/public/reactdevtools/fb-stubs/getInternalDevToolsModule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
|
||
export function getInternalDevToolsModule<TModule>(): TModule { | ||
throw new Error( | ||
"Can't require internal version of React DevTools from public version of Flipper.", | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters