Skip to content

chore: upgrade dependencies + upgrade React types - #7138

Merged
Josh-Cena merged 3 commits into
mainfrom
jc/upgrade-deps
Apr 9, 2022
Merged

Josh-Cena merged 3 commits into
mainfrom
jc/upgrade-deps

Conversation

@Josh-Cena

@Josh-Cena Josh-Cena commented Apr 9, 2022 •

Copy link
Copy Markdown
Collaborator

Motivation

Most notably, this PR bumps @types/react across major versions. Even if we don't use React v18, the types are back-compatible, but much stricter (e.g. got rid of {} in ReactNode, forbids implicit any in useCallback (which catches a few in our own code), etc.), which we will benefit from.

Have you read the Contributing Guidelines on pull requests?

Yes

@Josh-Cena
Josh-Cena requested review from lex111 and slorber as code owners April 9, 2022 03:52
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 9, 2022
@netlify

netlify Bot commented Apr 9, 2022 •

Copy link
Copy Markdown

✅ [V2]

Name Link
🔨 Latest commit 67e2265
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/62510a049c1e2a00098fda7c
😎 Deploy Preview https://deploy-preview-7138--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions

github-actions Bot commented Apr 9, 2022 •

Copy link
Copy Markdown

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 62
🟢 Accessibility 100
🟢 Best practices 92
🟢 SEO 100
🟢 PWA 90

Lighthouse ran on https://deploy-preview-7138--docusaurus-2.netlify.app/

@github-actions

github-actions Bot commented Apr 9, 2022 •

Copy link
Copy Markdown

Size Change: -121 B (0%)

Total Size: 798 kB

Filename Size Change
website/build/assets/js/main.********.js 604 kB -121 B (0%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 49.9 kB
website/build/assets/css/styles.********.css 105 kB
website/build/index.html 38.6 kB

compressed-size-action

@Josh-Cena
Josh-Cena merged commit 2a78205 into main Apr 9, 2022
@Josh-Cena
Josh-Cena deleted the jc/upgrade-deps branch April 9, 2022 04:36
@slorber slorber changed the title chore: upgrade dependencies chore: upgrade dependencies + upgrade React types Apr 13, 2022
@slorber slorber added the pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. label Apr 13, 2022
@slorber

slorber commented Apr 13, 2022 •

Copy link
Copy Markdown
Collaborator

Let's try this 👍

Please next time separate regular updates from more impactful ones like React 18 types into 2 separate PRs

Notably one is a more risky typings breaking change that may impact user code and also may produce issues with third-party libs used by some users that may rely on React 17 typings (we'll see complains on next release, it's possible we'll have to revert)

@Josh-Cena

Josh-Cena commented Apr 13, 2022 •

Copy link
Copy Markdown
Collaborator Author

We don't have a strong TypeScript community (from my observation) and have even fewer users who are impacted and don't know how to migrate. Also, we using React v18 only means fewer issues for the consumers, because it enforces explicit children. FYI I've already fixed (or observed others fixing) the implicit children issue in several React libraries, which won't happen if they use React v18 typings.

Remember, what @types/react version we use should have very little impact on downstream.

@Josh-Cena

Josh-Cena commented Apr 13, 2022 •

Copy link
Copy Markdown
Collaborator Author

@slorber I don't think this is breaking change. Could you give an example where it breaks things? We don't install @types/react for users. It's always dev dependency.

@slorber

slorber commented Apr 13, 2022

Copy link
Copy Markdown
Collaborator

ok right 👍 if it's only a dev dependency, users should upgrade React types on their own

BTW isn't our TypeScript template supposed to declare "@types/react" ? apparently it doesn't

@slorber slorber added pr: maintenance This PR does not produce any behavior differences to end users when upgrading. and removed pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. labels Apr 13, 2022
@Josh-Cena

Copy link
Copy Markdown
Collaborator Author

It's included in @docusaurus/types, but apparently we have a wildcard range there😅

Not very ideal but no-one has complained, and ever since @types/react@18 is out users should start getting the new version, so if they ever complain they should have already

@slorber

slorber commented Apr 13, 2022

Copy link
Copy Markdown
Collaborator

ok we can keep that, we'll see if it's compatible enough and users can still fix a version if needed 👍

mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
* chore: upgrade dependencies

* reorg

* update comment
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.

3 participants