Component file names: component.js and index.js #1518
Replies: 5 comments 10 replies
-
There are some benefits with this new proposal from @stivaliserna described in this article |
Beta Was this translation helpful? Give feedback.
-
I love this aproach and started apliing it a year ago on sui-components but... the API tab breaks cuz the sui-studio is parsing the default component exported from index.js which must be declared into it. It is parsed using react-docs appling an ast-parser to the declared component propTypes default exported of this file. Then i rollback |
Beta Was this translation helpful? Give feedback.
-
The Wonderful (aka Cross Login) FE team are in love with the proposal, we can't wait to have the new structure 😊 |
Beta Was this translation helpful? Give feedback.
-
When I first join Adevinta, this was one of the pains I had to deal with, but I had a bunch of other stuff going on and I ended up getting used to search for components with this pattern . Love the initiative. |
Beta Was this translation helpful? Give feedback.
-
From the Web Platform point of view, it's fine to go ahead with this solution, but in order to finally implement it, we must fix before any issue it can cause in the |
Beta Was this translation helpful? Give feedback.
-
Currently for each component, there’s a component folder and inside it lives an index file, e.g
component/src/index.js
, but this makes fuzzy file searching difficult because all the files are name the same.To solve this pain, the idea is to have a
Component.js
file that contains all the component logic and an index re-export:This makes searching easier while keeping cleaner imports.
Is this also a pain for you? Do you have any other ideas on how to solve it? Would you be ok with this new structure?
Leave a comment with your thoughts and if the topic was discussed and approved in your vertical check the box below:
Beta Was this translation helpful? Give feedback.
All reactions