Page MenuHomePhabricator

[Flow202][lib][skip-ci] [6/23] Fix Flow issues with computed properties
ClosedPublic

Authored by ashoat on Nov 4 2023, 11:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 12, 2:18 PM
Unknown Object (File)
Tue, May 7, 10:20 AM
Unknown Object (File)
Wed, May 1, 10:30 PM
Unknown Object (File)
Tue, Apr 16, 6:01 PM
Unknown Object (File)
Tue, Apr 16, 5:59 PM
Unknown Object (File)
Mon, Apr 15, 8:49 PM
Unknown Object (File)
Mon, Apr 15, 8:48 PM
Unknown Object (File)
Apr 13 2024, 8:26 AM
Subscribers

Details

Summary

The new version of Flow is showing a bunch of errors that look like this:

Error ---------------------------------------------------------------------------------- reducers/entry-reducer.js:293:8

Cannot use localID [1] as a computed property. Computed properties may only be primitive literal values, but localID [1]
is a union. Can you add a literal type annotation to localID [1]? See https://flow.org/en/docs/types/literals/ for more
information on literal types. [invalid-computed-prop]

     290|     invariant(localID, 'localID should be set in CREATE_LOCAL_ENTRY');
     291|     const newEntryInfos = {
     292|       ...entryInfos,
 [1] 293|       [localID]: entryInfo,
     294|     };
     295|     const dayString = dateString(
     296|       entryInfo.year,

This diff adds the required annotations.

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 D9697

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 4 2023, 12:14 PM
Harbormaster failed remote builds in B23740: Diff 32702!
This revision is now accepted and ready to land.Nov 5 2023, 10:47 AM
ashoat retitled this revision from [Flow202][lib] [6/23] Fix Flow issues with computed properties to [Flow202][lib][skip-ci] [6/23] Fix Flow issues with computed properties.Nov 19 2023, 11:46 AM
This revision was landed with ongoing or failed builds.Nov 27 2023, 3:25 PM
This revision was automatically updated to reflect the committed changes.