Remove fs.write from plugins

Summary:
1. Remove "fs.writeFile" from plugins
2. Remove "showSaveDialog" from "FlipperLib"
3. Add "exportFile" to "FlipperLib" and "RenderHost"

As we are going to use Flipper in a browser as well, instead of providing low-level abstraction like "showSaveDialog", we should provide more high-level ones like "exportFile". In browsers it does not make too much sense to expose "showSaveDialog" as there is not way to use the returned file path to write to it.
In the end, "exportFile" is going to trigger a file download for browsers and show the save dialog and write to the returned file path for Electron.

Reviewed By: mweststrate

Differential Revision: D32492149

fbshipit-source-id: 0673119bdb7670a5872f5982c7d82dfc44eb7906
This commit is contained in:
Andrey Goncharov
2021-11-18 09:13:48 -08:00
committed by Facebook GitHub Bot
parent 1b54a079f5
commit 2c7bc0a952
7 changed files with 36 additions and 28 deletions

View File

@@ -60,9 +60,8 @@ export function initializeFlipperLibImplementation(
);
},
DetailsSidebarImplementation: DetailSidebarImpl,
showSaveDialog: renderHost.showSaveDialog,
exportFile: renderHost.exportFile,
showOpenDialog: renderHost.showOpenDialog,
showSelectDirectoryDialog: renderHost.showSelectDirectoryDialog,
paths: {
appPath: renderHost.paths.appPath,
homePath: renderHost.paths.homePath,