-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Custom Model Classes #487
Custom Model Classes #487
Conversation
This comment has been minimized.
This comment has been minimized.
text/0000-custom-model-classes.md
Outdated
kind: 'hasMany'| 'belongsTo'; | ||
type: string; | ||
options: { [key: string]: any } ; | ||
name: string; |
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.
we should validate that this is in fact what we currently expose / want to document as info concerning inversePropertyName
inverseType
and isPolymorphic
is typically available as well.
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.
Thats a very good point. isPolymorphic
should be available from the options. We currently in practice expose a bunch of underscored properties for inverses, but all of that data is calculable given the exposed public data. I would prefer to keep it private, and figure out in the schema work if we need to expose it
959be70
to
10ade6f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I discussed this with @igorT today. One concern I've had here is that Also, some method return values on I'm fine moving this to FCP if others are. I will give it another pass over the weekend. |
47a6f8c
to
c6c4e85
Compare
I have implemented a slightly older version of this api(pending some cleanup) at ember-m3/ember-m3#294. It passes all the tests without any usage of |
text/0000-custom-model-classes.md
Outdated
} | ||
``` | ||
|
||
Instead of exposing the entire RecordData Class, we expose only the local facing methods and hide the server/adapter facing methods that the Model should not have access to, by giving a RecordData lookup method to `instantiateRecord` |
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.
Instead of exposing the entire RecordData Class
On what? Needs a slight prose tweak here
text/0000-custom-model-classes.md
Outdated
We need to make the following changes: | ||
|
||
* expose a method on the store for instantiating a record | ||
* add a hook to be notified when a record is being destroyed for potential cleanup |
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.
Clarify interaction with unloadRecord
I've left a couple suggestions but don't consider anything blocking. In addition to the comments I left, I'd like to eventually iron out inconsistencies between usage of |
3575893
to
3a8b8b6
Compare
3a8b8b6
to
d8d46dd
Compare
Implements RFC emberjs/rfcs#487
This allows us to move away from using _internalModel and private apis, by using apis descibred at emberjs/rfcs#487
This allows us to move away from using _internalModel and private apis, by using apis descibred at emberjs/rfcs#487
This allows us to move away from using _internalModel and private apis, by using apis descibred at emberjs/rfcs#487
This allows us to move away from using _internalModel and private apis, by using apis descibred at emberjs/rfcs#487
This allows us to move away from using _internalModel and private apis, by using apis descibred at emberjs/rfcs#487
* master: (56 commits) Fix code examples & add ember-cli release version in emberjs#637 Update FCP guidance to include Discord Update RFC 085421 ready-for-release PR URL Advance RFC {{ inputs.rfc-number }} to Stage ready-for-release feat: EmberData Cache v2.1 finalize lifetimes Update text/0860-ember-data-request-service.md Update RFC 496, typos, correct field name add note chore: update RequestService url with finalized design details Move emberjs#331 deprecate-globals-resolver to recommended Correct metadata for emberjs#487 custom model classes Move emberjs#625 helper-managers to recommended Add release date and version for 776 Update RFC 0776 released PR URL Advance RFC {{ inputs.rfc-number }} to Stage released Update RFC 0739 ready-for-release PR URL Advance RFC {{ inputs.rfc-number }} to Stage ready-for-release Deprecate `ember-mocha` Add title of RFC to advancement PR titles ...
Rendered