fix(core): update to TypeScript 4.8 and improve EntityDTO
type
#3389
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.
Due to changes in TS 4.8 we had to simplify the
AnyEntity
type, it no longer contains the__helper
and__meta
properties. Those are considered internal, and they are in fact still present, just not on the type level. Most places now use justobject
instead ofAnyEntity
for the type signatures (e.g.em.find<T extends object>()
).Another semi type level breaking change is the return type of
toJSON/toObject/toPOJO
, which now usesEntityDTO<this>
and respects the populate hints (Loaded
type) too, narrowing relations to their PK if they are not populated.Closes #3417
Closes #2414