Seeking Guidance on Customizing Zotero: Understanding Branches and Building

194 views
Skip to first unread message

张志豪

unread,
Jul 24, 2023, 10:41:17 PM7/24/23
to zotero-dev
Hello Zotero dev,

I'm reaching out for assistance as I'm interested in modifying Zotero and I've run into some hurdles. My primary challenge revolves around understanding the source code of Zotero, which I've found on GitHub. I noticed that there are frequent commits on the 'main' branch. Is this the primary development branch?

Following the steps provided on this link: https://www.zotero.org/support/dev/client_coding/building_the_desktop_app_windows_notes, I managed to build the application successfully. However, upon running the program, I encountered several errors that prevented its use. This led me to speculate whether the 'main' branch truly contains the stable version of Zotero's source code.

In an attempt to find a solution, I switched to the '6.0.26-hotfix' branch. Yet, the build process described in the document did not apply, as the 'app' folder, which supposedly houses the scripts, was missing.

Consequently, I am left with a few questions: Which branch holds the stable version of Zotero's source code? How can I effectively set up a development environment? And lastly, what's the correct process to build the application?

I would greatly appreciate any insights or advice on these matters. Thank you in advance for your time and support.

Dan Stillman

unread,
Jul 25, 2023, 6:31:04 AM7/25/23
to zoter...@googlegroups.com
On 7/24/23 9:46 PM, 张志豪 wrote:
Following the steps provided on this link: https://www.zotero.org/support/dev/client_coding/building_the_desktop_app_windows_notes, I managed to build the application successfully. However, upon running the program, I encountered several errors that prevented its use. This led me to speculate whether the 'main' branch truly contains the stable version of Zotero's source code.

'main' is the branch for Zotero 7 and what you should use for any new development.

Pull the latest commits, and if you're still having trouble let us know the actual errors you're getting.

Abe Jellinek

unread,
Jul 25, 2023, 8:17:31 AM7/25/23
to zoter...@googlegroups.com
If the errors were related to missing entities, first open your stable installation of Zotero and change the UI language to English (United States). Then you should be able to run source builds.

On Jul 24, 2023, at 10:41 PM, 张志豪 <zhangzh...@gmail.com> wrote:

Hello Zotero dev,
--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/9b9dbf5d-df16-4729-9c50-a60783328fc5n%40googlegroups.com.

张志豪

unread,
Jul 26, 2023, 2:17:21 AM7/26/23
to zotero-dev

Thank you all for your previous responses. After a day of research, I've decided to proceed with the development using Zotero 6. However, I'm having trouble finding documentation on how to build the entire application from the Zotero 6 source code.

 Could anyone kindly explain how to set up a development environment for Zotero 6, and outline the process for building Zotero 6 (if there is comprehensive documentation available)?

I come from a web development background and am new to this field. Please forgive my beginner questions, and I appreciate your patience and understanding. I am eagerly looking forward to your tutelage. Thank you.

Dan Stillman

unread,
Jul 26, 2023, 2:19:36 AM7/26/23
to zoter...@googlegroups.com
We're only going to help with a Zotero 7 source build at this point. Zotero 6 is no longer under development.

You can look back at the documentation revision history if you want, but I'd strongly suggest just using Zotero 7. And I'm not sure why you're not just telling us the errors you were getting…

Dan Stillman

unread,
Jul 26, 2023, 2:22:24 AM7/26/23
to zoter...@googlegroups.com
(Zotero 7 is also much easier to build than Zotero 6.)

张志豪

unread,
Jul 26, 2023, 3:00:09 AM7/26/23
to zotero-dev
Thank you. I will listen to your suggestion and use the Zotero 7 version. Following the official documentation, I was successful in building the application, yet upon initiating it, I encountered a series of errors on the console. These complications led to some functional deficiencies such as missing menu text and unresponsive buttons, as shown in the attached image. It seems as if there may be some missing components.

Furthermore, I'm quite perplexed by the errors displayed in the console, seemingly related to some environment configuration issues (my system is Windows 10, node.js version 18.12.1).

I apologize, as I previously refrained from reaching out for help with these issues, assuming their simplicity and feeling somewhat embarrassed to ask. In retrospect, I should invest more time in expanding my knowledge in this field.1.png2.png

张志豪

unread,
Jul 26, 2023, 6:56:14 AM7/26/23
to zotero-dev
"I've noticed an error message stating 'Missing chrome or resource URL: resource://zotero/bluebird/promise.js.' It is likely due to the absence of Promise, which prevents the proper loading of the js file, hence the error 'something is not defined.' I will proceed to rectify this issue accordingly."

