-
Notifications
You must be signed in to change notification settings - Fork 378
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
Griddle 1.0 #276
Comments
👍 the new architecture looks very solid! |
cool, Regards. nice job. |
one more thing, but actually griddle is storing data on its own state making difficult implement it with a flux (redux) application, and even it make difficult create testable components. The problem that actually I have, is that the only way to pass data to Griddle but in a Flux app, I execute and async action USER_FETCH -> that calls the action -> USER_FETCH_SUCCESS when the response was retrieved successfully. so in that escenario seems is not possible to use griddle. the following pseudo code will explain better: thats how it actually works class MyContainer extends React.Component {
getExternalResults(filterString, sortColumn, sortAscending, page, pageSize, callback) {
// get async stuff
callback({
results: respose.json(),
totalResults: totalResults,
pageSize: pageSize
})
}
render() {
return <GriddleTable getExternalResults={getExternalResults} ... />
}
} but, in a FLUX app we need something like this: class MyContainer extends React.Component {
getExternalResults(filterString, sortColumn, sortAscending, page, pageSize, rowIndex) {
if (this.state.data[rowIndex]) {
return this.state.data[rowIndex];
}
this.dispatch({
type: 'USER_FETCH_DATA',
payload: { page: page + 1, pageSize: pageSize}
});
}
render() {
return <GriddleTable getExternalResults={getExternalResults} ... />
}
} this approach is how actually fixed-data-table works, would be great if you can analyze a little bit this. Regards. |
Thanks a ton for your thoughts on this and totally understand the pain you've encountered passing state to the components. One of the big reasons for splitting up Griddle like we are is to allow more customization at each point in the component (and to make view components just view components). We first wrote Griddle when we were switching to React and later realized we were forcing some design decisions that we didn't want to be making for people (such as how the grid state was managed, etc). The new separation of the modules helps us avoid some of that.
This will allow someone that is managing their own state to use just the griddle-render components. Additionally (spoilers), we plan to make something that hooks up fixed-data-table to griddle-core state management since the state is no longer tightly tied to our view components. |
Ryan, would it be possible to export a reducer (or multiple reducers) in griddle-core for someone who is already using redux but didn't want to have to code their own state management from scratch? It would seem that the exported reducer(s) could be combined with an app's other reducers so the griddle state would become a part of an app's redux store without requiring someone to write any of their own griddle state management if they didn't want to. |
That is definitely the intent (although it may not be in 1.0 -- maybe a release that quickly follows 1.x). Do you have any thoughts on what the best way to do that may be? One of the things I want to make sure is that everything is setup for people who may want multiple grids on the page too. I totally agree though that there should be a nice way that people who are already using Redux can just add the grid state management to their own state tree. |
I'm fairly new to redux myself (and also not a full-time coder) so I'm probably not a good person to make architectural decisions. But I think one pattern that might work is demonstrated at least on a basic level in the redux real-world example where there is a pagination reducer "factory" so that multiple store objects can re-use the same pagination reducer functions. There is also a library (https://github.com/erikras/multireducer) built to allow sharing a single reducer. Just throwing out some avenues to explore. |
I appreciate the suggestions -- these look like great options. |
We've been starting to work on the documentation for 1.0 a bit. One of the first things we're trying to make sure we have documented clearly is the overall architecture mainly as it relates to the state management piece. While understanding the architecture won't be necessary for using Griddle, it is necessary for contributors / plugin creators (the community plugin ability is what I'm most excited about for a 1.0 release). This document will likely be changing over the next couple of weeks as we receive more feedback but the initial architecture page is available here: |
I am having a problem with the dependency on underscore when my project already has lodash, seems to me like a burden. Can you make it like optional or inforce it inside the library? |
Thanks for asking. Griddle 1.0 doesn't use the full underscore or lodash (it does use some of the individual modules from lodash). 👍 |
Very exciting! Ready for alpha! |
@ryanlanciaux awesome! |
@ryanlanciaux I was wondering where I could start digging in to help contribute with the 1.0 release? I use Griddle a lot(including with a production app for work), and I'd love to be able to give back by contributing towards this release! I've been more of a Github consumer in the past, and I'm looking to change that. :) |
That would be incredible! We're trying to start triaging anything that's ready here https://waffle.io/GriddleGriddle/griddle and I'm "trying" to do a better job at adding notes in there so they are more clear to others (and sometimes myself a couple weeks after I create an issue for the new stuff 😕 haha). If there's anything in there that looks to be of particular interest and isn't well defined please let me know. We have the new docs for the alpha version at http://griddlegriddle.github.io/Griddle/next/ -- One other thing that would be extremely helpful is we are still thinking through how to make the upgrade from 0.x to 1.x as smooth as possible. Where I'm currently at on that is making a higher order component that takes similar props (probably not 100%) to the 0.x component and maps to 1.0. Any thoughts around that sort of thing would be much appreciated also. |
Thanks for that neat update with using lodash modules instead of underscore dep. |
is there any timeline when griddle 1 will come out? |
YAY! |
What are the chances of getting Griddle 1.0 this year ? |
@ryanlanciaux any news on this? |
I'm using 1.0 on several projects BUT we are trying to make sure the API is solid before we start promoting it more heavily / calling it something more concrete than alpha. I don't have any specific timeline regarding when it will be released -- currently churning on some parts of the API around plugins. |
Can you release the alpha version for early adopters to try out? |
@mrn3 - this is on NPM as alpha and if you go to http://griddlegriddle.github.io/Griddle/next docs are there. |
I added Griddle 1.0 to a test project using
I'm running the project using react-create-app. Here's my https://gist.github.com/babenzele/9d3ba9b1f426103b32eafe4038880c8d @ryanlanciaux I'd like to get this working to get myself familiar with 1.0 and start taking some issues to push forward to the 1.0 release. |
@babenzele - this is usually because two versions of React are being loaded (usually one from an npm module, and one from your main project that is including the npm module). I am wondering if it is because the peer dependencies are set up correctly on griddle-react@alpha npm module. Also, it could be that another npm module you are including is including React incorrectly and needs to switch to peer dependencies. |
@mrn3, I ran
Maybe something else is going on inside react-create-app. |
@babenzele Sorry that's not working out so well for you. I will try to get create-react-app going with it and see if I have diff results. Interacting with Griddle should mostly be the same as the current alpha (except plugins) but we are going to be merging the 1.0-combined branch into 1.0 (the current alpha) as soon as we get the base Griddle plugins converted over. The 1.0-combined branch removes some of our custom conventions and gets them more inline with what others in the React ecosystem are doing. This is mostly only pertinent to people who will be creating plugins but that's a big thing we're trying to get "right" (or as right as can be in software ha) with the 1.0 release. |
@ryanlanciaux I tried loading
|
@ryanlanciaux Would you mind describing how I would get |
@babenzele @ryanlanciaux I suspect the issue is not related to react-create-app. I was able to reproduce the same problem with react-starter-kit. I do see warnings when installing the griddle dependency:
|
@babenzele This is some uncharted territory right now as it's our most in-flight branch :) but ultimately it most closely matches the direction we want to go with 1.0. That said, I would imagine that if the package.json file points to src/index as the entry point, that you could reference the package this way. Traditionally, we build the project with webpack before pushing to npm and have package.json point to the built version of the package. We have not set up the build stuff too much for this branch just yet since we're mostly working out of storybook to finalize the features. We are is porting over the virtual scrolling plugin (@joellanciaux has been working on this -- plugins are the thing that should be changing the most between current alpha and the upcoming version) and then we will be focusing on the build steps. We would love any additional assistance or thoughts around this, approach! |
@garretfick Thanks for calling this out -- we will have to look into this a bit more as we may have something misconfigured with our externals. |
Does this thing output semantic tabular markup? |
We use |
@ryanlanciaux thanks, Ryan. Here's my top resource for planning accessible tables, if you haven't read it yet: http://www.456bereastreet.com/archive/200410/bring_on_the_tables/ |
This is a great read, thanks! |
Please check out the docs for more info http://griddlegriddle.github.io/Griddle/ -- We've taken the approach that the core library should mostly be just the core things that a datagrid needs (we do have a virtual scrolling plugin and local state management plugin that we ship currently) and everything else should be plugins and This all said, 0.x should ideally still be receiving updates for a bit and is available at |
@babenzele have you figured anything out on that Ref error mentioned in your first post? I just tried running 1.0.0-alpha.43 and I get the same behavior you describe. |
@capouch I haven't tried |
The Road to Griddle 1.0
Update ( Feb. 6, 2016): Griddle 1.0 pre-release docs are available here http://griddlegriddle.github.io/Griddle/next/
Throughout the 6 months or so, we've been working on a new version of Griddle. It's not quite ready yet (alpha likely coming before Jan. 1, 2016) but we wanted to start communicating where we're at with it and where it's going.
One of the biggest things that we've encountered with Griddle is that we would like to enable all sorts of features without making the codebase too bloated for those that want a more minimal grid. Too often we would add new features which added additional complexity. Over time, this complexity makes it harder to quickly add new features, harder to fix bugs, harder to avoid regressions, and a bit more difficult for others in the community to jump in and contribute.
To address all these concerns, we began working on a new version of Griddle that is more modular. While the modularity doesn't single-handedly take care of the issues listed above, it does make tackling these things easier.
New Architecture
Griddle will now exist as a series of modules:
In addition to these modules, the main Griddle (griddle-react) module will still exist as an opinionated default setup for using Griddle. Conceptually, the main Griddle component will import the other modules and pass set up a default configuration.
Plugins
Another big part of the new architecture is that we wanted to introduce plugins to the Griddle landscape. Instead of having subgrid / selection / remote / editing (not yet implemented), etc support as part of the default Griddle module, these features are added in as plugins. We are currently documenting how the plugins work in a lot more detail but for now, they can be thought of as a series of higher-order components and redux reducer / action creators (please see the selection plugin for more information on how they look in the meantime).
We've had a lot of requests for awesome features that we would really like to see exist as plugins. Again there will be more documentation on how plugins work and how to create them in the coming weeks / months. Until then please see a couple of the core plugins.
The Road to 1.0
As noted above, we're trying to stay mostly consistent while still introducing some breaking changes (while still establishing a nice upgrade path). To that end, we're calling this Griddle 1.0 (obviously pre-release at this point) and are hoping to have the offical 1.0 release out sometime in the Spring of 2016.
That all said, a very very early version of these components can be used today by taking the following, exhausting steps (if it's not abundantly clear -- these components are not production ready yet 😄).
npm link
all of the modules in griddle-test andnpm-install
&npm-start
everything. Runningnpm-start
in griddle-test should log that a webserver is running on port 3000.As of this weekend, we're trying to place all of the things that are left to do and not currently being worked on into GitHub issues in their various projects. Any help / feedback would be much appreciated.
The best place to discuss all this is in the comments here -- or the Griddle gitter.im channel 👍
The text was updated successfully, but these errors were encountered: