-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Switch from `graceful-fs` synchronous IO in `metro-file-map`'s `DiskCacheManager` to native promise IO. [`graceful-fs`](https://github.com/isaacs/node-graceful-fs/blob/main/graceful-fs.js) [does not patch](https://github.com/isaacs/node-graceful-fs/tree/main?tab=readme-ov-file#sync-methods) `readFileSync`/`writeFileSync`, so we're not deriving any benefit from `graceful-fs` over `fs` in this instance. Using async IO is just good practice especially during startup when Metro is doing various things at once. This sets up lazy writes triggered by events, in the next diff. Modification to `server-torn-down-test` required because `fs.promises` open differently-labelled handles, but these are unreffed and don't block shutdown. Changelog: Internal Reviewed By: vzaidman Differential Revision: D68722144 fbshipit-source-id: 6e070b76a650f43238719e95bdb2d13600deb3d8
- Loading branch information
1 parent
71b8a54
commit b4d5251
Showing
3 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
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
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
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