-
Notifications
You must be signed in to change notification settings - Fork 585
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
Implement support for flat collections in Mixed
#6364
Conversation
9c84b57
to
88c8d28
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.
It is amazing to see that collections in mixed is coming to JS 😍
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.
Great! LGTM
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.
I like to see this much test vs implementation code. Great job!
ab06b3f
to
efdb3d3
Compare
* Differentiate use of 'mixedToBinding()' for query arg validation. * Refactor 'mixedFromBinding()' to own function and account for List and Dictionary. * Implement setting a flat list and dictionary in Mixed. * Implement accessing a flat list and dictionary in Mixed. * Add tests for storing and accessing flat lists and dictionaries in Mixed. * Refactor helper in test to not rely on collection position. * Add tests for Set in Mixed throwing. * Add tests for updating lists and dictionaries. * Add tests for removing items in lists and dictionaries. * Add tests for filtering lists and dictionaries by path. * Throw if adding a set via property accessors. * Group tests into separate sub-suites. * Guard for embedded objects being set as Mixed value. * Add tests for embedded objects in Mixed throwing. * Add more filtering tests. * Add 'at_keys' query tests to uncomment after Core bug fix. * Add tests for inserting into lists and dictionaries. * Add tests for notifications on lists. * Add tests for notifications on dictionaries. * Add tests for notifications on object when changed prop is list in mixed. * Add tests for invalidating old list and dictionary. * Minor updates to names. * Add tests for notifications on object when changed prop is dictionary in mixed. * Add tests for creating dictionary via object without prototype. * Add tests filtering by query path using IN. * Access array of changes only 1 time in notifications tests. * Remove unnecessary type assertion. * Update schema object names in tests. * Add link to Core bug. * Add tests for default list and dictionary in schema. * Add tests for setting lists and dictionaries outside transaction. * Add tests for spreading Realm and non-Realm objects as Dictionary. * Add unit tests for 'isPOJO()'. * Point to updated Core commit and enable related tests. * Wrap chai's 'instanceOf()' in custom helper to assert type. * Update helper function name to be consistent with other helpers. * Add internal docs for 'isQueryArg'. * Rename unit test file. * Refactor notification tests into 'observable.ts'. * Refactor notification tests to use test context. * Use named import of 'ObjectSchema'. * Group CRUD tests into subsuites.
What, How & Why?
Adds support for storing flat lists and dictionaries as the underlying value of a
Mixed
property on non-synced realms. Hence, the list or dictionary can contain any of the previously allowedMixed
values, but not another nested collection. Nested lists and dictionaries will be implemented as a separate PR.Sets are not supported as a
Mixed
value.Notes
List
andOrderedCollection
will be added as part of the nested collections implementation.Brief overview of usage
This closes #6342 and #6343.
☑️ ToDos
main
)