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

chore: Upgrade Docusaurus and related library versions #176

Merged
merged 3 commits into from Nov 13, 2022
Merged

chore: Upgrade Docusaurus and related library versions #176

merged 3 commits into from Nov 13, 2022

Conversation

ghost
Copy link

@ghost ghost commented Nov 13, 2022

What does this PR do?

  • It upgrades the library versions that Docusaurus ships with to the latest versions that work together correctly
  • Removes ^ from @docusaurus/plugin-pwa. It should always be on the same version as @docusaurus/core
  • adds @docusaurus/module-type-aliases to devDependencies, as a new project that is created by create-docusaurus@latest includes this, and it seems to be an integral part of the project

Tested with both local development and build - serve

closes #175

Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

So they recommend using pinned versions for Docusaurus? I notice you're mixing ^ and pinned versions now.

Also, can I get you to look into these warnings (specifically, unmet peer deps, and also the browsersdb update)?

yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "@docusaurus/core > [email protected]" has unmet peer dependency "react-loadable@*".
warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "@docusaurus/core > react-dev-utils > [email protected]" has unmet peer dependency "typescript@>= 2.7".
warning "@docusaurus/plugin-ideal-image > @endiliey/[email protected]" has unmet peer dependency "prop-types@>=[15](https://github.com/Seneca-ICTOER/Intro2C/actions/runs/3455836656/jobs/5768612494#step:4:16)".
warning "@docusaurus/preset-classic > @docusaurus/theme-search-algolia > @docsearch/react > @algolia/[email protected]" has unmet peer dependency "@algolia/client-search@>= 4.9.1 < 6".
[4/4] Building fresh packages...
$ husky install
husky - Git hooks installed
Done in 41.82s.
yarn run v1.22.[19](https://github.com/Seneca-ICTOER/Intro2C/actions/runs/3455836656/jobs/5768612494#step:4:20)
$ docusaurus build
[INFO] [en] Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
[info] [webpackbar] Compiling Client
[info] [webpackbar] Compiling Server
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
[success] [webpackbar] Client: Compiled successfully in [30](https://github.com/Seneca-ICTOER/Intro2C/actions/runs/3455836656/jobs/5768612494#step:4:31).06s
[success] [webpackbar] Server: Compiled successfully in [33](https://github.com/Seneca-ICTOER/Intro2C/actions/runs/3455836656/jobs/5768612494#step:4:34).81s
[info] [webpackbar] Compiling Service Worker
[success] [webpackbar] Service Worker: Compiled successfully in 6[38](https://github.com/Seneca-ICTOER/Intro2C/actions/runs/3455836656/jobs/5768612494#step:4:39).69ms
[SUCCESS] Generated static files in "build".
[INFO] Use `npm run serve` command to test your build locally.
Done in 51.83s.

@ghost
Copy link
Author

ghost commented Nov 13, 2022

They do pin the following:

  • @docusaurus/core
  • @docusaurus/preset-classic
  • @docusaurus/module-type-aliases

but they do not pin:

  • @mdx-js/react
  • clsx
  • prism-react-renderer
  • react
  • react-dom

It seems that they do correlated releases of the @Docusaurus namespaced libs (they all have the same, 2.2.0 version)

  • Caniuse / browsersdb upgrade done

warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".

File-loader should be (and is) required by @docusaurus/core. with the appropriate version. Adding this dependency again into the package.json file caused the warning (with no other effect). Since the newly built version does not contain this dependency in the package.json, I think it can safely be removed (causing no change other than removing this error)

warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".

Exact same as above

warning "@docusaurus/core > [email protected]" has unmet peer dependency "react-loadable@*".

This warning is present in a freshly deployed install too. They seem to resolve react-loadable from @docusaurus/react-loadable but it triggers this warning non the less, I think this is expacted behaviour.

warning "@docusaurus/core > react-dev-utils > [email protected]" has unmet peer dependency "typescript@>= 2.7".

This warning is also present in a fresh deploy, I'd guess this only has an impact if custom components are employed, and they are developed in TS.

warning "@docusaurus/plugin-ideal-image > @endiliey/[email protected]" has unmet peer dependency "prop-types@>=15".

I'm not exactly sure that this plugin is in use at all. If it is, it is being run on autopilot. Regardless, adding prop-types would only make sense for custom (non-TS) react components, so I'm not sure if in our case this peer-dep declaration makes sense. May be worth an investigation ticket if this lib is in use at all or not.

warning "@docusaurus/preset-classic > @docusaurus/theme-search-algolia > @docsearch/react > @algolia/[email protected]" has unmet peer dependency "@algolia/client-search@>= 4.9.1 < 6"

This is also present in a fresh install, Seems to be an internal issue to the @algolia project, but it is indeed required by multiple other @algolia scoped package with the correct version

@ghost ghost requested a review from humphd November 13, 2022 19:37
Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

Awesome, nice detective work.

@humphd
Copy link
Contributor

humphd commented Nov 13, 2022

@CameronGray1210 this looks good to go from my perspective, but I'll let you have the final say and merge when you're happy.

@CameronGray1210
Copy link
Collaborator

Yes this is greatly appreciated excellent resolution!

@CameronGray1210 CameronGray1210 merged commit 55d49d3 into Seneca-ICTOER:main Nov 13, 2022
Copy link
Collaborator

@CameronGray1210 CameronGray1210 left a comment

Choose a reason for hiding this comment

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

Much needed update and something I was wanting to look into.

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.

Docusaurus is pinned to an outdated beta version
3 participants