Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeFS: Symlink-enabled, prefix-tree implementation of FileSystem #926

Closed
wants to merge 1 commit into from

Commits on Feb 14, 2023

  1. TreeFS: Symlink-enabled, prefix-tree implementation of FileSystem (f…

    …acebook#926)
    
    Summary:
    Pull Request resolved: facebook#926
    
    Currently, `HasteFS` is the only implementation of the `FileSystem` interface, used by Metro to check for file existence during resolution, and to retrieve metadata (file hashes, etc) during transformation. `HasteFS` is based on a simple, performant `Map` of  real paths to metadata.
    
    This diff introduces `TreeFS`, which is based on an in-memory prefix tree representation, split on path separators, of all watched files.
    
    By using a prefix tree, we can lookup files whose paths segments are directory symlinks or files which are themselves links to other files.
    
    We use `TreeFS` in preference to `HasteFS` when `config.resolver.unstable_enableSymlinks` (default: `false`) is `true`.
    
    Reviewed By: motiz88
    
    Differential Revision: D42552999
    
    fbshipit-source-id: 2705f34436d549831b51e4773bce39094a6ec507
    robhogan authored and facebook-github-bot committed Feb 14, 2023
    Copy the full SHA
    bd87dbc View commit details
    Browse the repository at this point in the history