I started playing around with GJS recently and tried out the builder JS template for it, but found I wanted a bit more than it could provide:
I wanted Typescript
I wanted to develop with VSCode because writing XML without emmet shortcuts is painful, and I already knew all my shortcuts
I wanted decent intellisense for the gnome objects (so girs )
I wanted an explicit guarantee that my widgets get loaded before the application starts so I don’t ever have to think about “class X was not loaded yet” kinds of errors
I wanted a utility to generate the basic boilerplate of a new widget for me because there’s way too much to keep in mind and you need to add the path to like 3-4 places
I want ui files and ts files in the same src dir. Maybe just a habit from me being webdev by profession, but generally components/widgets have all related files bundled together in one dir (i.e. “src/button/button.ts” and “src/button/button.ui”).
the 6) point means also by extension I want a single gresources.xml
I wanted shorthands for building/running flatpaks, for one because the commands are way too long to type, for another because I didn’t know those commands initially and couldn’t find them when initially setting up the project with GNOME builder
The matrix GJS room initially pointed me in the direction of the “World” Gnome-typescript-template and it was a solid starting point, but it had various issues and didn’t fully satisfy my requirements.
So I added my own changes to get to something useable. However, that took long enough (since I was entirely new to meson, ninja and basically any native build system) that I’d have loved to have this kind of setup from the get go provided by Gnome Builder.
Therefore I think it makes sense to contribute a template somewhat like the one I just modified to GNOME builder, mostly the TS setup, setup with these gir types and the script for generating a widget.
As per the request in the GNOME Builder issue tracker I’m first opening this here as a discussion.
I’d be willing to be the person that contributes this setup if I can, though I have still very, very little experience with meson.
In general, I think it’d be awesome to have a TS template in Builder, but I also think there’s nothing wrong with having a template outside of it with a script, that’s what I’ve personally done for PyGObject because I wanted it to be a bit more opinionated.
I haven’t created a Gnome Builder issue as the issue template contains the following:
If you want to request a feature, please start a discussion with your idea over at Topics tagged builder.
So I didn’t open one.
As for TS template outside of builder or not: I do not care too much about the exact place, I care about easy discoverability. Had I not been linked the “World” template as a starting point, I’d not have been able to get to a functioning state from which I could start an application in GJS and given up at some point.
It would have been really nice to have been able to discover that template or templates like it easily and quickly. Ideally I’d want people like me (as in, webdevs that know how to compile native but haven’t done native appdev) that start with GJS to have an easier time than I had. So that they just look at GJS, follow some instructions and have something they can start working with.
The only reason I thought of GNOME Builder was because it was the first place I thought to look at when I started, so it seemed to me like a sensible place to add it (as well as some README.md file or so that explains the repo structure for the uninitiated). And even if I don’t use GNOME Builder as an IDE myself, as a “Project initializer” it is still very valuable.
What is the workflow to go from “Feature Request in forum” to “collaborating on implementation in GNOME Builder” ?
I think the templates are done per build-system and the per-programming-languages bits are just templates files, so I might be able to get away with just writing those template files. Could somebody confirm this to me? My assumption is based on gbp-meson-template-provider.c.
Are there specific parts of what I typically want in a project that is in my list of 8 points that would not be okay in a typescript project template?