Skip to content

Canary versions are treated as older than the latest stable version #11013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
6 of 7 tasks
tats-u opened this issue Mar 20, 2025 · 8 comments
Open
6 of 7 tasks

Canary versions are treated as older than the latest stable version #11013

tats-u opened this issue Mar 20, 2025 · 8 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers

Comments

@tats-u
Copy link
Contributor

tats-u commented Mar 20, 2025

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

In the semver, unstable versions v3.7.0-* is treated as older than v3.7.0.
We must bump the patch version before adding a Canary verssion suffix. e.g. v3.7.1-canary-6264.

Reproducible demo

https://codesandbox.io/p/devbox/angry-antonelli-w9v59m?workspaceId=ws_5geAx947TkSAXN4qahDJMt

Steps to reproduce

  1. Create a project

  2. Upgrade Docusaurus to a Canary version by e.g. the following command:

    yarn upgrade @docusaurus/core@3.7.0-canary-6264 @docusauru/preset-classic@3.7.0-canary-6264 @docusaurus/module-type-aliases@3.7.0-canary-6264 @docusaurus/types@3.7.0-canary-6264
  3. Then run yarn dev

Expected behavior

No upgrade recommendation banner

Actual behavior

------------------------------------------------------------------------------
Update available 3.7.0-canary-6264 → 3.7.0
To upgrade Docusaurus packages with the latest version, run the
following command:
`yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest
@docusaurus/module-type-aliases@latest @docusaurus/types@latest`
------------------------------------------------------------------------------ 

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used: canary version
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Node.js v20.9.0/22
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows / CodeSandbox

Self-service

  • I'd be willing to fix this bug myself.
@tats-u tats-u added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Mar 20, 2025
@slorber
Copy link
Collaborator

slorber commented Mar 20, 2025

Agree we should probably do that.

I've seen React and Next.js bumping to the next minor version instead, it's probably better than a patch.

@tats-u
Copy link
Contributor Author

tats-u commented Mar 20, 2025

Stable versions of React or Next other than x.y.0 are "backport" versions.
I think Docusaurus's stable versions other than x.y.0 today are main.

@slorber
Copy link
Collaborator

slorber commented Mar 20, 2025

I'm not sure I understand what you try to say 🤔

What I want is to be clear that the canary version is not the "upcoming patch" but may contain new features, and eventually breaking changes too.

@tats-u
Copy link
Contributor Author

tats-u commented Mar 20, 2025

In Next.js, x.y.n (n ≠ 0) are independent of the main branch.
Unlike it, the recent Docusaurus 3.5.1–2 and 3.6.1–3 are just commits in the main branch. They're not in independent branch.

@tats-u
Copy link
Contributor Author

tats-u commented Mar 20, 2025

Next has next-15-2, next-15-0, next-14-1, and next-13 branches.
In Next, whether the patch or minor version is bumped depends on whether breaking changes have been introduced.
There are some cases that only patch versions are bumped.

@tats-u
Copy link
Contributor Author

tats-u commented Mar 23, 2025

Since some new features have already been introduced in main since 3.7.0, we can bump the minor version as for now (at least until 3.8.0 is released).

@slorber
Copy link
Collaborator

slorber commented Mar 24, 2025

In Next.js, x.y.n (n ≠ 0) are independent of the main branch. Unlike it, the recent Docusaurus 3.5.1–2 and 3.6.1–3 are just commits in the main branch. They're not in independent branch.

That's true, but we used to have backport branches and got rid of that as it was too time consuming to manage. I don't think the way we organize releases/commit should really impact the canary versioning scheme though.


We don't want to update the canary script every time we merge a new patch/minor/major commit.

Always bumping to the next minor version is not 100% accurate, but is likely a decent choice that would work in most cases, and solves the reported CLI warning.

Even if we have only merged patch commits, that doesn't seem like a big deal. And when merging breaking changes, we can remember to update the script once in a while.

@tats-u
Copy link
Contributor Author

tats-u commented Mar 24, 2025

We may as well try the minor version bumping strategy first as you say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants