Page MenuHomePhabricator

[Flow202][web][skip-ci] [12/x] Fix Flow issues with computed properties
ClosedPublic

Authored by ashoat on Nov 8 2023, 11:38 AM.
Tags
None
Referenced Files
F3532267: D9778.id33776.diff
Wed, Dec 25, 8:56 AM
F3531972: D9778.id33622.diff
Wed, Dec 25, 8:38 AM
F3531949: D9778.id32964.diff
Wed, Dec 25, 8:36 AM
F3531591: D9778.id33832.diff
Wed, Dec 25, 7:49 AM
F3531590: D9778.id33776.diff
Wed, Dec 25, 7:49 AM
F3531589: D9778.id33622.diff
Wed, Dec 25, 7:49 AM
F3531585: D9778.id32964.diff
Wed, Dec 25, 7:48 AM
F3531543: D9778.diff
Wed, Dec 25, 7:34 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 D9777

Test Plan

Confirm the Flow errors go away

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Nov 8 2023, 11:57 AM
Harbormaster failed remote builds in B23926: Diff 32964!
This revision is now accepted and ready to land.Nov 9 2023, 11:45 AM
ashoat retitled this revision from [Flow202][web] [12/x] Fix Flow issues with computed properties to [Flow202][web][skip-ci] [12/x] Fix Flow issues with computed properties.Nov 19 2023, 5:03 PM