Repository navigation
VCS API feedback
#11909
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
In Docusaurus v3.10, we introduced a new experimental VCS API to integrate Docusaurus with Version Control Systems.
Historically, Docusaurus only integrates with Git, and the implementation was previously hardcoded.
Our official Docusaurus plugins are now using this new API to implement features such as:
<lastmod>value in the sitemap pluginThis new API makes it possible to integrate Docusaurus with other VCS, such as SVN, Mercurial, a CMS, or any other external system.
Here's an example implementation using hardcoded data:
You can also take a look at the original PR, which highlights 2 distinct ways to integrate with a VCS: #11512
For example, you could implement an "svn-ad-hoc" strategy. It's simply but might overflow your system with one CLI call per file and might not scale well:
Or implement an "svn-eager" strategy, which reads the whole VCS log ahead of time and cache it for further plugin usage:
In our experience, the 2nd strategy (eagerly reading the whole VCS log) performs much better for large repositories.
This is also why we implemented a new
git-eagerstrategy that we plan to enable by default in Docusaurus v4.Community feedback wanted
Although the API works for our official plugins and Git, we'd like the community to share feedback on how this works for other Version Control Systems and third-party plugins:
We'll handle the feedback we receive and adjust the API design accordingly before marking this API as stable.
Until this is officially stable, it might be better for open-source plugin authors not to leverage this new API.
Thanks 👋
All reactions