Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide system and gettext as ESM #114

Closed
Tracked by #106
naipotato opened this issue Apr 3, 2023 · 3 comments
Closed
Tracked by #106

Provide system and gettext as ESM #114

naipotato opened this issue Apr 3, 2023 · 3 comments

Comments

@naipotato
Copy link

Both system and gettext are currently available to be imported as ECMAScript Modules, I think since GJS supports ESM. It would be nice to be able to import them in such a way using ts-for-gir, since the default GNOME Builder template imports system that way :)

@JumpLink
Copy link
Collaborator

JumpLink commented Apr 4, 2023

I agree, we should support the following as ambient modules:

import gettext from 'gettext';
import system from 'system';

This should also work:

import { exit } from 'system';
import { ngettext as _ } from 'gettext';

Support for ambient modules will come with #106, but system and gettext are not supported at the moment, but I will add them. Are there more such imports?

@CharlieQLe
Copy link
Contributor

Cairo is another one like this, it doesn't use the gi:https:// format as far as I know. However, Cairo does not provide named exports according to the docs.

@JumpLink
Copy link
Collaborator

JumpLink commented May 8, 2023

Added in #106, for cairo I have create a new issue, see #118

@JumpLink JumpLink closed this as completed May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants