diff --git a/grunt/config/jsx.js b/grunt/config/jsx.js index acafefb4af..f5b3bc6990 100644 --- a/grunt/config/jsx.js +++ b/grunt/config/jsx.js @@ -8,6 +8,12 @@ var rootIDs = [ "ReactWithAddons" ]; +// TODO: stop packaging these libraries +rootIDs = rootIDs.concat([ + "merge", + "mergeInto", + "copyProperties" +]); var normal = { rootIDs: rootIDs, diff --git a/src/vendor/README.md b/src/vendor/README.md new file mode 100644 index 0000000000..624820d343 --- /dev/null +++ b/src/vendor/README.md @@ -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. diff --git a/src/vendor_deprecated/README.md b/src/vendor_deprecated/README.md new file mode 100644 index 0000000000..9bdf4bc16b --- /dev/null +++ b/src/vendor_deprecated/README.md @@ -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". diff --git a/src/vendor/core/copyProperties.js b/src/vendor_deprecated/core/copyProperties.js similarity index 84% rename from src/vendor/core/copyProperties.js rename to src/vendor_deprecated/core/copyProperties.js index 37c1767eca..e5d6a09e6c 100644 --- a/src/vendor/core/copyProperties.js +++ b/src/vendor_deprecated/core/copyProperties.js @@ -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, ...).' +); diff --git a/src/vendor/core/merge.js b/src/vendor_deprecated/core/merge.js similarity index 76% rename from src/vendor/core/merge.js rename to src/vendor_deprecated/core/merge.js index 609ba7e8d4..389b335bb9 100644 --- a/src/vendor/core/merge.js +++ b/src/vendor_deprecated/core/merge.js @@ -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).' +); diff --git a/src/vendor/core/mergeInto.js b/src/vendor_deprecated/core/mergeInto.js similarity index 63% rename from src/vendor/core/mergeInto.js rename to src/vendor_deprecated/core/mergeInto.js index 472099ab66..7bf424aace 100644 --- a/src/vendor/core/mergeInto.js +++ b/src/vendor_deprecated/core/mergeInto.js @@ -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, ...).' +);