Skip to content

Commit

Permalink
restore core lib Flow definitions for Request, Response, etc.
Browse files Browse the repository at this point in the history
Summary:
The main change of this diff is in file react-native-github/interface.js.
This file used to override the definitions for `fetch`, `Headers`, `Request`,
`Response`, `requestAnimationFrame` of flow/lib/bom.js and type them
as `any` instead.

This is inconsistent with the rest of the flow library definitions that expect
`Request`, for example, to be adequately typed. Overriding this defnition
with `any` raises `[value-as-type]` errors in the library definitions themselves.

Due to a Flow bug, these errors were silently suppressed, leading to loss of
coverage. I'm trying to clean-up these errors and fix the Flow bug so that
library errors are always surfaced.

This diff also:
* Removes 53 unused suppression comments
* Adds 110 new error suppressions

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D25806504

fbshipit-source-id: e312bc5d64818b63c3b8b4f86dea51e13aacfac0
  • Loading branch information
panagosg7 authored and facebook-github-bot committed Jan 7, 2021
1 parent d3a3ce8 commit 6651b7c
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,3 @@ declare var __DEV__: boolean;
declare var __REACT_DEVTOOLS_GLOBAL_HOOK__: any; /*?{
inject: ?((stuff: Object) => void)
};*/

declare var fetch: any;
declare var Headers: any;
declare var Request: any;
declare var Response: any;
declare module requestAnimationFrame {
declare module.exports: (callback: any) => any;
}

1 comment on commit 6651b7c

@chrisbobbe
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'm glad to have this change! I'll close issue #29866 and PR #29926, then.

Please sign in to comment.