Skip to content

[WIP] Convert to bundles directory structure #171

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

Merged
merged 2 commits into from
Dec 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 7 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.0)
connection_pool (2.2.0)
coveralls (0.8.9)
json (~> 1.8)
Expand Down Expand Up @@ -139,12 +140,12 @@ GEM
mime-types (>= 1.16, < 3)
method_source (0.8.2)
mime-types (2.99)
mini_portile (0.6.2)
mini_portile2 (2.0.0)
minitest (5.8.3)
multi_json (1.11.2)
netrc (0.11.0)
nokogiri (1.6.6.4)
mini_portile (~> 0.6.0)
nokogiri (1.6.7)
mini_portile2 (~> 2.0.0.rc2)
parser (2.2.3.0)
ast (>= 1.1, < 3.0)
pg (0.18.4)
Expand Down Expand Up @@ -203,7 +204,7 @@ GEM
rainbow (2.0.0)
rake (10.4.2)
rdoc (4.2.0)
react_on_rails (1.1.0)
react_on_rails (1.1.1)
connection_pool
execjs (~> 2.5)
rails (>= 3.2)
Expand Down Expand Up @@ -278,7 +279,8 @@ GEM
spring (1.4.4)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.4.1)
sprockets (3.5.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (2.3.3)
actionpack (>= 3.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class CommentForm extends React.Component {
comment = {
// This is different because the input is a native HTML element
// rather than a React element.
author: this.refs.inlineAuthor.getDOMNode().value,
text: this.refs.inlineText.getDOMNode().value,
author: this.refs.inlineAuthor.value,
text: this.refs.inlineText.value,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a warning from React 0.14.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Provider } from 'react-redux';

import createStore from '../stores/commentsStore';
import createStore from '../store/commentsStore';
import NonRouterCommentScreen from '../components/NonRouterCommentScreen';

const App = props => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Provider } from 'react-redux';
import Router from 'react-router';
import createHistory from 'history/lib/createBrowserHistory';

import createStore from '../stores/commentsStore';
import createStore from '../store/commentsStore';
import routes from '../routes/routes';

const RouterApp = (props, location) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Provider } from 'react-redux';

import createStore from '../stores/commentsStore';
import createStore from '../store/commentsStore';
import NonRouterCommentScreen from '../components/NonRouterCommentScreen';

const App = props => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Provider } from 'react-redux';
import { match, RoutingContext } from 'react-router';

import createStore from '../stores/commentsStore';
import createStore from '../store/commentsStore';
import routes from '../routes/routes';

const RouterApp = (props, location) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { compose, createStore, applyMiddleware, combineReducers } from 'redux';
import thunkMiddleware from 'redux-thunk';
import loggerMiddleware from '../middlewares/loggerMiddleware';
import loggerMiddleware from 'lib/middlewares/loggerMiddleware';
import reducers from '../reducers';
import { initalStates } from '../reducers';

Expand Down
4 changes: 2 additions & 2 deletions client/test/components/CommentList_spec.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { React, expect, TestUtils } from '../test_helper';
import { List, Map } from 'immutable';
import CommentList from '../../app/components/CommentList';
import Comment from '../../app/components/Comment';
import CommentList from '../../app/bundles/Comments/components/CommentList';
import Comment from '../../app/bundles/Comments/components/Comment';

const {
renderIntoDocument,
Expand Down
2 changes: 1 addition & 1 deletion client/test/components/Comment_spec.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { React, expect, TestUtils } from '../test_helper';
import Comment from '../../app/components/Comment';
import Comment from '../../app/bundles/Comments/components/Comment';

const {
renderIntoDocument,
Expand Down
8 changes: 7 additions & 1 deletion client/webpack.client.base.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Common client-side webpack configuration used by webpack.hot.config and webpack.rails.config.

const webpack = require('webpack');
const path = require('path');

const devBuild = process.env.NODE_ENV !== 'production';
const nodeEnv = devBuild ? 'development' : 'production';
Expand All @@ -21,10 +22,15 @@ module.exports = {
],

// This will contain the app entry points defined by webpack.hot.config and webpack.rails.config
app: [],
app: [
'./app/bundles/Comments/startup/clientGlobals',
],
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.scss', '.css', 'config.js'],
alias: {
lib: path.join(process.cwd(), 'app', 'lib'),
},
},
plugins: [
new webpack.DefinePlugin({
Expand Down
5 changes: 1 addition & 4 deletions client/webpack.client.hot.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ config.entry.app.push(

// Test out Css & Sass
'./assets/stylesheets/test-stylesheet.css',
'./assets/stylesheets/test-sass-stylesheet.scss',

// App entry point
'./app/startup/clientGlobals'
'./assets/stylesheets/test-sass-stylesheet.scss'
);

config.output = {
Expand Down
1 change: 0 additions & 1 deletion client/webpack.client.rails.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ config.entry.vendor.unshift(
'es5-shim/es5-shim',
'es5-shim/es5-sham'
);
config.entry.app.push('./app/startup/clientGlobals');

// See webpack.common.config for adding modules common to both the webpack dev server and rails

Expand Down
6 changes: 5 additions & 1 deletion client/webpack.server.rails.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Common webpack configuration for server bundle

const webpack = require('webpack');
const path = require('path');

const devBuild = process.env.NODE_ENV !== 'production';
const nodeEnv = devBuild ? 'development' : 'production';
Expand All @@ -9,13 +10,16 @@ module.exports = {

// the project dir
context: __dirname,
entry: ['./app/startup/serverGlobals', 'react-dom/server', 'react'],
entry: ['./app/bundles/Comments/startup/serverGlobals', 'react-dom/server', 'react'],
output: {
filename: 'server-bundle.js',
path: '../app/assets/javascripts/generated',
},
resolve: {
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', 'config.js'],
alias: {
lib: path.join(process.cwd(), 'app', 'lib'),
},
},
plugins: [
new webpack.DefinePlugin({
Expand Down