-
Notifications
You must be signed in to change notification settings - Fork 1
FRONTEND-2309 :: Feature :: Remove getAll and putAll #142
base: master
Are you sure you want to change the base?
Conversation
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.
There few things you could change, but I'm still approving it. Remember the next releas will need to be 2.0
, as these are breaking changes. Kind of unfortunate… as we could have waited before doing the 1.0
. 😅
packages/core/src/repository/data-source/in-memory.data-source.ts
Outdated
Show resolved
Hide resolved
packages/core/src/repository/data-source/sql/array-raw-sql.data-source.ts
Show resolved
Hide resolved
|
||
return new OAuthClientModel( | ||
client.id, | ||
client.createdAt, | ||
client.updatedAt, | ||
client.clientId, | ||
client.clientSecret, | ||
grants.map((el) => el.grant), | ||
grants.map((el: OAuthClientGrantEntity) => el.grant), |
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.
Nit: is this type annotation needed? Isn't correctly inferred from GetDataSource<OAuthClientGrantEntity[]>
?
grants.map((el: OAuthClientGrantEntity) => el.grant), | |
grants.map((el) => el.grant), |
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.
@doup Agree, but in a discussion in socialPals @lucianosantana told he preffers that we put explicitly all the types so I'm used to it. We could raise this discussion to MJ.
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.
Technically, is not needed. The type can be inferred quickly on a modern IDE context, but needs a bit of code reading in "dumb" contexts such as browser debugging. I don't think we lose anything by adding that info explicitly.
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 don't have a problem adding it, but it's true that in a dumb context having an OAuthClientGrantEntity you don't have more information than before, and what we have in the end is the logic and algorithms filled with types. My preference is mainly having everything typed but as compact and readable as possible.
Being a library as it is, I'll leave it with these types in there.
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.
Then this is ready to be merged, right?
value.grants.map( | ||
(el) => new OAuthClientGrantEntity(undefined, undefined, undefined, el, client.id as number), | ||
), | ||
new VoidQuery(), | ||
); | ||
|
||
grants = grantEntities.map((el) => el.grant); | ||
grants = grantEntities.map((el: OAuthClientGrantEntity) => el.grant); |
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.
Nit: same here.
grants = grantEntities.map((el: OAuthClientGrantEntity) => el.grant); | |
grants = grantEntities.map((el) => el.grant); |
@doup The v1.0.0 was really needed in a project so I had to release it. There's nothing wrong on creating a new major release. I had this into account, although we can keep this changes without a new release for now. Also think that all your suggestions are for things that are not created by me in this PR, just moved from the original place, so some applies no only to the place you pointed out but many others. For these cases I'll create an asana. Thanks! |
Asana task link:
https://app.asana.com/0/1109863238977521/1204203716532309/f
Pull request information: