-
Notifications
You must be signed in to change notification settings - Fork 87
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
Web support #26
Comments
This would be awesome |
We are certainly interested in supporting Flutter Web as a platform but it will require web assembly support and our Core team is exploring the various options we have. This is still at very early stages of research so we can't do any commitments currently |
wouldn't js with indexedDB be enough ? Last I checked the js client was just allowing graphql queries |
I think the point is to have a cross-platform database on Flutter (android, ios, web and other supported platforms). |
Would love to see web support as well! |
Hi, any updates on this one? |
From a local persistent DB perspective; not sure how beneficial this is for Flutter Web as persistent local databases in web browsers are usually not a great approach from a data security perspective... |
From what I understand the web support in general of realm is not local db just a sync from the cloud and it's available for js just ask to add it to flutter web |
they should add support for GraphQL subscriptions |
Any updates? web assembly is now in a further stage with flutter web since the last keynote a couple weeks ago. |
Support for web assembly is not on our short-term roadmap. As @blagoev said, we are interested in eventually supporting it as a platform and are doing some preliminary work there, but we don't currently expect this to materialize in something user-facing before the end of 2023. If you would like to use App Services in a web assembly project, the recommendation is to use GraphQL or the Data API which are both accessible using a simple http client or via a 3rd party package, such as graphql_flutter. |
I understand. I just wanted to make it clear that there is a big opportunity in the growing flutter community for you. |
We are aware of it and are definitely interested in catering to the needs of businesses that would like to share a codebase between their native and web apps. The main blocker here is that the database as well as the sync layer is written in C++ (in order for us to share it across all supported platforms). Web Assembly imposes certain restrictions/has some peculiarities when it comes to IO and multithreading that require significant work to support. We're working on it and making some progress there, but I wanted to be upfront about the timelines so that you folks can make the best design choices for the architecture of your project. If you're looking to ship something in the next 3-6 months, it would be a mistake to wait for WebAssembly support in the Flutter SDK. If you're working on a huge project that will ship in 2024 or later, then definitely reach out to your account executive (if using any of our paid services) and they should be able to work with you and share more precise timelines as well as relay your requirements to the engineering team. |
Now that Flutter 3.10 is released and supports WASM, would it be possible to use Realm on web? |
@realrk95 It has limited support. I believe adding support for the web is still a challenging task. |
For the interested (in case you missed it) there is a preview in the NOTE: It is only for javascript, not Dart. |
@nielsenko not sure where's best to give this feedback, but the next absolute game changer would be to figure out how to connect other wasm efforts such as SwiftWASM into this new realm-js work such that Swift code (or other langs which Realm supports) can be used for both mobile and web including the Realm usage. JS is great for cross-platform, but there are many Swift / native app developers who are looking for cross-plat solutions too and this brings us closer to that. Thanks |
@aehlke I'm not familiar with SwiftWASM, but feel free to open a feature request in https://github.com/realm/realm-swift |
@nirinchev @blagoev |
@nielsenko thanks a lot for the answer, I cannot reccommend ISAR alghthough. It has critical issues with isolates for example. |
@zs-dima Please observe https://www.mongodb.com/community-code-of-conduct. I can't speak for @nirinchev, but I stand by my word. |
Any update on this? |
When we have an update, we will be sure to post it in the issue. |
Sorry for my ignorance, but why doesn't it work on web apps? |
The Realm database is built in C++ and the features it uses - particularly around filesystem access - are not available in the web. The Realm Flutter SDK is wrapping the C++ database to expose ergonomic API to read/write data from dart/flutter apps, but the platforms we support are limited by the platforms the native database supports. |
To elaborate on @nirinchev's answer. We would need to compile realm-core (or actually One complication is that realm uses mmap'ed IO, which is not supported by the WASM runtimes of the browsers. We either need to
Also, we are using Add on top of this that some browsers still don't even support WasmGC - which is pre-requisite for compiling flutter code to WASM. This means we would have to support compiling to javascript, just to run in Safari. Or any browser on iOS, as they all forced to use WebKit (except in the EU as of iOS 17.4). Which again will require some work-around regarding the dreaded 53 bit integers. This is just a lot of risky external dependencies, and/or a ton of work that has to be prioritized among other stuff. That said, we are well aware that this is the most upvoted feature in the repo. So stay tuned, but be very patient 🙏 .. |
After the depreciation announcement of Atlas Device SDK by MongoDB weeks ago, which also affects this Realm Flutter SDK,
If someone has the answer please help. I could not find any better answer on the deprecation page other than "The on-device database will continue to exist as an open-source project." We need clarification because we do not want to waste investment in our project if Realm will be dead soon. Thanks. |
MongoDB will not be actively contributing to the project, but if someone from the community would like to work on this feature, we'd be willing to accept PRs and facilitate new releases. |
Since Realm already has a JS client, would it be easy enough to add a web compatible variant to this package?
The text was updated successfully, but these errors were encountered: