2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
#! /bin/sh | |
# file : ~/bin/favicon | |
# | |
# usage: favicon foo.png | |
convert "$@" -resize 16x16 favicon-16.png | |
convert "$@" -resize 32x32 favicon-32.png | |
convert "$@" -resize 64x64 favicon-64.png | |
convert "$@" -resize 128x128 favicon-128.png |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
-
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the
secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection. -
Use production SSL certificates locally. This is annoying
env = (function() { | |
var flags = {}, ua = navigator.userAgent, el = document.createElement('div'), video = document.createElement('video'), audio = document.createElement('audio'), root = document.documentElement, i | |
function flag(names) { | |
names = names.split(' ') | |
for (i = 0; i < names.length; i++) | |
flags[names[i]] = true | |
} | |
function classnames() { | |
var names = [], name | |
for(name in flags) if (flags.hasOwnProperty(name)) |
Dear soon-to-be-former user, | |
We've got some fantastic news! Well, it's great news for us anyway. You, on | |
the other hand, are fucked. | |
We've just been acquired by: | |
namespace :db do | |
desc 'Drop, create, migrate, and seed a database' | |
task :reload => :environment do | |
puts "Environment Check: Rails Environment = #{Rails.env}" | |
Rake::Task['db:drop'].reenable | |
Rake::Task['db:drop'].invoke | |
Rake::Task['db:create'].reenable | |
Rake::Task['db:create'].invoke | |
Rake::Task['db:migrate'].reenable if Rails.env.development? | |
Rake::Task['db:migrate'].invoke if Rails.env.development? |
group :assets do | |
gem 'sass-rails', '~> 3.1.0' | |
gem 'coffee-rails', '~> 3.1.0' | |
gem 'uglifier' | |
gem 'compass' | |
end |
main(doc,op) | |
{ | |
// Which frame to sample. Grab this from the userattr of the COFFEE tag! | |
var cofy = op->GetFirstTag(); | |
// Gotcha - when rendering tags get reordered and coffee tag might not come first, | |
// so walk the fucking linked list until we arrive at the tag | |
while(cofy) { | |
if(instanceof(cofy, CoffeeExpressionTag)) break; | |
cofy = cofy->GetNext(); |