After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759171 - Make seed compatible to gjs javascript syntax
Make seed compatible to gjs javascript syntax
Status: RESOLVED FIXED
Product: seed
Classification: Bindings
Component: libseed
git master
Other Linux
: Normal normal
: ---
Assigned To: seed-maint
seed-maint
Depends on:
Blocks:
 
 
Reported: 2015-12-08 12:27 UTC by Peter Rustler
Modified: 2015-12-21 02:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add support for new webkit version 4.0 to build system (1.79 KB, patch)
2015-12-08 15:11 UTC, Peter Rustler
none Details | Review
Add support for gjs signal connections (2.20 KB, patch)
2015-12-08 15:12 UTC, Peter Rustler
none Details | Review
Add support for NULL value in init function (1.36 KB, patch)
2015-12-08 15:13 UTC, Peter Rustler
none Details | Review
Add missing log and logError functions to global object (2.83 KB, patch)
2015-12-08 15:13 UTC, Peter Rustler
none Details | Review
Made GLib variable in seed.js scoped (1.17 KB, patch)
2015-12-08 15:14 UTC, Peter Rustler
none Details | Review
Add support for the global ARGV object (3.79 KB, patch)
2015-12-08 15:14 UTC, Peter Rustler
none Details | Review
Made named constuctors compatible with gjs (3.90 KB, patch)
2015-12-09 12:57 UTC, Peter Rustler
none Details | Review
Made named constuctors compatible with gjs (3.90 KB, patch)
2015-12-09 13:08 UTC, Peter Rustler
none Details | Review
Add gjs compatibility layer to seed (149.04 KB, patch)
2015-12-17 15:40 UTC, Peter Rustler
none Details | Review
Add the gjs native module "window" for compatibility (1.81 KB, patch)
2015-12-17 15:41 UTC, Peter Rustler
none Details | Review
Add the native gjs module dummy "system" for compatibility (11.54 KB, patch)
2015-12-17 15:41 UTC, Peter Rustler
none Details | Review
Add the native gjs module dummy "system" for compatibility (11.96 KB, patch)
2015-12-17 15:57 UTC, Peter Rustler
none Details | Review

Description Peter Rustler 2015-12-08 12:27:21 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.
Comment 1 Peter Rustler 2015-12-08 15:11:49 UTC
Created attachment 316942 [details] [review]
Add support for new webkit version 4.0 to build system
Comment 2 Peter Rustler 2015-12-08 15:12:33 UTC
Created attachment 316943 [details] [review]
Add support for gjs signal connections
Comment 3 Peter Rustler 2015-12-08 15:13:08 UTC
Created attachment 316944 [details] [review]
Add support for NULL value in init function
Comment 4 Peter Rustler 2015-12-08 15:13:41 UTC
Created attachment 316945 [details] [review]
Add missing log and logError functions to global object
Comment 5 Peter Rustler 2015-12-08 15:14:24 UTC
Created attachment 316946 [details] [review]
Made GLib variable in seed.js scoped
Comment 6 Peter Rustler 2015-12-08 15:14:56 UTC
Created attachment 316947 [details] [review]
Add support for the global ARGV object
Comment 7 Alan Knowles 2015-12-09 03:10:56 UTC
all committed,

Thanks
Alan
Comment 8 Peter Rustler 2015-12-09 12:55:51 UTC
Thanks for reviewing and committing my patches.

I will now reopen this ticket to provide another patch.
Comment 9 Peter Rustler 2015-12-09 12:57:43 UTC
Created attachment 317020 [details] [review]
Made named constuctors compatible with gjs
Comment 10 Peter Rustler 2015-12-09 13:08:17 UTC
Created attachment 317022 [details] [review]
Made named constuctors compatible with gjs
Comment 11 Alan Knowles 2015-12-11 03:24:28 UTC
committed - feel free to open again if you need more patches against this issue.

Regards
Alan
Comment 12 Peter Rustler 2015-12-11 10:01:48 UTC
Thanks
Comment 13 Peter Rustler 2015-12-17 15:40:51 UTC
Created attachment 317578 [details] [review]
Add gjs compatibility layer to seed
Comment 14 Peter Rustler 2015-12-17 15:41:17 UTC
Created attachment 317579 [details] [review]
Add the gjs native module "window" for compatibility
Comment 15 Peter Rustler 2015-12-17 15:41:59 UTC
Created attachment 317580 [details] [review]
Add the native gjs module dummy "system" for compatibility
Comment 16 Peter Rustler 2015-12-17 15:47:25 UTC
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.
Comment 17 Peter Rustler 2015-12-17 15:57:47 UTC
Created attachment 317581 [details] [review]
Add the native gjs module dummy "system" for compatibility

Sorry missed a bit.
Comment 18 Peter Rustler 2015-12-17 16:40:19 UTC
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
Comment 19 Alan Knowles 2015-12-21 02:49:36 UTC
All committed - interesting to see a bytearray implementation in there.. wonder if it works....