Basic unit type:
λ> replTy "()"
() :: ()
Basic functions:
command-shift-P > Package > Package Generator: Generate Syntax Theme > mypackage | |
cd ~/.atom/packages/mypackage | |
apm login | |
apm develop mypackage | |
cd ~/github/mypackage | |
sudo chown -R username:wheel . | |
git commit -a -m 'checking everything in' | |
apm publish --tag v2.5.0 minor |
Basic unit type:
λ> replTy "()"
() :: ()
Basic functions:
This blog post series has moved here.
You might also be interested in the 2016 version.
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).
package lan.dk.podcastserver.utils.multipart; | |
import lan.dk.podcastserver.utils.MimeTypeUtils; | |
import org.apache.commons.lang3.StringUtils; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import javax.servlet.ServletOutputStream; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
key
is pretty much crucial for state perservation in React. As of React 0.13 it can't do the following things:
<Comp key={1} /><Comp key={1} />
import {Router, Route} from 'react-router'; | |
import BrowserHistory from 'react-router/lib/BrowserHistory'; | |
import App from './components/App'; | |
import Widget from './components/Widget'; | |
// A wrapper to create a Relay container | |
function createRelayContainer(Component, props) { | |
if (Relay.isContainer(Component)) { | |
// Construct the RelayQueryConfig from the route and the router props. |
class PostIndex extends React.Component { | |
state = { loading: false }; | |
componentDidMount() { | |
window.onscroll = () => { | |
if (!this.state.loading | |
&& (window.innerHeight + window.scrollY) | |
>= document.body.offsetHeight) { | |
this.setState({loading: true}, () => { |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
A maintainable application architecture requires that the UI only contain the rendering logic and execute queries and mutations against the underlying data model on the server. A maintainable architecture must not contain any logic for composing "app state" on the client as that would necessarily embed business logic in the client. App state should be persisted to the database and the client projection of it should be composed in the mid tier, and refreshed as mutations occur on the server (and after network interruption) for a highly interactive, realtime UX.
With GraphQL we are able to define an easy-to-change application-level data schema on the server that captures the types and relationships in our data, and wiring it to data sources via resolvers that leverage our db's own query language (or data-oriented, uniform service APIs) to resolve client-specified "queries" and "mutations" against the schema.
We use GraphQL to dyn