Skip to content

Commit

Permalink
Merge pull request #2317 from zpao/npm-ship-merge
Browse files Browse the repository at this point in the history
Ship merge, mergeInto, copyProperties to npm
  • Loading branch information
zpao committed Oct 14, 2014
2 parents 4dcc116 + b227837 commit 27cbd71
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions grunt/config/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ var rootIDs = [
"ReactWithAddons"
];

// TODO: stop packaging these libraries
rootIDs = rootIDs.concat([
"merge",
"mergeInto",
"copyProperties"
]);

var normal = {
rootIDs: rootIDs,
Expand Down
1 change: 1 addition & 0 deletions src/vendor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +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.
3 changes: 3 additions & 0 deletions src/vendor_deprecated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
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.

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".
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@ function copyProperties(obj, a, b, c, d, e, f) {
}

module.exports = copyProperties;

// deprecation notice
console.warn(
'react/lib/copyProperties has been deprecated and will be removed in the ' +
'next version of React. All uses can be replaced with ' +
'Object.assign(obj, a, b, ...) or _.extend(obj, a, b, ...).'
);
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ var merge = function(one, two) {
};

module.exports = merge;

// deprecation notice
console.warn(
'react/lib/merge has been deprecated and will be removed in the ' +
'next version of React. All uses can be replaced with ' +
'Object.assign({}, a, b) or _.extend({}, a, b).'
);
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@
"use strict";

module.exports = Object.assign;

// deprecation notice
console.warn(
'react/lib/mergeInto has been deprecated and will be removed in the ' +
'next version of React. All uses can be replaced with ' +
'Object.assign(a, b, c, ...) or _.extend(a, b, c, ...).'
);

0 comments on commit 27cbd71

Please sign in to comment.