facebook / metro

🚇 The JavaScript bundler for React Native
https://metrobundler.dev
MIT License
5.25k stars 626 forks source link

TreeFS: Return traversed symlinks and first missing segments in lookup results #1217

Closed robhogan closed 9 months ago

robhogan commented 9 months ago

Summary: A module resolution should be invalidated whenever the (non-)existence of a path checked during resolution may have changed. To implement this, we'll need more information from the FileSystem APIs.

Existence

A positive existence check is straightforwardly invalidated when either:

Non-existence

For non-existence, note that it is not sufficient to simply watch for file events whose path matches the path originally looked up, because file events are emitted for real paths, and the checked path may resolve through one or more symlinks.

We will require:

This diff

This adds links, the set of traversed links by their canonical paths, and missing (for non-existence) - the first non-navigable path segment by its canonical path.

Changelog: Internal

Reviewed By: huntie

Differential Revision: D52391404

facebook-github-bot commented 9 months ago

This pull request was exported from Phabricator. Differential Revision: D52391404

facebook-github-bot commented 9 months ago

This pull request has been merged in facebook/metro@451e2a1f174981cf7150fa0d7c70a6992b9150bb.