rename to with associated warnings

This commit is contained in:
petehunt
2013-12-06 11:56:30 -08:00
committed by Paul O’Shannessy
parent 82f211f6b8
commit 6269cbf482
4 changed files with 45 additions and 1 deletions
+38
View File
@@ -0,0 +1,38 @@
var copyProperties = require('./lib/copyProperties');
var WARNING_MESSAGE = (
'It looks like you\'re trying to use jeffbski\'s React.js project.\n' +
'The `react` npm package now points to the React JavaScript library for ' +
'building user interfaces, not the React.js project for managing asynchronous ' +
'control flow. If you\'re looking for that library, please npm install reactjs.'
);
function error() {
throw new Error(WARNING_MESSAGE);
}
// Model the React.js project's public interface exactly.
function ReactJSShim() {
error();
};
ReactJSShim.logEvents = error;
ReactJSShim.resolvePromises = error;
ReactJSShim.trackTasks = error;
ReactJSShim.createEventCollector = error;
// These could throw using defineProperty() but supporting older browsers will
// be painful. Additionally any error messages around this will contain the string
// so I think this is sufficient.
ReactJSShim.options = WARNING_MESSAGE;
ReactJSShim.events = WARNING_MESSAGE;
var ReactJSErrors = {
wrap: function(module) {
copyProperties(ReactJSShim, module);
return ReactJSShim;
}
};
module.exports = ReactJSErrors;
+3
View File
@@ -1 +1,4 @@
module.exports = require('./lib/ReactWithAddons');
if ('production' !== process.env.NODE_ENV) {
module.exports = require('./ReactJSErrors').wrap(module.exports);
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "react-core",
"name": "react",
"version": "0.6.0-alpha",
"keywords": [
"react"
+3
View File
@@ -1 +1,4 @@
module.exports = require('./lib/React');
if ('production' !== process.env.NODE_ENV) {
module.exports = require('./ReactJSErrors').wrap(module.exports);
}