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: upgrade app-runtime React version to v18 #1387

Merged
merged 8 commits into from
Nov 21, 2024
Merged

Conversation

kabaros
Copy link
Contributor

@kabaros kabaros commented Sep 10, 2024

Upgrades the runtime to use react 18. Implements https://dhis2.atlassian.net/browse/LIBS-708

This is not stictly necessary for using React 18, because apps bootstrapped from app-scripts resolves the version of React in the shell, but it generates a lot of warnings. As usual, updating the version of react was easy (a peer dependency here), but updating the tests is the hard part.

I also tried to update cli-style as part of this change, to use the "native" way of linting typescript projects, but ran into problems with how this project is setup with nested tsconfigs.

"@dhis2/cli-app-scripts": "^10.2.0",
"@dhis2/cli-style": "^10.4.3",
"@dhis2/cli-app-scripts": "^12.0.0-alpha.21",
"@dhis2/cli-style": "10.4.3",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this needs to be a fixed version - the latest version that works with TypeScript doesn't work for the setup we have here with nested tsconfig, I will create a separate ticket and investigate it

@@ -109,9 +110,11 @@ describe('debouncing state changes', () => {
// Immediately, nothing should happen
expect(result.current.online).toBe(true)

await wait(1000)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to add a couple of explict waits here in place of the previous timeouts .. I think this is equivalent of the previous tests, but maybe we can rewrite the tests with fake timers or something in the near future

)
expect(getByTestId(/loading-mask/)).toBeInTheDocument()
expect(getByTestId(/section-rc/)).toBeInTheDocument()
it.skip('handles a successful recording', async (done) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't get the tests in this file to pass - not sure I understand how they worked before .. I'd need some help here

@kabaros kabaros marked this pull request as ready for review November 5, 2024 11:51
@kabaros kabaros changed the title feat: upgrade react to v18 feat: upgrade app-runtime react to v18 Nov 5, 2024
@kabaros kabaros changed the title feat: upgrade app-runtime react to v18 feat: upgrade app-runtime React version to v18 Nov 5, 2024
Copy link
Contributor

@KaiVandivier KaiVandivier left a comment

Choose a reason for hiding this comment

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

Approved for merging to alpha for manual testing

  • Still needs looking at automated tests (and cli-style config?)
  • Also at React-Query version: v3 doesn't seem to support React v18

@KaiVandivier KaiVandivier merged commit 0e4a3d5 into alpha Nov 21, 2024
12 checks passed
@KaiVandivier KaiVandivier deleted the react-upgrade branch November 21, 2024 13:55
dhis2-bot added a commit that referenced this pull request Nov 21, 2024
# [3.11.0-alpha.1](v3.10.4-alpha.1...v3.11.0-alpha.1) (2024-11-21)

### Features

* upgrade app-runtime React version to v18 ([#1387](#1387)) ([0e4a3d5](0e4a3d5))
dhis2-bot added a commit that referenced this pull request Nov 26, 2024
# [3.11.0-alpha.1](v3.10.4-alpha.1...v3.11.0-alpha.1) (2024-11-26)

### Bug Fixes

* **cacheable-section:** synchronously flush recording state for UI consistency ([04bc604](04bc604))
* add endpoint to text plain matchers ([#1390](#1390)) ([de8fbec](de8fbec))
* expand FetchErrorDetails type ([#1389](#1389)) ([78ad0b3](78ad0b3))
* handle alert returned async by parentAlertsAdd [LIBS-695] ([#1388](#1388)) ([bba9c23](bba9c23))
* **cacheable-section:** stable references to avoid loops [LIBS-642] ([#1385](#1385)) ([31562e9](31562e9))
* update plugin sizing definition ([#1383](#1383)) ([38c09b9](38c09b9))
* **deps:** remove cli-app-scripts peer dep [LIBS-587] ([#1379](#1379)) ([9e22e88](9e22e88))
* **deps:** update cli-app-scripts for package/types race condition ([dee6795](dee6795))

### Features

* fixed dimensions efficiency ([#1386](#1386)) ([b56ad2d](b56ad2d))
* upgrade app-runtime React version to v18 ([#1387](#1387)) ([0e4a3d5](0e4a3d5))
dhis2-bot added a commit that referenced this pull request Nov 27, 2024
# [3.12.0-alpha.1](v3.11.3...v3.12.0-alpha.1) (2024-11-27)

### Bug Fixes

* **cacheable-section:** synchronously flush recording state for UI consistency ([#1394](#1394)) ([50d216c](50d216c))
* **deps:** remove cli-app-scripts peer dep ([7764439](7764439))
* **deps:** update cli-app-scripts for package/types race condition ([7980364](7980364))

### Features

* upgrade app-runtime React version to v18 ([#1387](#1387)) ([0e4a3d5](0e4a3d5))
@dhis2-bot
Copy link
Contributor

dhis2-bot added a commit that referenced this pull request Dec 4, 2024
# [3.12.0](v3.11.3...v3.12.0) (2024-12-04)

### Bug Fixes

* **cacheable-section:** synchronously flush recording state for UI consistency ([#1394](#1394)) ([50d216c](50d216c))
* **deps:** remove cli-app-scripts peer dep ([7764439](7764439))
* **deps:** update cli-app-scripts for package/types race condition ([7980364](7980364))

### Features

* upgrade app-runtime React version to v18 ([#1387](#1387)) ([0e4a3d5](0e4a3d5))
* upgrade react query to v4 ([#1395](#1395)) ([8b02fdf](8b02fdf))
@dhis2-bot
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants