Page MenuHomePhabricator

[Flow202][web][skip-ci] [20/x] Fix Flow issues in ComposedMessage
ClosedPublic

Authored by ashoat on Nov 8 2023, 11:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 27, 9:02 PM
Unknown Object (File)
Sat, Oct 19, 2:39 AM
Unknown Object (File)
Sat, Oct 19, 2:39 AM
Unknown Object (File)
Sat, Oct 19, 2:38 AM
Unknown Object (File)
Sat, Oct 19, 2:33 AM
Unknown Object (File)
Sat, Oct 12, 2:14 AM
Unknown Object (File)
Sep 11 2024, 6:49 PM
Unknown Object (File)
Sep 11 2024, 6:49 PM
Subscribers

Details

Summary

The new version of Flow is printing this error:

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ chat/composed-message.react.js:60:50

Cannot use variable ComposedMessage [1] because the declaration either comes later or was skipped.
[reference-before-declaration]

     57│   +fixedWidth?: boolean,
     58│   +borderRadius: number,
     59│ };
     60│ type BaseConfig = React.Config<BaseProps, typeof ComposedMessage.defaultProps>;
     61│ type Props = {
     62│   ...BaseProps,
     63│   // withInputState
       :
 [1] 71│ class ComposedMessage extends React.PureComponent<Props> {

To get around it, I extracted the type of defaultProps into its own declaration, and then used that type directly.

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 of 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 D9785

Test Plan

Confirm the Flow errors go away

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Nov 8 2023, 12:13 PM
Harbormaster failed remote builds in B23934: Diff 32972!
This revision is now accepted and ready to land.Nov 9 2023, 3:25 AM
ashoat retitled this revision from [Flow202][web] [20/x] Fix Flow issues in ComposedMessage to [Flow202][web][skip-ci] [20/x] Fix Flow issues in ComposedMessage.Nov 19 2023, 5:04 PM
This revision was landed with ongoing or failed builds.Nov 27 2023, 3:26 PM
This revision was automatically updated to reflect the committed changes.