Skip to content

Fix on Gnome 42#1

Merged
nvlgit merged 8 commits intonvlgit:releasefrom
ZimbiX:fix-on-gnome-42
Aug 16, 2022
Merged

Fix on Gnome 42#1
nvlgit merged 8 commits intonvlgit:releasefrom
ZimbiX:fix-on-gnome-42

Conversation

@ZimbiX
Copy link

@ZimbiX ZimbiX commented Apr 10, 2022

Extends from Daniel-Khodabakhsh#20.

The extension wasn't working at all on Gnome 42. This PR resolves that, containing various fixes and also addresses deprecation warnings - see each commit for details.

The errors & warnings were uncovered using journalctl -f /usr/bin/gnome-shell /usr/bin/gjs. It took me a little while to discover the latter filter; once I got the preferences window able to show, the edit buttons didn't do anything and weren't showing a UI error.

It didn't seem like this part of the deprecation warning was actually true:

The property access will work as previously for the time being, but please fix your code anyway.

I realise we're a few fork in at this point, but with this repo being the most progressed, it seemed like the place to make the changes =P

ZimbiX added 8 commits April 10, 2022 21:13
I noticed that a warning & error were shown from `journalctl -f -o cat /usr/bin/gnome-shell`:

```
Some code accessed the property 'Class' on the module 'Settings'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.
JS ERROR: Extension datetime-format@Daniel-Khodabakhsh.github.com: TypeError: extension.imports.Settings.Class is not a constructor
@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/extension.js:10:18
_callExtensionInit@resource:///org/gnome/shell/ui/extensionSystem.js:435:13
loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:360:27
_loadExtensions/<@resource:///org/gnome/shell/ui/extensionSystem.js:611:18
collectFromDatadirs@resource:///org/gnome/shell/misc/fileUtils.js:27:28
_loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:590:19
_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:617:18
_sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:637:14
init@resource:///org/gnome/shell/ui/extensionSystem.js:55:14
_initializeUI@resource:///org/gnome/shell/ui/main.js:288:22
start@resource:///org/gnome/shell/ui/main.js:165:5
@resource:///org/gnome/shell/ui/init.js:6:17
```
Warning:

```
Some code accessed the property 'defaultFormat' on the module 'DateMenuDate'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.
```
```
JS ERROR: TypeError: Object is of type Gtk.Box - cannot convert to GtkWindow
Class/this.showWindow@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/EditWindow.js:111:10
create/<@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/FormatTarget.js:59:14
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:186:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:21:13
run@resource:///org/gnome/gjs/modules/script/package.js:206:19
start@resource:///org/gnome/gjs/modules/script/package.js:190:8
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
Caused by: Error: This JS object wrapper isn't wrapping a GObject. If this is a custom subclass, are you sure you chained up to the parent _init properly?
```
```
JS WARNING: [/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/FormatTarget.js 62]: Too many arguments to method Gtk.Box.append: expected 1, got 4
```
```
Some code accessed the property 'name' on the module 'DateMenuDate'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.
Some code accessed the property 'name' on the module 'DateMenuDay'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.
Some code accessed the property 'name' on the module 'StatusBar'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.
```
```
Some code called array.toString() on a Uint8Array instance. Previously this would have interpreted the bytes of the array as a string, but that is nonstandard. In the future this will return the bytes as comma-separated digits. For the time being, the old behavior has been preserved, but please fix your code anyway to explicitly call ByteArray.toString(array).
(Note that array.toString() may have been called implicitly.)
0 readFile() ["/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/prefs.js":86:8]
1 buildPrefsWidget() ["/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/prefs.js":102:27]
2 _init() ["resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js":32:43]
3 ExtensionPrefsDialog() ["resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js":10:3]
4 OpenExtensionPrefsAsync/<() ["resource:///org/gnome/Shell/Extensions/js/extensionsService.js":129:32]
5 asyncCallback() ["resource:///org/gnome/gjs/modules/core/overrides/Gio.js":115:21]
6 run() ["resource:///org/gnome/Shell/Extensions/js/dbusService.js":186:19]
7 main() ["resource:///org/gnome/Shell/Extensions/js/main.js":21:12]
8 run() ["resource:///org/gnome/gjs/modules/script/package.js":206:18]
9 start() ["resource:///org/gnome/gjs/modules/script/package.js":190:7]
10 <TOP LEVEL> ["/usr/share/gnome-shell/org.gnome.Shell.Extensions":1:16]
```

https://github.com/GNOME/gjs/blob/master/doc/ByteArray.md
```
Some code accessed the property 'create' on the module 'FormatTarget'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.
JS ERROR: Failed to open preferences: TypeError: extension.imports.FormatTarget.create is not a function
buildPrefsWidget/<@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/prefs.js:142:107
buildPrefsWidget@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/prefs.js:142:50
_init@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:32:44
ExtensionPrefsDialog@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:10:4
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:129:33
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:115:22
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:186:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:21:13
run@resource:///org/gnome/gjs/modules/script/package.js:206:19
start@resource:///org/gnome/gjs/modules/script/package.js:190:8
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
JS ERROR: TypeError: prefsWindow is null
buildPrefsWidget/<@/home/brendan/.local/share/gnome-shell/extensions/datetime-format@Daniel-Khodabakhsh.github.com/prefs.js:109:3
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:186:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:21:13
run@resource:///org/gnome/gjs/modules/script/package.js:206:19
start@resource:///org/gnome/gjs/modules/script/package.js:190:8
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
```
@nvlgit nvlgit merged commit 4d20eba into nvlgit:release Aug 16, 2022
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

Successfully merging this pull request may close these issues.

2 participants