HomePhabricator
Diffusion Comm ace12667d607

[Flow202][electron-update-server][skip-ci] [3/3] Fix Flow issues in electron…

Description

[Flow202][electron-update-server][skip-ci] [3/3] Fix Flow issues in electron-update-server

Summary:
There were three issues here:

  1. Hazel libdef was using Request/Response built-in types, which are incompatible with express$Request/express$Response. Changed it to use the latter.
  2. Flow was having trouble choosing between the variants of express$Middleware, so I explicitly typed the params of the middleware function.
  3. Flow wanted explicit type params for the express() invocation. Instead of providing them, I specified default type params in the libdef.
NOTE: CI will fail on this diff. I considered the possibility of fixing Flow errors BEFORE upgrading Flow, but it wasn't possible... in some cases, the fixes to support the new version o f Flow caused errors in the old version. I could have hidden these type errors with $FlowFixMe lines and then later revert those, but that seemed like too much busy work.

Depends on D9717

Test Plan: Make sure all Flow errors in electron-node-server are resolved

Reviewers: michal, jon

Reviewed By: michal

Subscribers: tomek, wyilio

Differential Revision: https://phab.comm.dev/D9718