GNOME Bugzilla – Bug 759171
Make seed compatible to gjs javascript syntax
Last modified: 2015-12-21 02:49:36 UTC
I am currently looking into making seed more compatible to gjs syntax. I came that far, that I could run most of the examples provided by gjs source unmodified by seed. For that I have some patches lying around here. I also tried to let the original syntax of seed working. So, my patches do not break current seed js code. I still work on it to make it more compatible. For that I try to make patches, that gnome-weather is runnable by seed without modifications. That's just my test case. I have no real usage for this, now. The biggest problems with yield, let and const are solved. For that I patched the build system to support webkit2gtk4.0. The default is still 3.0. Webkit2gtk4 supports let and const in the current version and the master branch has already support for yield.
Created attachment 316942 [details] [review] Add support for new webkit version 4.0 to build system
Created attachment 316943 [details] [review] Add support for gjs signal connections
Created attachment 316944 [details] [review] Add support for NULL value in init function
Created attachment 316945 [details] [review] Add missing log and logError functions to global object
Created attachment 316946 [details] [review] Made GLib variable in seed.js scoped
Created attachment 316947 [details] [review] Add support for the global ARGV object
all committed, Thanks Alan
Thanks for reviewing and committing my patches. I will now reopen this ticket to provide another patch.
Created attachment 317020 [details] [review] Made named constuctors compatible with gjs
Created attachment 317022 [details] [review] Made named constuctors compatible with gjs
committed - feel free to open again if you need more patches against this issue. Regards Alan
Thanks
Created attachment 317578 [details] [review] Add gjs compatibility layer to seed
Created attachment 317579 [details] [review] Add the gjs native module "window" for compatibility
Created attachment 317580 [details] [review] Add the native gjs module dummy "system" for compatibility
Hello, I have made a few other patches for compatibility reason for seed. Unfortunately, I am not sure if I can work on this next year and that's the reason to add the last patch. Maybe someone have the time to finish it. The missing parts to get compatibility: (as far I can see) * Finish the "system" patch and solve the issue mentioned there. * Add the missing native gjs compatibility modules "console" and "cairo" With that work, you should come pretty far in running gjs code.
Created attachment 317581 [details] [review] Add the native gjs module dummy "system" for compatibility Sorry missed a bit.
The steps left to make seed compatible to gjs: (as far I can see) part2 * Finish the "system" patch and solve the issue mentioned there. * Add the missing native gjs compatibility modules "console" and "cairo". See gjs code for their implementions. You can find it in modules folder in gjs. * Find out what are the tweeners for in gjs and add them to seed. Find them in modules/tweeners folder in gjs codebase. As far I can see, they are just more js modules, but I can not find them used somewhere. They are just packaged into a resource file. So adding them to the seed modules/gjs folder could make them work. * Port gjs subclassing system to seed This is implemented in jsapi-dynamic-class.cpp in gjs. See also: https://github.com/GNOME/gnome-shell/blob/master/HACKING#L128
All committed - interesting to see a bytearray implementation in there.. wonder if it works....