Static file server with livereload, preprocessors, synchronised testing over multiple browser instances and batteries included. This setup uses Harp and Browsersync, hence the name.
You will need node, install it if you haven't already.
#!/bin/bash | |
# Disclaimer: never got this to work properly and have not attempted it since. | |
# This will require about 30GB of space, still in experimental phase right now | |
sudo gem install iesd | |
cd /Applications # Or wherever you hve the "Install 10.12 Developer Preview.app" available | |
iesd -i Install\ 10.12\ Developer\ Preview.app -o macos.dmg -t BaseSystem | |
hdiutil convert macos.dmg -format UDSP -o macos.sparseimage |
Static file server with livereload, preprocessors, synchronised testing over multiple browser instances and batteries included. This setup uses Harp and Browsersync, hence the name.
You will need node, install it if you haven't already.
curl -Lo concourse https://github.com/concourse/concourse/releases/download/v2.5.0/concourse_darwin_amd64 && chmod +x concourse && mv concourse /usr/local/bin
function prefetch(getKey, getValue, getInitialValue, propName) { | |
const inFlight = new Set(); | |
const cache = new Map(); | |
return ChildComponent => { | |
return class extends React.Component { | |
state = {value: getInitialValue(this.props)}; | |
componentWillReceiveProps(nextProps) { | |
const key = getKey(nextProps); | |
if (cache.has(key)) { | |
// Use cached value |
tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.
A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.
But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.
How do we solve this with React?