mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #3866 from sebmarkbage/coreapi
Reorganize Src Directory for Isomorphic React Package
This commit is contained in:
commit
5275244676
261 files changed
+138
-51
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
# We can probably lint these later but not important at this point
|
||||
src/vendor
|
||||
src/shared/vendor
|
||||
# eslint uses JSX* node types to determine if using JSX. esprima-fb still uses
|
||||
# XJS* nodes. When we fix that (https://github.com/facebook/esprima/pull/85) we
|
||||
# can enable linting the tests and fix those errors.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var assign = require('../../src/stubs/Object.assign');
|
||||
var assign = require('../../src/shared/stubs/Object.assign');
|
||||
var grunt = require('grunt');
|
||||
|
||||
var rootIDs = [
|
||||
|
||||
@@ -10,7 +10,7 @@ var reactVersionExp = /\bReact\.version\s*=\s*['"]([^'"]+)['"];/;
|
||||
|
||||
module.exports = function() {
|
||||
var reactVersion = reactVersionExp.exec(
|
||||
grunt.file.read('./src/browser/ui/React.js')
|
||||
grunt.file.read('./src/React.js')
|
||||
)[1];
|
||||
var npmReactVersion = grunt.file.readJSON('./npm-react/package.json').version;
|
||||
var reactToolsVersion = grunt.config.data.pkg.version;
|
||||
|
||||
@@ -7,7 +7,7 @@ var tsPreprocessor = require('./ts-preprocessor');
|
||||
|
||||
var defaultLibraries = [
|
||||
require.resolve('./jest.d.ts'),
|
||||
require.resolve('../src/modern/class/React.d.ts')
|
||||
require.resolve('../src/isomorphic/modern/class/React.d.ts')
|
||||
];
|
||||
|
||||
var ts = tsPreprocessor(defaultLibraries);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright 2013-2015, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule React
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var ReactDOMClient = require('ReactDOMClient');
|
||||
var ReactDOMServer = require('ReactDOMServer');
|
||||
var ReactIsomorphic = require('ReactIsomorphic');
|
||||
|
||||
var assign = require('Object.assign');
|
||||
|
||||
var React = {};
|
||||
|
||||
assign(React, ReactIsomorphic);
|
||||
assign(React, ReactDOMClient);
|
||||
assign(React, ReactDOMServer);
|
||||
|
||||
React.version = '0.14.0-alpha1';
|
||||
|
||||
module.exports = React;
|
||||
File renamed without changes.
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* Copyright 2013-2015, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule ReactIsomorphic
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var ReactChildren = require('ReactChildren');
|
||||
var ReactComponent = require('ReactComponent');
|
||||
var ReactClass = require('ReactClass');
|
||||
var ReactDOM = require('ReactDOM');
|
||||
var ReactElement = require('ReactElement');
|
||||
var ReactElementValidator = require('ReactElementValidator');
|
||||
var ReactPropTypes = require('ReactPropTypes');
|
||||
|
||||
var assign = require('Object.assign');
|
||||
var onlyChild = require('onlyChild');
|
||||
|
||||
var createElement = ReactElement.createElement;
|
||||
var createFactory = ReactElement.createFactory;
|
||||
var cloneElement = ReactElement.cloneElement;
|
||||
|
||||
if (__DEV__) {
|
||||
createElement = ReactElementValidator.createElement;
|
||||
createFactory = ReactElementValidator.createFactory;
|
||||
cloneElement = ReactElementValidator.cloneElement;
|
||||
}
|
||||
|
||||
var React = {
|
||||
|
||||
// Modern
|
||||
|
||||
Children: {
|
||||
map: ReactChildren.map,
|
||||
forEach: ReactChildren.forEach,
|
||||
count: ReactChildren.count,
|
||||
only: onlyChild
|
||||
},
|
||||
|
||||
Component: ReactComponent,
|
||||
|
||||
createElement: createElement,
|
||||
cloneElement: cloneElement,
|
||||
isValidElement: ReactElement.isValidElement,
|
||||
|
||||
// Classic
|
||||
|
||||
PropTypes: ReactPropTypes,
|
||||
createClass: ReactClass.createClass,
|
||||
createFactory: createFactory,
|
||||
createMixin: function(mixin) {
|
||||
// Currently a noop. Will be used to validate and trace mixins.
|
||||
return mixin;
|
||||
},
|
||||
|
||||
// This looks DOM specific but these are actually isomorphic helpers
|
||||
// since they are just generating DOM strings.
|
||||
DOM: ReactDOM,
|
||||
|
||||
// Hook for JSX spread, don't use this for anything else.
|
||||
__spread: assign
|
||||
};
|
||||
|
||||
module.exports = React;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -6,77 +6,34 @@
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule React
|
||||
* @providesModule ReactDOMClient
|
||||
*/
|
||||
|
||||
/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var ReactChildren = require('ReactChildren');
|
||||
var ReactComponent = require('ReactComponent');
|
||||
var ReactClass = require('ReactClass');
|
||||
var ReactCurrentOwner = require('ReactCurrentOwner');
|
||||
var ReactElement = require('ReactElement');
|
||||
var ReactElementValidator = require('ReactElementValidator');
|
||||
var ReactDOM = require('ReactDOM');
|
||||
var ReactDOMTextComponent = require('ReactDOMTextComponent');
|
||||
var ReactDefaultInjection = require('ReactDefaultInjection');
|
||||
var ReactInstanceHandles = require('ReactInstanceHandles');
|
||||
var ReactMount = require('ReactMount');
|
||||
var ReactPerf = require('ReactPerf');
|
||||
var ReactPropTypes = require('ReactPropTypes');
|
||||
var ReactReconciler = require('ReactReconciler');
|
||||
var ReactServerRendering = require('ReactServerRendering');
|
||||
|
||||
var assign = require('Object.assign');
|
||||
var findDOMNode = require('findDOMNode');
|
||||
var onlyChild = require('onlyChild');
|
||||
var warning = require('warning');
|
||||
|
||||
ReactDefaultInjection.inject();
|
||||
|
||||
var createElement = ReactElement.createElement;
|
||||
var createFactory = ReactElement.createFactory;
|
||||
var cloneElement = ReactElement.cloneElement;
|
||||
|
||||
if (__DEV__) {
|
||||
createElement = ReactElementValidator.createElement;
|
||||
createFactory = ReactElementValidator.createFactory;
|
||||
cloneElement = ReactElementValidator.cloneElement;
|
||||
}
|
||||
|
||||
var render = ReactPerf.measure('React', 'render', ReactMount.render);
|
||||
|
||||
var React = {
|
||||
Children: {
|
||||
map: ReactChildren.map,
|
||||
forEach: ReactChildren.forEach,
|
||||
count: ReactChildren.count,
|
||||
only: onlyChild
|
||||
},
|
||||
Component: ReactComponent,
|
||||
DOM: ReactDOM,
|
||||
PropTypes: ReactPropTypes,
|
||||
createClass: ReactClass.createClass,
|
||||
createElement: createElement,
|
||||
cloneElement: cloneElement,
|
||||
createFactory: createFactory,
|
||||
createMixin: function(mixin) {
|
||||
// Currently a noop. Will be used to validate and trace mixins.
|
||||
return mixin;
|
||||
},
|
||||
constructAndRenderComponent: ReactMount.constructAndRenderComponent,
|
||||
constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID,
|
||||
findDOMNode: findDOMNode,
|
||||
render: render,
|
||||
renderToString: ReactServerRendering.renderToString,
|
||||
renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
|
||||
unmountComponentAtNode: ReactMount.unmountComponentAtNode,
|
||||
isValidElement: ReactElement.isValidElement,
|
||||
|
||||
// Hook for JSX spread, don't use this for anything else.
|
||||
__spread: assign
|
||||
unmountComponentAtNode: ReactMount.unmountComponentAtNode
|
||||
};
|
||||
|
||||
// Inject the runtime into a devtools global hook regardless of browser.
|
||||
@@ -150,6 +107,4 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
React.version = '0.14.0-alpha1';
|
||||
|
||||
module.exports = React;
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright 2013-2015, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule ReactDOMServer
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var ReactDefaultInjection = require('ReactDefaultInjection');
|
||||
var ReactServerRendering = require('ReactServerRendering');
|
||||
|
||||
ReactDefaultInjection.inject();
|
||||
|
||||
var ReactDOMServer = {
|
||||
renderToString: ReactServerRendering.renderToString,
|
||||
renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup
|
||||
};
|
||||
|
||||
module.exports = ReactDOMServer;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 261 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user