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

19 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. Now you can win free stuff online, free giveaways, enter every day to win latest iphones, smartphones, macbooks, laptops, accessories, technology and much more.

    Participate, Win & Keep A Free Apple iPhone XS

    ReplyDelete
  5. Sickbits is a library of unlimited hacks for android, ios smartphones. Get unlimited amount of hacks and modes for mac & pc. https://sickbits.net/

    ReplyDelete
  6. It's very useful blog post with inforamtive and insightful content and i had good experience with this information.I have gone through CRS Info Solutions Home which really nice. Learn more details About Us of CRS info solutions. Here you can see the Courses CRS Info Solutions full list.Find the best Hadoop Training with great faculty. Go to know about crs info solutions Workday Training program.

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

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

    ReplyDelete
  9. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    workday studio online training
    best workday studio online training
    top workday studio online training

    ReplyDelete
  10. 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
  11. 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
  12. it's really cool blog. Linking is very useful thing.you have really helped
    iot course in noida

    ReplyDelete
  13. A decent blog consistently concocts new and energizing data and keeping in mind that perusing I have feel that this blog is truly have each one of those quality that qualify a blog to be a one.
    360DigiTMG data analytics course

    ReplyDelete
  14. Super site! I am Loving it!! Will restore again, Im taking your food in like manner, Thanks.
    difference between analysis and analytics

    ReplyDelete
  15. 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
  16. Stunning! Such an astonishing and supportive post this is. I incredibly love it. It's so acceptable thus wonderful. I am simply astounded.
    digital marketing course

    ReplyDelete