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

Upgrading Docusaurus from 2.0.0-beta.4 → 2.4.1 + required fixes #790

Merged
merged 6 commits into from
May 30, 2023

Conversation

symbolpunk
Copy link
Contributor

@symbolpunk symbolpunk commented May 25, 2023

SUMMARY:

  • removes lastVerifiedBy / lastVerifiedDate from our header badges to align with broader Offchain docsets patterns
  • upgrades docusaurus from 2.0.0-beta.42.4.1
  • addresses breaking change RE google analytics
  • replaces Algolia with docusaurus-lunr-search, aligning Prysm's search with other Offchain docsets (local search, no api key needed)
  • resolves new (caused by Docusaurus upgrade) & old MDX & MDX component errors
  • reduces RequestUpdateWidget boilerplate repetition by swizzling the DocItem component (60x -> 1x)
  • removes the link to third-party JWT token generation website

TODOs:

  • determine why our Netlify deploys are using node v12 instead of node v20 (and why the .node-version override isn't working) - clearing deploy cache may fix ✅
  • ensure that the landing page is routed properly in the preview ✅
  • test lunr search ✅

PREVIEW: link

BROKEN BUILD FIX LOG:

  1. Added NODE_VERSION env variable to netlify deploy config w/ value 20
  2. New error indicating docusaurus dependency snafu
  3. Deleted node_modules locally, deleted package-lock.json, npm i, verified "works on my machine"
    • this generated changes to package-lock.json, which fixed it

@symbolpunk symbolpunk marked this pull request as draft May 25, 2023 22:15
@symbolpunk symbolpunk marked this pull request as ready for review May 26, 2023 15:44
const { siteConfig = {} } = useDocusaurusContext();
const isBrowser = useIsBrowser();
const { baseUrl } = siteConfig;
const initAlgolia = (searchDocs, searchIndex, DocSearch) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like several references to algolia but seems to be completely replaced by lunr

Copy link
Collaborator

Choose a reason for hiding this comment

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

it looks like the creator of the lunr-search plugin forked the algolia search implementation (see the note on their readme here). So it might be possible to fully remove references to algolia from the swizzled component, but IMO that seems like a low-pri optimization (would require testing, could introduce maintenance friction as we'd be deviating from the canonical package, etc).

@james-prysm james-prysm merged commit bde44f7 into master May 30, 2023
@delete-merged-branch delete-merged-branch bot deleted the misc-updates branch May 30, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants