-
Notifications
You must be signed in to change notification settings - Fork 90
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
RDART-866: Minimal web support #1699
Conversation
39418d8
to
ffd860d
Compare
461fecd
to
7cc3038
Compare
b88120f
to
4b9fd3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - I skimmed over large portions of repetitive changes, but those seem to be covered in tests, so they seem to work. One thing to consider is extracting the web exception somewhere so we don't have to repeat it 58329529 times.
void createCollection(Realm realm, RealmValue value, Pointer<realm_list> Function() createList, Pointer<realm_dictionary> Function() createMap) { | ||
CollectionHandleBase? collectionHandle; | ||
try { | ||
switch (value.collectionType) { | ||
case RealmCollectionType.list: | ||
final listHandle = ListHandle(createList(), realm.handle); | ||
final listHandle = ListHandle(createList(), realm.handle as RealmHandle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than cast here, should we move the cast to the ListHandle/MapHandle
ctor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fan of that.. I prefer all methods on the platform specific handles (including ctors) to traffic in platform specific handles. The problem is more in the handle
extension method on Realm
.
I have add a base-class on all web handles, and have it implement |
0826f58
to
e84d2bd
Compare
No, |
could we fallback to a String in the case the RealmModel has a Decimal128 type then (for web only)? We can then deal with it there onwards. Otherwise we are going to have lots of Realm Models we cant use in 'web'. Are there any other 'Realm' types that will not be supported in 'web'? Or any other limitations (granted Device Sync does not work in web). |
No. The generator run before we know if the model will be used on web or not. |
this package (which I think you use?) https://pub.dev/packages/bson supports Decimal128 and web? how about property annotations that takes into account the Flutter target web VS anything else (native) to conditionally build the models, for example:
Other than this, if we Realm cant conditionally build based on flutter target we are going to get lots of models with type issues...so web will not work... |
We will add web support for |
Thank you sooooo much @nielsenko - are they any other limitations in 'web' for Realm that we should be aware of? Obviously DeviceSync will not work in 'web'. |
- AppConfiguration.baseFilePath is now a String instead of a Directory. - AppConfiguration.httpClient is now a Client instead of a HttpClient. This is to avoid a dependency on dart:io in order to be compatible with package web. This is still work in progress. Missing is: - Support for timeout on web requests - Custom certificate for windows.
c1145f5
to
4d9f2ce
Compare
4d9f2ce
to
1e8e180
Compare
This is now released with realm: ^3.0.0 |
* main: Add vNext Changelog header (#1717) [Release 3.0.0] (#1716) libraryVersion moved to realm_libary.dart (take 2) libraryVersion moved to realm_libary.dart Update CHANGELOG (#1715) Github composite action for setting up flutter on runner (#1710) RDART-866: kn/decimal128 web support (#1713) Reduce expected gain of memEquals for test stability Refresh after awaiting download to stabilize tests RDART-866: Minimal web support (#1699) RDART-1052: Update realm-core to v14.9.0 (#1704) RDART-1020: Fix writeAsync behaviour (#1666) RDART-999: Fix flutter test dlopen (#1623) RDART-1045: Expose setrlimit ios (#1700) RDART-962: Use xcode 15.4 (#1548) RDART-1039: Drop catalyst support. Flutter doesn't support it (#1696) # Conflicts: # packages/realm_dart/src/realm-core
The aim of this PR is to allow package realm to be included in flutter web projects without breaking compilation. It is not intended to actually make realm work runtime with flutter web.
It is safe to use unmanaged realm object in web projects, except if they include
Decimal128
fields.Fixes: #1374