Skip to content

Commit

Permalink
[removed] Factory support
Browse files Browse the repository at this point in the history
See #825
  • Loading branch information
mtscout6 committed Jul 19, 2015
1 parent fbf9ed6 commit caff9a0
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 91 deletions.
12 changes: 0 additions & 12 deletions docs/src/GettingStartedPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,6 @@ define(['react-bootstrap'], function(ReactBootstrap) { var Alert = ReactBootstra
/>
</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">
<CodeExample
mode="javascript"
codeText={
`var Alert = require('react-bootstrap/lib/factories').Alert;
// or
var Alert = require('react-bootstrap/lib/factories/Alert');`
}
/>
</div>
</div>
<div className="bs-docs-section">
<h2 id="browser-support" className="page-header">Browser support</h2>
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
"homepage": "http://react-bootstrap.github.io/",
"scripts": {
"build": "babel-node tools/build-cli.js",
"lib-build": "babel-node tools/build-cli.js --lib-only",
"test-watch": "npm run lib-build && karma start",
"test-coverage": "npm run lib-build && COVERAGE=true karma start --single-run",
"test-watch": "karma start",
"test-coverage": "COVERAGE=true karma start --single-run",
"test": "npm run lint && npm run build && npm run tests-set",
"tests-set": "karma start --single-run && _mocha --compilers js:babel-core/register test/server/*Spec.js",
"lint": "eslint ./",
Expand Down
11 changes: 0 additions & 11 deletions src/templates/factory.index.js.template

This file was deleted.

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

This file was deleted.

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

This file was deleted.

10 changes: 1 addition & 9 deletions tools/build-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import 'colors';
import build from './build';
import docs from '../docs/build';
import lib from './lib/build';
import { setExecOptions } from './exec';

import yargs from 'yargs';
Expand All @@ -14,11 +13,6 @@ const argv = yargs
demand: false,
default: false
})
.option('lib-only', {
demand: false,
default: false,
describe: 'Used for factories testing'
})
.option('verbose', {
demand: false,
default: false,
Expand All @@ -35,9 +29,7 @@ setExecOptions(argv);

let buildProcess;

if (argv.libOnly) {
buildProcess = lib(argv);
} else if (argv.docsOnly) {
if (argv.docsOnly) {
buildProcess = docs(argv);
} else {
buildProcess = build(argv);
Expand Down
23 changes: 0 additions & 23 deletions tools/generateFactories.js

This file was deleted.

6 changes: 1 addition & 5 deletions tools/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ import 'colors';
import { exec } from '../exec';
import fsp from 'fs-promise';
import { srcRoot, libRoot } from '../constants';
import generateFactories from '../generateFactories';
import { buildFolder } from '../buildBabel';

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

return exec(`rimraf ${libRoot}`)
.then(() => fsp.mkdirs(libRoot))
.then(() => Promise.all([
generateFactories(libRoot),
buildFolder(srcRoot, libRoot)
]))
.then(() => buildFolder(srcRoot, libRoot))
.then(() => console.log('Built: '.cyan + 'npm module'.green));
}
2 changes: 1 addition & 1 deletion tools/release-scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { exec } from '../exec';
function test() {
console.log('Running: '.cyan + 'tests'.green);

return exec('npm run lib-build && npm run tests-set')
return exec('npm run tests-set')
.then(() => console.log('Completed: '.cyan + 'tests'.green));
}

Expand Down

0 comments on commit caff9a0

Please sign in to comment.