Skip to content

PF4 Bring Reactabular in-house #1628

@priley86

Description

@priley86

Reactabular is no longer as active as the project here and I believe thru discussions and recent PRs it would be better to bring this minimal library in-house. Reactabular's current source is a good starting point for writing minimal table extensions, but I believe we can customize and improve it much faster here. The upstream maintainer is no longer able to actively maintain it as noted in #313 #338.

Noted issues causing a poor developer experience:

  • onChange \ onBlur callbacks for rows are not handled correctly upstream and our current workarounds are not great.
  • passing refs thru callback methods is no longer a good way to pass React refs, and React.createRef() should be used instead.
  • getChildContext is the old way of using React context. We can update this to use the new stable Context API.

Proposed solution:

  • We only currently consume reactabular-table (which is luckily only 12 js files 😎). Bring them in-house and expose as a new package @patternfly/reactabular-table and consume them from @patternfly/react-table. I think this would be a great first step. Another alternative (which may be better and help us avoid another internal package) would be to bring the source directly into react-table and just rename the components to avoid conflict, i.e. BaseProvider, BaseBody, BaseBodyRow, BaseHeader, BaseHeader, BaseHeaderRow or attempt to integrate them inside our current wrappers there.
  • Continue writing our own extensions here in patternfly-react

Additional nice-to-haves:

  • convert to TSX
  • incrementally fix the issues above
  • revisit the API of Provider, Body, BodyRow, Header, HeaderRow and see if we can improve them.

thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions