react-native-live-markdown
react-native-live-markdown copied to clipboard
Add macOS support
Details
Work in progress
Related Issues
GH_LINK
Manual Tests
Linked PRs
visionOS support also coming? :)
Any updates on this one? MacOS support would be huge!
After applying changes required by macOS itself (e.g. removing UIKit.h imports and replacing UIView with RCTUIView), there's a bug that prevents the user from typing more than only one character – all subsequent keypresses behave like pressing right arrow even though here I'm only pressing
https://github.com/user-attachments/assets/a1053473-eb14-47e3-a9f4-9f662d68059a
I managed to get it working by commenting out two swizzled methods in 7026df149fbddd1c3620132922bd1489bc151d6c but then the formatting is applied with a slight delay:
https://github.com/user-attachments/assets/764c3550-db4e-4af4-85d1-63d40f92532e
So the formatting is incorrect for 1 frame:
Hello! I would be interested if this PR was revived, though as I understand it, now this library is new architecture only? Could I get an idea of any blockers y'all were seeing in macOS if there were any?
@Saadnajmi Hey, nice to hear that!
Yep, as of today @expensify/react-native-live-markdown supports only the new architecture, see explanation in https://github.com/Expensify/react-native-live-markdown/pull/634.
So one of the blockers is that we're still using method swizzling to override the default behavior when typing or updating the value from JS. There's a PR that eliminates method swizzling but there are still some details that need to be fixed: https://github.com/Expensify/react-native-live-markdown/pull/520
As far as I remember, there were no blockers caused by react-native-macos so far, only some API differences like lack of UITextRange (we'll need to use NSRange instead) or some problems with valueForKey:.
I'm curious to know about your use case, feel free to send me a DM.
@Saadnajmi Hey, nice to hear that!
Yep, as of today
@expensify/react-native-live-markdownsupports only the new architecture, see explanation in https://github.com/Expensify/react-native-live-markdown/pull/634.So one of the blockers is that we're still using method swizzling to override the default behavior when typing or updating the value from JS. There's a PR that eliminates method swizzling but there are still some details that need to be fixed: https://github.com/Expensify/react-native-live-markdown/pull/520
As far as I remember, there were no blockers caused by
react-native-macosso far, only some API differences like lack ofUITextRange(we'll need to useNSRangeinstead) or some problems withvalueForKey:.I'm curious to know about your use case, feel free to send me a DM.
The use case is mostly "it would be real great to have a proper open source richtextinput library for desktop". It feels like a common request for desktop apps specifically. We have some custom stuff internally, but it's not something that would be useful in open source IMO.