SIP-61 src/pages structure proposal #22330
Replies: 10 comments 10 replies
-
My first PR for this proposal - chore: Move charts to src/pages folder 🙌 |
Beta Was this translation helpful? Give feedback.
-
Maybe it's better to rename the |
Beta Was this translation helpful? Give feedback.
-
We are planning to take the iterative approach and move the pages one by one in order to reduce the chance of breaking current PRs |
Beta Was this translation helpful? Give feedback.
-
Thank you @EugeneTorap for the discussion. I'm pinging some folks to help with the discussion and also to raise awareness @kgabryje @geido @codyml @eschutho @lyndsiWilliams @EugeneTorap Some first-pass comments:
|
Beta Was this translation helpful? Give feedback.
-
I suggest to rename |
Beta Was this translation helpful? Give feedback.
-
This looks great to me. One question: it looks like the above schema combines |
Beta Was this translation helpful? Give feedback.
-
Thanks @EugeneTorap for the SIP! Similar to my comment above, what defines a page? Is it just a component that is linked to a route? There's nothing really intrinsic about the component itself that makes it a page, but rather how it is used. The way that I see it now is that we have two types of components: design components and everything else. Some components like the database modal can appear on any page, so where do they go? I don't know that I would consider that a page, or even nest it under the database page folder. Similarly, the dataset modal is going to be a full page soon. I'm not sure if we should be binding our folder nomenclature that strongly to how the component is used. I'd be curious to hear @eric-briscoe's thoughts, too, since he's working on the design components. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your comments @codyml @eschutho. They were really valuable to the discussion. I went back and reviewed SIP-61’s references and also searched for new ones such as How To Structure React Projects From Beginner To Advanced and Evolution of a React folder structure and why to group by features right away and a possible structure could be:
Features are reusable parts of pages. They are not atomic UI elements, those are the components. Think of features as Superset specific parts while components could be reused by any other application. A feature may be promoted to a component if it’s reusable outside of Superset. Some examples of features are:
The names of the feature folders represent the domain and not where a particular feature is used. Using the Pages are a composition of features and they are mapped to the navigation routes of the application. Two pages can use the same feature such as the dataset edit modal. Because we didn’t have these concepts before, some folders or component names may seem weird at this stage, but as we continue to reuse the features across pages, the concepts, dependencies, and names will improve over time. The same applies to our actions and reducers, they are all grouped now but over time we’ll have them split by feature. WDYT? |
Beta Was this translation helpful? Give feedback.
-
Hi @EugeneTorap. We received great feedback from @eschutho @codyml and @eric-briscoe and kept the discussion open for more than a month to give the opportunity for more contributions. We have reached a good structure and we're ready to incrementally move the files. Thank you all for the discussion. |
Beta Was this translation helpful? Give feedback.
-
#23241 implements the changes outlined here. |
Beta Was this translation helpful? Give feedback.
-
SIP-61 provides a new structure for our frontend folders.
In this discussion, we will only touch on structure of the pages.
src
&src/views/CRUD
pages tosrc/pages
camelCase
for every folder name.chart
has two pages:creation
andlist
sqlLab
,explore
, andhome
should be kept in the singular form.welcome
tohome
Before
After
Beta Was this translation helpful? Give feedback.
All reactions