-
Notifications
You must be signed in to change notification settings - Fork 119
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
Designer Maintainability Refactor Plan Proposal #528
Comments
This was referenced Aug 2, 2017
Closed
This was referenced Aug 5, 2017
This was referenced Aug 12, 2017
This was referenced Aug 18, 2017
This was referenced Aug 25, 2017
This was referenced Sep 10, 2017
This was referenced Sep 28, 2017
Merged
This was referenced Nov 13, 2017
Merged
I believe this has been achieved and we can close it. We still have some refactor we can do to improve and discuss about adding hookers, but I believe it will be better fitted in a new proposal. Closing this one |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Below is an outline of a new directory/component structure for decrediton and a general refactor
plan to pave the way towards a more maintainable, faster, designer friendly decrediton.
The index components can be thought of as containers.
This is where any component logic will go including connecting to redux.
Any component that is not an index component should (eventually) be simple enough to convert
to straight up functions in this form:
The components marked (styleonly) seem to only exist as a vehicle for Radium's inline styling.
From talking on slack we all want to eventually abandon inline styling.
That means these components can eventually go away and be replaced by solid className use in
the components that currently reference them.
Component Structure
First Stage: Initial Reorg
This is a shallow first pass at making the app more maintainable with an eye towards separating
concerns between presentation and logic.
Any component that is marked as being broken into index+other components will be split into
the index component and associated presentation component.
We will not be converting all of the presentational components to the function style in this passas I believe that may interfere with Radium.
(Turns out it works fine so will be switching to this style with little to no imperative code in the presentational components.)
Likewise the components that are not converted into index+other components will be left alone.
Second Stage: Radium to CSS
Eliminate Radium, convert inline styles to CSS stylesheets and sane classNames.
Third Stage: Split up/Clean up presentational components
It may make sense to split up presentational components more than is outlined here.
StakePool in particularly needs some cleanup. This will be easier after the switch to CSS
The move to a function style for presentational components can happen in this stage as well:
Fourth Stage: Re-evaluate and consolidate state management through redux/reselect
We build out a JS core of decrediton that centralizes the business logic and becomes primary source of truth for the React components.
Much of the logic that would be in index components at this point would be moved to this
functional core.
This core would be built around redux state management
This would be a good time to move to Immutable.js for managing app state, and a goal of this
app core would be to maintain object identity persistence to aid in rerender reduction.
Fifth Stage: Pure Components/Performance
Once state is consistently managed and immutable, we can take advantage of React.PureComponent
through many of our components to reduce rerender CPU churn. Particularly tables of large data.
The text was updated successfully, but these errors were encountered: