mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
rename to with associated warnings
This commit is contained in:
committed by
Paul O’Shannessy
parent
82f211f6b8
commit
6269cbf482
@@ -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;
|
||||
@@ -1 +1,4 @@
|
||||
module.exports = require('./lib/ReactWithAddons');
|
||||
if ('production' !== process.env.NODE_ENV) {
|
||||
module.exports = require('./ReactJSErrors').wrap(module.exports);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "react-core",
|
||||
"name": "react",
|
||||
"version": "0.6.0-alpha",
|
||||
"keywords": [
|
||||
"react"
|
||||
|
||||
Vendored
+3
@@ -1 +1,4 @@
|
||||
module.exports = require('./lib/React');
|
||||
if ('production' !== process.env.NODE_ENV) {
|
||||
module.exports = require('./ReactJSErrors').wrap(module.exports);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user