Frontend architecture
Already chosen


React
Webpack
In progress


vs
Final encounter coming soon!
ES experiment FTW!
To be decided!
Application state manager

Why?
- Big community backup
- Small and concise
- Easily extendable
- A lot of plugins / libs
- One central state
- Great developer experience
	- Redux tools
- Time travelling
- Hot reloading
 
Cons
- Not opinionated - lots of ways to achieve the same result
- A bit of boilerplate to write
- No "batteries included"
Alternatives
- Other Flux-ish libraries
- GraphQL / Falcor
- Baobab
- Pure React state
Voting time!



State object

Why?
- Made and supported by Facebook
- Immutability
- Convenient API
- Lots of helpers to transform state
- Objective - functional mix feels good
- Battle tested with Redux - deep state comparing works great
Cons
- Not a pure JS object
	- Interoperability is not perfect
- Need getters, .toJS() or Records for getting values
- Harder to debug
 
Alternatives
- Ramda JS
- Seamless-immutable
- POJO
Voting time!



Testing


Enzyme

Karma
- Very popular combination
- Run tests in real browsers (even BrowserStack)
- Easily test output of React components with Enzyme
- Familiar expect syntax with Chai
Why?
- Need some initial setup and configuration
Cons
Voting time!



Folder structure
* frontend (<-- apps go here)
  |-- apps
      |-- Build
          |-- index.js (<-- entry file)
          |-- components
              |-- PostItItem
                  |-- PostItItem.js
                  |-- PostItItem.spec.js
                  |-- PostItItem.css
                  |-- package.json
          |-- containers
              |-- PostItItemContainer.js
          |-- actions
              |-- postIts.js
          |-- reducer
              |-- postIts.js
  |-- lib (<-- shared stuff we created)
      |-- components
      |-- utils
      |-- etc.
  |-- vendor (<-- shared stuff others created)
Alternative
* frontend (<-- apps go here)
  |-- apps
      |-- Build
          |-- index.js (<-- entry file)
          |-- PostIts
              |-- postItActions.js
              |-- postItsReducer.js
              |-- PostItItem.js
              |-- PostItItem.spec.js
              |-- PostItItem.css
              |-- PostItsList.js
              |-- PostItsList.spec.js
              |-- PostItsList.css
              |-- PostItsListContainer.js
              |-- PostItItemContainer.js
  |-- lib (<-- shared stuff we created)
      |-- components
      |-- utils
      |-- etc.
  |-- vendor (<-- shared stuff others created)
Voting time!



Not covered
- CSS
- Smooth Backbone -> Redux transition

deck
By Lucjan Suski
deck
- 311
 
   
   
  