mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-25 14:47:21 +08:00
packager: get rid of type any in ResolutionRequest
Summary: One of my changeset broke the "ModuleGraph" code without warning earlier because we are using `any`, that equivalent to having no typing at all. This changeset fixes the types so that `ResolutionRequest` is exactly what it actually is: a class usable for any `Module`-looking class, including the normal one, and the "ModuleGraph" one used for Buck builds. That way, the ModuleGraph's `Module` is typechecked against `Moduleish`. Concretely this change mostly migrates the `Module` to its generic parameter counterpart `TModule` inside `ResolutionRequest`. Reviewed By: kentaromiura Differential Revision: D4826256 fbshipit-source-id: fcd7ca08ac6c35e4e9ca983e2aab260e352bcb4e
This commit is contained in:
committed by
Facebook Github Bot
parent
03892d1036
commit
8755338728
@@ -226,7 +226,8 @@ class Module {
|
||||
if (hasteImpl !== undefined) {
|
||||
const {enforceHasteNameMatches} = hasteImpl;
|
||||
if (enforceHasteNameMatches) {
|
||||
/* $FlowFixMe: this rely on the above if being executed, that is fragile. Rework the algo. */
|
||||
/* $FlowFixMe: this rely on the above if being executed, that is fragile.
|
||||
* Rework the algo. */
|
||||
enforceHasteNameMatches(this.path, this._hasteNameCache.hasteName);
|
||||
}
|
||||
this._hasteNameCache = {hasteName: hasteImpl.getHasteName(this.path)};
|
||||
|
||||
Reference in New Issue
Block a user