Skip to content
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

refactor(v2): clarify versions page #3577

Merged
merged 2 commits into from
Oct 12, 2020
Merged

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Oct 12, 2020

Motivation

Resolves #3572

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Preview

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@lex111 lex111 added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Oct 12, 2020
@lex111 lex111 requested a review from slorber as a code owner October 12, 2020 15:14
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 12, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Oct 12, 2020

Deploy preview for docusaurus-2 ready!

Built with commit 84aa3c7

https://deploy-preview-3577--docusaurus-2.netlify.app

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

LGTM, but as we deploy the bootstrap theme without any version, the pastVersions array is empty (versioning disabled so that netlify build is not too slow due to multiple builds)

We should rather fallback to "latestVersion", or consider in render that stableVersion may be undefined.

@@ -20,8 +20,9 @@ function Version() {
const pastVersions = versions.filter(
(version) => version !== latestVersion && version.name !== 'current',
);

const stableVersion = pastVersions.shift();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const stableVersion = pastVersions.shift();
const stableVersion = pastVersions.shift() ?? latestVersion;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(just an idea, this wn't lead to a good deploy preview versions page for the bootstrap theme, but probably not a big deal anyway)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution is ok? 84aa3c7

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks even better ;)

@slorber slorber merged commit e5d9cdc into master Oct 12, 2020
@lex111 lex111 deleted the lex111/clarify-versions-page branch October 16, 2020 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stable unreleased alpha with no release notes
4 participants