D2 App Platform and Typescript

Hi there,

I have seen a mention of this question in a thread with no answers, so I thought I would make it a full topic. I have an app developed using the app platform, however when trying to migrate this over to typescript I am getting a number of errors relating to the d2 modules and project structure, I was wondering if there are any plans to document how to use typescript with the app platform? As quite a few people have been developing apps for DHIS2 in typescript without the app platform, it seems like this could be a cause for people to not adopt the platform until it’s supported.

Keen to hear other peoples thoughts too.

Many thanks for your time,

@plinnegan can you share the specific errors you’re seeing?

There is support for compiling typescript in the platform (we use it for the app-runtime library) but we do not have official support for typescript applications and so that isn’t well-tested. I imagine it should work, it likely just requires some customization of the typescript config and type stubbing. If this is something people are interested in, perhaps typescript support could be added to the platform and/or a HOWTO guide added to developers.dhis2.org by you or others from the community?


Thanks for the quick feedback @austin! I will try and setup a minimal example and get back to you this week!