mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
80b862395d
* Add missing object-assign dep to create-react-class * Remove unnecessary inlines and irrelevant tests in createFragment * Uninline shallowEqual in shallowCompare * Uninline invariant in update * Uninline invariant/warning and remove unreachable code in react-linked-input * Envify and collapse createClass UMD * Envify and collapse createFragment * ReactLink doesn't really need PropTypes dep It is unnecessary because it is not explicitly exposed and was never public API. * Rebuild, envify and collapse LinkedStateMixin UMD * Collapse PureRenderMixin UMD * Rebuild shallowCompare * Envify and collapse update UMD * Remove unused prop-types dep from linked-input * Fix change handling in LinkedInput * Compile LinkedInput to ES5 * Rebuild, collapse, and fix LinkedInput UMD * Add full README for react-addons-create-fragment * Mention compat version of transition-group so we can delete those docs * README for react-addons-linked-state-mixin * More docs * Fix devDeps for createClass * docs
2 lines
4.4 KiB
JavaScript
2 lines
4.4 KiB
JavaScript
!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;if(g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,void 0===g.React)throw Error("React module should be required before update");void 0===g.React.addons&&(g.React.addons={}),g.React.addons.update=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";function shallowCopy(x){return Array.isArray(x)?x.concat():x&&"object"==typeof x?Object.assign(new x.constructor,x):x}function invariantArrayCase(value,spec,command){invariant(Array.isArray(value),"update(): expected target of %s to be an array; got %s.",command,value);var specValue=spec[command];invariant(Array.isArray(specValue),"update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?",command,specValue)}function update(value,spec){if(invariant("object"==typeof spec,"update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}?",ALL_COMMANDS_LIST.join(", "),COMMAND_SET),hasOwnProperty.call(spec,COMMAND_SET))return invariant(1===Object.keys(spec).length,"Cannot have more than one key in an object with %s",COMMAND_SET),spec[COMMAND_SET];var nextValue=shallowCopy(value);if(hasOwnProperty.call(spec,COMMAND_MERGE)){var mergeObj=spec[COMMAND_MERGE];invariant(mergeObj&&"object"==typeof mergeObj,"update(): %s expects a spec of type 'object'; got %s",COMMAND_MERGE,mergeObj),invariant(nextValue&&"object"==typeof nextValue,"update(): %s expects a target of type 'object'; got %s",COMMAND_MERGE,nextValue),Object.assign(nextValue,spec[COMMAND_MERGE])}hasOwnProperty.call(spec,COMMAND_PUSH)&&(invariantArrayCase(value,spec,COMMAND_PUSH),spec[COMMAND_PUSH].forEach(function(item){nextValue.push(item)})),hasOwnProperty.call(spec,COMMAND_UNSHIFT)&&(invariantArrayCase(value,spec,COMMAND_UNSHIFT),spec[COMMAND_UNSHIFT].forEach(function(item){nextValue.unshift(item)})),hasOwnProperty.call(spec,COMMAND_SPLICE)&&(invariant(Array.isArray(value),"Expected %s target to be an array; got %s",COMMAND_SPLICE,value),invariant(Array.isArray(spec[COMMAND_SPLICE]),"update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?",COMMAND_SPLICE,spec[COMMAND_SPLICE]),spec[COMMAND_SPLICE].forEach(function(args){invariant(Array.isArray(args),"update(): expected spec of %s to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?",COMMAND_SPLICE,spec[COMMAND_SPLICE]),nextValue.splice.apply(nextValue,args)})),hasOwnProperty.call(spec,COMMAND_APPLY)&&(invariant("function"==typeof spec[COMMAND_APPLY],"update(): expected spec of %s to be a function; got %s.",COMMAND_APPLY,spec[COMMAND_APPLY]),nextValue=spec[COMMAND_APPLY](nextValue));for(var k in spec)ALL_COMMANDS_SET.hasOwnProperty(k)&&ALL_COMMANDS_SET[k]||(nextValue[k]=update(value[k],spec[k]));return nextValue}var invariant=require(2),hasOwnProperty={}.hasOwnProperty,COMMAND_PUSH="$push",COMMAND_UNSHIFT="$unshift",COMMAND_SPLICE="$splice",COMMAND_SET="$set",COMMAND_MERGE="$merge",COMMAND_APPLY="$apply",ALL_COMMANDS_LIST=[COMMAND_PUSH,COMMAND_UNSHIFT,COMMAND_SPLICE,COMMAND_SET,COMMAND_MERGE,COMMAND_APPLY],ALL_COMMANDS_SET={};ALL_COMMANDS_LIST.forEach(function(command){ALL_COMMANDS_SET[command]=!0}),module.exports=update},{2:2}],2:[function(require,module,exports){"use strict";function invariant(condition,format,a,b,c,d,e,f){if(validateFormat(format),!condition){var error;if(void 0===format)error=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var args=[a,b,c,d,e,f],argIndex=0;error=new Error(format.replace(/%s/g,function(){return args[argIndex++]})),error.name="Invariant Violation"}throw error.framesToPop=1,error}}var validateFormat=function(format){};module.exports=invariant},{}]},{},[1])(1)});
|