developer-docs icon indicating copy to clipboard operation
developer-docs copied to clipboard

Update example to use *.sys.mjs file

Open jobisoft opened this issue 1 year ago • 4 comments

Found this while fixing some of the broken links, which are due to ESMIfication.

jobisoft avatar Sep 17 '24 14:09 jobisoft

I know that *sys.mjs files are what many *.jsm files have been converted to so that seems like a modern change that makes sense.

I am not well versed in javascript though. Did you test out this snippet somehow? I copy pasted it into the error console.. does this look right? image

hellsworth avatar Sep 17 '24 15:09 hellsworth

I know that *sys.mjs files are what many *.jsm files have been converted to so that seems like a modern change that makes sense.

I am not well versed in javascript though. Did you test out this snippet somehow? I copy pasted it into the error console.. does this look right? image

That is exactly how I verified that code. The result looks correct.

jobisoft avatar Sep 17 '24 15:09 jobisoft

hmm. I tested this in the most recent TB nightly. What version did you test / expect some different result?

hellsworth avatar Sep 17 '24 16:09 hellsworth

I tested in TB115 and TB128. Output:

IRC		prpl-irc
XMPP		prpl-jabber
Matrix		prpl-matrix
Odnoklassniki		prpl-odnoklassniki

Neither my new code, nor the old code works in TB102, because the file imServices.jsm does not exist, it was renamed from TB91 to TB102 from imServices.jsm to IMServices.jsm. The old code does work in TB91. Output:

IRC		prpl-irc
XMPP		prpl-jabber
Odnoklassniki		prpl-odnoklassniki

So the new code in TB115/128 has similar output to the original code in TB91 (matrix was added after TB91). This looks all good to me.

jobisoft avatar Sep 17 '24 16:09 jobisoft

Thanks again!

hellsworth avatar Nov 06 '24 18:11 hellsworth