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
F3529612: D9786.diff
Tue, Dec 24, 8:22 PM
Unknown Object (File)
Tue, Dec 17, 1:10 AM
Unknown Object (File)
Sat, Dec 14, 8:21 PM
Unknown Object (File)
Mon, Dec 2, 2:15 PM
Unknown Object (File)
Nov 23 2024, 10:24 AM
Unknown Object (File)
Nov 8 2024, 4:04 AM
Unknown Object (File)
Oct 27 2024, 9:02 PM
Unknown Object (File)
Oct 19 2024, 2:39 AM
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.