-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGrid] Prepare work for a future public state api #533
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we miss:
- The declarative API, this one should come first.
- The documentation.
- End to end tests.
- A description of the problem we are solving.
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the documentation, I think that a new page would probably be the best solution. I don't see another place where documenting this really makes sense. We could maybe have a "Data & state" page, where we document the state, how to load data, lazy loading, the server-side part,
1c818b0
to
57caf63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no 📚 = nobody uses it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Danail, exposing the state to the open raises the question of what's internal and not. Let's have all new features be documented. This is a forcing function to consider the feature end-to-end.
This is to allow to persist the state, attach it to a redux store, or just manipulate the grid state directly. |
Will it work? I am right to assume that we can't have developers store internal values that we might change between two release patches, breaking the restore logic? |
Well that's the reason to expose the state, so we allow users to persist and restore their settings for columns... |
What about we isolate the private state from the public state? For instance in https://codesandbox.io/s/material-demo-forked-0n563?file=/demo.js, developers would end-up sending a lot of unneeded data through the network, e.g. send the rows multiple times, which doesn't scale for large datasets. |
I would leave it this way for now
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I have updated the title of the pull request, it's internal, for now, but it sets the stone in the right direction.
fix api finish state api clean cleanup fix cylce dependency added more tests fix issues with state more test, fix sourcemaps Update packages/grid/_modules_/grid/models/api/stateApi.ts Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com> Add arg assert on test, move to DataGrid clean
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
5092d74
to
7ff4fc5
Compare
Add the state API that allows using the grid in a controlled way. Related to #190.