michael-s-molina commented on issue #13632:
URL: https://github.com/apache/superset/issues/13632#issuecomment-800487515


   Thank you all for your feedback! I really like the spirit of this community!
   
   > I suggest removing "utils" as a category. In my experience, utils usually 
ends up being a disorganized grab bag of random things. I'd move "logger" to a 
"services" category, and split out the rest into either their feature folders, 
or into files organized by their domain (`stringFns.ts`, `urlFns`, etc.).
   
   > Awesome @michael-s-molina! What do you think about putting the redux 
actions and reducers outside of the folders for the pages or features as they 
will usually align with the structure of the store and not necessarily be that 
closely related to the rest of the folder structure?
   
   @suddjian and @eschutho Your comments are great and couldn’t be more 
related! I was reviewing the articles and I think we can kill two birds with 
the same stone!
   
   Some quotes from [React Folder Structure in 5 
Steps](https://www.robinwieruch.de/react-folder-structure):
   
   > From here, there may be other utilities which need to be accessible to 
your components and hooks. For miscellaneous utilities I usually create a 
services/ folder.
   
   > Fortunately JavaScript's Intl API gives us excellent tools for date 
conversions. However, instead of using the API directly in my React components, 
I like to have a service for it, because only this way I can guarantee that my 
components have only a slim set of actively used date formatting options 
available for my application. Otherwise there would be lots of different date 
formats in a growing application.
   
   > Furthermore, if a service from the previous step is tightly coupled to a 
domain, then move the service to the specific domain folder.
   
   This is a picture from the article showing the organization:
   
   <img width="700" alt="Screen Shot 2021-03-16 at 2 38 34 PM" 
src="https://user-images.githubusercontent.com/70410625/111354769-6b99ea00-8665-11eb-9a55-240896f2de8a.png";>
   
   We can see that the organization follows the same logic as the components 
but this time using a services folder. So if a service is shared among features 
then it belongs to the first level. If it's something specific then it should 
go to the feature level. We can apply the same concept to utilities,  actions 
and reducers. We can see in the image that date formatting (utility) is treated 
as service and that any level can contain a service folder depending on 
reusability.
   
   The same pattern is present in [How to better organize your React 
applications?](https://alexmngn.medium.com/how-to-better-organize-your-react-applications-2fd3ea1920f1)
   
   <img width="633" alt="Screen Shot 2021-03-16 at 2 43 43 PM" 
src="https://user-images.githubusercontent.com/70410625/111357655-4490e780-8668-11eb-9a60-7b42d2d482a7.png";>
   
   Sounds good?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to