GNOME 45 Release: Compatibility Issues with Add-ons
In the user environment GNOME 45, set to be released on September 25, significant changes have been made regarding the organization of loading modules in additions to Gnome Shell. These changes will result in a violation of reverse compatibility, requiring adjustments to the existing add-ons. As a result, add-ons developed for previous versions of GNOME will not be compatible with the upcoming GNOME 45 release, and add-ons adapted for GNOME 45 will not be installable in previous GNOME versions. To ensure compatibility across different GNOME releases, add-ons developers will need to create two separate versions of their additions – one for GNOME 45 and subsequent releases, and another for older GNOME versions. These additions should be loaded through extensions.gnom.org.
This compatibility violation is a direct consequence of Gnome Shell transitioning from its custom import system of modules, specific to JavaScript Runtime gjs, to the standard import mechanism using JavaScript modules (ESM) as defined in the ECMAScript 6 specification. This transition aligns with the import mechanism commonly used in web applications. The main difference lies in the way JavaScript modules and gobjects were connected in GNOME Shell add-ons. Previously, the IMPORTS object was used, whereas now, the Import operator is utilized. For example: “Import Glib from ‘Gi: // Glib’;” is now “Import * As Main from Resource: /org/Gnome/Shell/ui/main.js’;” and “Import Soup from ‘Gi: // Soup 45.html’>”. In order to cope with these changes, developers will need to modify the code related to library downloads and ensure the presence of Enable(), Disable(), and Disable() in the Default class. Additionally, when using Prefs.js to determine the extension preferences, developers must use the subclapreferenceswindow subclass. The revised version of each add-on must be linked to the new Gnome Shell releases using the “Shell-Version” parameter defined as [“45”] in Metadata.json. For earlier GNOME versions before release 45, separate add-on options can be created, ensuring they are bound to the specific old versions through the shall-version in metadata.json. To test the modified additions, developers can use the assemblies provided by GNOME OS, which are accessible here.