GNOME Bugzilla – Bug 691409
E4X is deprecated (and completely removed as of FF18).
Last modified: 2013-11-03 23:08:35 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.
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']] }], });
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.
(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.
(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.
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>');
(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?
Well, besides combining all arguments with '\n' for a multiline string hack.
(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?
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.
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).
(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...
(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...
Created attachment 258060 [details] [review] Remove support for E4X E4X is no longer available in js24.
Created attachment 258061 [details] [review] Stringify the xml definitions for E4X removal
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 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
Created attachment 258064 [details] [review] Remove support for E4X Correct the stringification of the interface in GDBus test
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.
Created attachment 258066 [details] [review] Stringify the xml definitions for E4X removal
Created attachment 258067 [details] [review] Stringify the xml definitions for E4X removal
Created attachment 258068 [details] [review] Stringify the xml definitions for E4X removal
Created attachment 258069 [details] [review] Stringify the xml definitions for E4X removal
Created attachment 258070 [details] [review] Stringify the xml definitions for E4X removal
Created attachment 258071 [details] [review] Stringify the xml definitions for E4X removal
ACK on all of these.
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 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 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 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 on attachment 258064 [details] [review] Remove support for E4X Attachment 258064 [details] pushed as 8a9d233 - Remove support for E4X
telepathy-glib patch filed at https://bugs.freedesktop.org/show_bug.cgi?id=70852
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!