-
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
Fix for TS create declarations when updating (v10) #3266
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…deprecated create-declarations removed.
…leanup & formatting) Check Class Model if instanceof.
steffenagger
force-pushed
the
sa/v10/fix-ts-create-declarations
branch
from
September 28, 2020 07:09
f4be753
to
b7068de
Compare
kneth
approved these changes
Sep 28, 2020
blagoev
approved these changes
Sep 28, 2020
steffenagger
changed the title
Fix for TS create declarations when updating
Fix for TS create declarations when updating (v10)
Sep 28, 2020
5 tasks
blagoev
suggested changes
Sep 29, 2020
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.
maybe we can improve a bit
blagoev
reviewed
Sep 29, 2020
blagoev
approved these changes
Sep 30, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Main goal
Initiated based on this comment: #3044 (comment) - v6 PR can be found here: #3271
Allow for partial models when using
Realm.UpdateMode.All
orRealm.UpdateMode.Modified
Create declarations has been updated to:
Deprecated declarations has been removed after agreement with @kneth
Any better way of achieving the above?
Additional changes
I extended integration-tests for object creation/reading to include update-tests & test for Class Models (these additions only works in combination with #3262 - now rebased on
v10
efter merge).And fixed an issue with serialization tests (so it now works in different environments - the previous error message check was a bit too specific, as described here (MDN)).
Update
objectForPrimaryKey updated to:
(to align with the existing declarations for
objects<T>(...)
- tests for this added)The above change limits the use of
realm.objectForPrimaryKey(Person)
to only accept Class Model which extendsRealm.Object
(just likeobjects<T>(...)
is currently declared).☑️ ToDos
If this PR adds or changes public API's: