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 dependencies + upgrade React types #7138

Merged
merged 3 commits into from
Apr 9, 2022
Merged

Conversation

Josh-Cena
Copy link
Collaborator

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

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 slorber and lex111 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
Copy link

netlify bot commented Apr 9, 2022

[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
Copy link

github-actions bot commented Apr 9, 2022

⚡️ 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
Copy link

github-actions bot commented Apr 9, 2022

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
Copy link
Collaborator

slorber commented Apr 13, 2022

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
Copy link
Collaborator Author

Josh-Cena commented Apr 13, 2022

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
Copy link
Collaborator Author

Josh-Cena commented Apr 13, 2022

@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
Copy link
Collaborator

slorber commented Apr 13, 2022

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
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
Copy link
Collaborator

slorber commented Apr 13, 2022

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

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