mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-07 09:27:29 +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
@@ -44,6 +44,10 @@ module.exports = class Module {
|
||||
isHaste() {
|
||||
return this.hasteID.then(Boolean);
|
||||
}
|
||||
|
||||
hash() {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
};
|
||||
|
||||
function getName(path) {
|
||||
|
||||
Reference in New Issue
Block a user