Page MenuHomePhabricator

[lib] Replace Shape<> with $ReadOnly<Partial<>> in MultimediaUploadExtras
ClosedPublic

Authored by ashoat on Nov 28 2023, 8:39 PM.
Tags
None
Referenced Files
F2898518: D10086.id33977.diff
Sat, Oct 5, 3:31 AM
F2898014: D10086.diff
Sat, Oct 5, 1:20 AM
Unknown Object (File)
Tue, Oct 1, 11:30 PM
Unknown Object (File)
Tue, Sep 10, 8:32 AM
Unknown Object (File)
Tue, Sep 10, 8:32 AM
Unknown Object (File)
Tue, Sep 10, 8:32 AM
Unknown Object (File)
Tue, Sep 10, 8:32 AM
Unknown Object (File)
Tue, Sep 10, 8:32 AM
Subscribers

Details

Summary

Alongside my attempts to replace $Shape with Partial in the preceding diffs, I'm also looking to replace our custom type Shape.

Doing this for MultimediaUploadExtras revealed a type error. We can't pass dimensions in as MultimediaUploadExtras in native/avatars/avatar-hooks.js on line 71, because dimensions is read-only but MultimediaUploadExtras is not, implying that the call to callUploadMultimedia might mutate it, which would be a type error.

We resolve this by making MultimediaUploadExtras read-only. Also including updates to MultimediaUploadCallbacks, which I made read-only as well as converting to use Partial. (Though this was not necessitated by any type errors.)

Depends on D10085

Test Plan

Flow

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable