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
F3382052: D10086.diff
Thu, Nov 28, 8:07 AM
Unknown Object (File)
Wed, Nov 27, 1:15 PM
Unknown Object (File)
Wed, Oct 30, 9:24 PM
Unknown Object (File)
Wed, Oct 30, 9:24 PM
Unknown Object (File)
Wed, Oct 30, 9:24 PM
Unknown Object (File)
Wed, Oct 30, 9:23 PM
Unknown Object (File)
Wed, Oct 30, 9:23 PM
Unknown Object (File)
Oct 10 2024, 1:45 PM
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