gtk-js-app
gtk-js-app copied to clipboard
Template for using GJS with TypeScript
I am a complete newcomer to GTK & GJS development. I write TypeScript professionally and I prefer using TypeScript using plain JavaScript. I see that multiple GTK apps are written in TypeScript now.
One popular example is pop-os/shell, however that project does not use type definitions for GJS itself. It also uses quite a weird build setup with sed scripts.
Then I found ts-for-gir which seems to be the most mature library that provides types for GJS. They also have a lot of example projects. Meson is not used as a build tool for these example projects (esbuild is used instead for most).
It would be great to have a standard template for starting out GJS development that includes TypeScript.
If you want an officially supported template from GNOME – I think several things need to happen
- “official” GJS types. This is more or less in progress https://www.npmjs.com/search?q=%40gi-types - perhaps @ewlsh could use help?
- Find out if we agree to use TypeScript in GNOME Core - @BrainBlasted is working on that as part of https://gitlab.gnome.org/GNOME/gnome-sound-recorder/-/merge_requests/191 (probably a good reference in the meantime)
- Add TypeScript template to GNOME Builder
Ha and of course there is https://blogs.gnome.org/christopherdavis/2022/08/25/trying-typescript-for-gnome-apps/ as well
Curious, has there been any progress / insight on this enhacement? I saw that there is https://gitlab.gnome.org/BrainBlasted/gnome-typescript-template but at least for me, it does not build correctly and requires quite a lot of dependencies for flatpak with node
Would be super if there was something a bit more minimal.