Update to fbjs@0.3
As far as we're concerned, the only difference is that we moved some files from React to fbjs.
Paul O’Shannessy committed
Oct 1, 2015 at 14:29 UTC
693dd3567b6648fdccfd602702192bb22f405e63
6 files changed
+2
-152
package.json
+1
-1
@@ -15,7 +15,7 @@
15
"eslint": "^1.5.1",
16
"eslint-plugin-react": "^3.4.2",
17
"eslint-plugin-react-internal": "file:eslint-rules",
18
- "fbjs": "^0.2.0",
18
+ "fbjs": "^0.3.1",
19
"fbjs-scripts": "^0.2.0",
20
"grunt": "^0.4.5",
21
"grunt-cli": "^0.1.13",
packages/react/package.json
+1
-1
@@ -22,7 +22,7 @@
22
},
23
"dependencies": {
24
"envify": "^3.0.0",
25
- "fbjs": "^0.2.0"
25
+ "fbjs": "^0.3.1"
26
},
27
"browserify": {
28
"transform": [
src/isomorphic/deprecated/__tests__/joinClasses-test.js
deleted
-50
@@ -1,50 +0,0 @@
1
-/**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @emails react-core
10
- */
11
-
12
-'use strict';
13
-
14
-require('mock-modules').dontMock('joinClasses');
15
-
16
-var joinClasses = require('joinClasses');
17
-
18
-describe('joinClasses', function() {
19
-
20
- it('should return a single className', function() {
21
- expect(joinClasses('aaa')).toEqual('aaa');
22
- });
23
-
24
- it('should join two classes together', function() {
25
- var aaa = 'aaa';
26
- var bbb = 'bbb';
27
- expect(joinClasses(aaa, bbb)).toEqual('aaa bbb');
28
- });
29
-
30
- it('should join many classes together', function() {
31
- var aaa = 'aaa';
32
- var bbb = 'bbb';
33
- var ccc = 'ccc';
34
- var ddd = 'ddd';
35
- var eee = 'eee';
36
- expect(joinClasses(aaa, bbb, ccc, ddd, eee)).toEqual('aaa bbb ccc ddd eee');
37
- });
38
-
39
- it('should omit undefined and empty classes', function() {
40
- var aaa = 'aaa';
41
- var bbb;
42
- var ccc = null;
43
- var ddd = '';
44
- var eee = 'eee';
45
- expect(joinClasses(bbb)).toEqual('');
46
- expect(joinClasses(bbb, bbb, bbb)).toEqual('');
47
- expect(joinClasses(aaa, bbb, ccc, ddd, eee)).toEqual('aaa eee');
48
- });
49
-
50
-});
src/isomorphic/deprecated/joinClasses.js
deleted
-39
@@ -1,39 +0,0 @@
1
-/**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule joinClasses
10
- * @typechecks static-only
11
- */
12
-
13
-'use strict';
14
-
15
-/**
16
- * Combines multiple className strings into one.
17
- * http://jsperf.com/joinclasses-args-vs-array
18
- *
19
- * @param {...?string} className
20
- * @return {string}
21
- */
22
-function joinClasses(className/*, ... */) {
23
- if (!className) {
24
- className = '';
25
- }
26
- var nextClass;
27
- var argLength = arguments.length;
28
- if (argLength > 1) {
29
- for (var ii = 1; ii < argLength; ii++) {
30
- nextClass = arguments[ii];
31
- if (nextClass) {
32
- className = (className ? className + ' ' : '') + nextClass;
33
- }
34
- }
35
- }
36
- return className;
37
-}
38
-
39
-module.exports = joinClasses;
src/shared/utils/__tests__/memoizeStringOnly-test.js
deleted
-30
@@ -1,30 +0,0 @@
1
-/**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @emails react-core
10
- */
11
-
12
-'use strict';
13
-
14
-describe('memoizeStringOnly', function() {
15
- var memoizeStringOnly;
16
-
17
- beforeEach(function() {
18
- require('mock-modules').dumpCache();
19
- memoizeStringOnly = require('memoizeStringOnly');
20
- });
21
-
22
- it('should be transparent to callers', function() {
23
- var callback = function(string) {
24
- return string;
25
- };
26
- var memoized = memoizeStringOnly(callback);
27
-
28
- expect(memoized('foo'), callback('foo'));
29
- });
30
-});
src/shared/utils/memoizeStringOnly.js
deleted
-31
@@ -1,31 +0,0 @@
1
-/**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule memoizeStringOnly
10
- * @typechecks static-only
11
- */
12
-
13
-'use strict';
14
-
15
-/**
16
- * Memoizes the return value of a function that accepts one string argument.
17
- *
18
- * @param {function} callback
19
- * @return {function}
20
- */
21
-function memoizeStringOnly(callback) {
22
- var cache = {};
23
- return function(string) {
24
- if (!cache.hasOwnProperty(string)) {
25
- cache[string] = callback.call(this, string);
26
- }
27
- return cache[string];
28
- };
29
-}
30
-
31
-module.exports = memoizeStringOnly;