@samitouri / QOS-React-2 / commits / be5c09c24d

Update fbjs dependency

- remove a file that got moved over there - update for renamed babel transform

Paul O’Shannessy committed Jul 27, 2015 at 13:37 UTC be5c09c24d0e09ecec21246fdd9b08e4158f2c11
5 files changed +5 -143
gulpfile.js
+2 -2
@@ -15,7 +15,7 @@ var flatten = require('gulp-flatten');
15 var del = require('del');
16
17 var babelPluginDEV = require('fbjs/scripts/babel/dev-expression');
18 -var babelPluginRequires = require('fbjs/scripts/babel/rewrite-requires');
18 +var babelPluginModules = require('fbjs/scripts/babel/rewrite-modules');
19
20 var paths = {
21 react: {
@@ -36,7 +36,7 @@ var babelOpts = {
36 optional: [
37 'es7.trailingFunctionCommas',
38 ],
39 - plugins: [babelPluginDEV, babelPluginRequires],
39 + plugins: [babelPluginDEV, babelPluginModules],
40 ignore: ['third_party'],
41 _moduleMap: require('fbjs/module-map'),
42 };
package.json
+1 -1
@@ -42,7 +42,7 @@
42 "eslint-plugin-react": "^2.5.0",
43 "eslint-plugin-react-internal": "file:eslint-rules",
44 "eslint-tester": "^0.7.0",
45 - "fbjs": "^0.1.0-alpha.0",
45 + "fbjs": "0.1.0-alpha.3",
46 "grunt": "^0.4.5",
47 "grunt-cli": "^0.1.13",
48 "grunt-compare-size": "^0.4.0",
scripts/jest/preprocessor.js
+2 -2
@@ -16,7 +16,7 @@ var ts = tsPreprocessor(defaultLibraries);
16 // We should consider consuming this from a built fbjs module from npm.
17 var moduleMap = require('fbjs/module-map');
18 var babelPluginDEV = require('fbjs/scripts/babel/dev-expression');
19 -var babelPluginRequires = require('fbjs/scripts/babel/rewrite-requires');
19 +var babelPluginModules = require('fbjs/scripts/babel/rewrite-modules');
20
21 module.exports = {
22 process: function(src, path) {
@@ -37,7 +37,7 @@ module.exports = {
37 optional: [
38 'es7.trailingFunctionCommas',
39 ],
40 - plugins: [babelPluginDEV, babelPluginRequires],
40 + plugins: [babelPluginDEV, babelPluginModules],
41 ignore: ['third_party'],
42 filename: path,
43 retainLines: true,
src/shared/utils/__tests__/shallowEqual-test.js deleted
-89
@@ -1,89 +0,0 @@
1 -/**
2 - * Copyright 2014-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')
15 - .dontMock('shallowEqual');
16 -
17 -var shallowEqual;
18 -
19 -describe('shallowEqual', function() {
20 -
21 - beforeEach(function() {
22 - shallowEqual = require('shallowEqual');
23 - });
24 -
25 - it('returns false if either argument is null', function() {
26 - expect(shallowEqual(null, {})).toBe(false);
27 - expect(shallowEqual({}, null)).toBe(false);
28 - });
29 -
30 - it('returns true if both arguments are null or undefined', function() {
31 - expect(shallowEqual(null, null)).toBe(true);
32 - expect(shallowEqual(undefined, undefined)).toBe(true);
33 - });
34 -
35 - it('returns true if arguments are shallow equal', function() {
36 - expect(
37 - shallowEqual(
38 - {a: 1, b: 2, c: 3},
39 - {a: 1, b: 2, c: 3}
40 - )
41 - ).toBe(true);
42 - });
43 -
44 - it('returns false if arguments are not objects and not equal', function() {
45 - expect(
46 - shallowEqual(
47 - 1,
48 - 2
49 - )
50 - ).toBe(false);
51 - });
52 -
53 - it('returns false if only one argument is not an object', function() {
54 - expect(
55 - shallowEqual(
56 - 1,
57 - {}
58 - )
59 - ).toBe(false);
60 - });
61 -
62 - it('returns false if first argument has too many keys', function() {
63 - expect(
64 - shallowEqual(
65 - {a: 1, b: 2, c: 3},
66 - {a: 1, b: 2}
67 - )
68 - ).toBe(false);
69 - });
70 -
71 - it('returns false if second argument has too many keys', function() {
72 - expect(
73 - shallowEqual(
74 - {a: 1, b: 2},
75 - {a: 1, b: 2, c: 3}
76 - )
77 - ).toBe(false);
78 - });
79 -
80 - it('returns false if arguments are not shallow equal', function() {
81 - expect(
82 - shallowEqual(
83 - {a: 1, b: 2, c: {}},
84 - {a: 1, b: 2, c: {}}
85 - )
86 - ).toBe(false);
87 - });
88 -
89 -});
src/shared/utils/shallowEqual.js deleted
-49
@@ -1,49 +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 shallowEqual
10 - */
11 -
12 -'use strict';
13 -
14 -/**
15 - * Performs equality by iterating through keys on an object and returning
16 - * false when any key has values which are not strictly equal between
17 - * objA and objB. Returns true when the values of all keys are strictly equal.
18 - *
19 - * @return {boolean}
20 - */
21 -function shallowEqual(objA, objB) {
22 - if (objA === objB) {
23 - return true;
24 - }
25 -
26 - if (typeof objA !== 'object' || objA === null ||
27 - typeof objB !== 'object' || objB === null) {
28 - return false;
29 - }
30 -
31 - var keysA = Object.keys(objA);
32 - var keysB = Object.keys(objB);
33 -
34 - if (keysA.length !== keysB.length) {
35 - return false;
36 - }
37 -
38 - // Test for A's keys different from B.
39 - var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
40 - for (var i = 0; i < keysA.length; i++) {
41 - if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
42 - return false;
43 - }
44 - }
45 -
46 - return true;
47 -}
48 -
49 -module.exports = shallowEqual;