-
Notifications
You must be signed in to change notification settings - Fork 382
Move jQuery and jQuery-ujs under /client and npm #88
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
7 commits
Select commit
Hold shift + click to select a range
879ecb2
Move jQuery and jQuery-ujs under /client and npm
dylangrafmyre 6beab23
Remove jquery-rails gem, remove commented external jQuery from webpac…
dylangrafmyre 2ace443
Remove require expose jQuery and jQuery-ujs from script/rails_only
dylangrafmyre 78de2cb
Address eslint linting issue
dylangrafmyre 851dc3c
Add additional jquery expose-loader to global $
dylangrafmyre 208dc62
Update README.md referencing the jQuery expose and entry point within…
dylangrafmyre 421cef2
Addrees suggest comments from PR
dylangrafmyre 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,6 +173,17 @@ Be sure to see [assets.rake](https://github.com/shakacode/react-webpack-rails-tu | |
The `webpack.rails.config.js` file generates client-bundle.js which is then included | ||
by the Rails asset pipeline. | ||
|
||
##jQuery with Rails and Webpack | ||
jQuery and jQuery-ujs are not required within `app/assets/javascript/application.js` | ||
and have been moved under`/client` and managed by npm. The modules are exposed via entry point | ||
by `webpack.common.config.js`. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Also, possibly the twitter bootstrap javascript should come from npm? |
||
In `application.js`, it's critical that any libraries that depend on jQuery come after the inclusion | ||
of the Webpack bundle, such as the twitter bootstrap javascript. | ||
|
||
Please refer to [Considerations for jQuery with Rails and Webpack](http://forum.railsonmaui.com/t/considerations-for-jquery-with-rails-and-webpack/344) for further info. | ||
|
||
|
||
## Sass and images | ||
1. The Webpack server loads the images from the **symlink** of the | ||
`app/assets/images` directory. | ||
|
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 |
---|---|---|
|
@@ -9,14 +9,11 @@ | |
// | ||
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details | ||
// about supported directives. | ||
// | ||
//= require jquery | ||
//= require jquery_ujs | ||
|
||
//= require bootstrap-sprockets | ||
|
||
// Important to import jquery_ujs before rails-bundle as that patches jquery xhr to use the authenticity token! | ||
|
||
// Need to be on top to allow Poltergeist test to work with React. | ||
//= require es5-shim/es5-shim | ||
|
||
// It is important that generated/client-bundle must be before bootstrap since it is exposing jQuery and jQuery-ujs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
//= require generated/client-bundle | ||
//= require bootstrap-sprockets | ||
//= require turbolinks |
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.