commit 441fbc3580eccdbb984c05af15fd3311f0651879
parent 893d741bdc258c147e290e634bc0d0d2bdebfe23
Author: Konstantin Tarkus <hello@tarkus.me>
Date: Thu, 17 Dec 2015 11:34:21 +0300
Rename app.js to client.js (aka client-side code)
Diffstat:
6 files changed, 22 insertions(+), 24 deletions(-)
diff --git a/README.md b/README.md
@@ -37,7 +37,7 @@ join [#react-starter-kit](https://gitter.im/kriasoft/react-starter-kit) chatroom
│ ├── /decorators/ # Higher-order React components
│ ├── /public/ # Static files which are copied into the /build/public folder
│ ├── /stores/ # Stores contain the application state and logic
-│ ├── /app.js # Client-side startup script
+│ ├── /client.js # Client-side startup script
│ ├── /config.js # Global application settings
│ ├── /routes.js # Universal (isomorphic) application routes
│ └── /server.js # Server-side startup script
diff --git a/docs/recipes/how-to-implement-routing.md b/docs/recipes/how-to-implement-routing.md
@@ -16,7 +16,7 @@ In its simplest form the routing looks like a collection of URLs where each URL
is mapped to a React component:
```js
-// app.js
+// client.js
import React from 'react';
import Layout from './components/Layout';
import HomePage from './components/HomePage';
diff --git a/package.json b/package.json
@@ -6,22 +6,22 @@
},
"dependencies": {
"babel-core": "5.8.34",
- "bluebird": "3.0.6",
+ "bluebird": "3.1.1",
"classnames": "2.2.1",
"eventemitter3": "1.1.1",
"express": "4.13.3",
"fastclick": "1.0.6",
- "fbjs": "0.5.0",
+ "fbjs": "0.5.1",
"flux": "2.1.1",
"front-matter": "2.0.1",
- "history": "1.14.0",
+ "history": "1.16.0",
"jade": "1.11.0",
"normalize.css": "3.0.3",
"react": "0.14.3",
"react-dom": "0.14.3",
- "react-routing": "0.0.5",
+ "react-routing": "0.0.6",
"source-map-support": "0.4.0",
- "superagent": "1.5.0"
+ "superagent": "1.6.1"
},
"devDependencies": {
"assets-webpack-plugin": "^3.2.0",
@@ -30,12 +30,12 @@
"babel-eslint": "^4.1.6",
"babel-loader": "^5.4.0",
"babel-plugin-react-transform": "^1.1.1",
- "browser-sync": "^2.10.0",
+ "browser-sync": "^2.10.1",
"css-loader": "^0.23.0",
"csscomb": "^3.1.8",
"del": "^2.2.0",
"eslint": "^1.10.3",
- "eslint-config-airbnb": "^2.0.0",
+ "eslint-config-airbnb": "^2.1.1",
"eslint-loader": "^1.1.1",
"eslint-plugin-react": "^3.11.3",
"file-loader": "^0.8.5",
@@ -43,12 +43,12 @@
"git-repository": "^0.1.1",
"glob": "^6.0.1",
"isomorphic-style-loader": "0.0.5",
- "jest-cli": "^0.8.0",
- "jscs": "^2.6.0",
+ "jest-cli": "^0.8.2",
+ "jscs": "^2.7.0",
"lodash.merge": "^3.3.2",
"mkdirp": "^0.5.1",
"ncp": "^2.0.0",
- "postcss": "^5.0.12",
+ "postcss": "^5.0.13",
"postcss-import": "^7.1.3",
"postcss-loader": "^0.8.0",
"precss": "^1.3.0",
diff --git a/src/app.js b/src/client.js
diff --git a/src/server.js b/src/server.js
@@ -29,7 +29,7 @@ server.use('/api/content', require('./api/content'));
server.get('*', async (req, res, next) => {
try {
let statusCode = 200;
- const data = { title: '', description: '', css: '', body: '', entry: assets.app.js };
+ const data = { title: '', description: '', css: '', body: '', entry: assets.main.js };
const css = [];
const context = {
insertCss: styles => css.push(styles._getCss()),
diff --git a/tools/webpack.config.js b/tools/webpack.config.js
@@ -32,7 +32,7 @@ const GLOBALS = {
//
// Common configuration chunk to be used for both
-// client-side (app.js) and server-side (server.js) bundles
+// client-side (client.js) and server-side (server.js) bundles
// -----------------------------------------------------------------------------
const config = {
@@ -107,16 +107,14 @@ const config = {
};
//
-// Configuration for the client-side bundle (app.js)
+// Configuration for the client-side bundle (client.js)
// -----------------------------------------------------------------------------
-const appConfig = merge({}, config, {
- entry: {
- app: [
- ...(WATCH ? ['webpack-hot-middleware/client'] : []),
- './src/app.js',
- ],
- },
+const clientConfig = merge({}, config, {
+ entry: [
+ ...(WATCH ? ['webpack-hot-middleware/client'] : []),
+ './src/client.js',
+ ],
output: {
path: path.join(__dirname, '../build/public'),
filename: DEBUG ? '[name].js?[hash]' : '[name].[hash].js',
@@ -148,7 +146,7 @@ const appConfig = merge({}, config, {
});
// Enable React Transform in the "watch" mode
-appConfig.module.loaders
+clientConfig.module.loaders
.filter(x => WATCH && x.loader === 'babel-loader')
.forEach(x => x.query = {
// Wraps all React components into arbitrary transforms
@@ -208,4 +206,4 @@ const serverConfig = merge({}, config, {
],
});
-export default [appConfig, serverConfig];
+export default [clientConfig, serverConfig];