Skip to content

Commit

Permalink
Merge pull request react-bootstrap#607 from react-bootstrap/revert-53…
Browse files Browse the repository at this point in the history
…6-master

Revert "adds ability to require components already wrapped in factories"
  • Loading branch information
AlexKVal committed May 3, 2015
2 parents 694113f + 9eb7e25 commit 13c2c33
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 105 deletions.
10 changes: 0 additions & 10 deletions docs/src/GettingStartedPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ const Page = React.createClass({
</script>
`}</code></pre>
</div>

<h3>Without JSX</h3>
<p>If you do not use JSX and just call components as functions, you must explicitly <a href="https://facebook.github.io/react/blog/2014/10/14/introducing-react-elements.html#deprecated-auto-generated-factories">create a factory before calling it</a>. React-bootstrap provides factories for you in <code>lib/factories</code>:</p>
<div className="highlight">
<pre><code className="js">{`
var Alert = require('react-bootstrap/lib/factories').Alert;
// or
var Alert = require('react-bootstrap/lib/factories/Alert');
`}</code></pre>
</div>
</div>
<div className="bs-docs-section">
<h2 id="browser-support" className="page-header">Browser support</h2>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"build": "node run-babel tools/build.js",
"test-watch": "karma start",
"test": "npm run lint && npm run build && karma start --single-run",
"test": "karma start --single-run && npm run lint && npm run build",
"lint": "eslint src test docs ie8 tools webpack karma.conf.js webpack.config.js webpack.docs.js",
"docs-build": "node run-babel tools/build.js --docs-only",
"docs": "node run-babel docs/server.js",
Expand Down
9 changes: 0 additions & 9 deletions src/templates/factory.index.js.template

This file was deleted.

4 changes: 0 additions & 4 deletions src/templates/factory.js.template

This file was deleted.

20 changes: 0 additions & 20 deletions test/FactoriesSpec.js

This file was deleted.

10 changes: 2 additions & 8 deletions tools/amd/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import path from 'path';
import fsp from 'fs-promise';
import { copy } from '../fs-utils';
import { exec } from '../exec';
import generateFactories from '../generateFactories';
import { repoRoot, srcRoot, bowerRoot } from '../constants';

const packagePath = path.join(repoRoot, 'package.json');
Expand All @@ -13,10 +12,6 @@ const bowerJson = path.join(bowerRoot, 'bower.json');
const readme = path.join(__dirname, 'README.md');
const license = path.join(repoRoot, 'LICENSE');

const babelOptions = '--modules amd --optional es7.objectRestSpread';

const factoriesDestination = path.join(bowerRoot, 'factories');

function bowerConfig() {
return Promise.all([
fsp.readFile(packagePath)
Expand All @@ -32,11 +27,10 @@ export default function BuildBower() {
console.log('Building: '.cyan + 'bower module'.green);

return exec(`rimraf ${bowerRoot}`)
.then(() => fsp.mkdirs(factoriesDestination))
.then(() => fsp.mkdir(bowerRoot))
.then(() => Promise.all([
bowerConfig(),
generateFactories(babelOptions, factoriesDestination),
exec(`babel ${babelOptions} ${srcRoot} --out-dir ${bowerRoot}`),
exec(`babel --modules amd --optional es7.objectRestSpread ${srcRoot} --out-dir ${path.join(bowerRoot, 'lib')}`),
copy(readme, bowerRoot),
copy(license, bowerRoot)
]))
Expand Down
31 changes: 0 additions & 31 deletions tools/generateFactories.js

This file was deleted.

12 changes: 1 addition & 11 deletions tools/lib/build.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
import 'colors';
import { exec } from '../exec';
import path from 'path';
import fsp from 'fs-promise';
import { srcRoot, libRoot } from '../constants';
import generateFactories from '../generateFactories';

const factoryDestination = path.join(libRoot, 'factories');
const babelOptions = '--optional es7.objectRestSpread';

export default function BuildCommonJs() {
console.log('Building: '.cyan + 'npm module'.green);

return exec(`rimraf ${libRoot}`)
.then(() => fsp.mkdirs(factoryDestination))
.then(() => Promise.all([
generateFactories(babelOptions, factoryDestination),
exec(`babel ${babelOptions} ${srcRoot} --out-dir ${libRoot}`)
]))
.then(() => exec(`babel --optional es7.objectRestSpread ${srcRoot} --out-dir ${libRoot}`))
.then(() => console.log('Built: '.cyan + 'npm module'.green));
}
11 changes: 0 additions & 11 deletions tools/public-components.js

This file was deleted.

0 comments on commit 13c2c33

Please sign in to comment.