- Stephen BelangerβBrowserifying Big Projects With Minimal Rage
- Nicolas BevacquaβBrowserify All The Things
- James HallidayβBrick The Web
| /** | |
| * Bitwise Mathematics Utilities | |
| * | |
| * A collection of fast bitwise operations for integer mathematics. | |
| * These functions prioritize performance over readability and should be used | |
| * when micro-optimizations are critical (game engines, real-time applications). | |
| * | |
| * References: | |
| * - http://michalbe.blogspot.com.br/2013/03/javascript-less-known-parts-bitwise.html | |
| * - http://jsperf.com/bitwise-vs-math-object |
| [alias] | |
| co = checkout | |
| ci = commit | |
| ca = commit --amend | |
| cia = commit -a | |
| can = commit --amend --no-edit | |
| com = checkout master | |
| st = status | |
| s = status --short | |
| b = branch |
##Sass Functions Cheat Sheet
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
When writing a React component, you want to target all environments. It is easy to generate a build that will work on the server and browser with Webpack, and as a bonus you can use loaders (like babel-loader for ES6 code).
When you generate this bundle, you should rely on "react" as an external so it isn't included in the bundle. In all environments this is desired behavior so you don't duplicate "react" and break it. This is necessary both because it would make a much larger bundle than necessary, but also because React behaves badly when multiple copies are loaded.
If you do this, you'll end up with a UMD shim like:
(function webpackUniversalModuleDefinition(root, factory) {| var spawnSync = require('spawn-sync'); | |
| var NODE_ENV = process.env.NODE_ENV; | |
| var production = (NODE_ENV === 'production'); | |
| /** | |
| * `npm dedupe` in cwd | |
| * @return {undefined} | |
| */ | |
| var dedupe = function() { | |
| var result; |
| {% comment %} | |
| * | |
| * This loop loops through a collection called `collection_name` | |
| * and sorts it by the front matter variable `date` and than filters | |
| * the collection with `reverse` in reverse order | |
| * | |
| * To make it work you first have to assign the data to a new string | |
| * called `sorted`. | |
| * | |
| {% endcomment %} |