Skip to content
  • Colin Walters's avatar
    repo: Warn when importing a namespace with >1 version · 0154c9d5
    Colin Walters authored and Philip Chimento's avatar Philip Chimento committed
    In introspection, libraries are a pair of (namespace, version).  But
    it's possible to request "the latest" version of a namespace, and this
    is in fact what many projects do.
    
    The problem is that for say GTK+ which has 2.0, 3.0, and is just releasing
    4.0, most people's scripts imported gi.Gtk and expected to receive 3.0, and
    will explode when installing 4.0.
    
    Let's start warning about unversioned imports when there are multiple
    versions available, and get people to do:
    
    imports.gi.versions.Gtk = '3.0';
    const Gtk = imports.gi.Gtk;
    
    (Original patch by Colin Walters; revised by Philip Chimento.)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689654
    0154c9d5