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 691409 - E4X is deprecated (and completely removed as of FF18).
E4X is deprecated (and completely removed as of FF18).
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
1.35.x
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2013-01-09 12:53 UTC by darkxst
Modified: 2013-11-03 23:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove support for E4X (7.00 KB, patch)
2013-10-24 21:56 UTC, darkxst
accepted-commit_after_freeze Details | Review
Stringify the xml definitions for E4X removal (60.94 KB, patch)
2013-10-24 21:57 UTC, darkxst
committed Details | Review
Remove support for E4X (6.74 KB, patch)
2013-10-24 22:47 UTC, darkxst
committed Details | Review
Stringify the xml definitions for E4X removal (4.02 KB, patch)
2013-10-24 23:49 UTC, darkxst
committed Details | Review
Stringify the xml definitions for E4X removal (1.38 KB, patch)
2013-10-24 23:51 UTC, darkxst
committed Details | Review
Stringify the xml definitions for E4X removal (2.75 KB, patch)
2013-10-24 23:54 UTC, darkxst
committed Details | Review
Stringify the xml definitions for E4X removal (1.68 KB, patch)
2013-10-24 23:56 UTC, darkxst
none Details | Review
Stringify the xml definitions for E4X removal (1.13 KB, patch)
2013-10-24 23:57 UTC, darkxst
committed Details | Review
Stringify the xml definitions for E4X removal (2.09 KB, patch)
2013-10-25 00:06 UTC, darkxst
committed Details | Review

Description darkxst 2013-01-09 12:53:54 UTC
E4x is currently used in the Gio overrides, however this has been deprecated in Spidermonkey 17ESR (and is disabled by default). It is also completely removed as of FF18. 

Obviously we can't depend on E4X going forward so at some point need to remove the dependency on it.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-01-09 14:40:39 UTC
I think the best solution is to generate an XML node description from JSON:

