Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gnome-shell gnome-shell
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2,043
    • Issues 2,043
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 152
    • Merge requests 152
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gnome-shellgnome-shell
  • Merge requests
  • !1499

Port to ESM

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Evan Welsh requested to merge ewlsh/gnome-shell:ewlsh/esm into main Nov 14, 2020
  • Overview 61
  • Commits 8
  • Pipelines 115
  • Changes 207

This MR ports the Shell UI to ESM modules based on the GJS work at gjs/!450 and gjs/!525

Note: DBus services and subprojects (like the Extensions app) will be fully addressed in later MRs.

For the most part this is a 1:1 port between the old and new imports systems, some code must be refactored to work asynchronously:

  • Panel indicator loading (to support dynamically checking if NetworkManager and GnomeBluetooth are available)
  • Extension loading (all JavaScript sources load asynchronously now) - !2364 (merged)

Extensions

Extensions require changes to support modules (if they want to import Shell files they need to be modules)

Import changes

Extensions use resource:// paths to load shell files.

import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';

import * as Main from 'resource:///org/gnome/shell/ui/main.js';

If GJS adds import aliases, we could add something similar to below in a follow up...

import * as PopupMenu from '~/ui/popupMenu.js';

metadata.json Updates

To differentiate from extensions with older formats (all of which will error due to import changes), a "module" key has been added to metadata.json to specify the 43+ entrypoint for each extension.

{
    "module": "extension.js"
}
{
    "module": "extension42.js"
}

This should simplify extensions shipping multiple versions if they choose to do so and prevents old extensions from loading.

Dependencies

!2364 (merged)

Edited Nov 30, 2022 by Evan Welsh
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: ewlsh/esm