yoast-components icon indicating copy to clipboard operation
yoast-components copied to clipboard

[WIP] Restructure yoast-components folder structure

Open abotteram opened this issue 8 years ago • 2 comments

Currently, yoast-components is a bit of a mess. That's why I propose to restructure the entire repository for the 3.0.0 release, to make the library more easy to use.

I propose the following folder structure:

.
+-- /composites
|   +-- /CompositeComponent
|       +-- CompositeComponent.js ( The composite component with a default export )
|       +-- index.js ( Exporting the default export of CompositeComponent.js for shorter import statements )
|       +-- /components ( components that are VERY unlikely to be used stand-alone )
|       |   +-- CompositeSpecificComponent.js
|       +-- /reducers
|           +-- index.js ( combined reducers )
|           +-- subReducer1.js
+-- /components
|   +-- Component.js
+-- /decorators ( Higher order components )
|   +-- enhanceComponent.js
+-- /utils
|   +-- utilFunction.js
+-- /style
+-- /assets
|   +-- /svg
+-- /tests
|   +-- /composites
|   +-- /components
|   +-- /decorators
|   +-- /utils
+-- /app ( Development app and associated files )
|   +-- App.js
|   +-- /tabs (Contains a container component for each App.js tab)

A few other things I would like to see in the 3.0.0 release:

  • Precompiled components (Npm packages should not have to be transpiled by babel)
  • No more required loaders (All assets should be passed by the parent project)

abotteram avatar Sep 26 '17 14:09 abotteram

Sounds good to me. One thing to consider: Do we actually neer different folders for components and composites. What is thr advantage we have got or will get fron this setup?

atimmer avatar Sep 26 '17 20:09 atimmer

@atimmer Simply to differentiate basic components from the more complex components. This way we can keep the components folder clean of components that are only used by one composite because they are defined in the composite components folder.

abotteram avatar Sep 27 '17 09:09 abotteram