Facebook tutorials and resources:
- Introducing Relay and GraphQL, Data fetching for React applications @Facebook.
- GraphQL Introduction @Facebook
- Building the facebook news feed with relay
Why be interested:
var Lokka = require('lokka').Lokka; | |
var Transport = require('lokka-transport-http').Transport; | |
// Create a lokka client against SWAPI GraphQL API | |
var client = new Lokka({ | |
transport: new Transport('http://graphql-swapi.parseapp.com/') | |
}); |
var graphqlDemo = React.createClass({ | |
getInitialState() { | |
return {movies: []} | |
}, | |
componentDidMount() { | |
// query when we mount the view | |
client.query(` | |
{ | |
allFilms { | |
films { |
import Lokka from 'lokka'; | |
import HttpTransport from 'lokka-transport-http'; | |
const client = new Lokka({ | |
transport: new HttpTransport('http://graphql-swapi.parseapp.com/') | |
}); |
const GraphQLCache = require('graphql-cache'); | |
const HttpTransport = require('graphql-cache-http-transport'); | |
const React = require('react'); | |
const ReactDOM = require('react-dom'); | |
const Cache = new GraphQLCache({ | |
transport: new HttpTransport('/graphql'); | |
}); | |
// Create the fragment where we can use later on |
Facebook tutorials and resources:
Why be interested:
var graphql = require('graphql'); | |
var userType = new graphql.GraphQLObjectType({ | |
name: 'User', | |
fields: () => ({ | |
id: {type: graphql.GraphQLString}, | |
name: {type: graphql.GraphQLString}, | |
friends: { | |
type: new graphql.GraphQLList(userType), | |
args: { |
ServiceConfiguration.configurations.remove({ | |
service: "meteor-developer" | |
}); | |
if(Meteor.settings.meteorDevelopers) { | |
var meteorDevelopersInfo = Meteor.settings.meteorDevelopers; | |
} else { | |
var meteorDevelopersInfo = { | |
clientId: "HcempmSyaawiyb4G4", | |
secret: "snC3snsmTebC8HHCwwhqhHaAzAFxtFsQRL" |
{ | |
_id: "7Tij2HTGqhrRE3k78", | |
created: ISODate("2014-02-07T04:04:33.266Z"), | |
initialDataReceived: true, | |
name: "kadira-ui", | |
owner: "vapXLdykrravRPua8", | |
secret: "bfda539b-cf42-469a-9847-49f11883858f", | |
plan: "pro", | |
planToUSD: 0.003, | |
collaborators: [], |
# add the email package | |
meteor add email |
The prep-script.sh
will setup the latest Node and install the latest perf version on your Linux box.
When you want to generate the flame graph, run the following (folder locations taken from install script):
sudo sysctl kernel/kptr_restrict=0
perf record -i -g -e cycles:u -- ~/sources/node/node --perf-basic-prof script.js
perf script | egrep -v "( __libc_start| LazyCompile | v8::internal::| Builtin:| Stub:| LoadIC:|\[unknown\]| LoadPolymorphicIC:)" | sed 's/ LazyCompile:[*~]\?/ /' | ~/sources/FlameGraph/stackcollapse-perf.pl > out.perf-folded