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

DataTable refactor/rewrite #1043

Closed
45 of 48 tasks
josh-griffin opened this issue Jul 1, 2019 · 11 comments
Closed
45 of 48 tasks

DataTable refactor/rewrite #1043

josh-griffin opened this issue Jul 1, 2019 · 11 comments
Labels
Docs: not needed Epic A discussion and/or parent issue for module/feature design Priority: high Type: Refactor The issue relates to restructuring code without affecting functionality (hopefully)
Milestone

Comments

@josh-griffin
Copy link
Contributor

josh-griffin commented Jul 1, 2019

Description

Old table is bad. We're rewriting it. See context (below) or msupply-foundation/react-native-data-table#46

Plan

We'll operate a local import of code for the data table. At the end we'll take the core parts back to react-native-data-table repo

Branches

Feature branch: #1043-data-table-rewrite

Tasks

Each task to have its own issue, branch and PR.

Utility

Pages

Need to rewrite all pages to use new data table.

Post refactor

Additional existing issues

These issues should either be fixed or closed with the new data table implementation

Context

Old data table was slow, using deprecated ListView, A specific Realmjs version of the deprecated ListView component. Generic table page has significant problems with multiple unnecessary full re-renders.

Design discussion

Addition context here msupply-foundation/react-native-data-table#46
If necessary, discuss GenericPage/GenericTablePage design. Going to have a crack at CustomerInvoicePage to get a solid grasp of the challenges.

Architecture

@josh-griffin josh-griffin added the Bug: production Bug was found or believed to be in a live release label Jul 1, 2019
@josh-griffin josh-griffin added Docs: not needed Priority: high Type: Refactor The issue relates to restructuring code without affecting functionality (hopefully) and removed Bug: production Bug was found or believed to be in a live release labels Jul 1, 2019
@Chris-Petty
Copy link
Contributor

Would be better here IMO https://github.com/sussol/react-native-data-table/issues

Right questions though:

  • Are we keeping realm? Or, if we can't decide this, are we writing this new data table in such a way that is completely decoupled from realm? (I think coupling the data table with realm, if we are using it, offers quite a few benefits)

Decoupled. It's annoying for people wanting to use the table with anything other than realm. The coupling is Realm.ListView, but we're throwing that out with the rewrite anyway.

  • Are we going to keep the data table as a separate NPM package? I don't like having the table abstracted away, personally, but I can also see the benefit

I think executed well, it's a pretty sensible package to exist in it's own right. I'm not against getting generic table page into mobile, though. 2 levels out is exponentially more of a pain in the ass than 1 level.

  • Are we using hooks? (This will require upgrading react-native, which should probably happen regardless, but will have to happen sooner rather than later. Keeping in mind the vaccine module branch is already a version behind)

I say yes, though we're trading off backwards compatibility with older RN apps, with modern react APIs/style. Not that they are planning to deprecate the class API.

  • FlatList/VirtualizedList/Something else? - FlatList is reall easy to use, whereas virtualized list offers more flexibility. I think FlatList would probably be sufficient.

I think FlatList would probably be sufficient, but I appreciate the flexibility of not being locked to down to Arrays.

  • What 'extra's' are needed? Expansions, sections?, custom components as cells, sorting, "switching" (i.e, click a 'menu' button on a row to offer different options), highlighting rows - I think at least thinking about this is a good idea as it can change a lot about how the table is written.

"Yes"

  • Performance metrics I think having baselines for rendering performance might be a good idea to have in place at the start, although this could be premature

Yes

  • Tests I think having jest upgraded and able to run tests would be extremely valuable

Yes

  • refreshData I think the use of refreshData is basically the biggest flaw in the current implementation and that it should not be used at all :)

Yes

Live examples Written in Expo or RN. Should flex the whole API. Might tie into automated tests.

@Chris-Petty
Copy link
Contributor

To be able to use the data table with 5,000 lines as effeciently and performant as with 1 line.

That's a pretty optimistic bar, but here's hoping there aren't hurdles haha.

@craigdrown
Copy link
Contributor

@Chris-Petty Chris-Petty added this to the Mobile 3.1.0 milestone Aug 5, 2019
@Chris-Petty Chris-Petty added the Epic A discussion and/or parent issue for module/feature design label Aug 5, 2019
@Chris-Petty
Copy link
Contributor

Reopening this issue as epic

@josh-griffin josh-griffin unpinned this issue Sep 23, 2019
wlthomson added a commit that referenced this issue Sep 29, 2019
josh-griffin added a commit that referenced this issue Oct 16, 2019
@josh-griffin josh-griffin reopened this Oct 16, 2019
@josh-griffin
Copy link
Contributor Author

Just need to port code to react-native-data-table repo, publish a new version, use that new version in mobile and remove the then-unused data table code

@wlthomson
Copy link
Contributor

wlthomson commented Oct 16, 2019

In terms of testing, this can be moved to "Done" as soon as the remaining issues are tested.

@kat-ms
Copy link
Contributor

kat-ms commented May 7, 2021

Closing - looks more or less done (and if there was any testing missing, I think it's been in production long enough 😆 )? Any outstanding issues (e.g. porting) can be logged/tracked via a separate issue...

@kat-ms kat-ms closed this as completed May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs: not needed Epic A discussion and/or parent issue for module/feature design Priority: high Type: Refactor The issue relates to restructuring code without affecting functionality (hopefully)
Projects
None yet
Development

No branches or pull requests

6 participants