gjsify/ts-for-gir

Generate camel cased property accessors

YarnSphere opened this issue · 2 comments

GJS supports camel cased property accessors, except when used as strings. Using them seems to even be encouraged in the style guide, see: https://gjs.guide/guides/gjs/style-guide.html#properties.

It would be nice to have typings available for them as well.

Hey @YarnSphere,

Thanks a bunch for flagging the camelCase thing in line with the GJS style guide. You're absolutely right – it's something the generator should definitely handle.

I've slapped a gjs-convention label on this issue to mark it as a "must-do" for aligning with GJS standards. It's not just a nice-to-have, but a real necessity for keeping up with GJS.

I'm juggling this project with other stuff in my life, so I can't jump on it right away. But rest assured, it's on my radar and I'll get to it as soon as I can squeeze in some coding time.

It would be really helpful if you could drop a simple code example here, showing what's not working or being flagged as an error but should be fine. When I get the chance to tackle several convention bugs, having these examples would make things way easier to process.

Your input's super helpful and totally appreciated – it's what keeps projects like this moving forward!

Catch you later with updates. Cheers for the patience and support!

Best,
JumpLink

It would be really helpful if you could drop a simple code example here, showing what's not working or being flagged as an error but should be fine. When I get the chance to tackle several convention bugs, having these examples would make things way easier to process.

Both of these statements currently give a TypeScript error but should not:

import Gtk from "gi://Gtk?version=4.0";

// `Label.ConstructorProperties` should support camel cased properties
const label = new Gtk.Label({ marginTop: 6 });
// `Label` should support camel cased properties
label.marginBottom = 6;

I'm juggling this project with other stuff in my life, so I can't jump on it right away. But rest assured, it's on my radar and I'll get to it as soon as I can squeeze in some coding time.

Totally understandable, I'm in the same boat myself. :)

I looked into the code at the time I reported this and it seemed like a simple-ish fix. If I get the time during this or another weekend I'll make sure to drop a PR myself.

Cheers.