Closed noveogroup-amorgunov closed 6 months ago
Name | Link |
---|---|
Latest commit | c3661bf9fc558642fe5321936a79283201e544da |
Latest deploy log | https://app.netlify.com/sites/nukeapp/deploys/65fac250a1632600080713c9 |
Deploy Preview | https://deploy-preview-21--nukeapp.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Name | Link |
---|---|
Latest commit | c3661bf9fc558642fe5321936a79283201e544da |
Latest deploy log | https://app.netlify.com/sites/nukeapp-story/deploys/65fac2505cb14100085ef5e4 |
Deploy Preview | https://deploy-preview-21--nukeapp-story.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Motivation
Usually we don't have enough layers to composite UI. For example, we have
ProductList
widget which uses different entities and features. At the same time, we have N widgets like{Any}ProductList
(for example,PopularProductList
) that useProductList
. Of course, we can make dumbProductList
and place it onentities/product
level and pass all data as props, but every of the N widgets will duplicate each other's logic (hello prop drilling). A lot of duplication of each other.So, there are several options:
page-widgets
orentity-widgets
, but it complicates architecture and module communication in general;Initially, this project used the second approach 2️⃣ (we use this approach on the working project as well), when cross-imports between widgets were allowed. But this option violates the low coupling principle, and this can become a problem in large projects.
This pull request introduces a fourth option: 4️⃣ a new sublayer for base widgets that can be imported by other widgets. If a widget's name starts with
widget/Base*
, then it is a base widget and can be imported by other widgets.Changes (roadmap)
ProductList
.