Skip to content

Instantly share code, notes, and snippets.

--- react-with-addons.js 2015-05-21 19:10:23.000000000 -0700
+++ build/react-with-addons.js 2015-05-21 19:14:38.000000000 -0700
@@ -522,9 +522,9 @@
* @param {string} className the CSS className
* @return {DOMElement} the element passed in
*/
addClass: function (element, className) {
- 'production' !== "development" ? invariant(!/\s/.test(className), 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(!/\s/.test(className));
+ !!/\s/.test(className) ? 'production' !== "development" ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : undefined;

React-Core Meeting Notes 2015-03-20

Note: This is the first time we're sharing meeting notes publicly. The primary reason we haven't shared these is because we often mix public discussions with matters that are Facebook specific and should not be public. We're really trying to be more open about our development process and what's happening inside the project so moving forward, we'll be sharing meeting notes. While most of us do work at Facebook, we're committed to this being an open project - for now we'll filter out the private notes from the public notes. Hopefully we can make it possible for these meetings to be open to any who wish to attend.

Attendees:

  • @zpao
  • @sebmarkbage
  • @spicyj
  • @jeffmo
@zpao
zpao / advanced.js
Last active August 29, 2015 14:16
Why we have keyMirror - Google Closure Compiler examples
function d(c) {
var b = {}, a;
for (a in c) {
c.hasOwnProperty(a) && (b[a] = a);
}
return b;
}
var e = d({a:null, b:null, c:null}), f = d({a:null}), g = function(c) {
var b = {};
c.forEach(function(a) {
@zpao
zpao / compiled.js
Created February 7, 2015 18:35
PR 3085 Code
function b(a) {
return function() {
return a;
};
}
var c = {b:"a", abbr:"abbr", c:"address", d:"area", a:"article", e:"aside"}, d = {}, e;
for (e in c) {
hasOwnProperty.call(c, e) && (d[e] = b.call(void 0, c[e]));
}
var g = "a abbr address area article aside".split(" ").reduce(function(a, f) {
@zpao
zpao / foo.diff
Last active August 29, 2015 14:14
diff --git a/src/.eslintrc b/src/.eslintrc
index c9b9b50..2f75489 100644
--- a/src/.eslintrc
+++ b/src/.eslintrc
@@ -1,7 +1,11 @@
---
-settings:
+ecmaFeatures:
jsx: true
- ecmascript: 6
@zpao
zpao / -
Created January 22, 2015 01:41
==> Caveats
Add the following to $HOME/.bashrc, $HOME/.zshrc, or your shell's
equivalent configuration file:
source $(brew --prefix nvm)/nvm.sh
Node installs will be lost upon upgrading nvm. Add the following above
the source line to move install location and prevent this:
export NVM_DIR=~/.nvm
diff --git a/package.json b/package.json
index 11a64df..3cf2e94 100644
--- a/package.json
+++ b/package.json
@@ -72,7 +72,8 @@
"scripts": {
"test": "jest",
"jest": "jest",
- "lint": "eslint src"
+ "lint": "eslint src",
> [email protected] lint /Users/poshannessy/FB/code/react
> eslint src
src/addons/ReactRAFBatchingStrategy.js
18:4 error 'requestAnimationFrame' is read only no-undef
src/addons/transitions/ReactCSSTransitionGroupChild.js
67:6 warning Expected an assignment or function call and instead saw an expression no-unused-expressions
@zpao
zpao / foo.js
Created October 21, 2014 20:28
Cu.import("resource://gre/modules/Services.jsm");
Services.prompt.alert(
Services.wm.getMostRecentWindow("navigator:browser"),
"title",
"message"
);
--- build_old/JSXTransformer.js 2014-10-14 21:38:49.000000000 -0700
+++ build/JSXTransformer.js 2014-10-14 22:04:13.000000000 -0700
@@ -1,436 +1,765 @@
/**
* JSXTransformer v0.12.0-alpha
*/
-!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSXTransformer=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
-/*!
- * The buffer module from node.js, for the