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

React 18 upgrade #221

Merged
merged 8 commits into from
Feb 7, 2024
Merged

React 18 upgrade #221

merged 8 commits into from
Feb 7, 2024

Conversation

AlexanderKaran
Copy link
Collaborator

First pass at React18 upgrade.

  • Upgraded React packages
  • Upgraded testing packages
  • Upgraded tests to deal with changes

src/ui/link/utils/handle-navigation.tsx Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@@ -1,4 +1,5 @@
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not importing this in the setup file? So we don't get strange errors if we move tests around

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried moving in my previous PR but the TS compiler starts complaining and no matter what I tried it would not satisfy the error.

Choose a reason for hiding this comment

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

yeah, that's not ideal, I'd try to move it back to jest.setup.js

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Bigger significant changes are needed to the config, and TSConfig is required. Basing this on all the simple changes I tried.

Might be better in another PR as this one already has a lot of changes

@@ -1,4 +1,5 @@
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';

Choose a reason for hiding this comment

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

yeah, that's not ideal, I'd try to move it back to jest.setup.js

src/controllers/use-path-param/test.tsx Show resolved Hide resolved
@@ -272,16 +265,16 @@ describe('useQueryParam()', () => {

const { storeState, actions } = getRouterStore();

actions.push('/projects/123/board/456?foo=hello&bar=world');
await nextTick();
act(() => {

Choose a reason for hiding this comment

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

just wondering, why are you using act here, are there any async actions under the hood of push()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Were not using userEvent here so we need to manually use act due to waiting for re-renders and or any other background changes.

package.json Outdated Show resolved Hide resolved
@AlexanderKaran AlexanderKaran merged commit 1b6c3c8 into atlassian-labs:master Feb 7, 2024
3 checks passed
@AlexanderKaran AlexanderKaran deleted the react-18-upgrade branch February 7, 2024 02: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.

3 participants