Monday, February 27, 2017

Sorting out Gjs with Typescript

I get why Gnome wants to use javascript. I love the language. The thing is, I don't love Gnome's implementation.

The syntax is getting out of date, and my experience with other engines doesn't translate well to the Gjs environment. Combine this with a lack of documentation. If Gnome wants to attract javascript developers, this isn't the way to do it. Its not too bad when you are coding a one page demo widget, but try coding an ambitious desktop application. Without relevant api information, I'm coding blindfolded.

One solution would be to use Typescript. All I need to do is translate the *.gir metadata to *.d.ts format, so I've created a tool

https://www.npmjs.com/package/gir2dts

All I have to do is install with npm, and reference the contained *.d.ts files.

There are a couple of samples in the example folder at https://github.com/darkoverlordofdata/gir2dts

This tool was designed to facillitate the development of another application, so it's a great example of a Gjs/Typescript application: https://github.com/darkoverlordofdata/bosco-player

18 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Really good work. I agree wholeheartedly with your assertion that "If Gnome wants to attract javascript developers, this isn't the way to do it."

    And Typescript does look very appealing. Visual Studio Code, with your GTK typescript files, and therefore "intellisense" for the GTK libraries is really quite nice.

    One of the awkward things about GJS is how it handles modules. Have you looked into whether it is sane to try and support NodeJS (CommonJS I suppose) modules, and Typescript, with GJS?

    ReplyDelete
  3. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from TypeScript Training in Chennai . or learn thru Javascript Online Training from India. Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Training in Chennai

    ReplyDelete
  4. Superlative style of forming that each new blogger tries to have. 123movies

    ReplyDelete
  5. The AndroidRub.com store specializes in supplying and trading Mod Apps & Mod Games products for mobile phones with the best quality.

    ReplyDelete
  6. I will truly value the essayist's decision for picking this magnificent article fitting to my matter.Here is profound depiction about the article matter which helped me more.
    360DigiTMG data science certification

    ReplyDelete
  7. I need to communicate my deference of your composing aptitude and capacity to make perusers read from the earliest starting point as far as possible. I might want to peruse more up to date presents and on share my musings with you.
    360DigiTMG

    ReplyDelete
  8. With so many books and articles coming up to give gateway to make-money-online field and confusing reader even more on the actual way of earning money,
    data science course in hyderabad

    ReplyDelete
  9. Let us introduce you to Ahmedabad,Foreigner Call Girls in Aerocity a diverse city which offers a cultural mix of Sexy Beautiful Busty Call Girls in Ahmedabad who are bold, beautiful and want to live life to their fullest.Busty Call Girls in Ahmedabad Let us spoil you with their dreams which make them more appealing among others for wealthy gentlemen of your stature. Girls of Ahmedabad are different.Busty Escorts Service in Haridwar They desire to date to fulfill their dreams.Busty Escorts Service in Delhi They spend times in cafes,Busty Escorts Service in Ahmedabad restaurants and shopping malls waiting for rich guys like you to approach them.

    ReplyDelete
  10. Informative article. Thanks for sharing with us.keep it up.
    best data science course online

    ReplyDelete
  11. I recommend everyone to read this blog as it has some of the best data science content you will find. The best part is that the writer presented the information in an engaging and engaging way. Each line gives you something new to learn, and that says a lot about the quality of the information presented here.

    Kickstart your career by enrolling in this Data Science Certification Course in Chennai

    ReplyDelete
  12. It is really helpful for a newbie like me.. I am a regular follower of your blog. Very informative post you shared here. Kindly keep blogging. Now its time to avail Moving company in Tuscaloosa, AL for more information.

    ReplyDelete
  13. Your tool seems like a valuable contribution to the Gnome development community.
    Also Read: Data Analytics in Aviation: Enhancing Safety and Efficiency

    ReplyDelete