-
Notifications
You must be signed in to change notification settings - Fork 54
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
Projects: move panel mgmt to React Context #1010
Conversation
Pull Request Test Coverage Report for Build 2470
💛 - Coveralls |
Pull Request Test Coverage Report for Build 2473
💛 - Coveralls |
353589e
to
900c1b9
Compare
900c1b9
to
6166834
Compare
d38a8c9
to
99c0a77
Compare
e0c6e87
to
fb2b5c0
Compare
713053f
to
e0ded45
Compare
@chadoh the PR status is "In progress" is that accurate, or is it ready for review? |
I am finding some issues with it still, maybe hold off on review. You can look over the code if you want, I don’t think the shape of it will change much, but don’t bother trying to run it locally.
…On Jun 25, 2019, 10:28 PM -0400, Otto G ***@***.***>, wrote:
@chadoh the PR status is "In progress" is that accurate, or is it ready for review?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
4cb47a3
to
4b6d13b
Compare
BountyContextMenu doesn't want to know about the specifics of opening a panel. It just wants to call a function. This locates the logic for how to open a specific panel next to the PanelManager component. This gives us a clean place to which to relocate other panel-opening logic, rather than putting it all in App.js.
This new functional component can use React hooks, which will allow us to move `curateIssues` and `allocateBounties` to the `usePanelManagement` custom hook.
This makes it easier to move panel-opening logic to the `usePanelManagement` hook, since these panels no longer rely on state from App.js
This removes all reliance that FundIssues had on props from App.js, so that logic for opening this panel can move out of App.js entirely
This allows moving opening of the panel to usePanelManagement hook
* Open these panels using the `usePanelManagement` hook * Clean up `ActionsMenu.propTypes` * Simplify `Issues` somewhat
Perplexingly, without the change to `LoadingAnimation` to render an inline svg, this resulted in cryptic Parcel errors like: > Uncaught (in promise) Error: Cannot find module 'components/Shared/assets/svg/ethereum-loading.svg' > at newRequire (VM856 app.e31bb0bc.js:37) Another way to fix this issue is to remove the dynamic imports from `PanelManager`. After hours of research, I'm not sure how the rest of this change resulted in such an error, but I'm moving on for now.
It is now `editBounty`, since it opens a panel to edit the bounty, rather than actually sending the update request.
It only uses workStatus, which comes from `issue` Also, * when rendering Issues, use their id as `key`, instead of the order in the list
I would prefer to use React.memo with the functional component, but am preferring PureComponent for the sake of reducing noise in the pull request.
The individual files that need props from useAragonApi are now responsible for calling it. This keeps the code close to where it's used and makes it easier to understand where props are coming from.
9f89cb0
to
1c7343b
Compare
I think capture a ticket and we can start looking into this post mainnet. |
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.
In my recent tests with latest codebase the most concerning issues were addressed, and overall the code works good.
A lot of code was cleaned and the code changes seem ok
I have some other findings, probably most of them are not really related, and I think this PR is already huge, just to take note of these to capture on other tickets if relevant:
- Basically once we stop using some complex react lifecycles we could change lot of other components to be functional, like App.js and the panels (most of them have right now the TODO note about that)
- We can still abstract lot of duplicated logic to hooks to reuse the code a lot, specially the panels seem to have a lot of duplicated boilerplate
- We could encode the proptypes to clean the code a lot, specially the complex objects that need shape
- Lot of props seem not properly typed (I am pretty sure @chadoh addressed this on other commits)
- View funding proposal could probably be improved a bit, probably out of scope but something to take in mind, some data will need additional Apollo queries other can be taken as we do on issuedetail
- Lot of issues transformations happen on the render function, that should be done IMHO in the reducer and some others just Apollo requests, taking advantage of the nice zero config caching it offers (like array of issue names or things like that, so we don't need to manipulate some data locally or we could save some of those transformations)
- When removing repos or creating new issues there is no visual feedback at all, this should happen without the need to refresh
- Filter bar is not correctly showing the filtered results, for example for funded issues, specially after a cache clean
- We want to adopt a solution like aragon/ui has to do the svg cleaning and minification by using a script instead of in-lining svg code from other files (ethereum loading animation) - that is probably not a priority but nice to have and would save time in the mid/long term
- Some things like the github authenticated user should not be loaded each time we visit the settings tab, but be already loaded in a more global state and only read by the settings field
- I generally rather to assign default values for props into the beginning of the components instead of dealing with conditionals in the render function (thing like
token={props.token || []}
would be cleaner if we deal with default values for token just when the prop is received, maybe this is more opinionated, but I find this more readable and cleaner) - The activity log is wiped when a funding is rejected and a new work submission starts
If you @chadoh or @Quazia think any of these are in the scope of this issue would be nice to incorporate, but as I said I encourage to put these on new tickets and merge this one ASAP :)
Nice job @chadoh !
I also commented with @chadoh about the -not that much annoying- |
Fixes #978
This change slims down the
App.js
file in Projects by hundreds of lines, primarily by pushing logic to hooks and context.Reviewing