Skip to content

[Feature]: Refactor class components to functional components #2610

Open
@MAX-786

Description

Requirement

Jaeger UI still have a number of core components that are React class-based components. This prevents the use of hooks in them, and newest DX on them.

Refactor all the possible components in Jaeger UI that still are class-based components. Convert them to functional components, whenever possible.

Problem & Motivation

The idea is also while moving to them, use hooks to abstract the functionality present in Redux and in data fetching so in a near future we can easily switch using the hooks to use other props provider.

Proposal & Implementation

Refactor should be done carefully and providing tests where they do not exist. The lifecycle of the components should be preserved while watching out for edge cases and UX problems.

Deliverables

IMO It should be delivered all at once, as a major breaking change. Ideally, we won't change the contract of any of the components, so no new props passed down, no return anything to the tree that we were not returning before, unless it's justified.

If the contract has to be broken, then it must be properly documented and exposed in the upgrade guide.

Here there is a preliminary list, subject to change:

Complex / Optional:

(list of complex or optional ones, so move those issues here from above)

Risks

The lifecycle of a component could easily be changed if the refactor is not done carefully and giving attention to details, that's why we should provide acceptance tests and heavy QA should be done while doing it.

⚠️ IMPORTANT ⚠️

There are several issues/PRs that exist (e.g., #2588, #2013), but I believe it would be most beneficial to maintain/track them properly by having a single, comprehensive list.

Open questions

No response

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions