samedi 20 mai 2017

Create services layer for react and react native

im starting a starting a new project with few of my friends, so before we started we were thinking what is the best way to split react/reactnative app into small completely isolated modules,

rules rules rules.

  1. every module will be developed in its own project, and once finished merged into master
  2. modules should have no dependencies out side, except for a single Signelton object that will be used to connect all parts togethers
  3. the main Signelton object, is alson not awware of the modules, they will import him, and register them self.
  4. UI will be developer separatly, and is not aware of any logic, it just depends on redux to get state.

so to add a new module, will go through process.

  1. build -Ducks- actions, reducers, constance that set mounting point on redux state, and selectors to define a strict boundries between modules, no module should ever fetch data from state directly but will use selectors;
  2. build web UI of module
  3. build mobile reactnative UI of module;
  4. module register its reducer, and routes with the App main sigelton;

so these are rules we belive will allow us to split work on the whole team, each one will be working on his own module, and we merge into master once finished.

so now how to can we implement :D ? is there a common practice to achive such separation of concerns ?

Aucun commentaire:

Enregistrer un commentaire