Thunderbird de-xbl effort finished!

Magnus Melin mkmelin+mozilla at iki.fi
Mon Sep 23 11:41:41 UTC 2019


It's just JavaScript, so whatever you normally use to make it available. 
Or even put it there in the same file.

However, usually what you want to do is to use 
customElements.define("launch-picker", MozLaunchPicker); after the 
definition. Then you can use <launch-picker> in markup. Or create it in 
JavaScript through document.createElement("launch-picker"). Or get the 
class by customElements.get("launch-picker");

  -Magnus

On 23-09-2019 14:29, Axel Grude wrote:
>
> Dear Magnus,
>
> just tried the converter - good work!
>
> If I have a new class implementation extending an action target, such as:
>
> class MozLaunchPicker extends MozRuleactiontargetBase {
>    (implementation)
> }
>
> (How) can I connect/export that to my global object. Let's say I have 
> a global object FiltaQuilla in the main Add-on scope. I want to import 
> it as a sub-object wx (*W*ebe*X*tension) like this:
>
> var {FiltaQuilla_wx} = Components.utils.import("chrome://filtaquilla/content/filtaquilla-wx.js");
> FiltaQuilla*.wx*  = FiltaQuilla_wx;
>
> Can I just "attach" the classes like this?
>
> var EXPORTED_SYMBOLS = ['FiltaQuilla_wx'];
> var FiltaQuilla_wx = {};
>
> //  Wrapped in a block to prevent leaking to window scope.
> {
>    class MozLaunchPicker extends MozRuleactiontargetBase {
>      (implementation)
>    }
>
>    FiltaQuilla.wx.launchPicker = MozLaunchPicker;
> }
>
> thanks in advance!
>
> Axel
>
> *Axel Grude <mailto:axel.grude at gmail.com>*
> Music Production and Composition
> Thunderbird Add-ons Developer (QuickFolders 
> <https://addons.thunderbird.net/thunderbird/addon/quickfolders-tabbed-folders/>, 
> quickFilters 
> <https://addons.thunderbird.net/thunderbird/addon/quickfilters/>, 
> QuickPasswords 
> <https://addons.mozilla.org/firefox/addon/quickpasswords/>, Zombie 
> Keys <https://addons.thunderbird.net/thunderbird/addon/zombie-keys/>, 
> SmartTemplate⁴ 
> <https://addons.thunderbird.net/thunderbird/addon/smarttemplate4/>)
> Visit my YouTube Channel <https://www.youtube.com/c/thunderbirddaily> 
> for email productivity tips Get Thunderbird!
>> *Subject:*Re: Thunderbird de-xbl effort finished!
>> *From:*Magnus Melin <mkmelin+mozilla at iki.fi>
>> *To:*<tb-planning at mozilla.org>
>> *Sent: *Thursday, 9/19/2019, 19:10 19:10 IST +0100 [Week 38]
>>
>> For things like that, start out with doing an automatic conversion 
>> using https://bgrins.github.io/xbl-analysis/converter/
>>
>> This will get you maybe 80% of the way. Then you need to do code 
>> adjustments and have the Custom Element classes extend whatever 
>> equivalent Custom Element class replaced the parent binding (if any).
>>
>>  -Magnus
>>
>> On 19-09-2019 15:39, Axel Grude wrote:
>>>
>>> Dear Magnus,
>>>
>>> well done to everyone involved!
>>>
>>> Now it would be fantastic if somebody could assist in migrating 
>>> FiltaQuilla. This extension one has been heavily affected by this 
>>> move. I would see at it's core about 75% of the code needs to be 
>>> rewritten. I have seen a pattern in Thunderbird that uses the 
>>> function MozXULElement.parseXULToFragment in order to overload / 
>>> inject xml, but I am not very sure what is happening at all, and 
>>> whether this is "ninja style" programming or the official way of 
>>> replacing xbl in order to create (sometimes customized) controls in 
>>> the filter conditions / actions dropdowns.
>>>
>>> If anyone is interested in helping, I made a new source tree at:
>>>
>>> https://github.com/RealRaven2000/FiltaQuilla/tree/thunderbird68
>>>
>>> the basic idea is removing bindings.xml 
>>> <https://github.com/RealRaven2000/FiltaQuilla/blob/thunderbird68/content/bindings.xml>
>>>
>>> and put the xml code into filtaquilla-wx.js 
>>> <https://github.com/RealRaven2000/FiltaQuilla/blob/thunderbird68/content/filtaquilla-wx.js> 
>>> instead.
>>>
>>> thanks,
>>>   Axel
>>>
>>> *Axel Grude <mailto:axel.grude at gmail.com>*
>>> Music Production and Composition
>>> Thunderbird Add-ons Developer (QuickFolders 
>>> <https://addons.thunderbird.net/thunderbird/addon/quickfolders-tabbed-folders/>, 
>>> quickFilters 
>>> <https://addons.thunderbird.net/thunderbird/addon/quickfilters/>, 
>>> QuickPasswords 
>>> <https://addons.mozilla.org/firefox/addon/quickpasswords/>, Zombie 
>>> Keys 
>>> <https://addons.thunderbird.net/thunderbird/addon/zombie-keys/>, 
>>> SmartTemplate⁴ 
>>> <https://addons.thunderbird.net/thunderbird/addon/smarttemplate4/>)
>>> Visit my YouTube Channel 
>>> <https://www.youtube.com/c/thunderbirddaily> for email productivity 
>>> tips Get Thunderbird!
>>>> *Subject:*Thunderbird de-xbl effort finished!
>>>> *From:*Magnus Melin <mkmelin+mozilla at iki.fi>
>>>> *To:*Thunderbird Planning <tb-planning at mozilla.org>
>>>> *Sent: *Thursday, 9/19/2019, 10:04 10:04 GMT DT +0100 [Week 38]
>>>>
>>>> As you may know, for the past year the Thunderbird team has put a 
>>>> lot of work into migrating away from the Mozilla proprietary XBL 
>>>> technology, and as of today, I'm happy to announce we're now XBL free!
>>>>
>>>> Thanks, and congrats to everybody who participated in this effort! 
>>>> Especially Khushil Mistry, Paul Morris, and Alessandro Castellani 
>>>> each converted many bindings. Also a big thanks to the 
>>>> mozilla-central de-XBL team whose background work made this possible.
>>>>
>>>> XBL over time
>>>>
>>>>  -Magnus
>>>>
>>>>
>>>> _______________________________________________
>>>> tb-planning mailing list
>>>> tb-planning at mozilla.org
>>>> https://mail.mozilla.org/listinfo/tb-planning
>>>
>>> _______________________________________________
>>> tb-planning mailing list
>>> tb-planning at mozilla.org
>>> https://mail.mozilla.org/listinfo/tb-planning
>>
>> _______________________________________________
>> tb-planning mailing list
>> tb-planning at mozilla.org
>> https://mail.mozilla.org/listinfo/tb-planning
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20190923/0c16157c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thunderbird_blog2.png
Type: image/png
Size: 846 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20190923/0c16157c/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tb-de-xbl.svg
Type: image/svg+xml
Size: 51156 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20190923/0c16157c/attachment-0001.svg>


More information about the tb-planning mailing list