-
Notifications
You must be signed in to change notification settings - Fork 634
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ResolutionContext.fileSystemLookup stable and required
Summary: Promote `ResolutionContext.fileSystemLookup` to stable and (for providers of `ResolutionContext`) make it mandatory. `fileSystemLookup` has two main advantages over `doesFileExist`: - It allows nonempty directory existence checks, which is important for resolver performance. - It exposes `realPath`. Metro has no other API for using the in-memory file system to resolve a path to a real path. The latter is critical for correct implementation of custom resolvers (non-real paths can mean duplication in the module graph, and broken Fast Refresh, whereas use of `fs` obscures traversed symlinks, which interferes with incremental resolution). From now on, we will require custom resolvers to return absolute, *real*, paths, and suggest that they use this method to do it. `ResolutionContext.doesFileExist` is consequently deprecated as redundant and potentially misleading for implementers.. Changelog: ``` - **[Breaking]**: [Custom resolvers](https://metrobundler.dev/docs/configuration#resolverequest) must now return absolute, real paths for any successful resolution. - **[Feature]**: Expose [`ResolutionContext.fileSystemLookup`](https://metrobundler.dev/docs/resolution#resolution-context) for performing file and directory existence checks and resolving real paths. ``` Reviewed By: huntie Differential Revision: D62374241 fbshipit-source-id: 7760bd4278736e6db27f994a7598784b6578ab9c
- Loading branch information
1 parent
fd7c3b1
commit 3b3e0aa
Showing
9 changed files
with
78 additions
and
62 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
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
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