-
Notifications
You must be signed in to change notification settings - Fork 46
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
front: technical debt with data transformation #7918
Comments
09/09 Meeting report : Observation: there is a lot of different state in different places (instead of having one or fewer sourcers or truth like in redux) and each place has ramifications (setters given to children who do transformation on parents state up 3-4 components hierachy, Todo :
it concerns main business data such as operationalPoints, pathSteps, currently stored in a If this is data that was initially in redux store, transformed, and store in a different useState(), This could be a case where the data would be better kept in the store and transformed with a selector. From these observations, think about possible design solutions
Low level transformation should not be exposed in children components. (details of the operations done on the data should only appear in parents)
Can |
example: bug #8935 we have to trace back SimulationResults => |
Description and goal
in
ManageTrainScheduleV2
, some major transformation on pathfinding data is delegated to sub componentsTypeAndPathV2
.launchPathFinding has much more responsibility than a mere (and small) subcomponent should have
I think that’s a design flaw and a case where props drilling is problematic. it creates major indirection: difficult to follow where to data comes from and what’s done to it.
This really could be a proper case to use a business hook (as proposed by @jacomyal @sim51)
to be discussed
TimetableV2
useTrainSchedulesDetails is receiving
setTrainSchedulesDetails
, which comes fromTimetableToolbar
props, which comes from a state inTimetableV2
.The text was updated successfully, but these errors were encountered: