dbusServices: Port to ESM
We want to replace gjs' custom (and now legacy) imports system with standard EcmaScript modules: JS developers are already familiar with them, they have better tooling support and using standard features over non-standard ones is generally the right thing to do. Our D-Bus services are separate from the main process, and thus can be ported separately (except for the few imports that are shared with the main process' code base). Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2786>
This commit is contained in:
@ -1,16 +1,12 @@
|
||||
/* exported main */
|
||||
|
||||
imports.gi.versions.Adw = '1';
|
||||
imports.gi.versions.Gdk = '4.0';
|
||||
imports.gi.versions.Gtk = '4.0';
|
||||
|
||||
const { Adw, GObject } = imports.gi;
|
||||
import Adw from 'gi://Adw?version=1';
|
||||
import GObject from 'gi://GObject';
|
||||
const pkg = imports.package;
|
||||
|
||||
const { DBusService } = imports.dbusService;
|
||||
const { ExtensionsService } = imports.extensionsService;
|
||||
import {DBusService} from './dbusService.js';
|
||||
import {ExtensionsService} from './extensionsService.js';
|
||||
|
||||
function main() {
|
||||
/** @returns {void} */
|
||||
export async function main() {
|
||||
Adw.init();
|
||||
pkg.initFormat();
|
||||
|
||||
@ -19,5 +15,5 @@ function main() {
|
||||
const service = new DBusService(
|
||||
'org.gnome.Shell.Extensions',
|
||||
new ExtensionsService());
|
||||
service.run();
|
||||
await service.runAsync();
|
||||
}
|
||||
|
Reference in New Issue
Block a user