Skip to content

Commit 272d813

Browse files
committed
init
0 parents  commit 272d813

File tree

8 files changed

+135
-0
lines changed

8 files changed

+135
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.idea/
2+
/bower_components/
3+
/node_modules/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# react-babel

app/components/App.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
define(function (require, exports, module) {
3+
var React = require('react');
4+
5+
var App = React.createClass({
6+
render() {
7+
return <div>Hello World!</div>;
8+
}
9+
});
10+
11+
//class App extends React.Component {
12+
// render() {
13+
// return <div>Hello {this.props.name}</div>;
14+
// }
15+
//}
16+
17+
module.exports = App;
18+
});

bower.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "react-babel",
3+
"main": "index.js",
4+
"version": "0.1.0",
5+
"authors": [
6+
"Jaroslaw Zabiello <[email protected]>"
7+
],
8+
"license": "MIT",
9+
"private": true,
10+
"ignore": [
11+
"**/.*",
12+
"node_modules",
13+
"bower_components",
14+
"test",
15+
"tests"
16+
],
17+
"dependencies": {
18+
"requirejs": "~2.1.16",
19+
"react": "~0.13.0",
20+
"reflux": "~0.2.6",
21+
"requirejs_babel": "requirejs-babel#*",
22+
"requirejs_text": "requirejs-text#~2.0.14"
23+
}
24+
}

index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>react-babel</title>
8+
</head>
9+
<body>
10+
<div id="app">Loading...</div>
11+
</body>
12+
<script src="require-config.js"></script>
13+
<script data-main="index.js" src="bower_components/requirejs/require.js"></script>
14+
</html>

index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
define(function (require, exports, module) {
2+
var React = require('react');
3+
4+
5+
var App = require('es6!app/components/App'); // this does not work!
6+
console.log('DEBUG App::',App);
7+
// => DEBUG App:: Object {}
8+
9+
//var App = require('jsx!app/components/App'); this is OK
10+
//console.log(React.createElement(App));
11+
// => ReactElement {type: function, key: null, ref: null, _owner: null, _context: Object…}
12+
13+
React.render(React.createElement(App), document.getElementById('app'));
14+
});

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "react-babel",
3+
"version": "0.1.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC"
11+
}

require-config.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
var require = {
2+
waitSeconds: 200,
3+
baseUrl: '..',
4+
paths: {
5+
app: './app',
6+
7+
JSXTransformer: 'bower_components/react/JSXTransformer',
8+
jsx: 'bower_components/jsx_requirejs_plugin/js/jsx',
9+
10+
babel: 'bower_components/requirejs_babel/babel-4.6.6.min',
11+
es6: 'bower_components/requirejs_babel/es6',
12+
13+
react: 'bower_components/react/react-with-addons',
14+
reflux: 'bower_components/reflux/dist/reflux',
15+
text: 'bower_components/requirejs_text/text'
16+
//jquery: 'bower_components/jquery/dist/jquery',
17+
//lodash: 'bower_components/lodash/lodash',
18+
//semantic: 'node_modules/react-semantify/amd',
19+
//react: 'bower_components/react/react-with-addons',
20+
//'react-router': 'bower_components/react_router/build/global/ReactRouter',
21+
//'react-router-shim': 'react-router-shim',
22+
//JSXTransformer: 'bower_components/jsx_requirejs_plugin/js/JSXTransformer',
23+
//jsx: 'bower_components/jsx_requirejs_plugin/js/jsx',
24+
//reflux: 'bower_components/reflux/dist/reflux',
25+
//flux: 'flux',
26+
//lib: 'lib'
27+
},
28+
shim: {
29+
//babel: {
30+
// deps: ['babel_polyfill']
31+
//}
32+
//'react-router-shim': {
33+
// exports: 'React'
34+
//},
35+
//'react-router': {
36+
// deps: ['react-router-shim'],
37+
// exports: 'ReactRouter'
38+
//}
39+
},
40+
jsx: {
41+
fileExtension: '.js',
42+
harmony: true,
43+
stripTypes: true
44+
},
45+
es6: {
46+
fileExtension: '.js',
47+
harmony: true,
48+
stripTypes: true
49+
}
50+
};

0 commit comments

Comments
 (0)