diff options
| author | Jan Tojnar <jtojnar@gmail.com> | 2023-11-27 14:38:15 +0100 |
|---|---|---|
| committer | Jan Tojnar <jtojnar@gmail.com> | 2023-11-27 14:42:29 +0100 |
| commit | af9e3ddc1da4c96d35b326d20ba09cedb1a5ac3b (patch) | |
| tree | 0de9bbd12d9bc9231aed1d37ac5cd8618d22047d /pkgs/development/python-modules/rangehttpserver | |
| parent | 5a09cb4b393d58f9ed0d9ca1555016a8543c2ac8 (diff) | |
gnome.gpaste: Fix typelib path modification
- GPaste 45 switched to ES6 modules.
- Imports in an ES6 module are resolved before the statements in the module body are evaluated.
- If we want our typelib path modification to take effect, we need to do it before the typelibs are imported.
One option is delaying further imports with a top-level await of dynamic import.
I did that in 33cb22179266ae5d6c6b63e3bcb2606a5a9acc7d
But forgot to do it in `extension.js`, causing the extensions to sometimes fail to start:
JS ERROR: Extension GPaste@gnome-shell-extensions.gnome.org: Error: Requiring GPaste, version 2: Typelib file for namespace 'GPaste', version '2' not found
require@resource:///org/gnome/gjs/modules/esm/gi.js:16:28
@gi://GPaste?version=2:3:25
@resource:///org/gnome/shell/ui/init.js:21:20
Not sure how it can sometimes work.
I could apply the transformation to `extension.js` as well
but there are multiple imports in the file so it would be pretty annoying
since any import that transitively imports typelibs would need to be converted.
Since gjs currently appears to load imports synchronously
and module bodies are executed when all imports are resolved (post-order),
we can instead just create a separate module and import it first.
Diffstat (limited to 'pkgs/development/python-modules/rangehttpserver')
0 files changed, 0 insertions, 0 deletions
