The Grail: React based Isomorph apps framework Eldar Djafarov [email protected] @edjafarov github.com/edjafarov
Jul 18, 2015
The Grail: React based Isomorph apps framework
Eldar Djafarov
[email protected] @edjafarov github.com/edjafarov
• rendering
• routing
• business logic
• resources
router business logic stores
view
resourceRESTAPI
How the isomorphic app should look like?
Isomorphic renderingReact
converts the state into DOM
state virtualdom DOM
describe how your state is rendered declaratively and make your business logic manipulate state
instead of view
How the isomorphic app should look like?
• rendering
• routing
• business logic
• resources
router business logic stores
view
resource
router business logic stores
view
resource
How the isomorphic app should look like?
• rendering
• routing
• business logic
• resources
router business logic stores
view
resource
router business logic stores
view
resource
Isomorphic business logic
• get Items
• render Screen
• validate incoming Item
• save Item
• get updated Items
• handle Error is save failed
• render Screen
Fetch data Save data
Isomorphic business logic
• getItems
• renderScreen
• validateItem
• saveItem
• getItems
• handleError
• renderScreen
Fetch data Save data
How the isomorphic app should look like?
• rendering
• routing
• business logic
• resources
router business logic stores
view
resource
router business logic stores
view
resourceRESTAPI
there is no server
- Do not try and code the isomorphic backend. That's impossible. Instead... only try to realize the truth. - What truth? - There is no server.
• rendering
• routing
• business logic
• resources
router business logic stores
view
How the isomorphic app should look like?
Isomorphic business logic
validate
validate allowIf(‘canSave’) db.saveTo(‘Item’)
db.get(‘Item’,{})emit(‘items’)catch(‘items:fail’)
client server