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

feat(react): Add React 18 as peer dep #4819

Merged
merged 5 commits into from
Mar 31, 2022
Merged

feat(react): Add React 18 as peer dep #4819

merged 5 commits into from
Mar 31, 2022

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Mar 29, 2022

  • Update peer dependency of @sentry/react to include React 18
  • Bump dev deps for React 18
  • Remove unused react-test-renderer dep
  • Update tests to use act(): https://reactjs.org/docs/test-utils.html#act
  • Update gatsby for React 18 peer dep

Fixes #4818

Resolves https://getsentry.atlassian.net/browse/WEB-764

@AbhiPrasad AbhiPrasad requested review from a team, lforst and Lms24 and removed request for a team March 29, 2022 19:33
@github-actions
Copy link
Contributor

github-actions bot commented Mar 29, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.06 KB (+0.01% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 64.54 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.78 KB (+0.01% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 57.95 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 23.21 KB (0%)
@sentry/browser - Webpack (minified) 82.45 KB (0%)
@sentry/react - Webpack (gzipped + minified) 23.25 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 48 KB (-0.4% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.98 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.41 KB (+0.01% 🔺)

@@ -1,4 +1,4 @@
import { render } from '@testing-library/react';
import { render, act } from '@testing-library/react';

Choose a reason for hiding this comment

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

You need to change this to { act, render }

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed with 0e78d1b, thanks!

- Update tests to test against React 18
- Remove unused `react-test-renderer` dep
- Update tests to use `act()`
@AbhiPrasad
Copy link
Member Author

Have to use alpha of https://github.com/testing-library/react-testing-library as it's the only one that support React 18: testing-library/react-testing-library#509 (comment). Made myself watch the releases so we can upgrade when they get to a stable version.

Copy link
Member

@lforst lforst left a comment

Choose a reason for hiding this comment

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

LGTM.

(At some point, definitely not now, we should probably change those getBy* returned from render to use screen)

@MikevPeeren
Copy link

@AbhiPrasad

v13 is now released from react-testing-library which supports react 18

@AbhiPrasad
Copy link
Member Author

@AbhiPrasad

v13 is now released from react-testing-library which supports react 18

Thanks for letting me know, updated!

@AbhiPrasad AbhiPrasad merged commit db661b4 into master Mar 31, 2022
@AbhiPrasad AbhiPrasad deleted the abhi-react-18 branch March 31, 2022 14:27
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.

Support React 18
3 participants