Skip to content

Conversation

@mozzius
Copy link
Member

@mozzius mozzius commented Nov 21, 2025

Stacked on #9429

Patches in this PR: facebook/react-native#45425
That one ^^^ is a little out of date so I used Expensify's patch for reference, as it's for 0.81.4 (still required me to manually reapply though as we're on 0.81.5 😢): https://github.com/Expensify/App/blob/main/patches/react-native/react-native%2B0.81.4%2B011%2BAdd-onPaste-to-TextInput.patch

Android required some further tweaks, like more accurate mime type detection and copying the content uri to a file uri

This lets us get rid of Mattermost's paste input library, yay!

Caveat: we now have to compile RN from source on Android

ios.paste.mov
screen-20251121-165752.mp4

@arcalinea arcalinea temporarily deployed to samuel/react-native-text-input-patch - social-app PR #9430 November 21, 2025 13:02 — with Render Destroyed
@mozzius mozzius changed the base branch from main to samuel/stacked-packages November 21, 2025 13:02
@github-actions
Copy link

github-actions bot commented Nov 21, 2025

Old size New size Diff
9.46 MB 9.46 MB 32 B (0.00%)

Comment on lines -130 to 141
async (err: string | undefined, files: PastedFile[]) => {
if (err) {
return onError(cleanError(err))
}
async (evt: NativeSyntheticEvent<TextInputPasteEventData>) => {
const files = evt.nativeEvent.items

const uris = files.map(f => f.uri)
const uri = uris.find(isUriImage)
const file = files.find(f => isAcceptedImageMimeType(f.type))

if (uri) {
onPhotoPasted(uri)
if (file) {
onPhotoPasted(file.data, file.type)
}
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has changed from a Data URI to a File URI with a mimetype, which requires some minor changes but is mostly simpler (i.e. no need to do regex mime type nonsense except on web)

compileSdkVersion: 35,
targetSdkVersion: 35,
buildToolsVersion: '35.0.0',
buildReactNativeFromSource: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RIP build times 🪦

"@haileyok/bluesky-video": "0.3.2",
"@ipld/dag-cbor": "^9.2.0",
"@lingui/react": "^4.14.1",
"@mattermost/react-native-paste-input": "mattermost/react-native-paste-input",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you love to see it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants