The document outlines the schedule for a conference including talks and Q&A sessions. It begins with pizza and networking at 7:00 followed by an introduction at 7:25. Three speakers will give talks between 7:30-9:00, with Q&A sessions following each talk. From 9:00-9:30 there will be lightning talks.
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
How and When to Use FalcorJS
1. Schedule
7:00 - Pizza and Networking
7:25 - Introduction
7:30 - Talk by Juha
7:50 - Q&A for Juha
8:00 - Talk by Yuan Feng
8:20 - Q&A for Yuan Feng
8:30 - Talk by Remi Robert
8:50 - Q&A for Remi
9:00- Lightning Talks
3. What is falcor? (1)
• Framework to replace the traditional RESTful JSON
API
• Developed by Netflix, released last year
• Uses their JSONGraph spec to define routes:
{
todosById: {
"44": {
name: "get milk from corner store",
done: false,
}},
todos: [
{ $type: "ref", value: ["todosById", 44] },
{ $type: "ref", value: ["todosById", 54] }
]
}
4. What is falcor? (2)
• Similar to GraphQL and relay
• Gives transparent graph construction
• Does browser-side caching
• Has clean client side and backend libraries
5.
6. Dig deeper: Backend
• RESTful API has url handlers <> Falcor API has JSON
path handlers
• Each handler defines the route and handler function:
{
route: "greeting",
get: function() {
return {path:["greeting"], value: "Hello World"};
}
},
• Add them to express.js app:
app.use('/model.json', FalcorServer.dataSourceRoute(function(req,
res) {
return new Router(falcorRoutes);
}));
7. Dig deeper: Frontend
• Create model object:
var model = new falcor.Model({
source: new falcor.HttpDataSource('/model.json')
});
• Query the data using JSON paths
model.get(“greeting”).then(function(data){
console.log(data);
})
8. Why did we consider
Falcor?
• We had:
• Browser app with a lot of independent widgets on page
• Fairly straightforward data structure
• Data in Redis
• We wanted to:
• Avoid making lots API requests when page loads
• Have clean way to request data from backend.
• Have something that we can use with Redux.
• Have a simple backend.
9. What worked for us?
• Very low amount of backend code, just
concentrating on data transformation (as it should)
11. What else can Falcor do?
• Support for references ($ref)
• Not just gets, writes are supported too
• Authentication management
• Support for other backend languages
• Use static JSON structure as a source