const Iface = Gio.DBusInterfaceInfo.new_for_json({
  name: 'Foo',
  methods: [{ name: 'Blah',
              signature: [['values', a{sv}'], ['flags', 'u']],
              returns: [['success', 'b'], ['flags', 'u']] }],
});
Comment 2 Giovanni Campagna 2013-01-09 16:36:32 UTC
What about just turning the XML into a string?
GDBusInterfaceInfo cannot be constructed from JS, we need a GjsPrivate helpers or to build the XML representation, and I don't like either way.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-01-09 16:52:47 UTC
(In reply to comment #2)
> What about just turning the XML into a string?

Not the biggest fan. Syntax highlighting doesn't work.

> GDBusInterfaceInfo cannot be constructed from JS

I don't see the problem in having JS helpers.
Comment 4 Giovanni Campagna 2013-01-09 17:04:15 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > What about just turning the XML into a string?
> 
> Not the biggest fan. Syntax highlighting doesn't work.

Neither it does with E4X: editors attempt to highlight that as JS.

> > GDBusInterfaceInfo cannot be constructed from JS
> 
> I don't see the problem in having JS helpers.

They would be C helpers, and they would either consist of a native module traversing the JSON representation (ugh), or a full "builder" API.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-01-09 17:22:10 UTC
After a discussion with Colin and Owen, we decided that stringifying the XML interface description was probably for the best. So, one idea I had:

const Interface = Gio.DBusInterfaceNode.new_for_xml(
'<interface name="foo">',
'  <method name="blah" />',
'</interface>');
Comment 6 Giovanni Campagna 2013-01-09 17:56:41 UTC
(In reply to comment #5)
> After a discussion with Colin and Owen, we decided that stringifying the XML
> interface description was probably for the best. So, one idea I had:
> 
> const Interface = Gio.DBusInterfaceNode.new_for_xml(
> '<interface name="foo">',
> '  <method name="blah" />',
> '</interface>');

Which is already implemented (Gio.DBusInterfaceInfo.new_for_xml), and implicitly done by makeProxyWrapper and wrapJSObj (as well as the GDBus2 bindings, if we ever land those). So, this one is notabug, right?
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-01-09 18:26:27 UTC
Well, besides combining all arguments with '\n' for a multiline string hack.
Comment 8 Giovanni Campagna 2013-01-09 18:34:55 UTC
(In reply to comment #7)
> Well, besides combining all arguments with '\n' for a multiline string hack.

Oh, I hadn't noticed that. Yes, this is indeed a big hack.
JS has C-style line continuations, can't we use those?
Comment 9 Jasper St. Pierre (not reading bugmail) 2013-01-09 18:42:27 UTC
I'm not the biggest fan of them, and they're non-standard (might confuse syntax tools / emacs). The ES.next thing to solve this are quasiliterals ( http://wiki.ecmascript.org/doku.php?id=harmony:quasis ), but those don't exist yet.

But it's certainly better than:

const DECLARATIONS = \
'void main(void) {\n' + \
'...\n' + \
'}';

So sure.
Comment 10 Giovanni Campagna 2013-01-09 18:47:37 UTC
FWIW, emacs handles them just fine, but if that is really a concern, maybe the JSON idea with a private builder API is the cleanest one. What I wanted to avoid was having to rewrite every single interface snippet out there (as compared to adding quotes and continuations).
Comment 11 Colin Walters 2013-01-09 18:47:49 UTC
(In reply to comment #9)
> I'm not the biggest fan of them, and they're non-standard [...]
> But it's certainly better than:

Hah so we're replacing non-standard E4X with a different non-standard literals? =)  Hopefully the string literals won't go away anytime soon...
Comment 12 Giovanni Campagna 2013-01-09 18:53:27 UTC
(In reply to comment #11)
> (In reply to comment #9)
> > I'm not the biggest fan of them, and they're non-standard [...]
> > But it's certainly better than:
> 
> Hah so we're replacing non-standard E4X with a different non-standard literals?
> =)  Hopefully the string literals won't go away anytime soon...

E4X was implemented only by Firefox (and in browsers there are better alternatives), so nothing actually uses it, while line continuations are supported by all major browsers, and there are huge compatibility concerns in removing them.
I wonder why they don't standardize them...
Comment 13 darkxst 2013-10-24 21:56:40 UTC
Created attachment 258060 [details] [review]
Remove support for E4X

E4X is no longer available in js24.
Comment 14 darkxst 2013-10-24 21:57:51 UTC
Created attachment 258061 [details] [review]
Stringify the xml definitions for E4X removal
Comment 15 Colin Walters 2013-10-24 21:59:40 UTC
Review of attachment 258060 [details] [review]:

Okay, but this patch is going to need dependencies for the users.  gnome-shell is a big one.
Comment 16 darkxst 2013-10-24 22:08:35 UTC
Comment on attachment 258061 [details] [review]
Stringify the xml definitions for E4X removal

Attachment 258061 [details] pushed as b908a3d - Stringify the xml definitions for E4X removal
Comment 17 darkxst 2013-10-24 22:47:28 UTC
Created attachment 258064 [details] [review]
Remove support for E4X

Correct the stringification of the interface in GDBus test
Comment 18 Jasper St. Pierre (not reading bugmail) 2013-10-24 22:56:18 UTC
Review of attachment 258064 [details] [review]:

Yep.

You also need to fix gnome-documents and sushi, at least. Maybe Polari too? See if you can use some package magic to see what requires gjs on your system.
Comment 19 darkxst 2013-10-24 23:49:15 UTC
Created attachment 258066 [details] [review]
Stringify the xml definitions for E4X removal
Comment 20 darkxst 2013-10-24 23:51:26 UTC
Created attachment 258067 [details] [review]
Stringify the xml definitions for E4X removal
Comment 21 darkxst 2013-10-24 23:54:09 UTC
Created attachment 258068 [details] [review]
Stringify the xml definitions for E4X removal
Comment 22 darkxst 2013-10-24 23:56:01 UTC
Created attachment 258069 [details] [review]
Stringify the xml definitions for E4X removal
Comment 23 darkxst 2013-10-24 23:57:33 UTC
Created attachment 258070 [details] [review]
Stringify the xml definitions for E4X removal
Comment 24 darkxst 2013-10-25 00:06:38 UTC
Created attachment 258071 [details] [review]
Stringify the xml definitions for E4X removal
Comment 25 Jasper St. Pierre (not reading bugmail) 2013-10-25 00:20:30 UTC
ACK on all of these.
Comment 26 darkxst 2013-10-25 00:33:28 UTC
Comment on attachment 258066 [details] [review]
Stringify the xml definitions for E4X removal

Attachment 258066 [details] pushed as 8ceac49 - Stringify the xml definitions for E4X removal
Comment 27 darkxst 2013-10-25 00:34:20 UTC
Comment on attachment 258067 [details] [review]
Stringify the xml definitions for E4X removal

Attachment 258067 [details] pushed as 1902999 - Stringify the xml definitions for E4X removal
Comment 28 darkxst 2013-10-25 00:35:41 UTC
Comment on attachment 258068 [details] [review]
Stringify the xml definitions for E4X removal

Attachment 258068 [details] pushed as fb80658 - Stringify the xml definitions for E4X removal
Comment 29 darkxst 2013-10-25 00:38:11 UTC
Comment on attachment 258070 [details] [review]
Stringify the xml definitions for E4X removal

Attachment 258070 [details] pushed as e737521 - Stringify the xml definitions for E4X removal
Comment 30 darkxst 2013-10-25 00:38:56 UTC
Comment on attachment 258064 [details] [review]
Remove support for E4X

Attachment 258064 [details] pushed as 8a9d233 - Remove support for E4X
Comment 31 darkxst 2013-10-25 00:57:40 UTC
telepathy-glib patch filed at
https://bugs.freedesktop.org/show_bug.cgi?id=70852
Comment 32 Colin Walters 2013-11-03 23:08:35 UTC
The gnome-documents commit needed this on top:

https://git.gnome.org/browse/gnome-documents/commit/?id=636b7191038e59259f37e6da38984e408a54c2c4

Be careful about this with future commits!