You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and obviously we'd still allow users to require the load() function that node-gir currently exports so that they can import specific versions of GI libraries.
Using a Proxy would mean the library would have a minimum NodeJS version of 6.4 (when Proxy was introduced to node). I think this is acceptable as the previous LTS, version 4, is very old now and 6 is the following LTS version. It is likely that node-gir won't work on node versions before 6 anyway due to v8 API breakages. CI currently tests against version 6,8,9.
Thoughts
The text was updated successfully, but these errors were encountered:
constGObject=require('node-gir/GObject');constGtk=require('node-gir/Gtk');// node_modules/node-gir/Gtk.jsconst{ load }=require('./');module.exports=load('Gtk','3.0');// how to support loading different versions?
update: fix typos
update 2: there's one downside, we can't create modules dynamically, so non-defaults like keybinder will be missing unless created manually (is there a registry of all gtk-bindings?)
The GJS GI implementation allows users to access GI libraries like the following:
Similarly, in Python GI libraries are imported using:
In NodeJS we could achieve something similar using an ES6
Proxy
object.this would allow users to import GI libraries in NodeJS using the following:
and obviously we'd still allow users to require the
load()
function thatnode-gir
currently exports so that they can import specific versions of GI libraries.Using a
Proxy
would mean the library would have a minimum NodeJS version of 6.4 (when Proxy was introduced to node). I think this is acceptable as the previous LTS, version 4, is very old now and 6 is the following LTS version. It is likely thatnode-gir
won't work on node versions before 6 anyway due to v8 API breakages. CI currently tests against version 6,8,9.Thoughts
The text was updated successfully, but these errors were encountered: