-
Notifications
You must be signed in to change notification settings - Fork 378
Client refactoring #96
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
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7dfd00a
Remove unused karma stuff
alex35mil de7627f
Remove unused gulp and setup npm lint scripts
alex35mil ede0a5e
Split generated webpack js bundle in 2: application and vendor libs
alex35mil 555453c
Update root package.json
alex35mil 95bc93e
Update root package.json
alex35mil 5be79fd
Use npm run to run client scripts
alex35mil 44eeb47
Fix after-rebase errors
alex35mil 537c985
Move js app to /client/app dir, update structure, fix linter and styl…
alex35mil 76a7482
:see_no_evil:
alex35mil 06fc11e
Pass initial data from Rails to Redux store
alex35mil 3d68653
Fix linter error
alex35mil 57f3bad
Update react_on_rails gem
alex35mil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| web: rails s -p 4000 | ||
| client: sh -c 'cd client && $(npm bin)/webpack -w --config webpack.rails.config.js' | ||
| server: sh -c 'cd client && $(npm bin)/webpack -w --config webpack.server.config.js' | ||
| hot: sh -c 'cd client && node server.js' | ||
| client: sh -c 'rm app/assets/javascripts/generated/* || true && cd client && npm run build:dev:client' | ||
| server: sh -c 'cd client && npm run build:dev:server' | ||
| hot: sh -c 'cd client && npm start' |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| class PagesController < ApplicationController | ||
| def index | ||
| @comments = Comment.all | ||
| end | ||
| end |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| { | ||
| "preset": "airbnb", | ||
| "fileExtensions": [".js", ".jsx"], | ||
| "excludeFiles": ["build/**", "node_modules/**"] | ||
| "excludeFiles": ["build/**", "node_modules/**"], | ||
|
|
||
| "validateQuoteMarks": null // Issue with JSX quotemarks: https://github.com/jscs-dev/babel-jscs/issues/12 | ||
| } |
This file contains hidden or 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
This file contains hidden or 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 @@ | ||
| import React, { PropTypes } from 'react'; | ||
| import marked from 'marked'; | ||
|
|
||
| const Comment = React.createClass({ | ||
| displayName: 'Comment', | ||
|
|
||
| propTypes: { | ||
| author: PropTypes.string.isRequired, | ||
| text: PropTypes.string.isRequired, | ||
| }, | ||
|
|
||
| render() { | ||
| const { author, text } = this.props; | ||
| const rawMarkup = marked(text, { gfm: true, sanitize: true }); | ||
| return ( | ||
| <div className="comment"> | ||
| <h2 className="comment-author"> | ||
| {author} | ||
| </h2> | ||
| <span dangerouslySetInnerHTML={{__html: rawMarkup}}/> | ||
| </div> | ||
| ); | ||
| }, | ||
| }); | ||
|
|
||
| export default Comment; |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be changed to app-bundle.js and vendor-bundle.js?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dylangrafmyre Nice catch! Will fix it today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexfedoseev @dylangrafmyre Should we also upgrade to current npm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and to current node also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also when we upgrade to npm@3.3.4 we need to change the npm install/upgrade instructions in the client/REAMDE.
shrinkwrap.jsongets automatically updated during npm install/upgrade similar to Gemfile.loc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By saying "yes", I meant current
npm@2.x.x. I suggest to wait a month or so before upgrade to3.x.x, since there is performance issue.