There were three issues here:
- Hazel libdef was using Request/Response built-in types, which are incompatible with express$Request/express$Response. Changed it to use the latter.
- Flow was having trouble choosing between the variants of express$Middleware, so I explicitly typed the params of the middleware function.
- 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