-
Notifications
You must be signed in to change notification settings - Fork 154
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 18): upgrade to react 18. #7336
Merged
v-viyada
merged 47 commits into
microsoft:main
from
v-rakeshsh:v-rakeshsh/react18-migration
Jun 14, 2024
Merged
feat(react 18): upgrade to react 18. #7336
v-viyada
merged 47 commits into
microsoft:main
from
v-rakeshsh:v-rakeshsh/react18-migration
Jun 14, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merging latest changes
madalynrose
requested changes
May 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is a huge effort! Well done, team! I have some questions about changes, mostly in tests.
.../unit/tests/DetailsView/components/__snapshots__/auto-detected-failures-dialog.test.tsx.snap
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/__snapshots__/next-requirement-button.test.tsx.snap
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/save-assessment-button.test.tsx
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/save-assessment-button.test.tsx
Show resolved
Hide resolved
src/tests/unit/tests/debug-tools/components/stores-tree.test.tsx
Outdated
Show resolved
Hide resolved
…akeshsh/accessibility-insights-web into v-rakeshsh/react18-migration
madalynrose
requested changes
Jun 6, 2024
src/tests/unit/tests/DetailsView/components/save-assessment-button.test.tsx
Show resolved
Hide resolved
src/tests/unit/tests/popup/components/diagnostic-view-toggle.test.tsx
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/popup/incompatible-browser-renderer.test.tsx
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/save-assessment-button.test.tsx
Outdated
Show resolved
Hide resolved
madalynrose
requested changes
Jun 7, 2024
src/tests/unit/tests/DetailsView/components/export-dialog.test.tsx
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/invalid-load-assessment-dialog.test.tsx
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/issue-filing-dialog.test.tsx
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/save-assessment-button.test.tsx
Show resolved
Hide resolved
...it/tests/DetailsView/components/tab-stops-requirement-instances-collapsible-content.test.tsx
Show resolved
Hide resolved
src/tests/unit/tests/common/components/__snapshots__/telemetry-permission-dialog.test.tsx.snap
Outdated
Show resolved
Hide resolved
madalynrose
requested changes
Jun 11, 2024
src/tests/unit/tests/DetailsView/components/details-view-command-bar.test.tsx
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/failure-instance-panel-control.test.tsx
Outdated
Show resolved
Hide resolved
...it/tests/DetailsView/components/tab-stops-requirement-instances-collapsible-content.test.tsx
Show resolved
Hide resolved
src/tests/unit/tests/popup/components/diagnostic-view-toggle.test.tsx
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/save-assessment-button.test.tsx
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/issue-filing-dialog.test.tsx
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/issue-filing-dialog.test.tsx
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/issue-filing-dialog.test.tsx
Outdated
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/issue-filing-dialog.test.tsx
Show resolved
Hide resolved
madalynrose
requested changes
Jun 12, 2024
src/tests/unit/tests/DetailsView/components/save-assessment-button.test.tsx
Show resolved
Hide resolved
src/tests/unit/tests/DetailsView/components/save-assessment-button.test.tsx
Show resolved
Hide resolved
madalynrose
requested changes
Jun 13, 2024
src/tests/unit/tests/DetailsView/components/save-assessment-button.test.tsx
Outdated
Show resolved
Hide resolved
madalynrose
approved these changes
Jun 14, 2024
v-viyada
pushed a commit
that referenced
this pull request
Jun 19, 2024
…accessibility insights ui (#7370) #### Details Update package version for accessibility insights report and accessibility insights ui for React 18 upgrade. Please refer #7336 Note : Making as major version update. On local testing we found that it will bring a breaking change as application consuming these packages also needs to update react and react-dom to v18 to avoid type mismatch. ##### Motivation <!-- This can be as simple as "addresses issue #123" --> ##### Context <!-- Are there any parts that you've intentionally left out-of-scope for a later PR to handle? --> <!-- Were there any alternative approaches you considered? What tradeoffs did you consider? --> #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [na] Addresses an existing issue: #0000 - [x] Ran `yarn fastpass` - [na] Added/updated relevant unit test(s) (and ran `yarn test`) - [x] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage` - [x] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See `CONTRIBUTING.md`. - [na] (UI changes only) Added screenshots/GIFs to description above - [na] (UI changes only) Verified usability with NVDA/JAWS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Details
This feature updates below packages.
1. Notable changes for react, react-dom:
Motivation: React 18 introduces a new root API which provides better ergonomics for managing roots. The new root API also enables the new concurrent renderer, which allows you to opt-into concurrent features.
In V16, we had below to render the component:
import { render } from 'react-dom';
const container = document.getElementById('app');
render(, container);
import { createRoot } from 'react-dom/client';
const container = document.getElementById('app');
const root = createRoot(container); // createRoot(container!) if you use TypeScript
root.render();
2. Notable changes for @types-react and @types-react-dom:
Motivation: The new types are safer and catch issues that used to be ignored by the type checker. The most notable change is that the children prop now needs to be listed explicitly when defining props
WrappedComponent: React.ComponentType
,
WrappedComponent: React.ComponentType<React.PropsWithChildren
>,
Approach for type changes: So this Type changes are added using automation script https://github.com/eps1lon/types-react-codemod. This automation script is suggested in react18 migration document.
>.
3. Notable changes for @testing-library/react:
4. Notable changes for @fluentui/react from v8.x.x to v8.118.1
5. Notable changes for react-helmet-async:
For example:
export const GuidanceTitle = NamedFC<GuidanceTitleProps>('GuidanceTitle', ({ name }) => { const titleValue =
Guidance for ${name} - ${productName}; return ( <> <Helmet> <title>{titleValue}</title> </Helmet> <h1>{name}</h1> </> ); });
6. Along with above
using of mockReactComponents in global and inside test case using of useOriginalComponents to get the props using getMockComponentClassPropsForCall which was wrong logically is fixed to use any one approach.
Context
This PR includes all changes required for migration of AI web from react16 to react18.
It includes test cases fixes.
It includes lint issues fixes.
Pull request checklist
yarn fastpass
yarn test
)<rootDir>/test-results/unit/coverage
fix:
,chore:
,feat(feature-name):
,refactor:
). SeeCONTRIBUTING.md
.