-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
2,785 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
; http://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[package.json] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# riw example | ||
|
||
Example project for [riw](https://github.com/avaragado/riw) | ||
|
||
::TODO:: explain how to make it work with riw | ||
|
||
## To run | ||
|
||
```js | ||
git clone git@github.com:avaragado/riw-example.git | ||
cd riw-example | ||
yarn install | ||
yarn start | ||
``` | ||
|
||
Then open up [localhost:9000](http://localhost:9000) in your browser. | ||
|
||
|
||
## Acknowledgements | ||
|
||
`riw-example` is derived from https://github.com/thejameskyle/react-loadable-example. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "riw-example", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"author": "David Smith <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"start": "webpack-dev-server" | ||
}, | ||
"dependencies": { | ||
"react": "^15.4.2", | ||
"react-dom": "^15.4.2" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.23.1", | ||
"babel-loader": "^6.4.0", | ||
"babel-preset-react": "^6.23.0", | ||
"webpack": "^2.2.1", | ||
"webpack-dev-server": "^2.4.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>riw-example</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="text/javascript" src="scripts/bundle-main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
|
||
import Buttons from './Buttons'; | ||
import Text from './Text'; | ||
import FileCounter from './FileCounter'; | ||
|
||
const App = () => ( | ||
<div> | ||
<h1>Hello world!</h1> | ||
|
||
<Text name="Fred" number="123456" /> | ||
|
||
<FileCounter numFiles={0} /> | ||
<FileCounter numFiles={1} /> | ||
<FileCounter numFiles={2} /> | ||
<FileCounter numFiles={10} /> | ||
|
||
<Buttons /> | ||
|
||
<p>The end</p> | ||
</div> | ||
); | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
|
||
const Buttons = () => ( | ||
<div> | ||
<button>Press me</button> | ||
<button>Cancel</button> | ||
</div> | ||
); | ||
|
||
export default Buttons; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
const FileCounter = ({ numFiles }) => ( | ||
<p>You have { numFiles } file(s)</p> | ||
); | ||
|
||
export default FileCounter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
|
||
import FileCounter from './FileCounter'; | ||
|
||
const Text = ({ name, number }) => ( | ||
<div> | ||
<p>This is some boring text related to {name}.</p> | ||
|
||
<FileCounter numFiles={number} /> | ||
|
||
<p>Thank you.</p> | ||
</div> | ||
); | ||
|
||
export default Text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
import App from './components/App'; | ||
|
||
ReactDOM.render( | ||
<App/>, | ||
document.getElementById('root') | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
entry: './src/index.js', | ||
module: { | ||
rules: [{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader', | ||
options: { | ||
babelrc: false, | ||
presets: ['react'], | ||
} | ||
}] | ||
}, | ||
output: { | ||
filename: 'bundle-[name].js', | ||
path: path.resolve(__dirname, 'public', 'scripts'), | ||
publicPath: 'scripts/', | ||
}, | ||
devServer: { | ||
contentBase: path.join(__dirname, 'public'), | ||
compress: true, | ||
port: 9000 | ||
} | ||
}; |
Oops, something went wrong.