Skip to content

[RFC] Generate generate and expose import files for gnome-shell

Marco Trevisan requested to merge 3v1n0/gnome-shell:more-explicit-imports into main

As per the ESM switch importing from shell (especially from extensions) may be very verbose.

This could be improved when using import-maps but ESM allow to do this even before, by just generating files that are only meant to expose imported paths.

So, now we expose as resource:///org/gnome/shell/imports all the js files that contain all the sub-files.

So that is possible to use

  import { Foo, Bar } from 'resource:///org/gnome/shell/imports/ui.js'
  import { Baz } from 'resource:///org/gnome/shell/imports/misc.js'

This should make porting extensions easier, but also would make the shell imports less verbose, without the need to define from what file a namespace has to be imported from.

Edited by Marco Trevisan

Merge request reports