Browse Source

doc: update CONTRIBUTING

master^2
Saúl Ibarra Corretgé 4 years ago
parent
commit
abb724e173
1 changed files with 29 additions and 0 deletions
  1. 29
    0
      CONTRIBUTING.md

+ 29
- 0
CONTRIBUTING.md View File

@@ -123,3 +123,32 @@ in the agreement, unfortunately, we cannot accept your contribution.
123 123
   respective variable, function, property is non-public i.e. private, protected,
124 124
   or internal. In contrast, the lack of an underscore at the beginning of a name
125 125
   signals public API.
126
+
127
+### Feature layout
128
+
129
+When adding a new feature, this would be the usual layout.
130
+
131
+```
132
+react/features/sample/
133
+├── actionTypes.js
134
+├── actions.js
135
+├── components
136
+│   ├── AnotherComponent.js
137
+│   ├── OneComponent.js
138
+│   └── index.js
139
+├── middleware.js
140
+└── reducer.js
141
+```
142
+
143
+The middleware must be imported in `react/features/app/` specifically
144
+in `middlewares.any`, `middlewares.native.js` or `middlewares.web.js` where appropriate.
145
+Likewise for the reducer.
146
+
147
+An `index.js` file must not be provided for exporting actions, action types and
148
+component. Features / files requiring those must import them explicitly.
149
+
150
+This has not always been the case and the entire codebase hasn't been migrated to
151
+this model but new features should follow this new layout.
152
+
153
+When working on an old feature, adding the necessary changes to migrate to the new
154
+model is encouraged.

Loading…
Cancel
Save