Skip to content

Instantly share code, notes, and snippets.

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.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@jeffmo
jeffmo / gist:054df782c05639da2adb
Last active January 11, 2024 06:05
ES Class Property Declarations
@Chase-san
Chase-san / decode.py
Created September 5, 2021 21:25
A python script to decode the hello games no man's sky save files. (The newer compressed kind)
#!/usr/bin/python3
import io
import os
import lz4.block
from glob import glob
FILE_PATH = os.path.dirname(os.path.realpath(__file__))
def uint32(data):
"""Convert 4 bytes to a little endian unsigned integer."""
@nddrylliog
nddrylliog / minimal-cairo.md
Last active January 7, 2022 04:40
Minimal cairo build - for the humanoid who already has everything and just needs vector graphics

You need both pixman and cairo, which you can find here: http://cairographics.org/releases/

Pixman configure:

../pixman-0.32.4/configure --prefix=/root/prefix --disable-libpng --disable-gtk

Cairo configure:

PKG_CONFIG_PATH=/root/prefix/lib/pkgconfig ../cairo-1.12.16/configure --prefix=/root/prefix --enable-xlib=no --enable-xcb=no --enable-xcb-shm=no --enable-win32=no --enable-quartz=no --enable-script=no --enable-ft=no --enable-fc=no --enable-ps=no --enable-pdf=no --enable-svg=no --enable-gobject=no --enable-trace=no --enable-interpreter=no --enable-png=no

@bmeck
bmeck / proposal-no-path-searching.md
Last active February 6, 2018 17:20
Removal of path searching / defining a hook for migration.

Problem

There has been no progress in working towards a single cohesive story for path resolution between Servers and Web. Notable discussion points relevant to this are:

  1. Node has a path searching algorithm.
  2. Web has not been able to gather support for any of the following:
    1. Build tooling as part of UX expectations (lack of interest)
    2. Smarter static web servers (lack of interest). PoC example at https://github.com/bmeck/esm-http-server
  3. A resolve based hook. (interest shown with desire for ~6 months of userland experimentation)
@getify
getify / bug1.js
Last active August 29, 2015 14:01
moar promise bugs :/
// This bug has already been reported to clarify the ES6 spec:
// https://bugs.ecmascript.org/show_bug.cgi?id=2837
//
// I think it still needs to be reported to FF.
//
// Documenting here for completeness and for relationship to
// the other bugs here.
function immed(s) { x++; s(); }
function incX(){ x++; }