-
Notifications
You must be signed in to change notification settings - Fork 9
Description
This Issue will document the process of rewriting QuickFolders code to eliminate as much of the internal XPCOM calls that it currently uses by the official API calls instead. While QuickFolders is in the "Mail extension with experimental APIs" stage, APIs cannot be called directly from the current, privileged code. Instead we are going to use John Bieling's notifyTools library to establish a 2-way messaging channel to the background script and execute backend code (asynchronously) through ES6 modules which will live in the API folder as experimental libraries.
This is an important part of the transition to being a pure "mail extension" (without experiment) but also will yuield some other benefits:
- calls will run asynchronously which means that the JavaScript main thread will be less utilized ultimately leading to snappier performance
- dependencies from internal implementation and changes of XPCOM interfaces / global variables will be removed. This will make updating to new Thunderbird versions less risky for Add-on users as the APIs are guaranteed to remain unchanged.
While these are good things we have to also remember that some things are currently (and may never be) possible without using legacy / experimental code:
- there is no plan to implement user generated toolbars. It is not clear whether there will be suitable workaround in pure mail extensions.
- existing toolbar button of Thunderbird Core will not be allowed to modify - instead they will have to be replaced with our own "browser button" implementations which will add a lot of extra work if we need to "wrap" existing UI (such as the template dropdown menus on the write / reply / forward buttons as done in my Add-on SmartTemplates)
- generally it will become harder to change or augment the existing UI of Thunderbird Core
- There are no synchronous calls and only "primitive" data structures can be passed between the layers. So it is not possible to pass down something like a message header, filter or folder completely - instead we will have to write communication wrappers to pack / unpack the desired information, which will lead to a lot more code for the same functionality. I am not currently sure whether the APIs have enough granularity to support all the functions that I use.
We have a conversion meeting with John Bieling and some other Add-on developers this evening and will start one conversion in QF as a pattern to move forward.