-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimise/simplify getPlatformExtension
Summary: `getPlatformExtension` extracts the `"ios"` from `"path/MyComponent.ios.js"`, if `"ios"` is a known platform. In the context of this function, this is only relevant to Haste. Currently, the effective set of platforms is the union of those passed from Metro (from `config.resolver.platforms`) and a hardcoded set. Entries in the hardcoded set but not in `config.resolver.platforms` are mostly superfluous because Metro will never resolve to them (although they would *prevent* `MyComponent.extraplatform` from being added to the Haste map with a generic platform). The notable exception is `native`, which in Metro is a special platform alias used in the absence of a specific platform match. Here, we remove the hardcoded set, and pass `native` from Metro when creating MetroFileMap. Changelog: Internal Reviewed By: motiz88 Differential Revision: D47050529 fbshipit-source-id: e9b5495e87133033a1f5270e36809c99eb75bbf9
- Loading branch information
1 parent
668ee8d
commit a6e3dd0
Showing
5 changed files
with
16 additions
and
21 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