Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post ES2015 - upgrade to react14.3 #5

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
de50836
Remove deployment tasks
jstclair Sep 4, 2015
b53f7a2
Bump node engine to 12.x
jstclair Sep 4, 2015
dc728e4
Remove deployment-related packages
jstclair Sep 4, 2015
2b2cb96
Upgrade all dependencies to latest
jstclair Sep 4, 2015
41fbe51
Replace node-jsx with babelify/babel
jstclair Sep 4, 2015
3e26659
Replace jshint with eslint
jstclair Oct 4, 2015
7e37aa9
Convert Clock
jstclair Sep 4, 2015
408907d
Convert Main
jstclair Sep 4, 2015
da85e4a
Convert Client
jstclair Sep 4, 2015
667594a
Convert Html
jstclair Sep 4, 2015
f8e54f8
Convert server
jstclair Sep 4, 2015
72eff60
(minor) Ignore VS Code settings
jstclair Sep 4, 2015
a67b5b8
Clean up server constants
jstclair Sep 4, 2015
42de56e
(minor) Remove used property and nodemon extensions
jstclair Sep 4, 2015
e42f6fc
Remove bind; use closure in onClick call
jstclair Oct 4, 2015
4b37a4f
Rename files to follow conventions; bump required Node version
jstclair Nov 28, 2015
cabf37b
(minor) :lipstick:
jstclair Nov 28, 2015
fc5b1b2
[FIX] fix click bug
jstclair Nov 28, 2015
44f8691
Webpack working for isomorphic-web
jstclair Nov 28, 2015
9a74aba
Update README with new tools; remove dead code from webpack configura…
jstclair Dec 3, 2015
c18080b
Upgrade to react@14.3
jstclair Dec 4, 2015
1b2bfd3
Convert Clock to pure component
jstclair Dec 4, 2015
b5595c9
Support webpack's per-component style importing
jstclair Dec 4, 2015
90d11fa
Updated to latest hot module reloading (compatible with Babel6). Move…
jstclair Dec 9, 2015
9cf8c26
:lipstick: remove dead code
jstclair Dec 23, 2015
25b03e9
:arrow-up: upgrade deps
jstclair Dec 23, 2015
2f3eba5
Windows :heart:
jstclair Dec 26, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": [ "es2015", "react" ],
"ignore": [ "node_modules" ]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parser": "babel-eslint",
"env": {
"node": true,
"es6": true
},
"ecmaFeatures": {
"modules": true,
"jsx": true
},
"plugins": [ "babel", "react" ]
}
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.DS_Store
node_modules
.sass-cache
.deploy-cache
dist
.tmp
.env
*.zip
jsconfig.json
npm-debug.log
.vscode
19 changes: 0 additions & 19 deletions .jshintrc

This file was deleted.

204 changes: 0 additions & 204 deletions Gulpfile.js

This file was deleted.

25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,27 @@
To have the application up an running in no time, follow the next few steps:

1. Install [node.js](http://nodejs.org/)
2. Install [Gulp](http://gulpjs.com/): `npm install -g gulp`
3. Install all dependencies: `npm install`
4. Create file `.env` in the project root folder. Example `.env` file:
2. Install all dependencies: `npm install`
3. Start the application: `npm start`
3. Access application on http://localhost:3002

BASE_URL=

5. Start application by running `gulp`
6. Access application on http://localhost:3000
> NOTE: `webpack` is configured with hot-reloading for both `.scss` and `.jsx` files

### Tools
Some of the major tools used are:

* [Gulp](http://gulpjs.com/) as the task runner
* [Browserify](http://browserify.org/) for bundling scripts for the browser, and enabling code sharing between client and server
* [npm](http://npmjs.io/) as the task runner
* [WebPack](https://webpack.github.io/) for bundling scripts for the browser, and enabling code sharing between client and server
* [SASS](http://sass-lang.com/) for CSS preprosessing
* [BrowserSync](http://www.browsersync.io/) for serving synchronized browser testing

All tools are configured in the `Gulpfile.js` and will run transparently when `gulp` is started.
All tools are configured in the `webpack.config.js` and will run transparently when `npm start` is run.

### Production

1. Run `npm run build start-prod`
2. Access the application on http://localhost:3002

> NOTE: if you use your browser's devTools, you can see the load-time difference from the normal dev build.

### Use as a starting point

Expand Down
12 changes: 12 additions & 0 deletions app/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true
},
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"plugins": [ "babel", "react" ]
}
23 changes: 0 additions & 23 deletions app/HtmlComponent.jsx

This file was deleted.

8 changes: 0 additions & 8 deletions app/client.jsx

This file was deleted.

9 changes: 9 additions & 0 deletions app/client/client.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
import MainComponent from '../components/Main.jsx';

import './client.scss';

window.addEventListener('load', () => {
ReactDOM.render(<MainComponent />, document.getElementById('app-container'));
});
7 changes: 7 additions & 0 deletions app/client/client.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*{
box-sizing: border-box;
}
body {
margin-left: 20px;
margin-top: 20px;
}
12 changes: 5 additions & 7 deletions app/components/Clock.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';
import './Clock.scss';

var React = require('react');
const Clock = ({ time }) => {
return <div className="clock">{time}</div>;
};

module.exports = React.createClass({
render: function () {
return <div>{this.props.time}</div>;
}
});
export default Clock;
Empty file added app/components/Clock.scss
Empty file.
Loading