XUL vs React

109 views
Skip to first unread message

maie...@gmail.com

unread,
Apr 22, 2019, 9:14:09 PM4/22/19
to zotero-dev
I have finally managed to put together a working prototype of a plugin. The plugin fulfills its basic purpose, i.e. looking up locations in our library catalog, saving the results and addingg tags based on the results. But it is still far from perfect, and the experience is rather raw, there are no such things as progress windows, you can't customize tags, and so on...

Now, just like most (all?) other plugins the plugin is based on the XUL technology, but my knowledge is too limited for adding features like those mentioned. Would it be a good idea to learn XUL for this? If my understanding is correct this infrastructure will become obsolete when Zotero will finally move to Electron, and that some parts of the code base are already in the process of being refactored using ReactJS. So I should perhaps better invest my time in learning Electron or ReactJS...? Is this something I could already use now or will I have to wait for when Zotero makes the move to Electron?


Dan Stillman

unread,
Apr 22, 2019, 9:31:22 PM4/22/19
to zoter...@googlegroups.com
I would strongly recommend against doing anything new in XUL.

As you say, React is already in use in Zotero — the tag selector in
production is built using React, and a React collection tree is almost
ready. These use standard React/HTML. As long as you limit your
dependencies, Electron isn't a dependency here.

The main catch is that we don't yet have React versions of some of the
core UI building blocks, but you can rely on built-in functions for some
things, like progress windows:

https://github.com/zotero/zotero/blob/a0be2da42c2901483858a19439ccb983f70027ec/chrome/content/zotero/xpcom/attachments.js#L1142-L1152

(That currently requires bundled localized strings, but we can change that.)

Denis Maier

unread,
Apr 22, 2019, 9:50:51 PM4/22/19
to zoter...@googlegroups.com
Ok. So it'll be React. What about adding a a new Hello World example plugin to the docs?

--
You received this message because you are subscribed to a topic in the Google Groups "zotero-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zotero-dev/xYC0I8JaUAI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zotero-dev+...@googlegroups.com.
To post to this group, send email to zoter...@googlegroups.com.
Visit this group at https://groups.google.com/group/zotero-dev.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages