Skip to content

[Meta] Be more explicit about/test for/document limitations of various runtimes #2789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bradjones1 opened this issue Oct 22, 2022 · 8 comments

Comments

@bradjones1
Copy link

Following-on to #2788 (comment) but more broadly: I think it would be helpful to document more explicitly the SDK's compatibility with various runtimes, e.g. Node, browsers, and RN (e.g., Hermes engine.)

The linked issue relating to WebCrypto is a good example of this: the SDK now basically requires Node 16+ or a browser with WebCrypto API. Unsupported in React Native.

I'm certainly not advocating for any more or unplanned work on the part of the Matrix team, which is doing amazing work here. Rather I think it would be helpful to explicitly state these requirements and limitations, and perhaps provide some sort of support matrix for features based on their capabilities or versions.

@bradjones1 bradjones1 changed the title [Meta] Be more explicit about/test React Native support/document limitations in RN [Meta] Be more explicit about/test for/document limitations of various runtimes Oct 22, 2022
@bradjones1
Copy link
Author

I've written a more detailed blog post about my experience implementing the SDK 21.0 RC, which provides a bit of a broader usage report.

@apguan
Copy link

apguan commented Nov 2, 2022

@bradjones1 thanks so much for this! My team has been trying to figure this out over the past couple days. Ultimately, were you able to get the SDK fully working in your RN app?

@bradjones1
Copy link
Author

bradjones1 commented Nov 2, 2022

@apguan I'd say, "yes," but not "fully working" in the sense that things like E2E encryption are dependent on runtime requirements that are difficult/impossible to manage reasonably in the RN environment. (Which is the genesis of this issue.)

There are also other considerations such as login, token refresh and the like that need special handling in a non-browser environment but they are not insurmountable. Token refresh in particular has been made a lot easier thanks to #2719 - I implemented a basic middleware but caveat emptor.

All that said, I'm very happy with the SDK and with Matrix as a chat solution - it lets me offload a lot of that complexity to a service I don't need to homebrew. There are things that I've had to postpone (such as selling access to read receipts) because the Matrix paradigm doesn't quite fit all my business domain needs. But life is all about trade-offs.

I'm far from an RN expert (I'm a back-end guy thrust into the front-end out of necessity) but you can email me at [email protected] if you want to chat more about it/want some consulting.

I will say that I started off early on working from https://gitlab.com/ditto-chat/ditto but the observer pattern she implemented just doesn't work for me. As I've learned more about Matrix (and honestly, RN/TypeScript) I've ripped a lot of that code out but it was a good reference implementation, especially for the chat screen.

Also, know any angels interested in a disruptive dating app? :-D

@apguan
Copy link

apguan commented Nov 2, 2022

Let me ask around in my network. Thanks again 🙂

@AbdullahQureshi1080
Copy link

@bradjones1 Hey, how's it going? It's five months later now, have you by any chance figured out a way to make e2e encryption work using the sdk in react native with all its kicks i.e backups and persisting cryoto storage etc.

@bradjones1
Copy link
Author

@AbdullahQureshi1080 Sorry, I don't use E2E so I can't speak to this.

@AbdullahQureshi1080
Copy link

@bradjones1 That's a bummer, I thought maybe you've had some breakthrough on that.

Thanks for the comment and best of luck with your usecase.👍🏻

@Neustradamus
Copy link

To follow

@github-actions github-actions bot added the Stale label Feb 7, 2025
@RiotRobot RiotRobot removed the Stale label Feb 8, 2025
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

No branches or pull requests

5 participants