-
Notifications
You must be signed in to change notification settings - Fork 384
Babel 6 / CSS Modules / Rails hot reloading #175
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
11 commits
Select commit
Hold shift + click to select a range
18b5646
Arrange deps
alex35mil 98c4663
Update linters
alex35mil d67548b
Update to babel@6
alex35mil e4832d4
Component oriented structure
alex35mil 832273a
Transfer all assets management to webpack, switch to CSS Modules
alex35mil aae804d
Make Rails development views hot reloadable
alex35mil c7577bd
Fix case in dir name
alex35mil a666689
Fix testing issues with Rails hot reloading setup
justin808 dda44b2
Fix JS tests
alex35mil 16e770c
npm shrinkwrap
alex35mil 816f3de
Fix Net::ReadTimeout error on the first Capybara test run
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
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,11 @@ | ||
web: rails s | ||
client: sh -c 'rm app/assets/javascripts/generated/* || true && cd client && npm run build:dev:client' | ||
|
||
# Run the hot reload server for client development | ||
client: sh -c 'rm app/assets/webpack/* || true && cd client && HOT_RAILS_PORT=3500 npm run build:dev:client' | ||
|
||
# Keep the JS fresh for specs | ||
client-spec: sh -c 'cd client && npm run build:test:client' | ||
|
||
# Keep the JS fresh for server rendering | ||
server: sh -c 'cd client && npm run build:dev:server' | ||
hot: sh -c 'cd client && npm start' | ||
hot: sh -c 'cd client && HOT_PORT=4000 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This file is used in production to server generated JS assets. In development mode, we use the Webpack Dev Server | ||
// to provide assets. This allows for hot reloading of the JS and CSS. | ||
// See app/helpers/application_helper.rb for how the correct assets file is picked based on the Rails environment. | ||
// Those helpers are used here: app/views/layouts/application.html.erb | ||
|
||
// These assets are located in app/assets/webpack directory | ||
// CRITICAL that webpack/vendor-bundle must be BEFORE turbolinks | ||
// since it is exposing jQuery and jQuery-ujs | ||
//= require vendor-bundle | ||
//= require app-bundle | ||
|
||
// Non-webpack assets incl turbolinks | ||
//= require application_dev |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
// Any non webpack assets can be imported here | ||
// Others will be served via webpack-dev-server |
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,6 @@ | ||
// These assets are located in app/assets/webpack directory | ||
@import 'vendor-bundle'; | ||
@import 'app-bundle'; | ||
|
||
// Non-webpack assets | ||
@import 'application_dev'; | ||
This file was deleted.
Oops, something went wrong.
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,2 +1,14 @@ | ||
module ApplicationHelper | ||
# TODO: MOVE TO helper in react_on_rails | ||
# See application.html.erb for usage example | ||
def env_javascript_include_tag(prod_asset, dev_asset, params = {}) | ||
asset_file = !Rails.env.development? ? prod_asset : dev_asset | ||
return javascript_include_tag(asset_file, params) if asset_file | ||
end | ||
|
||
# TODO: MOVE TO helper in react_on_rails | ||
def env_stylesheet_link_tag(prod_asset, dev_asset, params = {}) | ||
asset_file = !Rails.env.development? ? prod_asset : dev_asset | ||
return stylesheet_link_tag(asset_file, params) if asset_file | ||
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
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,3 +1,3 @@ | ||
{ | ||
"stage": 0 | ||
"presets": ["es2015", "stage-0", "react"] | ||
} |
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.
Where is this partial located?
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.
Right next to current file.