张志豪

unread,
Jul 26, 2023, 7:36:12 AM7/26/23
to zotero-dev

At last, after marshalling all the resources, the project was successfully launched! Indeed, this appears to be a seemingly naive question; I should probably delve more into it before asking.

Additionally, during development, is it necessary to rebuild after each code modification, waiting for several minutes? Is there a more efficient method for hot updates?

Dan Stillman

unread,
Jul 26, 2023, 7:47:00 AM7/26/23
to zoter...@googlegroups.com
On 7/26/23 7:36 AM, 张志豪 wrote:
> At last, after marshalling all the resources, the project was
> successfully launched! Indeed, this appears to be a seemingly naive
> question; I should probably delve more into it before asking.

To be clear, the Bluebird error isn't something you should've had to
fix. That would just mean there was something wrong with your
node_modules folder, possibly from running `npm install` with an earlier
version of Node. I'd guess that deleting node_modules and running `npm
i` again would've fixed it.

> Additionally, during development, is it necessary to rebuild after
> each code modification, waiting for several minutes? Is there a more
> efficient method for hot updates?

It doesn't take minutes. Running `build_and_run -r` takes ~11 seconds to
rebuild on my computer.

Pass `-b` if you're not doing anything related to styles or translators.

If you're making UI changes, pass `-d` and experiment using the dev
tools first.

We have an update planned to allow hot-reloading of certain changes, but
it's not yet available, and it would only work for certain kinds of
things. In most cases, a restart is necessary.

- Dan

张志豪

unread,
Jul 27, 2023, 11:31:29 PM7/27/23
to zotero-dev

Thank you, Dan, for your ongoing support. I've finally entered the development stage. However, I've made a change to a UI interface, and it took me 8 minutes to build the UI code and another 7 minutes to build the application, totaling 15 minutes. This is far from your 11-second record, perhaps I should consider upgrading my hardware setup.

Dan Stillman

unread,
Jul 27, 2023, 11:32:53 PM7/27/23
to zoter...@googlegroups.com
On 7/27/23 11:31 PM, 张志豪 wrote:
> Thank you, Dan, for your ongoing support. I've finally entered the
> development stage. However, I've made a change to a UI interface, and
> it took me 8 minutes to build the UI code and another 7 minutes to
> build the application, totaling 15 minutes. This is far from your
> 11-second record, perhaps I should consider upgrading my hardware setup.

Something is very wrong if it's taking that long. Could you explain
exactly what you're doing?

张志豪

unread,
Jul 31, 2023, 2:30:51 AM7/31/23
to zotero-dev
I merely tweaked the UI design, then built it to verify its effectiveness. Over this past weekend, I executed the program on my personal computer, which only took a few minutes. There might be an issue with my work computer, it appears I might need to reinstall the operating system.

Dan Stillman

unread,
Jul 31, 2023, 2:58:28 AM7/31/23
to zoter...@googlegroups.com
On 7/31/23 2:30 AM, 张志豪 wrote:
> I merely tweaked the UI design, then built it to verify its
> effectiveness. Over this past weekend, I executed the program on my
> personal computer, which only took a few minutes. There might be an
> issue with my work computer, it appears I might need to reinstall the
> operating system.

Even a few minutes is way too long for an incremental build, though.
After you run `build_and_run -r` once, running it again should take
literally seconds.

The only exception is if you're actually modifying the PDF reader.
Rebuilding the PDF reader might take a few minutes on a slower computer.

(And to be clear, I'm talking about build time, not startup time, which
depends on your library size.)

- Dan

continue dream

unread,
Jul 31, 2023, 11:45:55 PM7/31/23
to zotero-dev
Hi:

I'm also looking for the build method for Zotero 6.

Could you please tell me where to find the documentation revision history that you mentioned?
I cannot see the history of documents on the Zotero Wiki.

Thanks in advance.

Dan Stillman

unread,
Jul 31, 2023, 11:48:39 PM7/31/23
to zoter...@googlegroups.com
On 7/31/23 11:33 PM, continue dream wrote:
I'm also looking for the build method for Zotero 6.
Could you please tell me where to find the documentation revision history that you mentioned?
I cannot see the history of documents on the Zotero Wiki.

Add ?do=revisions to the URL.

Again, though, Zotero 7 is much easier to build, so we strongly recommend just using that.
Reply all
Reply to author
Forward
0 new messages