You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disallow Haste modules with separators, and require Haste packages to have standard valid package names
Summary:
Currently, with `allowHaste`, an input `moduleName` of `foo/bar/baz` will call `resolveHasteModule` with `foo/bar/baz` and `resolveHastePackage` with each of `foo/bar/baz`, `foo/bar` and `foo` until a match is found.
This is quite inefficient at the top of the resolver algorithm, especially for deeply nested paths. We can tidy up a bit here by narrowing the definition of a Haste module name and a Haste package name.
- A Haste module name must not contain path separators
- A Haste package name must be a valid (npm) package name, i.e. `'simple'` or `'scoped/package'`.
```
- **[Breaking]**: Disallow Haste modules with separators and Haste packages with invalid package names.
```
Reviewed By: huntie
Differential Revision: D64323177
fbshipit-source-id: 0f3e0342beb13499fc91f086b26aff339f96e877
"While resolving module \`some-package/subdir/does-not-exist\`, the Haste package \`some-package\` was found. However the module \`subdir/does-not-exist\` could not be found within the package. Indeed, none of these files exist:
392
+
"While resolving module \`some-package/subdir/does-not-exist\`, the Haste package \`some-package\` was found. However the subpath \`./subdir/does-not-exist\` could not be found within the package. Indeed, none of these files exist:
0 commit comments