fix: expose TS types internal to the data engine#1412
Merged
KaiVandivier merged 2 commits intomasterfrom May 29, 2025
Merged
Conversation
simonadomnisoru
approved these changes
May 28, 2025
simonadomnisoru
left a comment
There was a problem hiding this comment.
LGTM! Being able to import the types from @dhis2/app-service-data and avoid workarounds is really helpful.
Birkbjo
approved these changes
May 28, 2025
|
KaiVandivier
approved these changes
May 29, 2025
dhis2-bot
added a commit
that referenced
this pull request
May 29, 2025
## [3.14.2](v3.14.1...v3.14.2) (2025-05-29) ### Bug Fixes * expose TS types internal to the data engine ([#1412](#1412)) ([9803646](9803646))
Contributor
|
🎉 This PR is included in version 3.14.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This was referenced May 31, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



This exposes the types in Data service which are often needed by consumers of the app-runtime but currently are not exposed. This led consumers to have to do various workarounds in order to pluck these types, like this for example.
Which this change, the types can be accessed from the top level, i.e.
import {QueryRefetchFunction} from 'dhis2/app-runtime'Notes
Instead of exporting at the top-level, I looked at exporting the types to
@dhis2/app-runtime/types. This was mainly as I assumed that the initial intention was these types are internal, so didn't want to make them too obvious. But on second thought, I thought this was unnecessary and looking at other libraries - React for instance - it seems common to expose such types at the top-level.In some of the services, i.e. config service we explicitly exported some of the types in
/types.tsrather than everything - in this PR, I am exposing everything there, mainly because everything in types.ts seems to be useful in the context of Data Provider.Some other services
Offlinestill don't export the types defined in./types.ts, I left them for now - it seems like the workarounds are mostly needed for the types under the Data provider - if a need arises to export the other ones, we can do so later.In order to be able to do
export type * from ..., rather than importing and then re-exporting under a namespace, I updated TS version in the devDependencies to version 5 - this is also the version used by the app-shell and the one hoisted by default in dhis2 apps, so this actually brings the runtime consistent with app-shell and platform.Implements LIBS-769