-
Notifications
You must be signed in to change notification settings - Fork 0
[RFC] Proposal for new file structure #8
[RFC] Proposal for new file structure #8
Conversation
6b7fe6b
to
c00fdbe
Compare
I'd prefer to use map.tsx over index.tsx, it makes navigating to files on vscode easier and I think it's clearer to read. To clarify this we can make the file that matches the directory name is always the entry. i.e. Map > Map.tsx is the root component for feature directories. I'm not sure about sub directories called components within a feature, similar with the index confusions I think it's nicer to use more descriptive naming here and avoid having multiple directories called components scattered around the app. I would suggest using the nested style of Left Panel > Zone Details or Map > Map Controls. we could aim to keep things flat until nesting makes sense. |
Yeah, that does make good sense - let's do that :)
I see your point, I was just worried that one feature folder would suddenly have 10+ files which might make it harder to get an overview and navigate... But we can also deal with that when we get there 😄
Good point, I think it would also make it more clear how the components are used (e.g. an outer LeftPanel "wrapper" that hosts the different panels inside). Let's do as you suggest and aim for flat with exceptions 👍 |
Okay sounds good, let's revisit at some point! |
I'm not sure if this what @tonypls meant but I'd like to see that every component has it's own folder that contains both the "index" file with the same name as the folder Map (folder name) > map.tsx (component name).
What do you guys think? |
I agree on co-locating tests as X.test.tsx instead of inside tests folders :) Regarding everything component in it's own folder I'm not sure if we really want to go that far. I personally don't think we should aim for having unit tests for every single component (at least not in the beginning), so there might be components with just one file related to it. I think we should try it out for a while and then group things when it feels natural, and then see if we can setup automated rules for organizing based on those early experiences :) |
I agree that it will probably be a too big of a underatking to get every single component its own unit tests right now, but we should plan for the future and a long term goal should be to have a complete test coverage when possible. Regarding the folders itself it's mostly a personal choice at this point since we don't have any additional files for now. That config you found is huge! |
This should do the trick for the zones: "explorer.fileNesting.patterns": {
"*.yaml": "${capture}-*.yaml"
} But since there is only one capture group ther is no reliable way to do it for the exchanges. |
Good point, I've taken the js/ts/tsx patterns from the repo I shared + your pattern and added it all to |
Whoops, thought it was reviewed already... Oh well, let me know if there's any parts we should revert 😚 |
Shouldn't the .vscode folder be on the top level outside web? |
There's a symlink - so it works either way right now ¯\_(ツ)_/¯ |
Symlinks don't work on windows 🙈. But this is highly individual and I'm not sure we should override user setting too much. |
I'm hesitant though on recommending users to install a TailwindCSS extension if they're just changing a parser 🤔 |
This is a proposal for a slightly different file structure. I'd love you input and feedback, @tonypls and @Kongkille :)
(Note that this conflicts with other PRs, so for now this is just a PR to discuss things)
Follow-up questions