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

Migrate Jest website to Docusaurus v2 #11021

Merged
merged 142 commits into from Feb 12, 2021

Conversation

slorber
Copy link
Contributor

@slorber slorber commented Jan 20, 2021

Summary

Migrate Jest to Docusaurus v2, including i18n support

More infos about this migration here:
jest-website-migration#2

Urls and Redirects

Older URLs should work fine for the default en and alternate ja locales:

https://jestjs.netlify.app/en/
https://jestjs.netlify.app/ja/
https://jestjs.netlify.app/en/help
https://jestjs.netlify.app/ja/help
https://jestjs.netlify.app/docs/en/getting-started
https://jestjs.netlify.app/docs/ja/getting-started
https://jestjs.netlify.app/docs/en/api
https://jestjs.netlify.app/docs/ja/api
https://jestjs.netlify.app/blog
https://jestjs.netlify.app/blog/2020/05/05/jest-26

Note: .html extension is redirected to non-html extension too

i18n

The i18n translations should be done on a new Crowdin project: https://crowdin.com/project/jest-v2

Older Crowdin project can be archived/ignored: https://crowdin.com/project/jest

Note: unlike v1, the blog posts can now be translated

PWA

Installed PWA support for those who want a Jest app:

image

Test plan

Deploy preview: https://jestjs.netlify.app/

The preview is triggered from the fork as I need to access a sensitive Crowdin environment variable to deploy the translated sites, and as an external Jest contributor that env variable would be stripped by CI.

@slorber
Copy link
Contributor Author

slorber commented Jan 27, 2021

@RDIL @SimenB we don't force anyone to create versioned docs, if you feel versioning only major versions is simpler to manage, then just do that 👍

See for example react-navigation: https://reactnavigation.org/

Is Jest 26.6 significantly different from Jest 26.5 and it needs a docs version? I can't answer that question for you :)

website/package.json Outdated Show resolved Hide resolved
website/package.json Outdated Show resolved Hide resolved
@SimenB SimenB changed the base branch from master to jest-website-v2 February 9, 2021 09:07
@SimenB
Copy link
Member

SimenB commented Feb 9, 2021

Is Jest 26.6 significantly different from Jest 26.5 and it needs a docs version? I can't answer that question for you :)

There are APIs in .6 that doesn't exist in .5. With docusaurus v1, that means a single file (https://github.com/facebook/jest/tree/ca479ff2ac03bb9a47d5000bfe8c3b747d850c30/website/versioned_docs/version-26.6) as the only diff is a new config option. The "need a doc version" is not really a problem as it's a single file and an update to a json file (both of which is done automatically via docusaurus-version 26.6 or whatever), so it's essentially free from a source code perspective.

Docusaurus v2 approach makes that less feasible though as we need to check in every file. I guess we can start adding "Added in 26.6" here and there in the docs rather then rolling new doc versions. We did that before introducing versioning.

That said, I'd prefer this PR to land with consolidated 26.x versions rather than keeping all the minors we currently have. We consolidate on every new major anyways, and I think it's easier to just consolidate now rather than having a bunch of minors around for a short time that are hard to manage

@RDIL
Copy link

RDIL commented Feb 9, 2021

That's actually a really good idea for a plugin, single file versioned docs.

slorber and others added 2 commits February 10, 2021 17:51
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
@codecov-io
Copy link

Codecov Report

Merging #11021 (fd34cd0) into jest-website-v2 (ca479ff) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           jest-website-v2   #11021      +/-   ##
===================================================
- Coverage            64.23%   64.22%   -0.02%     
===================================================
  Files                  305      305              
  Lines                13255    13254       -1     
  Branches              3235     3234       -1     
===================================================
- Hits                  8515     8512       -3     
- Misses                4049     4050       +1     
- Partials               691      692       +1     
Impacted Files Coverage Δ
packages/expect/src/utils.ts 94.83% <0.00%> (-1.30%) ⬇️
packages/expect/src/jasmineUtils.ts 92.10% <0.00%> (-0.07%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca479ff...fd34cd0. Read the comment docs.

@slorber
Copy link
Contributor Author

slorber commented Feb 12, 2021

As we agreed on, I created the consolidated 26.x version

@slorber slorber marked this pull request as ready for review February 12, 2021 13:52
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

website/README.md is failing lint, beyond that I think we're good to go with landing this 👍

@SimenB SimenB merged commit 2fd0ce1 into jestjs:jest-website-v2 Feb 12, 2021
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants