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

refactor: Remove UNSAFE_ react lifecycle hooks #2196

Merged
merged 34 commits into from
Oct 30, 2024

Conversation

maiwald
Copy link
Collaborator

@maiwald maiwald commented Oct 4, 2024

No description provided.

@maiwald maiwald force-pushed the update-bootstrap-remove-UNSAFE branch from 3e6eb90 to ea164cf Compare October 8, 2024 15:47
Copy link

github-actions bot commented Oct 8, 2024

LCOV of commit ea164cf during Continuous Integration #3961

Summary coverage rate:
  lines......: 65.5% (14028 of 21402 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@maiwald maiwald force-pushed the update-bootstrap-remove-UNSAFE branch 4 times, most recently from 4c18cab to 381ec23 Compare October 9, 2024 08:07
@maiwald maiwald changed the title Update bootstrap: remove UNSAFE_ react lifecycle hooks Remove UNSAFE_ react lifecycle hooks Oct 9, 2024
Copy link

github-actions bot commented Oct 9, 2024

LCOV of commit 8b27199 during Continuous Integration #3963

Summary coverage rate:
  lines......: 65.5% (14014 of 21402 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

Copy link

github-actions bot commented Oct 9, 2024

LCOV of commit 381ec23 during Continuous Integration #3965

Summary coverage rate:
  lines......: 65.5% (14012 of 21402 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

Copy link

github-actions bot commented Oct 9, 2024

LCOV of commit e9153d0 during Continuous Integration #3962

Summary coverage rate:
  lines......: 65.5% (14012 of 21402 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@maiwald maiwald marked this pull request as ready for review October 9, 2024 08:39
@maiwald maiwald force-pushed the update-bootstrap-remove-UNSAFE branch from 381ec23 to c31bb19 Compare October 9, 2024 09:17
Copy link

github-actions bot commented Oct 9, 2024

LCOV of commit c31bb19 during Continuous Integration #3971

Summary coverage rate:
  lines......: 65.5% (14010 of 21400 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@maiwald maiwald force-pushed the update-bootstrap-remove-UNSAFE branch from c31bb19 to 1aadf55 Compare October 10, 2024 09:24
Copy link

LCOV of commit 1aadf55 during Continuous Integration #3981

Summary coverage rate:
  lines......: 65.5% (14010 of 21400 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@maiwald maiwald force-pushed the update-bootstrap-remove-UNSAFE branch from 1aadf55 to 34ec744 Compare October 14, 2024 09:05
@maiwald maiwald changed the base branch from update-bootstrap-ui-library to main October 17, 2024 09:06
@maiwald maiwald force-pushed the update-bootstrap-remove-UNSAFE branch 2 times, most recently from 42a4389 to 7be3838 Compare October 17, 2024 10:24
@PiTrem PiTrem changed the title Remove UNSAFE_ react lifecycle hooks refactor: Remove UNSAFE_ react lifecycle hooks Oct 29, 2024
The hideOverlay() does not exist and is not passed to the component
anymore.
With this change updating array values has been fixed by correctly
returning a new state in the `setState` handler.

This change also removes researchPlan from state, because changes are
only affected by its metadata.

We also clean up state management by removing all `ref` for state
updates in favour of proper `setState` calls using `handleFieldChange`.

Lastly, this also updates the UNSAFE_componentWillReceiveProps life cycle hook
to componentDidUpdate.
This patch separates state management from presentational components and
gets rid of UNSAFE_componentWillReceiveProps.
We don't ever modify the prop so we don't need to store it in state and
thus don't need to keep props and state in sync.
We were never updating the reaction state so we can simply use the prop
value and don't have to worry about keeping state and props in sync.
This removes reaction from state so we don't have to handle keeping
props and state in sync.

We are however still just mutating the variable instead of creating new
instances and passing those to our callbacks and handlers, but that is
for another time.
This way we don't have to worry about when we need to calculate the
display values and can get rid of the life cycle methods that modified
the reaction prop.
@maiwald maiwald force-pushed the update-bootstrap-remove-UNSAFE branch from 7be3838 to 5053ec1 Compare October 30, 2024 10:25
@ComPlat ComPlat deleted a comment from github-actions bot Oct 30, 2024
@ComPlat ComPlat deleted a comment from github-actions bot Oct 30, 2024
@ComPlat ComPlat deleted a comment from github-actions bot Oct 30, 2024
@ComPlat ComPlat deleted a comment from github-actions bot Oct 30, 2024
Copy link

LCOV of commit 5053ec1 during Continuous Integration #4072

Summary coverage rate:
  lines......: 65.5% (14010 of 21400 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@PiTrem PiTrem merged commit c85856e into main Oct 30, 2024
3 checks passed
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