diff --git a/Makefile b/Makefile index 4089b4f..80991aa 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ veryclean: clean rm -rf bower_components bower_components: - bower install react#v0.9.0 + bower install react#v0.10.0 vendor/reagent/react.min.js: bower_components/react/react.min.js Makefile cp $< $@ diff --git a/bower_components/react/.bower.json b/bower_components/react/.bower.json index 9545767..5603e9b 100644 --- a/bower_components/react/.bower.json +++ b/bower_components/react/.bower.json @@ -1,16 +1,16 @@ { "name": "react", - "version": "0.9.0", + "version": "0.10.0", "main": "react.js", "homepage": "https://github.com/facebook/react-bower", - "_release": "0.9.0", + "_release": "0.10.0", "_resolution": { "type": "version", - "tag": "v0.9.0", - "commit": "81855fdf1b8454ee0ea8dd0e05a896cf5cf03010" + "tag": "v0.10.0", + "commit": "4862309b39ceef32a65c160cd9987eccdfb29c38" }, "_source": "git://github.com/facebook/react-bower.git", - "_target": "v0.9.0", + "_target": "v0.10.0", "_originalSource": "react", "_direct": true } \ No newline at end of file diff --git a/bower_components/react/JSXTransformer.js b/bower_components/react/JSXTransformer.js index 1234541..eba3f1c 100644 --- a/bower_components/react/JSXTransformer.js +++ b/bower_components/react/JSXTransformer.js @@ -1,64 +1,18 @@ /** - * JSXTransformer v0.9.0 + * JSXTransformer v0.10.0 + */ +!function(e){if("object"==typeof exports)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 + * License: MIT + * + * `npm install buffer` */ -!function(e){if("object"==typeof exports)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 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; -})(); - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -} - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -},{}],2:[function(require,module,exports){ -var base64 = require('base64-js') -var ieee754 = require('ieee754') +var base64 = _dereq_('base64-js') +var ieee754 = _dereq_('ieee754') exports.Buffer = Buffer exports.SlowBuffer = Buffer @@ -73,13 +27,13 @@ Buffer.poolSize = 8192 Buffer._useTypedArrays = (function () { // Detect if browser supports Typed Arrays. Supported browsers are IE 10+, // Firefox 4+, Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. - if (typeof Uint8Array === 'undefined' || typeof ArrayBuffer === 'undefined') - return false + if (typeof Uint8Array !== 'function' || typeof ArrayBuffer !== 'function') + return false // Does the browser support adding properties to `Uint8Array` instances? If // not, then that's the same as no `Uint8Array` support. We need to be able to // add all the node Buffer API methods. - // Relevant Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=695438 + // Bug in Firefox 4-29, now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438 try { var arr = new Uint8Array(0) arr.foo = function () { return 42 } @@ -301,6 +255,12 @@ function _base64Write (buf, string, offset, length) { return charsWritten } +function _utf16leWrite (buf, string, offset, length) { + var charsWritten = Buffer._charsWritten = + blitBuffer(utf16leToBytes(string), buf, offset, length) + return charsWritten +} + Buffer.prototype.write = function (string, offset, length, encoding) { // Support both (string, offset, length, encoding) // and the legacy (string, encoding, offset, length) @@ -328,25 +288,34 @@ Buffer.prototype.write = function (string, offset, length, encoding) { } encoding = String(encoding || 'utf8').toLowerCase() + var ret switch (encoding) { case 'hex': - return _hexWrite(this, string, offset, length) + ret = _hexWrite(this, string, offset, length) + break case 'utf8': case 'utf-8': - case 'ucs2': // TODO: No support for ucs2 or utf16le encodings yet + ret = _utf8Write(this, string, offset, length) + break + case 'ascii': + ret = _asciiWrite(this, string, offset, length) + break + case 'binary': + ret = _binaryWrite(this, string, offset, length) + break + case 'base64': + ret = _base64Write(this, string, offset, length) + break + case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': - return _utf8Write(this, string, offset, length) - case 'ascii': - return _asciiWrite(this, string, offset, length) - case 'binary': - return _binaryWrite(this, string, offset, length) - case 'base64': - return _base64Write(this, string, offset, length) + ret = _utf16leWrite(this, string, offset, length) + break default: throw new Error('Unknown encoding') } + return ret } Buffer.prototype.toString = function (encoding, start, end) { @@ -362,25 +331,34 @@ Buffer.prototype.toString = function (encoding, start, end) { if (end === start) return '' + var ret switch (encoding) { case 'hex': - return _hexSlice(self, start, end) + ret = _hexSlice(self, start, end) + break case 'utf8': case 'utf-8': - case 'ucs2': // TODO: No support for ucs2 or utf16le encodings yet + ret = _utf8Slice(self, start, end) + break + case 'ascii': + ret = _asciiSlice(self, start, end) + break + case 'binary': + ret = _binarySlice(self, start, end) + break + case 'base64': + ret = _base64Slice(self, start, end) + break + case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': - return _utf8Slice(self, start, end) - case 'ascii': - return _asciiSlice(self, start, end) - case 'binary': - return _binarySlice(self, start, end) - case 'base64': - return _base64Slice(self, start, end) + ret = _utf16leSlice(self, start, end) + break default: throw new Error('Unknown encoding') } + return ret } Buffer.prototype.toJSON = function () { @@ -471,7 +449,15 @@ function _hexSlice (buf, start, end) { return out } -// http://nodejs.org/api/buffer.html#buffer_buf_slice_start_end +function _utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i+1] * 256) + } + return res +} + Buffer.prototype.slice = function (start, end) { var len = this.length start = clamp(start, len, 0) @@ -1062,6 +1048,20 @@ function asciiToBytes (str) { return byteArray } +function utf16leToBytes (str) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; i++) { + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + function base64ToBytes (str) { return base64.toByteArray(str) } @@ -1090,22 +1090,21 @@ function decodeUtf8Char (str) { * exceed the maximum allowed value. */ function verifuint (value, max) { - assert(typeof value == 'number', 'cannot write a non-number as a number') - assert(value >= 0, - 'specified a negative value for writing an unsigned value') + assert(typeof value === 'number', 'cannot write a non-number as a number') + assert(value >= 0, 'specified a negative value for writing an unsigned value') assert(value <= max, 'value is larger than maximum value for type') assert(Math.floor(value) === value, 'value has a fractional component') } -function verifsint(value, max, min) { - assert(typeof value == 'number', 'cannot write a non-number as a number') +function verifsint (value, max, min) { + assert(typeof value === 'number', 'cannot write a non-number as a number') assert(value <= max, 'value larger than maximum allowed value') assert(value >= min, 'value smaller than minimum allowed value') assert(Math.floor(value) === value, 'value has a fractional component') } -function verifIEEE754(value, max, min) { - assert(typeof value == 'number', 'cannot write a non-number as a number') +function verifIEEE754 (value, max, min) { + assert(typeof value === 'number', 'cannot write a non-number as a number') assert(value <= max, 'value larger than maximum allowed value') assert(value >= min, 'value smaller than minimum allowed value') } @@ -1114,7 +1113,7 @@ function assert (test, message) { if (!test) throw new Error(message || 'Failed assertion') } -},{"base64-js":3,"ieee754":4}],3:[function(require,module,exports){ +},{"base64-js":2,"ieee754":3}],2:[function(_dereq_,module,exports){ var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; ;(function (exports) { @@ -1237,7 +1236,7 @@ var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; module.exports.fromByteArray = uint8ToBase64 }()) -},{}],4:[function(require,module,exports){ +},{}],3:[function(_dereq_,module,exports){ exports.read = function(buffer, offset, isLE, mLen, nBytes) { var e, m, eLen = nBytes * 8 - mLen - 1, @@ -1323,8 +1322,64 @@ exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128; }; -},{}],5:[function(require,module,exports){ -var process=require("__browserify_process");// Copyright Joyent, Inc. and other Node contributors. +},{}],4:[function(_dereq_,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; + +process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + if (canPost) { + var queue = []; + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; +})(); + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +} + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +},{}],5:[function(_dereq_,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the @@ -1549,7 +1604,8 @@ var substr = 'ab'.substr(-1) === 'b' } ; -},{"__browserify_process":1}],6:[function(require,module,exports){ +}).call(this,_dereq_("/Users/poshannessy/FB/code/react/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js")) +},{"/Users/poshannessy/FB/code/react/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":4}],6:[function(_dereq_,module,exports){ /* Copyright (C) 2013 Ariya Hidayat Copyright (C) 2013 Thaddee Tyl @@ -7857,7 +7913,7 @@ parseYieldExpression: true })); /* vim: set sw=4 ts=4 et tw=80 : */ -},{}],7:[function(require,module,exports){ +},{}],7:[function(_dereq_,module,exports){ var Base62 = (function (my) { my.chars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] @@ -7885,17 +7941,17 @@ var Base62 = (function (my) { }({})); module.exports = Base62 -},{}],8:[function(require,module,exports){ +},{}],8:[function(_dereq_,module,exports){ /* * Copyright 2009-2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE.txt or: * http://opensource.org/licenses/BSD-3-Clause */ -exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator; -exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer; -exports.SourceNode = require('./source-map/source-node').SourceNode; +exports.SourceMapGenerator = _dereq_('./source-map/source-map-generator').SourceMapGenerator; +exports.SourceMapConsumer = _dereq_('./source-map/source-map-consumer').SourceMapConsumer; +exports.SourceNode = _dereq_('./source-map/source-node').SourceNode; -},{"./source-map/source-map-consumer":13,"./source-map/source-map-generator":14,"./source-map/source-node":15}],9:[function(require,module,exports){ +},{"./source-map/source-map-consumer":13,"./source-map/source-map-generator":14,"./source-map/source-node":15}],9:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors @@ -7903,11 +7959,11 @@ exports.SourceNode = require('./source-map/source-node').SourceNode; * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { - var define = require('amdefine')(module, require); + var define = _dereq_('amdefine')(module, _dereq_); } -define(function (require, exports, module) { +define(function (_dereq_, exports, module) { - var util = require('./util'); + var util = _dereq_('./util'); /** * A data structure which is a combination of an array and a set. Adding a new @@ -7994,7 +8050,7 @@ define(function (require, exports, module) { }); -},{"./util":16,"amdefine":17}],10:[function(require,module,exports){ +},{"./util":16,"amdefine":17}],10:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors @@ -8032,11 +8088,11 @@ define(function (require, exports, module) { * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ if (typeof define !== 'function') { - var define = require('amdefine')(module, require); + var define = _dereq_('amdefine')(module, _dereq_); } -define(function (require, exports, module) { +define(function (_dereq_, exports, module) { - var base64 = require('./base64'); + var base64 = _dereq_('./base64'); // A single base 64 digit can contain 6 bits of data. For the base 64 variable // length quantities we use in the source map spec, the first bit is the sign, @@ -8140,7 +8196,7 @@ define(function (require, exports, module) { }); -},{"./base64":11,"amdefine":17}],11:[function(require,module,exports){ +},{"./base64":11,"amdefine":17}],11:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors @@ -8148,9 +8204,9 @@ define(function (require, exports, module) { * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { - var define = require('amdefine')(module, require); + var define = _dereq_('amdefine')(module, _dereq_); } -define(function (require, exports, module) { +define(function (_dereq_, exports, module) { var charToIntMap = {}; var intToCharMap = {}; @@ -8184,7 +8240,7 @@ define(function (require, exports, module) { }); -},{"amdefine":17}],12:[function(require,module,exports){ +},{"amdefine":17}],12:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors @@ -8192,9 +8248,9 @@ define(function (require, exports, module) { * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { - var define = require('amdefine')(module, require); + var define = _dereq_('amdefine')(module, _dereq_); } -define(function (require, exports, module) { +define(function (_dereq_, exports, module) { /** * Recursive implementation of binary search. @@ -8267,7 +8323,7 @@ define(function (require, exports, module) { }); -},{"amdefine":17}],13:[function(require,module,exports){ +},{"amdefine":17}],13:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors @@ -8275,14 +8331,14 @@ define(function (require, exports, module) { * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { - var define = require('amdefine')(module, require); + var define = _dereq_('amdefine')(module, _dereq_); } -define(function (require, exports, module) { +define(function (_dereq_, exports, module) { - var util = require('./util'); - var binarySearch = require('./binary-search'); - var ArraySet = require('./array-set').ArraySet; - var base64VLQ = require('./base64-vlq'); + var util = _dereq_('./util'); + var binarySearch = _dereq_('./binary-search'); + var ArraySet = _dereq_('./array-set').ArraySet; + var base64VLQ = _dereq_('./base64-vlq'); /** * A SourceMapConsumer instance represents a parsed source map which we can @@ -8746,7 +8802,7 @@ define(function (require, exports, module) { }); -},{"./array-set":9,"./base64-vlq":10,"./binary-search":12,"./util":16,"amdefine":17}],14:[function(require,module,exports){ +},{"./array-set":9,"./base64-vlq":10,"./binary-search":12,"./util":16,"amdefine":17}],14:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors @@ -8754,13 +8810,13 @@ define(function (require, exports, module) { * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { - var define = require('amdefine')(module, require); + var define = _dereq_('amdefine')(module, _dereq_); } -define(function (require, exports, module) { +define(function (_dereq_, exports, module) { - var base64VLQ = require('./base64-vlq'); - var util = require('./util'); - var ArraySet = require('./array-set').ArraySet; + var base64VLQ = _dereq_('./base64-vlq'); + var util = _dereq_('./util'); + var ArraySet = _dereq_('./array-set').ArraySet; /** * An instance of the SourceMapGenerator represents a source map which is @@ -9128,7 +9184,7 @@ define(function (require, exports, module) { }); -},{"./array-set":9,"./base64-vlq":10,"./util":16,"amdefine":17}],15:[function(require,module,exports){ +},{"./array-set":9,"./base64-vlq":10,"./util":16,"amdefine":17}],15:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors @@ -9136,12 +9192,12 @@ define(function (require, exports, module) { * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { - var define = require('amdefine')(module, require); + var define = _dereq_('amdefine')(module, _dereq_); } -define(function (require, exports, module) { +define(function (_dereq_, exports, module) { - var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; - var util = require('./util'); + var SourceMapGenerator = _dereq_('./source-map-generator').SourceMapGenerator; + var util = _dereq_('./util'); /** * SourceNodes provide a way to abstract over interpolating/concatenating @@ -9501,7 +9557,7 @@ define(function (require, exports, module) { }); -},{"./source-map-generator":14,"./util":16,"amdefine":17}],16:[function(require,module,exports){ +},{"./source-map-generator":14,"./util":16,"amdefine":17}],16:[function(_dereq_,module,exports){ /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors @@ -9509,9 +9565,9 @@ define(function (require, exports, module) { * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { - var define = require('amdefine')(module, require); + var define = _dereq_('amdefine')(module, _dereq_); } -define(function (require, exports, module) { +define(function (_dereq_, exports, module) { /** * This is a helper function for getting values from parameter/options @@ -9708,8 +9764,9 @@ define(function (require, exports, module) { }); -},{"amdefine":17}],17:[function(require,module,exports){ -var process=require("__browserify_process"),__filename="/../node_modules/jstransform/node_modules/source-map/node_modules/amdefine/amdefine.js";/** vim: et:ts=4:sw=4:sts=4 +},{"amdefine":17}],17:[function(_dereq_,module,exports){ +(function (process,__filename){ +/** vim: et:ts=4:sw=4:sts=4 * @license amdefine 0.1.0 Copyright (c) 2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/amdefine for details @@ -9734,7 +9791,7 @@ function amdefine(module, requireFn) { var defineCache = {}, loaderCache = {}, alreadyCalled = false, - path = require('path'), + path = _dereq_('path'), makeRequire, stringRequire; /** @@ -10009,7 +10066,8 @@ function amdefine(module, requireFn) { module.exports = amdefine; -},{"__browserify_process":1,"path":5}],18:[function(require,module,exports){ +}).call(this,_dereq_("/Users/poshannessy/FB/code/react/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"/../node_modules/jstransform/node_modules/source-map/node_modules/amdefine/amdefine.js") +},{"/Users/poshannessy/FB/code/react/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":4,"path":5}],18:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * @@ -10097,7 +10155,7 @@ exports.extract = extract; exports.parse = parse; exports.parseAsObject = parseAsObject; -},{}],19:[function(require,module,exports){ +},{}],19:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * @@ -10125,8 +10183,8 @@ exports.parseAsObject = parseAsObject; * Parses input source with esprima, applies the given list of visitors to the * AST tree, and returns the resulting output. */ -var esprima = require('esprima-fb'); -var utils = require('./utils'); +var esprima = _dereq_('esprima-fb'); +var utils = _dereq_('./utils'); var Syntax = esprima.Syntax; @@ -10325,7 +10383,7 @@ function transform(visitors, source, options) { state.g.visitors = visitors; if (options.sourceMap) { - var SourceMapGenerator = require('source-map').SourceMapGenerator; + var SourceMapGenerator = _dereq_('source-map').SourceMapGenerator; state.g.sourceMap = new SourceMapGenerator({file: 'transformed.js'}); } @@ -10342,7 +10400,7 @@ function transform(visitors, source, options) { exports.transform = transform; -},{"./utils":20,"esprima-fb":6,"source-map":8}],20:[function(require,module,exports){ +},{"./utils":20,"esprima-fb":6,"source-map":8}],20:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * @@ -10711,7 +10769,7 @@ function indentBefore(start, state) { function getDocblock(state) { if (!state.g.docblock) { - var docblock = require('./docblock'); + var docblock = _dereq_('./docblock'); state.g.docblock = docblock.parseAsObject(docblock.extract(state.g.source)); } @@ -10823,7 +10881,7 @@ exports.updateIndent = updateIndent; exports.updateState = updateState; exports.analyzeAndTraverse = analyzeAndTraverse; -},{"./docblock":18}],21:[function(require,module,exports){ +},{"./docblock":18}],21:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * @@ -10864,9 +10922,9 @@ exports.analyzeAndTraverse = analyzeAndTraverse; * }.bind(this)); * */ -var restParamVisitors = require('./es6-rest-param-visitors'); -var Syntax = require('esprima-fb').Syntax; -var utils = require('../src/utils'); +var restParamVisitors = _dereq_('./es6-rest-param-visitors'); +var Syntax = _dereq_('esprima-fb').Syntax; +var utils = _dereq_('../src/utils'); /** * @public @@ -10942,7 +11000,7 @@ exports.visitorList = [ ]; -},{"../src/utils":20,"./es6-rest-param-visitors":24,"esprima-fb":6}],22:[function(require,module,exports){ +},{"../src/utils":20,"./es6-rest-param-visitors":24,"esprima-fb":6}],22:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * @@ -10966,9 +11024,9 @@ exports.visitorList = [ */ 'use strict'; -var base62 = require('base62'); -var Syntax = require('esprima-fb').Syntax; -var utils = require('../src/utils'); +var base62 = _dereq_('base62'); +var Syntax = _dereq_('esprima-fb').Syntax; +var utils = _dereq_('../src/utils'); var SUPER_PROTO_IDENT_PREFIX = '____SuperProtoOf'; @@ -11422,7 +11480,7 @@ exports.visitorList = [ visitSuperMemberExpression ]; -},{"../src/utils":20,"base62":7,"esprima-fb":6}],23:[function(require,module,exports){ +},{"../src/utils":20,"base62":7,"esprima-fb":6}],23:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * @@ -11453,8 +11511,8 @@ exports.visitorList = [ * function init({port, ip, coords: {x, y}}) { ... } * */ -var Syntax = require('esprima-fb').Syntax; -var utils = require('../src/utils'); +var Syntax = _dereq_('esprima-fb').Syntax; +var utils = _dereq_('../src/utils'); /** * @public @@ -11476,7 +11534,7 @@ exports.visitorList = [ ]; -},{"../src/utils":20,"esprima-fb":6}],24:[function(require,module,exports){ +},{"../src/utils":20,"esprima-fb":6}],24:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * @@ -11508,8 +11566,8 @@ exports.visitorList = [ * }; * */ -var Syntax = require('esprima-fb').Syntax; -var utils = require('../src/utils'); +var Syntax = _dereq_('esprima-fb').Syntax; +var utils = _dereq_('../src/utils'); function _nodeIsFunctionWithRestParam(node) { return (node.type === Syntax.FunctionDeclaration @@ -11559,7 +11617,7 @@ exports.visitorList = [ visitFunctionBodyWithRestParam ]; -},{"../src/utils":20,"esprima-fb":6}],25:[function(require,module,exports){ +},{"../src/utils":20,"esprima-fb":6}],25:[function(_dereq_,module,exports){ /** * Copyright 2013 Facebook, Inc. * @@ -11583,8 +11641,8 @@ exports.visitorList = [ */ 'use strict'; -var Syntax = require('esprima-fb').Syntax; -var utils = require('../src/utils'); +var Syntax = _dereq_('esprima-fb').Syntax; +var utils = _dereq_('../src/utils'); /** * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.1.9 @@ -11708,7 +11766,7 @@ exports.visitorList = [ visitTaggedTemplateExpression ]; -},{"../src/utils":20,"esprima-fb":6}],26:[function(require,module,exports){ +},{"../src/utils":20,"esprima-fb":6}],26:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -11731,10 +11789,10 @@ exports.visitorList = [ var runScripts; var headEl; -var buffer = require('buffer'); -var transform = require('jstransform').transform; -var visitors = require('./fbtransform/visitors').transformVisitors; -var docblock = require('jstransform/src/docblock'); +var buffer = _dereq_('buffer'); +var transform = _dereq_('jstransform').transform; +var visitors = _dereq_('./fbtransform/visitors').transformVisitors; +var docblock = _dereq_('jstransform/src/docblock'); // The source-map library relies on Object.defineProperty, but IE8 doesn't // support it fully even with es5-sham. Indeed, es5-sham's defineProperty @@ -11905,7 +11963,7 @@ if (typeof window !== "undefined" && window !== null) { } } -},{"./fbtransform/visitors":30,"buffer":2,"jstransform":19,"jstransform/src/docblock":18}],27:[function(require,module,exports){ +},{"./fbtransform/visitors":30,"buffer":1,"jstransform":19,"jstransform/src/docblock":18}],27:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -11924,14 +11982,14 @@ if (typeof window !== "undefined" && window !== null) { /*global exports:true*/ "use strict"; -var Syntax = require('esprima-fb').Syntax; -var utils = require('jstransform/src/utils'); +var Syntax = _dereq_('esprima-fb').Syntax; +var utils = _dereq_('jstransform/src/utils'); -var FALLBACK_TAGS = require('./xjs').knownTags; +var FALLBACK_TAGS = _dereq_('./xjs').knownTags; var renderXJSExpressionContainer = - require('./xjs').renderXJSExpressionContainer; -var renderXJSLiteral = require('./xjs').renderXJSLiteral; -var quoteAttrName = require('./xjs').quoteAttrName; + _dereq_('./xjs').renderXJSExpressionContainer; +var renderXJSLiteral = _dereq_('./xjs').renderXJSLiteral; +var quoteAttrName = _dereq_('./xjs').quoteAttrName; /** * Customized desugar processor. @@ -11968,7 +12026,7 @@ function visitReactTag(traverse, object, path, state) { 'Namespace tags are not supported. ReactJSX is not XML.'); } - var isFallbackTag = FALLBACK_TAGS[nameObject.name]; + var isFallbackTag = FALLBACK_TAGS.hasOwnProperty(nameObject.name); utils.append( (isFallbackTag ? jsxObjIdent + '.' : '') + (nameObject.name) + '(', state @@ -12009,7 +12067,7 @@ function visitReactTag(traverse, object, path, state) { utils.move(attr.name.range[1], state); // Use catchupWhiteSpace to skip over the '=' in the attribute utils.catchupWhiteSpace(attr.value.range[0], state); - if (JSX_ATTRIBUTE_TRANSFORMS[attr.name.name]) { + if (JSX_ATTRIBUTE_TRANSFORMS.hasOwnProperty(attr.name.name)) { utils.append(JSX_ATTRIBUTE_TRANSFORMS[attr.name.name](attr), state); utils.move(attr.value.range[1], state); if (!isLast) { @@ -12041,12 +12099,23 @@ function visitReactTag(traverse, object, path, state) { && child.value.match(/^[ \t]*[\r\n][ \t\r\n]*$/)); }); if (childrenToRender.length > 0) { - utils.append(', ', state); + var lastRenderableIndex; + + childrenToRender.forEach(function(child, index) { + if (child.type !== Syntax.XJSExpressionContainer || + child.expression.type !== Syntax.XJSEmptyExpression) { + lastRenderableIndex = index; + } + }); + + if (lastRenderableIndex !== undefined) { + utils.append(', ', state); + } childrenToRender.forEach(function(child, index) { utils.catchup(child.range[0], state); - var isLast = index === childrenToRender.length - 1; + var isLast = index >= lastRenderableIndex; if (child.type === Syntax.Literal) { renderXJSLiteral(child, isLast, state); @@ -12088,7 +12157,7 @@ exports.visitorList = [ visitReactTag ]; -},{"./xjs":29,"esprima-fb":6,"jstransform/src/utils":20}],28:[function(require,module,exports){ +},{"./xjs":29,"esprima-fb":6,"jstransform/src/utils":20}],28:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -12107,8 +12176,8 @@ exports.visitorList = [ /*global exports:true*/ "use strict"; -var Syntax = require('esprima-fb').Syntax; -var utils = require('jstransform/src/utils'); +var Syntax = _dereq_('esprima-fb').Syntax; +var utils = _dereq_('jstransform/src/utils'); function addDisplayName(displayName, object, state) { if (object && @@ -12197,7 +12266,7 @@ exports.visitorList = [ visitReactDisplayName ]; -},{"esprima-fb":6,"jstransform/src/utils":20}],29:[function(require,module,exports){ +},{"esprima-fb":6,"jstransform/src/utils":20}],29:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -12215,8 +12284,8 @@ exports.visitorList = [ */ /*global exports:true*/ "use strict"; -var Syntax = require('esprima-fb').Syntax; -var utils = require('jstransform/src/utils'); +var Syntax = _dereq_('esprima-fb').Syntax; +var utils = _dereq_('jstransform/src/utils'); var knownTags = { a: true, @@ -12306,6 +12375,7 @@ var knownTags = { p: true, param: true, path: true, + polygon: true, polyline: true, pre: true, progress: true, @@ -12440,15 +12510,15 @@ exports.renderXJSExpressionContainer = renderXJSExpressionContainer; exports.renderXJSLiteral = renderXJSLiteral; exports.quoteAttrName = quoteAttrName; -},{"esprima-fb":6,"jstransform/src/utils":20}],30:[function(require,module,exports){ +},{"esprima-fb":6,"jstransform/src/utils":20}],30:[function(_dereq_,module,exports){ /*global exports:true*/ -var es6ArrowFunctions = require('jstransform/visitors/es6-arrow-function-visitors'); -var es6Classes = require('jstransform/visitors/es6-class-visitors'); -var es6ObjectShortNotation = require('jstransform/visitors/es6-object-short-notation-visitors'); -var es6RestParameters = require('jstransform/visitors/es6-rest-param-visitors'); -var es6Templates = require('jstransform/visitors/es6-template-visitors'); -var react = require('./transforms/react'); -var reactDisplayName = require('./transforms/reactDisplayName'); +var es6ArrowFunctions = _dereq_('jstransform/visitors/es6-arrow-function-visitors'); +var es6Classes = _dereq_('jstransform/visitors/es6-class-visitors'); +var es6ObjectShortNotation = _dereq_('jstransform/visitors/es6-object-short-notation-visitors'); +var es6RestParameters = _dereq_('jstransform/visitors/es6-rest-param-visitors'); +var es6Templates = _dereq_('jstransform/visitors/es6-template-visitors'); +var react = _dereq_('./transforms/react'); +var reactDisplayName = _dereq_('./transforms/reactDisplayName'); /** * Map from transformName => orderedListOfVisitors. diff --git a/bower_components/react/bower.json b/bower_components/react/bower.json index 3585b5e..e038907 100644 --- a/bower_components/react/bower.json +++ b/bower_components/react/bower.json @@ -1,5 +1,5 @@ { "name": "react", - "version": "0.9.0", + "version": "0.10.0", "main": "react.js" } \ No newline at end of file diff --git a/bower_components/react/react-with-addons.js b/bower_components/react/react-with-addons.js index 175bab8..1fb828d 100644 --- a/bower_components/react/react-with-addons.js +++ b/bower_components/react/react-with-addons.js @@ -1,7 +1,7 @@ /** - * React (with addons) v0.9.0 + * React (with addons) v0.10.0 */ -!function(e){if("object"==typeof exports)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.React=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]+)/; var RESULT_INDEX_ATTR = 'data-danger-index'; @@ -1864,7 +1874,7 @@ var Danger = { module.exports = Danger; -},{"./ExecutionEnvironment":21,"./createNodesFromMarkup":104,"./emptyFunction":108,"./getMarkupWrap":115,"./invariant":121}],12:[function(require,module,exports){ +},{"./ExecutionEnvironment":21,"./createNodesFromMarkup":105,"./emptyFunction":109,"./getMarkupWrap":118,"./invariant":125}],12:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -1887,7 +1897,7 @@ module.exports = Danger; "use strict"; -var DOMProperty = require("./DOMProperty"); +var DOMProperty = _dereq_("./DOMProperty"); var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE; var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; @@ -1981,6 +1991,7 @@ var DefaultDOMPropertyConfig = { spellCheck: null, src: null, srcDoc: MUST_USE_PROPERTY, + srcSet: null, step: null, style: null, tabIndex: null, @@ -2020,6 +2031,7 @@ var DefaultDOMPropertyConfig = { stroke: MUST_USE_ATTRIBUTE, strokeLinecap: MUST_USE_ATTRIBUTE, strokeWidth: MUST_USE_ATTRIBUTE, + textAnchor: MUST_USE_ATTRIBUTE, transform: MUST_USE_ATTRIBUTE, version: MUST_USE_ATTRIBUTE, viewBox: MUST_USE_ATTRIBUTE, @@ -2040,6 +2052,7 @@ var DefaultDOMPropertyConfig = { stopOpacity: 'stop-opacity', strokeLinecap: 'stroke-linecap', strokeWidth: 'stroke-width', + textAnchor: 'text-anchor', viewBox: 'viewBox' }, DOMPropertyNames: { @@ -2052,24 +2065,14 @@ var DefaultDOMPropertyConfig = { hrefLang: 'hreflang', radioGroup: 'radiogroup', spellCheck: 'spellcheck', - srcDoc: 'srcdoc' - }, - DOMMutationMethods: { - /** - * Setting `className` to null may cause it to be set to the string "null". - * - * @param {DOMElement} node - * @param {*} value - */ - className: function(node, value) { - node.className = value || ''; - } + srcDoc: 'srcdoc', + srcSet: 'srcset' } }; module.exports = DefaultDOMPropertyConfig; -},{"./DOMProperty":9}],13:[function(require,module,exports){ +},{"./DOMProperty":9}],13:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -2090,7 +2093,7 @@ module.exports = DefaultDOMPropertyConfig; "use strict"; - var keyOf = require("./keyOf"); + var keyOf = _dereq_("./keyOf"); /** * Module that is injectable into `EventPluginHub`, that specifies a @@ -2115,7 +2118,7 @@ var DefaultEventPluginOrder = [ module.exports = DefaultEventPluginOrder; -},{"./keyOf":128}],14:[function(require,module,exports){ +},{"./keyOf":132}],14:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -2137,12 +2140,12 @@ module.exports = DefaultEventPluginOrder; "use strict"; -var EventConstants = require("./EventConstants"); -var EventPropagators = require("./EventPropagators"); -var SyntheticMouseEvent = require("./SyntheticMouseEvent"); +var EventConstants = _dereq_("./EventConstants"); +var EventPropagators = _dereq_("./EventPropagators"); +var SyntheticMouseEvent = _dereq_("./SyntheticMouseEvent"); -var ReactMount = require("./ReactMount"); -var keyOf = require("./keyOf"); +var ReactMount = _dereq_("./ReactMount"); +var keyOf = _dereq_("./keyOf"); var topLevelTypes = EventConstants.topLevelTypes; var getFirstReactDOM = ReactMount.getFirstReactDOM; @@ -2262,7 +2265,7 @@ var EnterLeaveEventPlugin = { module.exports = EnterLeaveEventPlugin; -},{"./EventConstants":15,"./EventPropagators":20,"./ReactMount":60,"./SyntheticMouseEvent":91,"./keyOf":128}],15:[function(require,module,exports){ +},{"./EventConstants":15,"./EventPropagators":20,"./ReactMount":60,"./SyntheticMouseEvent":92,"./keyOf":132}],15:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -2283,7 +2286,7 @@ module.exports = EnterLeaveEventPlugin; "use strict"; -var keyMirror = require("./keyMirror"); +var keyMirror = _dereq_("./keyMirror"); var PropagationPhases = keyMirror({bubbled: null, captured: null}); @@ -2340,12 +2343,12 @@ var EventConstants = { module.exports = EventConstants; -},{"./keyMirror":127}],16:[function(require,module,exports){ +},{"./keyMirror":131}],16:[function(_dereq_,module,exports){ /** * @providesModule EventListener */ -var emptyFunction = require("./emptyFunction"); +var emptyFunction = _dereq_("./emptyFunction"); /** * Upstream version of event listener. Does not take into account specific @@ -2411,7 +2414,7 @@ var EventListener = { module.exports = EventListener; -},{"./emptyFunction":108}],17:[function(require,module,exports){ +},{"./emptyFunction":109}],17:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -2432,14 +2435,15 @@ module.exports = EventListener; "use strict"; -var EventPluginRegistry = require("./EventPluginRegistry"); -var EventPluginUtils = require("./EventPluginUtils"); -var ExecutionEnvironment = require("./ExecutionEnvironment"); +var EventPluginRegistry = _dereq_("./EventPluginRegistry"); +var EventPluginUtils = _dereq_("./EventPluginUtils"); +var ExecutionEnvironment = _dereq_("./ExecutionEnvironment"); -var accumulate = require("./accumulate"); -var forEachAccumulated = require("./forEachAccumulated"); -var invariant = require("./invariant"); -var isEventSupported = require("./isEventSupported"); +var accumulate = _dereq_("./accumulate"); +var forEachAccumulated = _dereq_("./forEachAccumulated"); +var invariant = _dereq_("./invariant"); +var isEventSupported = _dereq_("./isEventSupported"); +var monitorCodeUse = _dereq_("./monitorCodeUse"); /** * Internal store for event listeners @@ -2582,6 +2586,7 @@ var EventPluginHub = { // bubble. if (registrationName === 'onScroll' && !isEventSupported('scroll', true)) { + monitorCodeUse('react_no_scroll_event'); console.warn('This browser doesn\'t support the `onScroll` event'); } } @@ -2706,7 +2711,7 @@ var EventPluginHub = { module.exports = EventPluginHub; -},{"./EventPluginRegistry":18,"./EventPluginUtils":19,"./ExecutionEnvironment":21,"./accumulate":97,"./forEachAccumulated":111,"./invariant":121,"./isEventSupported":122}],18:[function(require,module,exports){ +},{"./EventPluginRegistry":18,"./EventPluginUtils":19,"./ExecutionEnvironment":21,"./accumulate":98,"./forEachAccumulated":114,"./invariant":125,"./isEventSupported":126,"./monitorCodeUse":138}],18:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -2728,7 +2733,7 @@ module.exports = EventPluginHub; "use strict"; -var invariant = require("./invariant"); +var invariant = _dereq_("./invariant"); /** * Injectable ordering of event plugins. @@ -2989,7 +2994,7 @@ var EventPluginRegistry = { module.exports = EventPluginRegistry; -},{"./invariant":121}],19:[function(require,module,exports){ +},{"./invariant":125}],19:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -3010,9 +3015,9 @@ module.exports = EventPluginRegistry; "use strict"; -var EventConstants = require("./EventConstants"); +var EventConstants = _dereq_("./EventConstants"); -var invariant = require("./invariant"); +var invariant = _dereq_("./invariant"); /** * Injected dependencies: @@ -3205,7 +3210,7 @@ var EventPluginUtils = { module.exports = EventPluginUtils; -},{"./EventConstants":15,"./invariant":121}],20:[function(require,module,exports){ +},{"./EventConstants":15,"./invariant":125}],20:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -3226,11 +3231,11 @@ module.exports = EventPluginUtils; "use strict"; -var EventConstants = require("./EventConstants"); -var EventPluginHub = require("./EventPluginHub"); +var EventConstants = _dereq_("./EventConstants"); +var EventPluginHub = _dereq_("./EventPluginHub"); -var accumulate = require("./accumulate"); -var forEachAccumulated = require("./forEachAccumulated"); +var accumulate = _dereq_("./accumulate"); +var forEachAccumulated = _dereq_("./forEachAccumulated"); var PropagationPhases = EventConstants.PropagationPhases; var getListener = EventPluginHub.getListener; @@ -3350,7 +3355,7 @@ var EventPropagators = { module.exports = EventPropagators; -},{"./EventConstants":15,"./EventPluginHub":17,"./accumulate":97,"./forEachAccumulated":111}],21:[function(require,module,exports){ +},{"./EventConstants":15,"./EventPluginHub":17,"./accumulate":98,"./forEachAccumulated":114}],21:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -3396,7 +3401,7 @@ var ExecutionEnvironment = { module.exports = ExecutionEnvironment; -},{}],22:[function(require,module,exports){ +},{}],22:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -3418,8 +3423,8 @@ module.exports = ExecutionEnvironment; "use strict"; -var ReactLink = require("./ReactLink"); -var ReactStateSetters = require("./ReactStateSetters"); +var ReactLink = _dereq_("./ReactLink"); +var ReactStateSetters = _dereq_("./ReactStateSetters"); /** * A simple mixin around ReactLink.forState(). @@ -3444,7 +3449,7 @@ var LinkedStateMixin = { module.exports = LinkedStateMixin; -},{"./ReactLink":58,"./ReactStateSetters":74}],23:[function(require,module,exports){ +},{"./ReactLink":58,"./ReactStateSetters":75}],23:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -3466,9 +3471,10 @@ module.exports = LinkedStateMixin; "use strict"; -var ReactPropTypes = require("./ReactPropTypes"); +var ReactPropTypes = _dereq_("./ReactPropTypes"); -var invariant = require("./invariant"); +var invariant = _dereq_("./invariant"); +var warning = _dereq_("./warning"); var hasReadOnlyValue = { 'button': true, @@ -3531,33 +3537,31 @@ var LinkedValueUtils = { propTypes: { value: function(props, propName, componentName) { if ("production" !== "development") { - if (props[propName] && - !hasReadOnlyValue[props.type] && - !props.onChange && - !props.readOnly && - !props.disabled) { - console.warn( - 'You provided a `value` prop to a form field without an ' + - '`onChange` handler. This will render a read-only field. If ' + - 'the field should be mutable use `defaultValue`. Otherwise, ' + - 'set either `onChange` or `readOnly`.' - ); - } + ("production" !== "development" ? warning( + !props[propName] || + hasReadOnlyValue[props.type] || + props.onChange || + props.readOnly || + props.disabled, + 'You provided a `value` prop to a form field without an ' + + '`onChange` handler. This will render a read-only field. If ' + + 'the field should be mutable use `defaultValue`. Otherwise, ' + + 'set either `onChange` or `readOnly`.' + ) : null); } }, checked: function(props, propName, componentName) { if ("production" !== "development") { - if (props[propName] && - !props.onChange && - !props.readOnly && - !props.disabled) { - console.warn( - 'You provided a `checked` prop to a form field without an ' + - '`onChange` handler. This will render a read-only field. If ' + - 'the field should be mutable use `defaultChecked`. Otherwise, ' + - 'set either `onChange` or `readOnly`.' - ); - } + ("production" !== "development" ? warning( + !props[propName] || + props.onChange || + props.readOnly || + props.disabled, + 'You provided a `checked` prop to a form field without an ' + + '`onChange` handler. This will render a read-only field. If ' + + 'the field should be mutable use `defaultChecked`. Otherwise, ' + + 'set either `onChange` or `readOnly`.' + ) : null); } }, onChange: ReactPropTypes.func @@ -3607,7 +3611,7 @@ var LinkedValueUtils = { module.exports = LinkedValueUtils; -},{"./ReactPropTypes":69,"./invariant":121}],24:[function(require,module,exports){ +},{"./ReactPropTypes":69,"./invariant":125,"./warning":148}],24:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -3629,9 +3633,9 @@ module.exports = LinkedValueUtils; "use strict"; -var EventConstants = require("./EventConstants"); +var EventConstants = _dereq_("./EventConstants"); -var emptyFunction = require("./emptyFunction"); +var emptyFunction = _dereq_("./emptyFunction"); var topLevelTypes = EventConstants.topLevelTypes; @@ -3672,7 +3676,7 @@ var MobileSafariClickEventPlugin = { module.exports = MobileSafariClickEventPlugin; -},{"./EventConstants":15,"./emptyFunction":108}],25:[function(require,module,exports){ +},{"./EventConstants":15,"./emptyFunction":109}],25:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -3693,7 +3697,7 @@ module.exports = MobileSafariClickEventPlugin; "use strict"; -var invariant = require("./invariant"); +var invariant = _dereq_("./invariant"); /** * Static poolers. Several custom versions for each potential number of @@ -3793,7 +3797,7 @@ var PooledClass = { module.exports = PooledClass; -},{"./invariant":121}],26:[function(require,module,exports){ +},{"./invariant":125}],26:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -3814,25 +3818,25 @@ module.exports = PooledClass; "use strict"; -var DOMPropertyOperations = require("./DOMPropertyOperations"); -var EventPluginUtils = require("./EventPluginUtils"); -var ReactChildren = require("./ReactChildren"); -var ReactComponent = require("./ReactComponent"); -var ReactCompositeComponent = require("./ReactCompositeComponent"); -var ReactContext = require("./ReactContext"); -var ReactCurrentOwner = require("./ReactCurrentOwner"); -var ReactDOM = require("./ReactDOM"); -var ReactDOMComponent = require("./ReactDOMComponent"); -var ReactDefaultInjection = require("./ReactDefaultInjection"); -var ReactInstanceHandles = require("./ReactInstanceHandles"); -var ReactMount = require("./ReactMount"); -var ReactMultiChild = require("./ReactMultiChild"); -var ReactPerf = require("./ReactPerf"); -var ReactPropTypes = require("./ReactPropTypes"); -var ReactServerRendering = require("./ReactServerRendering"); -var ReactTextComponent = require("./ReactTextComponent"); +var DOMPropertyOperations = _dereq_("./DOMPropertyOperations"); +var EventPluginUtils = _dereq_("./EventPluginUtils"); +var ReactChildren = _dereq_("./ReactChildren"); +var ReactComponent = _dereq_("./ReactComponent"); +var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); +var ReactContext = _dereq_("./ReactContext"); +var ReactCurrentOwner = _dereq_("./ReactCurrentOwner"); +var ReactDOM = _dereq_("./ReactDOM"); +var ReactDOMComponent = _dereq_("./ReactDOMComponent"); +var ReactDefaultInjection = _dereq_("./ReactDefaultInjection"); +var ReactInstanceHandles = _dereq_("./ReactInstanceHandles"); +var ReactMount = _dereq_("./ReactMount"); +var ReactMultiChild = _dereq_("./ReactMultiChild"); +var ReactPerf = _dereq_("./ReactPerf"); +var ReactPropTypes = _dereq_("./ReactPropTypes"); +var ReactServerRendering = _dereq_("./ReactServerRendering"); +var ReactTextComponent = _dereq_("./ReactTextComponent"); -var onlyChild = require("./onlyChild"); +var onlyChild = _dereq_("./onlyChild"); ReactDefaultInjection.inject(); @@ -3856,6 +3860,8 @@ var React = { ReactMount.renderComponent ), renderComponentToString: ReactServerRendering.renderComponentToString, + renderComponentToStaticMarkup: + ReactServerRendering.renderComponentToStaticMarkup, unmountComponentAtNode: ReactMount.unmountComponentAtNode, isValidClass: ReactCompositeComponent.isValidClass, isValidComponent: ReactComponent.isValidComponent, @@ -3873,7 +3879,7 @@ var React = { }; if ("production" !== "development") { - var ExecutionEnvironment = require("./ExecutionEnvironment"); + var ExecutionEnvironment = _dereq_("./ExecutionEnvironment"); if (ExecutionEnvironment.canUseDOM && window.top === window.self && navigator.userAgent.indexOf('Chrome') > -1) { @@ -3886,11 +3892,55 @@ if ("production" !== "development") { // Version exists only in the open-source version of React, not in Facebook's // internal version. -React.version = '0.9.0'; +React.version = '0.10.0'; module.exports = React; -},{"./DOMPropertyOperations":10,"./EventPluginUtils":19,"./ExecutionEnvironment":21,"./ReactChildren":29,"./ReactComponent":30,"./ReactCompositeComponent":33,"./ReactContext":34,"./ReactCurrentOwner":35,"./ReactDOM":36,"./ReactDOMComponent":38,"./ReactDefaultInjection":48,"./ReactInstanceHandles":57,"./ReactMount":60,"./ReactMultiChild":62,"./ReactPerf":65,"./ReactPropTypes":69,"./ReactServerRendering":73,"./ReactTextComponent":76,"./onlyChild":136}],27:[function(require,module,exports){ +},{"./DOMPropertyOperations":10,"./EventPluginUtils":19,"./ExecutionEnvironment":21,"./ReactChildren":30,"./ReactComponent":31,"./ReactCompositeComponent":33,"./ReactContext":34,"./ReactCurrentOwner":35,"./ReactDOM":36,"./ReactDOMComponent":38,"./ReactDefaultInjection":48,"./ReactInstanceHandles":57,"./ReactMount":60,"./ReactMultiChild":62,"./ReactPerf":65,"./ReactPropTypes":69,"./ReactServerRendering":73,"./ReactTextComponent":77,"./onlyChild":141}],27:[function(_dereq_,module,exports){ +/** + * Copyright 2013-2014 Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @providesModule ReactBrowserComponentMixin + */ + +"use strict"; + +var ReactMount = _dereq_("./ReactMount"); + +var invariant = _dereq_("./invariant"); + +var ReactBrowserComponentMixin = { + /** + * Returns the DOM node rendered by this component. + * + * @return {DOMElement} The root node of this component. + * @final + * @protected + */ + getDOMNode: function() { + ("production" !== "development" ? invariant( + this.isMounted(), + 'getDOMNode(): A component must be mounted to have a DOM node.' + ) : invariant(this.isMounted())); + return ReactMount.getNode(this._rootNodeID); + } +}; + +module.exports = ReactBrowserComponentMixin; + +},{"./ReactMount":60,"./invariant":125}],28:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -3908,17 +3958,16 @@ module.exports = React; * * @typechecks * @providesModule ReactCSSTransitionGroup - * @jsx React.DOM */ "use strict"; -var React = require("./React"); +var React = _dereq_("./React"); -var ReactTransitionGroup = require("./ReactTransitionGroup"); -var ReactCSSTransitionGroupChild = require("./ReactCSSTransitionGroupChild"); +var ReactTransitionGroup = _dereq_("./ReactTransitionGroup"); +var ReactCSSTransitionGroupChild = _dereq_("./ReactCSSTransitionGroupChild"); -var ReactCSSTransitionGroup = React.createClass({displayName: 'ReactCSSTransitionGroup', +var ReactCSSTransitionGroup = React.createClass({ propTypes: { transitionName: React.PropTypes.string.isRequired, transitionEnter: React.PropTypes.bool, @@ -3936,19 +3985,20 @@ var ReactCSSTransitionGroup = React.createClass({displayName: 'ReactCSSTransitio // We need to provide this childFactory so that // ReactCSSTransitionGroupChild can receive updates to name, enter, and // leave while it is leaving. - return ( - ReactCSSTransitionGroupChild( - {name:this.props.transitionName, - enter:this.props.transitionEnter, - leave:this.props.transitionLeave}, - child - ) + return ReactCSSTransitionGroupChild( + { + name: this.props.transitionName, + enter: this.props.transitionEnter, + leave: this.props.transitionLeave + }, + child ); }, render: function() { return this.transferPropsTo( - ReactTransitionGroup( {childFactory:this._wrapChild}, + ReactTransitionGroup( + {childFactory: this._wrapChild}, this.props.children ) ); @@ -3957,7 +4007,7 @@ var ReactCSSTransitionGroup = React.createClass({displayName: 'ReactCSSTransitio module.exports = ReactCSSTransitionGroup; -},{"./React":26,"./ReactCSSTransitionGroupChild":28,"./ReactTransitionGroup":79}],28:[function(require,module,exports){ +},{"./React":26,"./ReactCSSTransitionGroupChild":29,"./ReactTransitionGroup":80}],29:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -3979,12 +4029,12 @@ module.exports = ReactCSSTransitionGroup; "use strict"; -var React = require("./React"); +var React = _dereq_("./React"); -var CSSCore = require("./CSSCore"); -var ReactTransitionEvents = require("./ReactTransitionEvents"); +var CSSCore = _dereq_("./CSSCore"); +var ReactTransitionEvents = _dereq_("./ReactTransitionEvents"); -var onlyChild = require("./onlyChild"); +var onlyChild = _dereq_("./onlyChild"); // We don't remove the element from the DOM until we receive an animationend or // transitionend event. If the user screws up and forgets to add an animation @@ -4097,7 +4147,7 @@ var ReactCSSTransitionGroupChild = React.createClass({ module.exports = ReactCSSTransitionGroupChild; -},{"./CSSCore":2,"./React":26,"./ReactTransitionEvents":78,"./onlyChild":136}],29:[function(require,module,exports){ +},{"./CSSCore":2,"./React":26,"./ReactTransitionEvents":79,"./onlyChild":141}],30:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -4118,10 +4168,10 @@ module.exports = ReactCSSTransitionGroupChild; "use strict"; -var PooledClass = require("./PooledClass"); +var PooledClass = _dereq_("./PooledClass"); -var invariant = require("./invariant"); -var traverseAllChildren = require("./traverseAllChildren"); +var invariant = _dereq_("./invariant"); +var traverseAllChildren = _dereq_("./traverseAllChildren"); var twoArgumentPooler = PooledClass.twoArgumentPooler; var threeArgumentPooler = PooledClass.threeArgumentPooler; @@ -4231,7 +4281,7 @@ var ReactChildren = { module.exports = ReactChildren; -},{"./PooledClass":25,"./invariant":121,"./traverseAllChildren":141}],30:[function(require,module,exports){ +},{"./PooledClass":25,"./invariant":125,"./traverseAllChildren":146}],31:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -4252,14 +4302,14 @@ module.exports = ReactChildren; "use strict"; -var ReactComponentEnvironment = require("./ReactComponentEnvironment"); -var ReactCurrentOwner = require("./ReactCurrentOwner"); -var ReactOwner = require("./ReactOwner"); -var ReactUpdates = require("./ReactUpdates"); +var ReactCurrentOwner = _dereq_("./ReactCurrentOwner"); +var ReactOwner = _dereq_("./ReactOwner"); +var ReactUpdates = _dereq_("./ReactUpdates"); -var invariant = require("./invariant"); -var keyMirror = require("./keyMirror"); -var merge = require("./merge"); +var invariant = _dereq_("./invariant"); +var keyMirror = _dereq_("./keyMirror"); +var merge = _dereq_("./merge"); +var monitorCodeUse = _dereq_("./monitorCodeUse"); /** * Every React component is in one of these life cycles. @@ -4284,9 +4334,32 @@ var ComponentLifeCycle = keyMirror({ var ownerHasExplicitKeyWarning = {}; var ownerHasPropertyWarning = {}; +var ownerHasMonitoredObjectMap = {}; var NUMERIC_PROPERTY_REGEX = /^\d+$/; +var injected = false; + +/** + * Optionally injectable environment dependent cleanup hook. (server vs. + * browser etc). Example: A browser system caches DOM nodes based on component + * ID and must remove that cache entry when this instance is unmounted. + * + * @private + */ +var unmountIDFromEnvironment = null; + +/** + * The "image" of a component tree, is the platform specific (typically + * serialized) data that represents a tree of lower level UI building blocks. + * On the web, this "image" is HTML markup which describes a construction of + * low level `div` and `span` nodes. Other platforms may have different + * encoding of this "image". This must be injected. + * + * @private + */ +var mountImageIntoNode = null; + /** * Warn if the component doesn't have an explicit key assigned to it. * This component is in an array. The array could grow and shrink or be @@ -4316,9 +4389,11 @@ function validateExplicitKey(component) { var message = 'Each child in an array should have a unique "key" prop. ' + 'Check the render method of ' + currentName + '.'; + + var childOwnerName = null; if (!component.isOwnedBy(ReactCurrentOwner.current)) { // Name of the component that originally created this child. - var childOwnerName = + childOwnerName = component._owner && component._owner.constructor.displayName; @@ -4329,6 +4404,10 @@ function validateExplicitKey(component) { } message += ' See http://fb.me/react-warning-keys for more information.'; + monitorCodeUse('react_key_warning', { + component: currentName, + componentOwner: childOwnerName + }); console.warn(message); } @@ -4349,6 +4428,7 @@ function validatePropertyKey(name) { } ownerHasPropertyWarning[currentName] = true; + monitorCodeUse('react_numeric_key_warning'); console.warn( 'Child objects should have non-numeric keys so ordering is preserved. ' + 'Check the render method of ' + currentName + '. ' + @@ -4357,6 +4437,25 @@ function validatePropertyKey(name) { } } +/** + * Log that we're using an object map. We're considering deprecating this + * feature and replace it with proper Map and ImmutableMap data structures. + * + * @internal + */ +function monitorUseOfObjectMap() { + // Name of the component whose render method tried to pass children. + // We only use this to avoid spewing the logs. We lose additional + // owner stacks but hopefully one level is enough to trace the source. + var currentName = (ReactCurrentOwner.current && + ReactCurrentOwner.current.constructor.displayName) || ''; + if (ownerHasMonitoredObjectMap.hasOwnProperty(currentName)) { + return; + } + ownerHasMonitoredObjectMap[currentName] = true; + monitorCodeUse('react_object_map_children'); +} + /** * Ensure that every component either is passed in a static location, in an * array with an explicit keys property defined, or in an object literal @@ -4378,6 +4477,7 @@ function validateChildKeys(component) { // This component was passed in a valid location. component.__keyValidated__ = true; } else if (component && typeof component === 'object') { + monitorUseOfObjectMap(); for (var name in component) { validatePropertyKey(name, component); } @@ -4411,6 +4511,23 @@ function validateChildKeys(component) { */ var ReactComponent = { + injection: { + injectEnvironment: function(ReactComponentEnvironment) { + ("production" !== "development" ? invariant( + !injected, + 'ReactComponent: injectEnvironment() can only be called once.' + ) : invariant(!injected)); + mountImageIntoNode = ReactComponentEnvironment.mountImageIntoNode; + unmountIDFromEnvironment = + ReactComponentEnvironment.unmountIDFromEnvironment; + ReactComponent.BackendIDOperations = + ReactComponentEnvironment.BackendIDOperations; + ReactComponent.ReactReconcileTransaction = + ReactComponentEnvironment.ReactReconcileTransaction; + injected = true; + } + }, + /** * @param {?object} object * @return {boolean} True if `object` is a valid component. @@ -4443,27 +4560,7 @@ var ReactComponent = { * * @internal */ - BackendIDOperations: ReactComponentEnvironment.BackendIDOperations, - - /** - * Optionally injectable environment dependent cleanup hook. (server vs. - * browser etc). Example: A browser system caches DOM nodes based on component - * ID and must remove that cache entry when this instance is unmounted. - * - * @private - */ - unmountIDFromEnvironment: ReactComponentEnvironment.unmountIDFromEnvironment, - - /** - * The "image" of a component tree, is the platform specific (typically - * serialized) data that represents a tree of lower level UI building blocks. - * On the web, this "image" is HTML markup which describes a construction of - * low level `div` and `span` nodes. Other platforms may have different - * encoding of this "image". This must be injected. - * - * @private - */ - mountImageIntoNode: ReactComponentEnvironment.mountImageIntoNode, + BackendIDOperations: null, /** * React references `ReactReconcileTransaction` using this property in order @@ -4471,8 +4568,7 @@ var ReactComponent = { * * @internal */ - ReactReconcileTransaction: - ReactComponentEnvironment.ReactReconcileTransaction, + ReactReconcileTransaction: null, /** * Base functionality for every ReactComponent constructor. Mixed into the @@ -4480,7 +4576,7 @@ var ReactComponent = { * * @lends {ReactComponent.prototype} */ - Mixin: merge(ReactComponentEnvironment.Mixin, { + Mixin: { /** * Checks whether or not this component is mounted. @@ -4588,7 +4684,7 @@ var ReactComponent = { * `ReactComponent.Mixin.mountComponent.call(this, ...)`. * * @param {string} rootID DOM ID of the root node. - * @param {ReactReconcileTransaction} transaction + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction * @param {number} mountDepth number of components in the owner hierarchy. * @return {?string} Rendered markup to be inserted into the DOM. * @internal @@ -4630,7 +4726,7 @@ var ReactComponent = { if (props.ref != null) { ReactOwner.removeComponentAsRefFrom(this, props.ref, this._owner); } - ReactComponent.unmountIDFromEnvironment(this._rootNodeID); + unmountIDFromEnvironment(this._rootNodeID); this._rootNodeID = null; this._lifeCycleState = ComponentLifeCycle.UNMOUNTED; }, @@ -4659,7 +4755,6 @@ var ReactComponent = { /** * Call `_performUpdateIfNecessary` within a new transaction. * - * @param {ReactReconcileTransaction} transaction * @internal */ performUpdateIfNecessary: function() { @@ -4748,7 +4843,7 @@ var ReactComponent = { transaction, shouldReuseMarkup) { var markup = this.mountComponent(rootID, transaction, 0); - ReactComponent.mountImageIntoNode(markup, container, shouldReuseMarkup); + mountImageIntoNode(markup, container, shouldReuseMarkup); }, /** @@ -4778,12 +4873,12 @@ var ReactComponent = { } return owner.refs[ref]; } - }) + } }; module.exports = ReactComponent; -},{"./ReactComponentEnvironment":32,"./ReactCurrentOwner":35,"./ReactOwner":64,"./ReactUpdates":80,"./invariant":121,"./keyMirror":127,"./merge":130}],31:[function(require,module,exports){ +},{"./ReactCurrentOwner":35,"./ReactOwner":64,"./ReactUpdates":81,"./invariant":125,"./keyMirror":131,"./merge":134,"./monitorCodeUse":138}],32:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -4806,14 +4901,14 @@ module.exports = ReactComponent; "use strict"; -var ReactDOMIDOperations = require("./ReactDOMIDOperations"); -var ReactMarkupChecksum = require("./ReactMarkupChecksum"); -var ReactMount = require("./ReactMount"); -var ReactPerf = require("./ReactPerf"); -var ReactReconcileTransaction = require("./ReactReconcileTransaction"); +var ReactDOMIDOperations = _dereq_("./ReactDOMIDOperations"); +var ReactMarkupChecksum = _dereq_("./ReactMarkupChecksum"); +var ReactMount = _dereq_("./ReactMount"); +var ReactPerf = _dereq_("./ReactPerf"); +var ReactReconcileTransaction = _dereq_("./ReactReconcileTransaction"); -var getReactRootElementInContainer = require("./getReactRootElementInContainer"); -var invariant = require("./invariant"); +var getReactRootElementInContainer = _dereq_("./getReactRootElementInContainer"); +var invariant = _dereq_("./invariant"); var ELEMENT_NODE_TYPE = 1; @@ -4825,26 +4920,6 @@ var DOC_NODE_TYPE = 9; * the browser context. */ var ReactComponentBrowserEnvironment = { - /** - * Mixed into every component instance. - */ - Mixin: { - /** - * Returns the DOM node rendered by this component. - * - * @return {DOMElement} The root node of this component. - * @final - * @protected - */ - getDOMNode: function() { - ("production" !== "development" ? invariant( - this.isMounted(), - 'getDOMNode(): A component must be mounted to have a DOM node.' - ) : invariant(this.isMounted())); - return ReactMount.getNode(this._rootNodeID); - } - }, - ReactReconcileTransaction: ReactReconcileTransaction, BackendIDOperations: ReactDOMIDOperations, @@ -4922,56 +4997,14 @@ var ReactComponentBrowserEnvironment = { 'See renderComponentToString() for server rendering.' ) : invariant(container.nodeType !== DOC_NODE_TYPE)); - // Asynchronously inject markup by ensuring that the container is not in - // the document when settings its `innerHTML`. - var parent = container.parentNode; - if (parent) { - var next = container.nextSibling; - parent.removeChild(container); - container.innerHTML = markup; - if (next) { - parent.insertBefore(container, next); - } else { - parent.appendChild(container); - } - } else { - container.innerHTML = markup; - } + container.innerHTML = markup; } ) }; module.exports = ReactComponentBrowserEnvironment; -},{"./ReactDOMIDOperations":40,"./ReactMarkupChecksum":59,"./ReactMount":60,"./ReactPerf":65,"./ReactReconcileTransaction":71,"./getReactRootElementInContainer":117,"./invariant":121}],32:[function(require,module,exports){ -/** - * Copyright 2013-2014 Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @providesModule ReactComponentEnvironment - */ - -"use strict"; - -var ReactComponentBrowserEnvironment = - require("./ReactComponentBrowserEnvironment"); - -var ReactComponentEnvironment = ReactComponentBrowserEnvironment; - -module.exports = ReactComponentEnvironment; - -},{"./ReactComponentBrowserEnvironment":31}],33:[function(require,module,exports){ +},{"./ReactDOMIDOperations":40,"./ReactMarkupChecksum":59,"./ReactMount":60,"./ReactPerf":65,"./ReactReconcileTransaction":71,"./getReactRootElementInContainer":120,"./invariant":125}],33:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -4992,23 +5025,26 @@ module.exports = ReactComponentEnvironment; "use strict"; -var ReactComponent = require("./ReactComponent"); -var ReactContext = require("./ReactContext"); -var ReactCurrentOwner = require("./ReactCurrentOwner"); -var ReactErrorUtils = require("./ReactErrorUtils"); -var ReactOwner = require("./ReactOwner"); -var ReactPerf = require("./ReactPerf"); -var ReactPropTransferer = require("./ReactPropTransferer"); -var ReactPropTypeLocations = require("./ReactPropTypeLocations"); -var ReactPropTypeLocationNames = require("./ReactPropTypeLocationNames"); -var ReactUpdates = require("./ReactUpdates"); +var ReactComponent = _dereq_("./ReactComponent"); +var ReactContext = _dereq_("./ReactContext"); +var ReactCurrentOwner = _dereq_("./ReactCurrentOwner"); +var ReactErrorUtils = _dereq_("./ReactErrorUtils"); +var ReactOwner = _dereq_("./ReactOwner"); +var ReactPerf = _dereq_("./ReactPerf"); +var ReactPropTransferer = _dereq_("./ReactPropTransferer"); +var ReactPropTypeLocations = _dereq_("./ReactPropTypeLocations"); +var ReactPropTypeLocationNames = _dereq_("./ReactPropTypeLocationNames"); +var ReactUpdates = _dereq_("./ReactUpdates"); -var invariant = require("./invariant"); -var keyMirror = require("./keyMirror"); -var merge = require("./merge"); -var mixInto = require("./mixInto"); -var objMap = require("./objMap"); -var shouldUpdateReactComponent = require("./shouldUpdateReactComponent"); +var instantiateReactComponent = _dereq_("./instantiateReactComponent"); +var invariant = _dereq_("./invariant"); +var keyMirror = _dereq_("./keyMirror"); +var merge = _dereq_("./merge"); +var mixInto = _dereq_("./mixInto"); +var monitorCodeUse = _dereq_("./monitorCodeUse"); +var objMap = _dereq_("./objMap"); +var shouldUpdateReactComponent = _dereq_("./shouldUpdateReactComponent"); +var warning = _dereq_("./warning"); /** * Policies that describe methods in `ReactCompositeComponentInterface`. @@ -5035,6 +5071,9 @@ var SpecPolicy = keyMirror({ DEFINE_MANY_MERGED: null }); + +var injectedMixins = []; + /** * Composite components are higher-level components that compose other composite * or native components. @@ -5474,7 +5513,7 @@ function mixStaticSpecIntoComponent(ConvenienceConstructor, statics) { } for (var name in statics) { var property = statics[name]; - if (!statics.hasOwnProperty(name) || !property) { + if (!statics.hasOwnProperty(name)) { return; } @@ -5566,19 +5605,52 @@ if ("production" !== "development") { constructor: true, construct: true, isOwnedBy: true, // should be deprecated but can have code mod (internal) - mountComponent: true, - mountComponentIntoNode: true, - props: true, type: true, - _checkPropTypes: true, - _mountComponentIntoNode: true, - _processContext: true + props: true, + // currently private but belong on the descriptor and are valid for use + // inside the framework: + __keyValidated__: true, + _owner: true, + _currentContext: true + }; + + var componentInstanceProperties = { + __keyValidated__: true, + __keySetters: true, + _compositeLifeCycleState: true, + _currentContext: true, + _defaultProps: true, + _instance: true, + _lifeCycleState: true, + _mountDepth: true, + _owner: true, + _pendingCallbacks: true, + _pendingContext: true, + _pendingForceUpdate: true, + _pendingOwner: true, + _pendingProps: true, + _pendingState: true, + _renderedComponent: true, + _rootNodeID: true, + context: true, + props: true, + refs: true, + state: true, + + // These are known instance properties coming from other sources + _pendingQueries: true, + _queryPropListeners: true, + queryParams: true + }; var hasWarnedOnComponentType = {}; - var warnIfUnmounted = function(instance, key) { - if (instance.__hasBeenMounted) { + var warningStackCounter = 0; + + var issueMembraneWarning = function(instance, key) { + var isWhitelisted = unmountedPropertyWhitelist.hasOwnProperty(key); + if (warningStackCounter > 0 || isWhitelisted) { return; } var name = instance.constructor.displayName || 'Unknown'; @@ -5594,6 +5666,7 @@ if ("production" !== "development") { var context = owner ? ' in ' + ownerName + '.' : ' at the top level.'; var staticMethodExample = '<' + name + ' />.type.' + key + '(...)'; + monitorCodeUse('react_descriptor_property_access', { component: name }); console.warn( 'Invalid access to component property "' + key + '" on ' + name + context + ' See http://fb.me/react-warning-descriptors .' + @@ -5601,6 +5674,30 @@ if ("production" !== "development") { ); }; + var wrapInMembraneFunction = function(fn, thisBinding) { + if (fn.__reactMembraneFunction && fn.__reactMembraneSelf === thisBinding) { + return fn.__reactMembraneFunction; + } + return fn.__reactMembraneFunction = function() { + /** + * By getting this function, you've already received a warning. The + * internals of this function will likely cause more warnings. To avoid + * Spamming too much we disable any warning triggered inside of this + * stack. + */ + warningStackCounter++; + try { + // If the this binding is unchanged, we defer to the real component. + // This is important to keep some referential integrity in the + // internals. E.g. owner equality check. + var self = this === thisBinding ? this.__realComponentInstance : this; + return fn.apply(self, arguments); + } finally { + warningStackCounter--; + } + }; + }; + var defineMembraneProperty = function(membrane, prototype, key) { Object.defineProperty(membrane, key, { @@ -5608,31 +5705,33 @@ if ("production" !== "development") { enumerable: true, get: function() { - if (this !== membrane) { - // When this is accessed through a prototype chain we need to check if - // this component was mounted. - warnIfUnmounted(this, key); + if (this === membrane) { + // We're allowed to access the prototype directly. + return prototype[key]; } - return prototype[key]; + issueMembraneWarning(this, key); + + var realValue = this.__realComponentInstance[key]; + // If the real value is a function, we need to provide a wrapper that + // disables nested warnings. The properties type and constructors are + // expected to the be constructors and therefore is often use with an + // equality check and we shouldn't try to rebind those. + if (typeof realValue === 'function' && + key !== 'type' && + key !== 'constructor') { + return wrapInMembraneFunction(realValue, this); + } + return realValue; }, set: function(value) { - if (this !== membrane) { - // When this is accessed through a prototype chain, we first check if - // this component was mounted. Then we define a value on "this" - // instance, effectively disabling the membrane on that prototype - // chain. - warnIfUnmounted(this, key); - Object.defineProperty(this, key, { - enumerable: true, - configurable: true, - writable: true, - value: value - }); - } else { - // Otherwise, this should modify the prototype + if (this === membrane) { + // We're allowed to set a value on the prototype directly. prototype[key] = value; + return; } + issueMembraneWarning(this, key); + this.__realComponentInstance[key] = value; } }); @@ -5647,26 +5746,51 @@ if ("production" !== "development") { * @private */ var createMountWarningMembrane = function(prototype) { - try { - var membrane = Object.create(prototype); - for (var key in prototype) { - if (unmountedPropertyWhitelist.hasOwnProperty(key)) { - continue; - } + var membrane = {}; + var key; + for (key in prototype) { + defineMembraneProperty(membrane, prototype, key); + } + // These are properties that goes into the instance but not the prototype. + // We can create the membrane on the prototype even though this will + // result in a faulty hasOwnProperty check it's better perf. + for (key in componentInstanceProperties) { + if (componentInstanceProperties.hasOwnProperty(key) && + !(key in prototype)) { defineMembraneProperty(membrane, prototype, key); } + } + return membrane; + }; - membrane.mountComponent = function() { - this.__hasBeenMounted = true; - return prototype.mountComponent.apply(this, arguments); + /** + * Creates a membrane constructor which wraps the component that gets mounted. + * + * @param {function} constructor Original constructor. + * @return {function} The membrane constructor. + * @private + */ + var createDescriptorProxy = function(constructor) { + try { + var ProxyConstructor = function() { + this.__realComponentInstance = new constructor(); + + // We can only safely pass through known instance variables. Unknown + // expandos are not safe. Use the real mounted instance to avoid this + // problem if it blows something up. + Object.freeze(this); }; - return membrane; + ProxyConstructor.prototype = createMountWarningMembrane( + constructor.prototype + ); + + return ProxyConstructor; } catch(x) { // In IE8 define property will fail on non-DOM objects. If anything in - // the membrane creation fails, we'll bail out and just use the prototype - // without warnings. - return prototype; + // the membrane creation fails, we'll bail out and just use the plain + // constructor without warnings. + return constructor; } }; @@ -5737,17 +5861,34 @@ var ReactCompositeComponentMixin = { construct: function(initialProps, children) { // Children can be either an array or more than one argument ReactComponent.Mixin.construct.apply(this, arguments); + ReactOwner.Mixin.construct.apply(this, arguments); this.state = null; this._pendingState = null; - this.context = this._processContext(ReactContext.current); + this.context = null; this._currentContext = ReactContext.current; this._pendingContext = null; + // The descriptor that was used to instantiate this component. Will be + // set by the instantiator instead of the constructor since this + // constructor is currently used by both instances and descriptors. + this._descriptor = null; + this._compositeLifeCycleState = null; }, + /** + * Components in the intermediate state now has cyclic references. To avoid + * breaking JSON serialization we expose a custom JSON format. + * @return {object} JSON compatible representation. + * @internal + * @final + */ + toJSON: function() { + return { type: this.type, props: this.props }; + }, + /** * Checks whether or not this composite component is mounted. * @return {boolean} True if mounted, false otherwise. @@ -5763,7 +5904,7 @@ var ReactCompositeComponentMixin = { * Initializes the component, renders markup, and registers event listeners. * * @param {string} rootID DOM ID of the root node. - * @param {ReactReconcileTransaction} transaction + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction * @param {number} mountDepth number of components in the owner hierarchy * @return {?string} Rendered markup to be inserted into the DOM. * @final @@ -5781,6 +5922,7 @@ var ReactCompositeComponentMixin = { ); this._compositeLifeCycleState = CompositeLifeCycle.MOUNTING; + this.context = this._processContext(this._currentContext); this._defaultProps = this.getDefaultProps ? this.getDefaultProps() : null; this.props = this._processProps(this.props); @@ -5808,7 +5950,9 @@ var ReactCompositeComponentMixin = { } } - this._renderedComponent = this._renderValidatedComponent(); + this._renderedComponent = instantiateReactComponent( + this._renderValidatedComponent() + ); // Done with mounting, `setState` will now trigger UI changes. this._compositeLifeCycleState = null; @@ -5844,10 +5988,6 @@ var ReactCompositeComponentMixin = { ReactComponent.Mixin.unmountComponent.call(this); - if (this.refs) { - this.refs = null; - } - // Some existing components rely on this.props even after they've been // destroyed (in event handlers). // TODO: this.props = null; @@ -5877,12 +6017,11 @@ var ReactCompositeComponentMixin = { 'setState(...): takes an object of state variables to update.' ) : invariant(typeof partialState === 'object' || partialState == null)); if ("production" !== "development") { - if (partialState == null) { - console.warn( - 'setState(...): You passed an undefined or null state object; ' + - 'instead, use forceUpdate().' - ); - } + ("production" !== "development" ? warning( + partialState != null, + 'setState(...): You passed an undefined or null state object; ' + + 'instead, use forceUpdate().' + ) : null); } // Merge with `_pendingState` if it exists, otherwise with existing state. this.replaceState( @@ -6146,13 +6285,16 @@ var ReactCompositeComponentMixin = { }, receiveComponent: function(nextComponent, transaction) { - if (nextComponent === this) { + if (nextComponent === this._descriptor) { // Since props and context are immutable after the component is // mounted, we can do a cheap identity compare here to determine // if this is a superfluous reconcile. return; } + // Update the descriptor that was last used by this component instance + this._descriptor = nextComponent; + this._pendingContext = nextComponent._currentContext; ReactComponent.Mixin.receiveComponent.call( this, @@ -6185,17 +6327,19 @@ var ReactCompositeComponentMixin = { prevProps, prevOwner ); - var prevComponent = this._renderedComponent; + + + var prevComponentInstance = this._renderedComponent; var nextComponent = this._renderValidatedComponent(); - if (shouldUpdateReactComponent(prevComponent, nextComponent)) { - prevComponent.receiveComponent(nextComponent, transaction); + if (shouldUpdateReactComponent(prevComponentInstance, nextComponent)) { + prevComponentInstance.receiveComponent(nextComponent, transaction); } else { // These two IDs are actually the same! But nothing should rely on that. var thisID = this._rootNodeID; - var prevComponentID = prevComponent._rootNodeID; - prevComponent.unmountComponent(); - this._renderedComponent = nextComponent; - var nextMarkup = nextComponent.mountComponent( + var prevComponentID = prevComponentInstance._rootNodeID; + prevComponentInstance.unmountComponent(); + this._renderedComponent = instantiateReactComponent(nextComponent); + var nextMarkup = this._renderedComponent.mountComponent( thisID, transaction, this._mountDepth + 1 @@ -6307,11 +6451,13 @@ var ReactCompositeComponentMixin = { // ignore the value of "this" that the user is trying to use, so // let's warn. if (newThis !== component && newThis !== null) { + monitorCodeUse('react_bind_warning', { component: componentName }); console.warn( 'bind(): React component methods may only be bound to the ' + 'component instance. See ' + componentName ); } else if (!args.length) { + monitorCodeUse('react_bind_warning', { component: componentName }); console.warn( 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + @@ -6374,15 +6520,21 @@ var ReactCompositeComponent = { Constructor.prototype = new ReactCompositeComponentBase(); Constructor.prototype.constructor = Constructor; + var DescriptorConstructor = Constructor; + var ConvenienceConstructor = function(props, children) { - var instance = new Constructor(); - instance.construct.apply(instance, arguments); - return instance; + var descriptor = new DescriptorConstructor(); + descriptor.construct.apply(descriptor, arguments); + return descriptor; }; ConvenienceConstructor.componentConstructor = Constructor; Constructor.ConvenienceConstructor = ConvenienceConstructor; ConvenienceConstructor.originalSpec = spec; + injectedMixins.forEach( + mixSpecIntoComponent.bind(null, ConvenienceConstructor) + ); + mixSpecIntoComponent(ConvenienceConstructor, spec); ("production" !== "development" ? invariant( @@ -6392,6 +6544,10 @@ var ReactCompositeComponent = { if ("production" !== "development") { if (Constructor.prototype.componentShouldUpdate) { + monitorCodeUse( + 'react_component_should_update_warning', + { component: spec.displayName } + ); console.warn( (spec.displayName || 'A component') + ' has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + @@ -6417,18 +6573,27 @@ var ReactCompositeComponent = { } if ("production" !== "development") { - Constructor.prototype = createMountWarningMembrane(Constructor.prototype); + // In DEV the convenience constructor generates a proxy to another + // instance around it to warn about access to properties on the + // descriptor. + DescriptorConstructor = createDescriptorProxy(Constructor); } return ConvenienceConstructor; }, - isValidClass: isValidClass + isValidClass: isValidClass, + + injection: { + injectMixin: function(mixin) { + injectedMixins.push(mixin); + } + } }; module.exports = ReactCompositeComponent; -},{"./ReactComponent":30,"./ReactContext":34,"./ReactCurrentOwner":35,"./ReactErrorUtils":51,"./ReactOwner":64,"./ReactPerf":65,"./ReactPropTransferer":66,"./ReactPropTypeLocationNames":67,"./ReactPropTypeLocations":68,"./ReactUpdates":80,"./invariant":121,"./keyMirror":127,"./merge":130,"./mixInto":133,"./objMap":134,"./shouldUpdateReactComponent":139}],34:[function(require,module,exports){ +},{"./ReactComponent":31,"./ReactContext":34,"./ReactCurrentOwner":35,"./ReactErrorUtils":51,"./ReactOwner":64,"./ReactPerf":65,"./ReactPropTransferer":66,"./ReactPropTypeLocationNames":67,"./ReactPropTypeLocations":68,"./ReactUpdates":81,"./instantiateReactComponent":124,"./invariant":125,"./keyMirror":131,"./merge":134,"./mixInto":137,"./monitorCodeUse":138,"./objMap":139,"./shouldUpdateReactComponent":144,"./warning":148}],34:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -6449,7 +6614,7 @@ module.exports = ReactCompositeComponent; "use strict"; -var merge = require("./merge"); +var merge = _dereq_("./merge"); /** * Keeps track of the current context. @@ -6497,7 +6662,7 @@ var ReactContext = { module.exports = ReactContext; -},{"./merge":130}],35:[function(require,module,exports){ +},{"./merge":134}],35:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -6538,7 +6703,7 @@ var ReactCurrentOwner = { module.exports = ReactCurrentOwner; -},{}],36:[function(require,module,exports){ +},{}],36:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -6560,10 +6725,10 @@ module.exports = ReactCurrentOwner; "use strict"; -var ReactDOMComponent = require("./ReactDOMComponent"); +var ReactDOMComponent = _dereq_("./ReactDOMComponent"); -var mergeInto = require("./mergeInto"); -var objMapKeyVal = require("./objMapKeyVal"); +var mergeInto = _dereq_("./mergeInto"); +var objMapKeyVal = _dereq_("./objMapKeyVal"); /** * Creates a new React class that is idempotent and capable of containing other @@ -6613,12 +6778,12 @@ var ReactDOM = objMapKeyVal({ a: false, abbr: false, address: false, - area: false, + area: true, article: false, aside: false, audio: false, b: false, - base: false, + base: true, bdi: false, bdo: false, big: false, @@ -6668,7 +6833,7 @@ var ReactDOM = objMapKeyVal({ label: false, legend: false, li: false, - link: false, + link: true, main: false, map: false, mark: false, @@ -6697,7 +6862,7 @@ var ReactDOM = objMapKeyVal({ section: false, select: false, small: false, - source: false, + source: true, span: false, strong: false, style: false, @@ -6719,7 +6884,7 @@ var ReactDOM = objMapKeyVal({ ul: false, 'var': false, video: false, - wbr: false, + wbr: true, // SVG circle: false, @@ -6747,7 +6912,7 @@ ReactDOM.injection = injection; module.exports = ReactDOM; -},{"./ReactDOMComponent":38,"./mergeInto":132,"./objMapKeyVal":135}],37:[function(require,module,exports){ +},{"./ReactDOMComponent":38,"./mergeInto":136,"./objMapKeyVal":140}],37:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -6768,11 +6933,12 @@ module.exports = ReactDOM; "use strict"; -var AutoFocusMixin = require("./AutoFocusMixin"); -var ReactCompositeComponent = require("./ReactCompositeComponent"); -var ReactDOM = require("./ReactDOM"); +var AutoFocusMixin = _dereq_("./AutoFocusMixin"); +var ReactBrowserComponentMixin = _dereq_("./ReactBrowserComponentMixin"); +var ReactCompositeComponent = _dereq_("./ReactCompositeComponent"); +var ReactDOM = _dereq_("./ReactDOM"); -var keyMirror = require("./keyMirror"); +var keyMirror = _dereq_("./keyMirror"); // Store a reference to the