From 15f19b1d03d1662e46cfaaceef562ce59b4b5aca Mon Sep 17 00:00:00 2001 From: Firebase Operations Date: Thu, 4 Sep 2014 06:21:15 +0000 Subject: [PATCH] [firebase-release] Removed changelog and distribution files after releasing ReactFire 0.2.0 --- bower.json | 2 +- changelog.txt | 1 - dist/reactfire.js | 147 ------------------------------------------ dist/reactfire.min.js | 10 --- package.json | 2 +- 5 files changed, 2 insertions(+), 160 deletions(-) delete mode 100644 dist/reactfire.js delete mode 100644 dist/reactfire.min.js diff --git a/bower.json b/bower.json index a90e7ab..09c105b 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "reactfire", "description": "Firebase mixin for ReactJS", - "version": "0.2.0", + "version": "0.0.0", "authors": [ "Firebase " ], diff --git a/changelog.txt b/changelog.txt index b63f75a..e69de29 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1 +0,0 @@ -feature - Added ability to have multiple listeners of the same type at the same Firebase node (submitted by @danielmahal). \ No newline at end of file diff --git a/dist/reactfire.js b/dist/reactfire.js deleted file mode 100644 index dc8baf7..0000000 --- a/dist/reactfire.js +++ /dev/null @@ -1,147 +0,0 @@ -/*! - * ReactFire is an open-source JavaScript library that allows you to add a - * realtime data source to your React apps by providing and easy way to let - * Firebase populate the state of React components. - * - * ReactFire 0.2.0 - * https://github.com/firebase/reactfire/ - * License: MIT - */ - -var ReactFireMixin = (function() { - "use strict"; -var ReactFireMixin = { - /********************/ - /* MIXIN LIFETIME */ - /********************/ - /* Initializes the Firebase binding refs array */ - componentWillMount: function() { - this.firebaseRefs = {}; - this.firebaseListeners = {}; - }, - - /* Removes any remaining Firebase bindings */ - componentWillUnmount: function() { - for (var key in this.firebaseRefs) { - if (this.firebaseRefs.hasOwnProperty(key)) { - this.unbind(key); - } - } - }, - - - /*************/ - /* BINDING */ - /*************/ - /* Creates a binding between Firebase and the inputted bind variable as an array */ - bindAsArray: function(firebaseRef, bindVar) { - this._bind(firebaseRef, bindVar, true); - }, - - /* Creates a binding between Firebase and the inputted bind variable as an object */ - bindAsObject: function(firebaseRef, bindVar) { - this._bind(firebaseRef, bindVar, false); - }, - - /* Creates a binding between Firebase and the inputted bind variable as either an array or object */ - _bind: function(firebaseRef, bindVar, bindAsArray) { - this._validateBindVar(bindVar); - - var error; - if (typeof firebaseRef.ref === "undefined" || firebaseRef.ref() instanceof Firebase === false) { - error = "firebaseRef must be an instance of Firebase"; - } - else if (typeof bindAsArray !== "boolean") { - error = "bindAsArray must be a boolean. Got: " + bindAsArray; - } - - if (typeof error !== "undefined") { - throw new Error("ReactFire: " + error); - } - - this.firebaseRefs[bindVar] = firebaseRef.ref(); - this.firebaseListeners[bindVar] = firebaseRef.on("value", function(dataSnapshot) { - var newState = {}; - if (bindAsArray) { - newState[bindVar] = this._toArray(dataSnapshot.val()); - } - else { - newState[bindVar] = dataSnapshot.val(); - } - this.setState(newState); - }.bind(this)); - }, - - /* Removes the binding between Firebase and the inputted bind variable */ - unbind: function(bindVar) { - this._validateBindVar(bindVar); - - if (typeof this.firebaseRefs[bindVar] === "undefined") { - throw new Error("unexpected value for bindVar. \"" + bindVar + "\" was either never bound or has already been unbound"); - } - - this.firebaseRefs[bindVar].off("value", this.firebaseListeners[bindVar]); - delete this.firebaseRefs[bindVar]; - delete this.firebaseListeners[bindVar]; - }, - - - /*************/ - /* HELPERS */ - /*************/ - /* Validates the name of the variable which is being bound */ - _validateBindVar: function(bindVar) { - var error; - - if (typeof bindVar !== "string") { - error = "bindVar must be a string. Got: " + bindVar; - } - else if (bindVar.length === 0) { - error = "bindVar must be a non-empty string. Got: \"\""; - } - else if (bindVar.length > 768) { - // Firebase can only stored child paths up to 768 characters - error = "bindVar is too long to be stored in Firebase. Got: " + bindVar; - } - else if (/[\[\].#$\/\u0000-\u001F\u007F]/.test(bindVar)) { - // Firebase does not allow node keys to contain the following characters - error = "bindVar cannot contain any of the following characters: . # $ ] [ /. Got: " + bindVar; - } - - if (typeof error !== "undefined") { - throw new Error("ReactFire: " + error); - } - }, - - - /* Returns true if the inputted object is a JavaScript array */ - _isArray: function(obj) { - return (Object.prototype.toString.call(obj) === "[object Array]"); - }, - - /* Converts a Firebase object to a JavaScript array */ - _toArray: function(obj) { - var out = []; - if (obj) { - if (this._isArray(obj)) { - out = obj; - } - else if (typeof(obj) === "object") { - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - out.push(obj[key]); - } - } - } - } - return out; - } -}; - - return ReactFireMixin; -})(); - -// Export ReactFireMixin if this is being run in node -if (typeof module !== "undefined" && typeof process !== "undefined") { - module.exports = ReactFireMixin; -} \ No newline at end of file diff --git a/dist/reactfire.min.js b/dist/reactfire.min.js deleted file mode 100644 index ff058fa..0000000 --- a/dist/reactfire.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * ReactFire is an open-source JavaScript library that allows you to add a - * realtime data source to your React apps by providing and easy way to let - * Firebase populate the state of React components. - * - * ReactFire 0.2.0 - * https://github.com/firebase/reactfire/ - * License: MIT - */ -var ReactFireMixin=function(){"use strict";var e={componentWillMount:function(){this.firebaseRefs={},this.firebaseListeners={}},componentWillUnmount:function(){for(var e in this.firebaseRefs)this.firebaseRefs.hasOwnProperty(e)&&this.unbind(e)},bindAsArray:function(e,t){this._bind(e,t,!0)},bindAsObject:function(e,t){this._bind(e,t,!1)},_bind:function(e,t,i){this._validateBindVar(t);var n;if("undefined"==typeof e.ref||e.ref()instanceof Firebase==!1?n="firebaseRef must be an instance of Firebase":"boolean"!=typeof i&&(n="bindAsArray must be a boolean. Got: "+i),"undefined"!=typeof n)throw new Error("ReactFire: "+n);this.firebaseRefs[t]=e.ref(),this.firebaseListeners[t]=e.on("value",function(e){var n={};n[t]=i?this._toArray(e.val()):e.val(),this.setState(n)}.bind(this))},unbind:function(e){if(this._validateBindVar(e),"undefined"==typeof this.firebaseRefs[e])throw new Error('unexpected value for bindVar. "'+e+'" was either never bound or has already been unbound');this.firebaseRefs[e].off("value",this.firebaseListeners[e]),delete this.firebaseRefs[e],delete this.firebaseListeners[e]},_validateBindVar:function(e){var t;if("string"!=typeof e?t="bindVar must be a string. Got: "+e:0===e.length?t='bindVar must be a non-empty string. Got: ""':e.length>768?t="bindVar is too long to be stored in Firebase. Got: "+e:/[\[\].#$\/\u0000-\u001F\u007F]/.test(e)&&(t="bindVar cannot contain any of the following characters: . # $ ] [ /. Got: "+e),"undefined"!=typeof t)throw new Error("ReactFire: "+t)},_isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},_toArray:function(e){var t=[];if(e)if(this._isArray(e))t=e;else if("object"==typeof e)for(var i in e)e.hasOwnProperty(i)&&t.push(e[i]);return t}};return e}();"undefined"!=typeof module&&"undefined"!=typeof process&&(module.exports=ReactFireMixin); \ No newline at end of file diff --git a/package.json b/package.json index 73c751f..823f802 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "reactfire", "description": "Firebase mixin for ReactJS", - "version": "0.2.0", + "version": "0.0.0", "author": "Firebase (https://www.firebase.com/)", "homepage": "https://github.com/firebase/reactfire/", "repository": {