GIR namespaces Override/Extension system standardisation



Heya everyone,

Working on some namespace extensions for seed. I had a look at the
equivalent facilities in Gjs.

Both of them offer a way to implicitely extend 'native' GIR namespaces
with javascript code at importation time.
This is often used to provide easier and more 'jsesque' APIs over
imported symbols.

Currently those two systems are slightly different requiring some manual
editing to shared code:
- naming: 
	seed: look in an 'extensions' directory 
	(imports.extensions.namespce)
	gjs: calls them 'overrides' 
	(imports.overrides.namespace)

- initialization: 
	seed: an anonymous initialization method is defined and invoked
	*within* the extension js code.
	gjs: an _init method is defined in the override, looked-up and
	invoked in the C importer code.

It'd be great if we could find a common ground and use the same
conventions/mecanism.

Obviously, that wont make overrides/extensions directly copypastable
because of the differences in the language support ('let', multiple
values return... kinda envious here) but would make us much more closer.
More common code could then move to gnome-js-common.

What do you think ?

Happy Coding,
Alexandre




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]