Skip to content
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

[Feature] Entity Service types #17799

Merged
merged 161 commits into from
Aug 30, 2023
Merged

Conversation

innerdvations
Copy link
Contributor

@innerdvations innerdvations commented Aug 25, 2023

What does it do?

Improves and adds types for the Entity Service methods

TODO before release

Why is it needed?

So types are available when using the Entity Service

How to test it?

Entity Service methods should now be typed

Typescript testing framework has been added in this PR but the tests themselves are still in progress.

Related issue(s)/PR(s)

Convly and others added 30 commits June 20, 2023 11:56
Co-authored-by:  christiancp100 <christian.capeans.perez@strapi.io>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
@Convly Convly marked this pull request as ready for review August 29, 2023 12:51
Convly
Convly previously approved these changes Aug 29, 2023
Copy link
Member

@Convly Convly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Changes regarding the initial scope

  • factories have been reverted to an explicit any type for now to avoid breaking any application while we work around prototype typing issues
  • Entities returned by the entity service are strongly typed (properties are narrowed based on given parameters) at the first level, but are keeping every fields for nested structures (relations, etc...)

The last two points will be worked on & shipped in later releases

@Bassel17
Copy link
Member

we have some failing tests here

Convly
Convly previously approved these changes Aug 29, 2023
@alexandrebodin alexandrebodin merged commit 41844c2 into main Aug 30, 2023
24 of 25 checks passed
@alexandrebodin alexandrebodin deleted the features/types/entity-service branch August 30, 2023 07:56
@alexandrebodin alexandrebodin modified the milestones: 4.13.0, 4.13.1 Aug 30, 2023
@jramstedt
Copy link
Contributor

Good improvements, but createCoreController and createCoreService types are unusable now (and gives typescript errors Binding element 'strapi' implicitly has an 'any' type.ts(7031) with strict configs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: feature This PR adds a new feature source: typescript Source is related to TypeScript (typings, tooling, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants