Skip to content

Commit 27cbd71

Browse files
committed
Merge pull request #2317 from zpao/npm-ship-merge
Ship merge, mergeInto, copyProperties to npm
2 parents 4dcc116 + b227837 commit 27cbd71

File tree

6 files changed

+31
-0
lines changed

6 files changed

+31
-0
lines changed

grunt/config/jsx.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ var rootIDs = [
88
"ReactWithAddons"
99
];
1010

11+
// TODO: stop packaging these libraries
12+
rootIDs = rootIDs.concat([
13+
"merge",
14+
"mergeInto",
15+
"copyProperties"
16+
]);
1117

1218
var normal = {
1319
rootIDs: rootIDs,

src/vendor/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The files in this directory are not related to React's core functionality. They are shared utility modules that are also used in other parts of Facebook's front-end. Changes to these files need more consideration than changes to React itself.

src/vendor_deprecated/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The files in this directory are modified from their original implementation. At some point the files here were included in the React package shipped to npm and used by other projects.
2+
3+
We removed all uses of these files inside React itself but would like to provide a sane deprecation notice for other consumers. We made no promises about the files here; they were always "use at your own risk".

src/vendor/core/copyProperties.js renamed to src/vendor_deprecated/core/copyProperties.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,10 @@ function copyProperties(obj, a, b, c, d, e, f) {
4545
}
4646

4747
module.exports = copyProperties;
48+
49+
// deprecation notice
50+
console.warn(
51+
'react/lib/copyProperties has been deprecated and will be removed in the ' +
52+
'next version of React. All uses can be replaced with ' +
53+
'Object.assign(obj, a, b, ...) or _.extend(obj, a, b, ...).'
54+
);

src/vendor/core/merge.js renamed to src/vendor_deprecated/core/merge.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ var merge = function(one, two) {
2323
};
2424

2525
module.exports = merge;
26+
27+
// deprecation notice
28+
console.warn(
29+
'react/lib/merge has been deprecated and will be removed in the ' +
30+
'next version of React. All uses can be replaced with ' +
31+
'Object.assign({}, a, b) or _.extend({}, a, b).'
32+
);

src/vendor/core/mergeInto.js renamed to src/vendor_deprecated/core/mergeInto.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@
1313
"use strict";
1414

1515
module.exports = Object.assign;
16+
17+
// deprecation notice
18+
console.warn(
19+
'react/lib/mergeInto has been deprecated and will be removed in the ' +
20+
'next version of React. All uses can be replaced with ' +
21+
'Object.assign(a, b, c, ...) or _.extend(a, b, c, ...).'
22+
);

0 commit comments

Comments
 (0)