react_on_rails 6.6.0 → 6.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9df3146f1b1852d86faa068f5d22dc82ac0a29d5
4
- data.tar.gz: e3850f41f59ac558263173e8407088b2c18f0c5b
3
+ metadata.gz: 0c58c7ed04a4a64f4e0215a9d409f8628a66a988
4
+ data.tar.gz: a12a656c9a33e5f6c3fbdb71e4f0811a60b99ad5
5
5
  SHA512:
6
- metadata.gz: c36020f6688cc06c004eba51a42b543c0d206e0b9664e544b04c3b5f0542af65ed875baf78923e905b7b5fc08999687cdb4c35506b7009c366588e9ec953d2f6
7
- data.tar.gz: 101064964aa15e85d333dba3c6ebfd053834e3770b7f14569249fc20f67ba639df80fbf81d66954a8eda445227ea30e95d4ae06477009b973f87262d5beee5c9
6
+ metadata.gz: ac418a4fc783db738ced2316c41e8f4031dcfd01eb50bf3afe0cce47470362ac0d212384a93be4a6d566cd110d2027205e7bd4fc840ee8c9b5952366fc26b749
7
+ data.tar.gz: a26293687d1ff59f02287ff5fb469b907f5eff5325d62833e2df1899d4bff6a2bf2d781826ffd4dda8b7ef6d1dd95f7207633bc9f069a4964283fefe72442b27
data/.travis.yml CHANGED
@@ -3,11 +3,11 @@ sudo: required
3
3
  language: ruby
4
4
 
5
5
  rvm:
6
- - 2.0.0
6
+ # Ruby 2.0.0 fails due to newer Nokogir
7
+ # nokogiri-1.7.0.1 requires ruby version >= 2.1.0, which is incompatible with the current version, ruby 2.0.0p648
7
8
  - 2.1.10
8
9
  - 2.2.6
9
10
  - 2.3.1
10
-
11
11
  services:
12
12
  - docker
13
13
 
data/CHANGELOG.md CHANGED
@@ -6,6 +6,15 @@ Contributors: please follow the recommendations outlined at [keepachangelog.com]
6
6
  ## [Unreleased]
7
7
  *Please add entries here for your pull requests.*
8
8
 
9
+ ## [6.7.0] - 2017-02-28
10
+
11
+ ### Added
12
+ - Allow using rake task to generate javascript locale files. The test helper automatically creates the localization files when needed. [#717](https://github.com/shakacode/react_on_rails/pull/717) by [JasonYCHuang](https://github.com/JasonYCHuang).
13
+
14
+ ### Fixed
15
+ - Upgrade Rails to 4.2.8 to fix security vulnerabilities in 4.2.5. [#735](https://github.com/shakacode/react_on_rails/pull/735) by [hrishimittal](https://github.com/hrishimittal).
16
+ - Fix spec failing due to duplicate component. [#734](https://github.com/shakacode/react_on_rails/pull/734) by [hrishimittal](https://github.com/hrishimittal).
17
+
9
18
  ## [6.6.0] - 2017-02-18
10
19
  ### Added
11
20
  - Switched to yarn! [#715](https://github.com/shakacode/react_on_rails/pull/715) by [squadette](https://github.com/squadette).
@@ -452,7 +461,8 @@ Best done with Object destructing:
452
461
  ##### Fixed
453
462
  - Fix several generator related issues.
454
463
 
455
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/6.6.0...master
464
+ [Unreleased]: https://github.com/shakacode/react_on_rails/compare/6.7.0...master
465
+ [6.7.0]: https://github.com/shakacode/react_on_rails/compare/6.6.0...6.7.0
456
466
  [6.6.0]: https://github.com/shakacode/react_on_rails/compare/6.5.1...6.6.0
457
467
  [6.5.1]: https://github.com/shakacode/react_on_rails/compare/6.5.0...6.5.1
458
468
  [6.5.0]: https://github.com/shakacode/react_on_rails/compare/6.4.2...6.5.0
data/Gemfile CHANGED
@@ -12,7 +12,7 @@ gem "coffee-rails", "~> 4.1.0"
12
12
  gem "jbuilder", "~> 2.0"
13
13
  gem "jquery-rails"
14
14
  gem "puma"
15
- gem "rails", "4.2.5"
15
+ gem "rails", "4.2.8"
16
16
  gem "rails_12factor"
17
17
  gem "rubocop", require: false
18
18
  gem "ruby-lint", require: false
data/KUDOS.md CHANGED
@@ -44,3 +44,9 @@ https://github.com/shakacode/react_on_rails/pull/591#issuecomment-258685925
44
44
 
45
45
  ### December 20, 2016
46
46
  ![2016-12-25_10-02-17](https://cloud.githubusercontent.com/assets/1118459/21472700/70242a1e-ca89-11e6-9522-fb45f7835bbb.png)
47
+
48
+ ### February 24, 2017
49
+ "I ❤️ React on Rails because it's easy to drop into a Rails project and still get all the power of native JavaScript tooling. The generators are great and the community is so awesome and welcoming. In fact, I love it so much I made a [course for learning React with Rails](https://goo.gl/uzu36X) using the react_on_rails gem!"
50
+ ![The Complete React on Rails course](https://raw.githubusercontent.com/learnetto/calreact/whyror/public/why_react_on_rails_gem.png)
51
+
52
+
data/PROJECTS.md CHANGED
@@ -18,6 +18,7 @@
18
18
  * **[Undeveloped](https://undeveloped.com/)**: Buy and sell domain names. ![image](https://cloud.githubusercontent.com/assets/1118459/19623703/7c6d63d0-9870-11e6-83f2-8b83ca49daa9.png)
19
19
  * **[Foxford.ru](http://foxford.ru/)**: Online School ![2016-12-17_13-23-21](https://cloud.githubusercontent.com/assets/1118459/21290377/1adacdf2-c45c-11e6-97c1-f726ab749b2d.png)
20
20
  * **[CareerBuilder for Employers](https://hiring.careerbuilder.com/)**: CareerBuilder's marketing/ecommerce website. We've integrated React on Rails and have deployed the application via Cloud 66, and are busy integrating this into other projects!
21
+ * **[Josephine](https://www.josephine.com)**: The private network for home cooked meals.
21
22
 
22
23
  ## Open Source Projects Live
23
24
  * [github.com/empirical-org/Empirical-Core](https://github.com/empirical-org/Empirical-Core): [Quill.org](https://quill.org/) Provides free tools to make your students better writers.
@@ -25,6 +26,7 @@
25
26
  ## Demos and Tutorials
26
27
  * [reactrails.com](http://www.reactrails.com), source code [github.com/shakacode/react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/)
27
28
  * [Relay Rails Blog](https://github.com/gauravtiwari/relay-rails-blog): Tutorial to learn Relay with Rails.
29
+ * [Hot Module Replacement with react_on_rails](https://medium.com/@hrishio/lesson-5-hot-module-replacement-for-react-in-rails-using-the-react-on-rails-gem-643c5b01f3d7#.ehevxok16) : Step-by-step tutorial for a quick basic set up of hot asset reloading with HMR in a Rails 5 app. [Code on Github](https://github.com/learnetto/calreact-hmr)
28
30
 
29
31
  --------
30
32
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **For a complete example of this gem, see our live demo at [www.reactrails.com](http://www.reactrails.com). ([Source Code](https://github.com/shakacode/react-webpack-rails-tutorial))**
4
4
 
5
- Aloha from Justin Gordon ([bio](http://www.railsonmaui.com/about)) and the [ShakaCode](http://www.shakacode.com) Team! We're actively looking for new projects involving React, React-Native, and Rails. Please [contact me](mailto:justin@shakacode.com) if we could potentially help you in any way. Besides consulting on bigger projects, [ShakaCode](http://www.shakacode.com) is doing ScreenHero plus Slack/Github based coaching for React on Rails. See our blog post [Can ShakaCode Help You?](https://blog.shakacode.com/can-shakacode-help-you-4a5b1e5a8a63#.jex6tg9w9) for more information.
5
+ Aloha from Justin Gordon ([bio](http://www.railsonmaui.com/about)) and the [ShakaCode](http://www.shakacode.com) Team! We're actively looking for new projects involving React, React-Native, and Rails, including conversion of AngularJs to React. Please [contact me](mailto:justin@shakacode.com) if we could potentially help you in any way. Besides consulting on bigger projects, [ShakaCode](http://www.shakacode.com) is doing ScreenHero plus Slack/Github based coaching for React on Rails. See our blog post [Can ShakaCode Help You?](https://blog.shakacode.com/can-shakacode-help-you-4a5b1e5a8a63#.jex6tg9w9) for more information.
6
6
 
7
7
  I'm offering a free half-hour project consultation, on anything from React on Rails to any aspect of web application development for both consumer and enterprise products. In addition to React.js and Rails, we're doing React-Native iOS and Android apps!
8
8
 
@@ -47,6 +47,8 @@ For more testimonials, see [Live Projects](PROJECTS.md) and [Kudos](./KUDOS.md).
47
47
  * [284 Ruby Rogues: React on Rails with Justin Gordon and Rob Wise](https://devchat.tv/ruby-rogues/284-rr-react-on-rails-with-justin-gordon-and-rob-wise)
48
48
 
49
49
  # NEWS
50
+ * 2017-02-28: See [discussions here on Webpacker](https://github.com/rails/webpacker/issues/139) regarding how Webpacker will allow React on Rails to avoid using the asset pipeline in the near future.
51
+ * 2017-02-28: Upgrade to Webpack v2 or use the `--bail` option in your webpack script for test and production builds. See the discussion on [PR #730](https://github.com/shakacode/react_on_rails/pull/730).
50
52
  * 2016-11-03: Spoke at [LA Ruby: "React on Rails: Why, What, and How?"](http://www.meetup.com/laruby/events/234825187/). [Video and pictures in this article](https://blog.shakacode.com/my-react-on-rails-talk-at-the-la-ruby-rails-meetup-november-10-2016-eaaa83aff800#.ej6h4eglp).
51
53
  * *See [NEWS.md](NEWS.md) for more notes over time.*
52
54
 
@@ -226,7 +228,7 @@ In the following screenshot you can see the 3 parts of React on Rails rendering:
226
228
  ### Building the Bundles
227
229
  Each time you change your client code, you will need to re-generate the bundles (the webpack-created JavaScript files included in application.js). The included Foreman `Procfile.dev` will take care of this for you by watching your JavaScript code files for changes. Simply run `foreman start -f Procfile.dev`.
228
230
 
229
- On production deployments that use asset precompilation, such as Heroku deployments, React on Rails, by default, will automatically run webpack to build your JavaScript bundles. You can see the source code for what gets added to your precompilation [here](https://github.com/shakacode/react_on_rails/tree/master/lib/tasks/assets.rake). For more information on this topic, see [the doc on Heroku deployment](https://github.com/shakacode/react_on_rails/tree/master/docs/additional-reading/heroku-deployment.md#more-details-on-precompilation-using-webpack-to-create-javascript-assets).
231
+ On production deployments that use asset precompilation, such as Heroku deployments, React on Rails, by default, will automatically run webpack to build your JavaScript bundles. You can see the source code for what gets added to your precompilation [here](https://github.com/shakacode/react_on_rails/tree/master/lib/tasks/assets.rake). For more information on this topic, see [the doc on Heroku deployment](./docs/additional-reading/heroku-deployment.md#more-details-on-precompilation-using-webpack-to-create-javascript-assets).
230
232
 
231
233
  If you have used the provided generator, these bundles will automatically be added to your `.gitignore` to prevent extraneous noise from re-generated code in your pull requests. You will want to do this manually if you do not use the provided generator.
232
234
 
@@ -335,7 +337,7 @@ Why would you create a function that returns a React component? For example, you
335
337
  Another reason to user a generator function is that sometimes in server rendering, specifically with React Router, you need to return the result of calling ReactDOMServer.renderToString(element). You can do this by returning an object with the following shape: { renderedHtml, redirectLocation, error }.
336
338
 
337
339
  #### Renderer Functions
338
- A renderer function is a generator function that accepts three arguments: `(props, railsContext, domNodeId) => { ... }`. Instead of returning a React component, a renderer is responsible for calling `ReactDOM.render` to manually render a React component into the dom. Why would you want to call `ReactDOM.render` yourself? One possible use case is [code splitting](docs/additional-reading/code-splitting.md).
340
+ A renderer function is a generator function that accepts three arguments: `(props, railsContext, domNodeId) => { ... }`. Instead of returning a React component, a renderer is responsible for calling `ReactDOM.render` to manually render a React component into the dom. Why would you want to call `ReactDOM.render` yourself? One possible use case is [code splitting](./docs/additional-reading/code-splitting.md).
339
341
 
340
342
  Renderer functions are not meant to be used on the server, since there's no DOM on the server. Instead, use a generator function. Attempting to server render with a renderer function will cause an error.
341
343
 
@@ -480,69 +482,70 @@ If you are using [jquery-ujs](https://github.com/rails/jquery-ujs) for AJAX call
480
482
  ## React Router
481
483
  [React Router](https://github.com/reactjs/react-router) is supported, including server side rendering! See:
482
484
 
483
- 1. [React on Rails docs for react-router](docs/additional-reading/react-router.md)
485
+ 1. [React on Rails docs for react-router](./docs/additional-reading/react-router.md)
484
486
  1. Examples in [spec/dummy/app/views/react_router](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/app/views/react_router) and follow to the JavaScript code in the [spec/dummy/client/app/startup/ServerRouterApp.jsx](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/client/app/startup/ServerRouterApp.jsx).
485
- 1. [Code Splitting docs](docs/additional-reading/code-splitting.md) for information about how to set up code splitting for server rendered routes.
487
+ 1. [Code Splitting docs](./docs/additional-reading/code-splitting.md) for information about how to set up code splitting for server rendered routes.
486
488
 
487
489
  ## Deployment
488
490
  * Version 6.0 puts the necessary precompile steps automatically in the rake precompile step. You can, however, disable this by setting certain values to nil in the [config/initializers/react_on_rails.rb](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/config/initializers/react_on_rails.rb).
489
491
  * `config.symlink_non_digested_assets_regex`: Set to nil to turn off the setup of non-js assets.
490
492
  * `npm_build_production_command`: Set to nil to turn off the precompilation of the js assets.
491
- * See the [Heroku Deployment](docs/additional-reading/heroku-deployment.md) doc for specifics regarding Heroku.
492
- * If you're using the node server for server rendering, you may want to do your own AWS install. We'll have more docs on this in the future.
493
+ * See the [Heroku Deployment](./docs/additional-reading/heroku-deployment.md) doc for specifics regarding Heroku. The information here should apply to other deployments.
494
+ * If you're using the node server for server rendering, you may want to do your own AWS install. We'll have more docs on this in the future. [Get in touch](mailto:justin@shakacode.com) if you're keenly interested in this feature.
493
495
 
494
496
  ## Integration with Node
495
- Node.js can be used as the backend for server-side rendering instead of [execJS](https://github.com/rails/execjs). Before you try this, consider the tradeoff of extra complexity with your deployments versus *potential* performance gains. We've found that using ExecJS with [mini_racer](https://github.com/discourse/mini_racer) to be "fast enough" so far. That being said, we've heard of other large websites using Node.js for better server rendering performance. See [Node.js for Server Rendering](docs/additional-reading/node-server-rendering.md) for more information.
497
+ Node.js can be used as the backend for server-side rendering instead of [execJS](https://github.com/rails/execjs). Before you try this, consider the tradeoff of extra complexity with your deployments versus *potential* performance gains. We've found that using ExecJS with [mini_racer](https://github.com/discourse/mini_racer) to be "fast enough" so far. That being said, we've heard of other large websites using Node.js for better server rendering performance. See [Node.js for Server Rendering](./docs/additional-reading/node-server-rendering.md) for more information.
496
498
 
497
499
  ## Additional Documentation
498
500
  **Try out our new [Documentation Gitbook](https://shakacode.gitbooks.io/react-on-rails/content/) for improved readability & reference!**
499
501
  + **Rails**
500
- + [Rails Assets](docs/additional-reading/rails-assets.md)
501
- + [Rails Engine Integration](docs/additional-reading/rails-engine-integration.md)
502
- + [Rails View Rendering from Inline JavaScript](docs/additional-reading/rails_view_rendering_from_inline_javascript.md)
503
- + [RSpec Configuration](docs/additional-reading/rspec-configuration.md)
504
- + [Turbolinks](docs/additional-reading/turbolinks.md)
502
+ + [Rails Assets](./docs/additional-reading/rails-assets.md)
503
+ + [Rails Engine Integration](./docs/additional-reading/rails-engine-integration.md)
504
+ + [Rails View Rendering from Inline JavaScript](./docs/additional-reading/rails_view_rendering_from_inline_javascript.md)
505
+ + [RSpec Configuration](./docs/additional-reading/rspec-configuration.md)
506
+ + [Turbolinks](./docs/additional-reading/turbolinks.md)
505
507
 
506
508
  + **Javascript**
507
- + [Node Dependencies, NPM, and Yarn](docs/additional-reading/node-dependencies-and-npm.md)
508
- + [Babel](docs/additional-reading/babel.md)
509
- + [React Router](docs/additional-reading/react-router.md)
510
- + [React & Redux](docs/additional-reading/react-and-redux.md)
511
- + [Webpack](docs/additional-reading/webpack.md)
512
- + [Webpack Configuration](docs/additional-reading/webpack.md)
509
+ + [Node Dependencies, NPM, and Yarn](./docs/additional-reading/node-dependencies-and-npm.md)
510
+ + [Babel](./docs/additional-reading/babel.md)
511
+ + [React Router](./docs/additional-reading/react-router.md)
512
+ + [React & Redux](./docs/additional-reading/react-and-redux.md)
513
+ + [Webpack](./docs/additional-reading/webpack.md)
514
+ + [Webpack Configuration](./docs/additional-reading/webpack.md)
513
515
  + [Webpack Cookbook](https://christianalfoni.github.io/react-webpack-cookbook/index.html)
514
516
  + [Developing with the Webpack Dev Server](docs/additional-reading/webpack-dev-server.md)
515
- + [Node Server Rendering](docs/additional-reading/node-server-rendering.md)
516
- + [Server Rendering Tips](docs/additional-reading/server-rendering-tips.md)
517
- + [Code Splitting](docs/additional-reading/code-splitting.md)
517
+ + [Node Server Rendering](./docs/additional-reading/node-server-rendering.md)
518
+ + [Server Rendering Tips](./docs/additional-reading/server-rendering-tips.md)
519
+ + [Code Splitting](./docs/additional-reading/code-splitting.md)
520
+ + [AngularJS Integration and Migration to React on Rails](./docs/additional-reading/angular-js-integration-migration.md)
518
521
 
519
522
  + **Development**
520
- + [React on Rails Basic Installation Tutorial](docs/tutorial.md) ([live demo](https://hello-react-on-rails.herokuapp.com))
521
- + [Installation Overview](docs/basics/installation-overview.md)
522
- + [Migration from react-rails](docs/basics/migrating-from-react-rails.md)
523
- + [Recommended Project Structure](docs/additional-reading/recommended-project-structure.md)
524
- + [Generator Tips](docs/basics/generator.md)
525
- + [Hot Reloading of Assets For Rails Development](docs/additional-reading/hot-reloading-rails-development.md)
526
- + [Heroku Deployment](docs/additional-reading/heroku-deployment.md)
527
- + [Updating Dependencies](docs/additional-reading/updating-dependencies.md)
523
+ + [React on Rails Basic Installation Tutorial](./docs/tutorial.md) ([live demo](https://hello-react-on-rails.herokuapp.com))
524
+ + [Installation Overview](./docs/basics/installation-overview.md)
525
+ + [Migration from react-rails](./docs/basics/migrating-from-react-rails.md)
526
+ + [Recommended Project Structure](./docs/additional-reading/recommended-project-structure.md)
527
+ + [Generator Tips](./docs/basics/generator.md)
528
+ + [Hot Reloading of Assets For Rails Development](./docs/additional-reading/hot-reloading-rails-development.md)
529
+ + [Heroku Deployment](./docs/additional-reading/heroku-deployment.md)
530
+ + [Updating Dependencies](./docs/additional-reading/updating-dependencies.md)
528
531
 
529
532
  + **API**
530
- + [JavaScript API](docs/api/javascript-api.md)
531
- + [Ruby API](docs/api/ruby-api.md)
532
- + [Setting up Hot Reloading during Rails Development, API docs](docs/api/ruby-api-hot-reload-view-helpers.md)
533
+ + [JavaScript API](./docs/api/javascript-api.md)
534
+ + [Ruby API](./docs/api/ruby-api.md)
535
+ + [Setting up Hot Reloading during Rails Development, API docs](./docs/api/ruby-api-hot-reload-view-helpers.md)
533
536
 
534
537
  + **[CONTRIBUTING](CONTRIBUTING.md)**
535
- + [Generator Testing](docs/contributor-info/generator-testing.md)
536
- + [Linting](docs/contributor-info/linters.md)
537
- + [Releasing](docs/contributor-info/releasing.md)
538
+ + [Generator Testing](./docs/contributor-info/generator-testing.md)
539
+ + [Linting](./docs/contributor-info/linters.md)
540
+ + [Releasing](./docs/contributor-info/releasing.md)
538
541
 
539
542
  + **Misc**
540
- + [Tips](docs/additional-reading/tips.md)
541
- + [Changelog](CHANGELOG.md)
542
- + [Projects](PROJECTS.md)
543
- + [Shaka Code Style](docs/coding-style/style.md)
543
+ + [Tips](./docs/additional-reading/tips.md)
544
+ + [Changelog](./CHANGELOG.md)
545
+ + [Projects](./PROJECTS.md)
546
+ + [Shaka Code Style](./docs/coding-style/style.md)
544
547
  + [React on Rails, Slides](http://www.slideshare.net/justingordon/react-on-rails-v61)
545
- + [Code of Conduct](docs/misc/code_of_conduct.md)
548
+ + [Code of Conduct](./docs/misc/code_of_conduct.md)
546
549
  + [The React on Rails Doctrine](https://medium.com/@railsonmaui/the-react-on-rails-doctrine-3c59a778c724)
547
550
  + [React on Rails, 2000+ 🌟 Stars](https://medium.com/shakacode/react-on-rails-2000-stars-32ff5cfacfbf#.6gmfb2gpy)
548
551
 
@@ -566,7 +569,7 @@ Bug reports and pull requests are welcome. This project is intended to be a safe
566
569
  See [Contributing](CONTRIBUTING.md) to get started.
567
570
 
568
571
  ## License
569
- The gem is available as open source under the terms of the [MIT License](docs/LICENSE).
572
+ The gem is available as open source under the terms of the [MIT License](./docs/LICENSE.md).
570
573
 
571
574
  ## Authors
572
575
  [The Shaka Code team!](http://www.shakacode.com/about/)
@@ -577,6 +580,12 @@ The gem project started with [Justin Gordon](https://github.com/justin808/) pair
577
580
 
578
581
  We owe much gratitude to the work of the [react-rails gem](https://github.com/reactjs/react-rails).
579
582
 
583
+ # Thanks!
584
+ The following companies support open source, and ShakaCode uses their products!
585
+
586
+ * [JetBrains](https://www.jetbrains.com/)
587
+ * [![2017-02-21_22-35-32](https://cloud.githubusercontent.com/assets/1118459/23203304/1261e468-f886-11e6-819e-93b1a3f17da4.png)](https://www.browserstack.com)
588
+
580
589
  # FINAL NOTES
581
590
  * See [Projects](PROJECTS.md) using and [KUDOS](./KUDOS.md) for React on Rails. Please submit yours! Please edit either page or [email us](mailto:contact@shakacode.com) and we'll add your info. We also **love stars** as it helps us attract new users and contributors.
582
591
  * Follow [@railsonmaui](https://twitter.com/railsonmaui) and [@shakacode](https://twitter.com/shakacode) on Twitter for updates on releases. We've also got a forum category dedicated to [react_on_rails](https://forum.shakacode.com/c/rails/reactonrails).
data/SUMMARY.md CHANGED
@@ -1,49 +1,52 @@
1
1
  # Table of Content
2
2
 
3
3
  ### **Rails**
4
- * [Rails Assets](docs/additional-reading/rails-assets.md)
5
- * [Rails View Rendering from Inline JavaScript](docs/additional-reading/rails_view_rendering_from_inline_javascript.md)
6
- * [RSpec Configuration](docs/additional-reading/rspec-configuration.md)
7
- * [Turbolinks](docs/additional-reading/turbolinks.md)
4
+ + [Rails Assets](./docs/additional-reading/rails-assets.md)
5
+ + [Rails Engine Integration](./docs/additional-reading/rails-engine-integration.md)
6
+ + [Rails View Rendering from Inline JavaScript](./docs/additional-reading/rails_view_rendering_from_inline_javascript.md)
7
+ + [RSpec Configuration](./docs/additional-reading/rspec-configuration.md)
8
+ + [Turbolinks](./docs/additional-reading/turbolinks.md)
8
9
 
9
10
  ### **Javascript**
10
- * [Node Dependencies, NPM, and Yarn](docs/additional-reading/node-dependencies-and-npm.md)
11
- * [Babel](docs/additional-reading/babel.md)
12
- * [React Router](docs/additional-reading/react-router.md)
13
- * [React & Redux](docs/additional-reading/react-and-redux.md)
14
- * [Webpack](docs/additional-reading/webpack.md)
15
- * [Webpack Configuration](docs/additional-reading/webpack.md)
16
- * [Webpack Cookbook](https://christianalfoni.github.io/react-webpack-cookbook/index.html)
17
- * [Developing with the Webpack Dev Server](docs/additional-reading/webpack-dev-server.md)
18
- * [Node Server Rendering](docs/additional-reading/node-server-rendering.md)
19
- * [Server Rendering Tips](docs/additional-reading/server-rendering-tips.md)
11
+ + [Node Dependencies, NPM, and Yarn](./docs/additional-reading/node-dependencies-and-npm.md)
12
+ + [Babel](./docs/additional-reading/babel.md)
13
+ + [React Router](./docs/additional-reading/react-router.md)
14
+ + [React & Redux](./docs/additional-reading/react-and-redux.md)
15
+ + [Webpack](./docs/additional-reading/webpack.md)
16
+ + [Webpack Configuration](./docs/additional-reading/webpack.md)
17
+ + [Webpack Cookbook](https://christianalfoni.github.io/react-webpack-cookbook/index.html)
18
+ + [Developing with the Webpack Dev Server](docs/additional-reading/webpack-dev-server.md)
19
+ + [Node Server Rendering](./docs/additional-reading/node-server-rendering.md)
20
+ + [Server Rendering Tips](./docs/additional-reading/server-rendering-tips.md)
21
+ + [Code Splitting](./docs/additional-reading/code-splitting.md)
22
+ + [AngularJS Integration and Migration to React on Rails](./docs/additional-reading/angular-js-integration-migration.md)
20
23
 
21
24
  ### **Development**
22
- * [React on Rails Basic Installation Tutorial](docs/tutorial.md) ([live demo](https://hello-react-on-rails.herokuapp.com))
23
- * [Installation Overview](docs/basics/installation-overview.md)
24
- * [Migration from react-rails](docs/basics/migrating-from-react-rails.md)
25
- * [Recommended Project Structure](docs/additional-reading/recommended-project-structure.md)
26
- * [Generator Tips](docs/basics/generator.md)
27
- * [Hot Reloading of Assets For Rails Development](docs/additional-reading/hot-reloading-rails-development.md)
28
- * [Heroku Deployment](docs/additional-reading/heroku-deployment.md)
29
- * [Updating Dependencies](docs/additional-reading/updating-dependencies.md)
25
+ + [React on Rails Basic Installation Tutorial](./docs/tutorial.md)
26
+ + [Installation Overview](./docs/basics/installation-overview.md)
27
+ + [Migration from react-rails](./docs/basics/migrating-from-react-rails.md)
28
+ + [Recommended Project Structure](./docs/additional-reading/recommended-project-structure.md)
29
+ + [Generator Tips](./docs/basics/generator.md)
30
+ + [Hot Reloading of Assets For Rails Development](./docs/additional-reading/hot-reloading-rails-development.md)
31
+ + [Heroku Deployment](./docs/additional-reading/heroku-deployment.md)
32
+ + [Updating Dependencies](./docs/additional-reading/updating-dependencies.md)
30
33
 
31
34
  ### **API**
32
- * [JavaScript API](docs/api/javascript-api.md)
33
- * [Ruby API](docs/api/ruby-api.md)
34
- * [Setting up Hot Reloading during Rails Development, API docs](docs/api/ruby-api-hot-reload-view-helpers.md)
35
+ + [JavaScript API](./docs/api/javascript-api.md)
36
+ + [Ruby API](./docs/api/ruby-api.md)
37
+ + [Setting up Hot Reloading during Rails Development, API docs](./docs/api/ruby-api-hot-reload-view-helpers.md)
35
38
 
36
- ### **CONTRIBUTING**
37
- * [Contributing](CONTRIBUTING.MD)
38
- * [Generator Testing](docs/contributor-info/generator-testing.md)
39
- * [Linting](docs/contributor-info/linters.md)
40
- * [Releasing](docs/contributor-info/releasing.md)
39
+ ### **[CONTRIBUTING](CONTRIBUTING.md)**
40
+ + [Generator Testing](./docs/contributor-info/generator-testing.md)
41
+ + [Linting](./docs/contributor-info/linters.md)
42
+ + [Releasing](./docs/contributor-info/releasing.md)
41
43
 
42
44
  ### **Misc**
43
- * [Tips](docs/additional-reading/tips.md)
44
- * [Changelog](CHANGELOG.md)
45
- * [Projects](PROJECTS.md)
46
- * [Shaka Code Style](docs/coding-style/style.md)
47
- * [React on Rails, Slides](http://www.slideshare.net/justingordon/react-on-rails-v4032)
48
- * [Code of Conduct](docs/misc/code_of_conduct.md)
49
- * [The React on Rails Doctrine](https://medium.com/@railsonmaui/the-react-on-rails-doctrine-3c59a778c724)
45
+ + [Tips](./docs/additional-reading/tips.md)
46
+ + [Changelog](./CHANGELOG.md)
47
+ + [Projects](./PROJECTS.md)
48
+ + [Shaka Code Style](./docs/coding-style/style.md)
49
+ + [React on Rails, Slides](http://www.slideshare.net/justingordon/react-on-rails-v61)
50
+ + [Code of Conduct](./docs/misc/code_of_conduct.md)
51
+ + [The React on Rails Doctrine](https://medium.com/@railsonmaui/the-react-on-rails-doctrine-3c59a778c724)
52
+ + [React on Rails, 2000+ 🌟 Stars](https://medium.com/shakacode/react-on-rails-2000-stars-32ff5cfacfbf#.6gmfb2gpy)
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ # The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015 Justin Gordon
3
+ Copyright (c) 2017 Justin Gordon and ShakaCode, http://www.shakacode.com
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,28 @@
1
+ # AngularJS Integration and Migration to React on Rails
2
+
3
+ [React on Rails](https://github.com/shakacode/react_on_rails) offers a smooth transition to migrating your existing [AngularJS](https://angularjs.org/) + Rails application to use React with Webpack on top of Rails. Here are a few highlights and tips.
4
+
5
+ ## Assets Handling
6
+ Ideally, you should have your JavaScript libraries packaged by `webpack` and gathered by `yarn`. If you have not already done this, then you can setup the `ReactOnRails` default JS code directory of `/client` to load the JS libraries related to AngularJS, etc. You can configure Webpack to globally export these libraries, so inclusion this way will be no different than using the Rails asset pipeline. However, so long as you *understand* how your JavaScript will eventually make its way onto your main layout, you will be OK.
7
+
8
+ ## Styling and CSS Modules
9
+ Once you move to Webpack, you can start using CSS modules. However, you'll need to carefully consider if your styling needs to apply to legacy AngularJS components in your app.
10
+
11
+ ## ngReact Package
12
+
13
+ Check out the [ngReact](https://github.com/ngReact/ngReact) package. This package allows your AngularJS components to contain React components, including support for passing props from AngularJS to React. The [ShakaCode team](http://www.shakacode.com/about/) is using this library on a commercial project. However, we're doing this with some limitations:
14
+
15
+ 1. We're only having the data flow in one direction, from AngularJS to React and never back up to the Angular components.
16
+ 2. When we get to a case where the React components will affect the Angular layout, we try to convert the components up the tree to React.
17
+ 3. Thus, the React components within AngularJS components will tend to be React "dumb" components, or totally self-contained chunks of React that have no side effects on the Angular code.
18
+
19
+ ## StoryBook
20
+
21
+ We love using [StoryBook](https://getstorybook.io/) to create a simple testing and inspection area of new React components as we migrate them over from AngularJS Components.
22
+
23
+ ## Overall Approach?
24
+
25
+ The big question when doing the migration from AngularJS to React is whether you should replace leaf level components first, to minimize the changes before you can deploy your hybrid AngularJS and React app. The alternative is to try to replace larger chunks at once. Both approaches have pros and cons.
26
+
27
+ 1. Frequent deploys with incremental parts of AngularJS replaced by React allows smaller incremental deploys and easier regression analysis should something break. On the negative side, any ping-pong of data between AngularJS and React can result in a complicated and convoluted architecture.
28
+ 2. Larger deploys of a full screen can yield efficiencies such as converting the whole screen to use one Redux store. However, this can be a large chunk of code to test and deploy.
@@ -10,7 +10,7 @@ The best way to understand these standards is to follow this example: [github.co
10
10
  1. `/client/app/bundles`: Top level of different app domains. Use a name within this directory for you app domains. For example, if you had a domain called `widget-editing`, then you would have: `/client/app/bundles/widget-editing`
11
11
  1. `/client/app/lib`: Common code for bundles
12
12
  1. Within each bundle directory (or the lib directory), such as a domain named "comments"
13
- `/client/app/bundle/comments`, use following directory structure:
13
+ `/client/app/bundles/comments`, use following directory structure:
14
14
 
15
15
  * `/actions`: Redux actions.
16
16
  * `/components`: "dumb" components (no connections to Redux or Ajax). These get props and can render themselves and children.
@@ -1,10 +1,22 @@
1
- # Entry Points and Globally Exposing Objects
1
+ # Webpack Tips
2
2
 
3
- You should ensure you configure the entry points correctly for webpack.
3
+ ## Where do I learn about advanced Webpack setups, such as with "CSS Modules", "Code Splitting", etc
4
+ You can try out example app, [shakacode/react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial). We're building comprehensive production examples in our new, premium product, [**React on Rails Pro**](https://forum.shakacode.com/t/introducing-react-on-rails-pro-subscriptions/785). If you're interested, please see the details in [this forum post](https://forum.shakacode.com/t/introducing-react-on-rails-pro-subscriptions/785).
4
5
 
5
- ## When using React 0.14 and greater
6
+ ## Webpack v1 or v2?
7
+ We recommend using Webpack version 2.2.1 or greater.
6
8
 
7
- You need both include `react-dom/server` and `react` as values for `entry`, like this:
9
+ ## Use the `--bail` Option When Running Webpack for CI or Deployments
10
+ For your scripts that statically build your Webpack bundles, use the `--bail` option. This will ensure that CI and your product deployment **halt** if Webpack cannot complete! For more details, see the documentation for [Webpack's `--bail` option](https://webpack.js.org/configuration/other-options/#bail). Note, you might not want to use the `--bail` option if you just want to depend on Webpack returning a non-zero error code and you want to see all the errors, rather than only the first error.
11
+
12
+ ## yarn or npm?
13
+ Yarn is the current recommendation!
14
+
15
+ ## Entry Points
16
+
17
+ You should ensure you configure the entry points correctly for webpack if you want to break out libraries into a "vendor" bundle where your libraries are packaged separately from your app's code. If you send web clients your vendor bundle separately from your app bundles, then web clients might have the vendor bundle cached while they receive updates for your app.
18
+
19
+ You need both include `react-dom` and `react` as values for `entry`, like this:
8
20
 
9
21
  ```
10
22
  entry: {
@@ -16,21 +28,3 @@ You need both include `react-dom/server` and `react` as values for `entry`, like
16
28
  'react-dom',
17
29
  ],
18
30
  ```
19
-
20
- and you need to expose them:
21
-
22
- ```
23
- // React is necessary for the client rendering:
24
- {test: require.resolve('react'), loader: 'expose?React'},
25
- {test: require.resolve('react-dom'), loader: 'expose?ReactDOM'},
26
- ```
27
-
28
- and use this line rather than `{test: require.resolve('react-dom'), loader: 'expose?ReactDOM'},`:
29
-
30
- ```
31
- {test: require.resolve('react-dom/server'), loader: 'expose?ReactDOMServer'},
32
- ```
33
-
34
- ## When you use React 0.13
35
-
36
- You don't need to put in react-dom.
data/docs/basics/i18n.md CHANGED
@@ -4,7 +4,7 @@ Here's a summary of adding the I18n functionality.
4
4
 
5
5
  You can refer to [react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial) and [PR #340](https://github.com/shakacode/react-webpack-rails-tutorial/pull/340) for a complete example.
6
6
 
7
- 1. Add `react-intl` & `intl` to `client/package.json`, and remember to `bundle && npm install`.
7
+ 1. Add `react-intl` & `intl` to `client/package.json`, and remember to `bundle && yarn install`.
8
8
 
9
9
  ```js
10
10
  "dependencies": {
@@ -44,18 +44,11 @@ You can refer to [react-webpack-rails-tutorial](https://github.com/shakacode/rea
44
44
  config.i18n_dir = Rails.root.join("PATH_TO", "YOUR_JS_I18N_FOLDER")
45
45
  ```
46
46
 
47
- Add following lines to `config/application.rb`, this will help you to generate `translations.js` & `default.js` automatically when you starts the server.
47
+ 4. Javascript locale files must be generated before `yarn build`.
48
+
49
+ Once you setup `config.i18n_dir` as in the previous step, react_on_rails will help you to do this for testing and for production deployments. For development, you should adjust your Procfiles so that they run `bundle exec rake react_on_rails:locale` before running the `yarn run build:development` (webpack watch process)
48
50
 
49
- ```js
50
- module YourModule
51
- class Application < Rails::Application
52
- ...
53
- config.after_initialize do
54
- ReactOnRails::LocalesToJs.new
55
- end
56
- end
57
- end
58
- ```
51
+ If you create your own Procfile files, you must add `bundle exec rake react_on_rails:locale` before `yarn build`.
59
52
 
60
53
  5. In React, you need to initialize `react-intl`, and set parameters for it.
61
54
 
data/docs/tutorial.md CHANGED
@@ -23,13 +23,15 @@ _Note: some of the screen images below show the "npm" command. react_on_rails 6.
23
23
 
24
24
  ##Setting up the environment
25
25
 
26
- Trying out **React on Rails** is super easy, so long as you have the basic prerequisites. This includes the basics for Rails 4.x and node version 5+. I recommend `rvm` and `nvm` to install Ruby and Node. Rails can be installed as ordinary gem.
26
+ Trying out **React on Rails** is super easy, so long as you have the basic prerequisites. This includes the basics for Rails 4.x and node version 6+. I recommend `rvm` and `nvm` to install Ruby and Node, and [brew](https://brew.sh/) to install [yarn](https://yarnpkg.com/en/docs/install#mac-tab). Rails can be installed as ordinary gem.
27
27
 
28
28
  ```
29
29
  nvm install node # download and install latest stable Node
30
30
  nvm alias default node # make it default version
31
31
  nvm list # check
32
32
 
33
+ brew install yarn # you can use other installer if desired
34
+
33
35
  rvm install 2.3.1 # download and install latest stable Ruby (update to exact version)
34
36
  rvm use 2.3.1 --default # use it and make it default
35
37
  rvm list # check
@@ -60,10 +60,10 @@ module ReactOnRails
60
60
  # js(.coffee) are not checked by this method, but instead produce warning messages
61
61
  # and allow the build to continue
62
62
  def installation_prerequisites_met?
63
- !(missing_node? || missing_npm? || ReactOnRails::GitUtils.uncommitted_changes?(GeneratorMessages))
63
+ !(missing_node? || missing_yarn? || ReactOnRails::GitUtils.uncommitted_changes?(GeneratorMessages))
64
64
  end
65
65
 
66
- def missing_npm?
66
+ def missing_yarn?
67
67
  return false unless ReactOnRails::Utils.running_on_windows? ? `where yarn`.blank? : `which yarn`.blank?
68
68
  error = "yarn is required. Please install it before continuing. "
69
69
  error << "https://yarnpkg.com/en/docs/install"
@@ -1,2 +1,2 @@
1
1
  web: rails s -p 3000
2
- client: sh -c 'rm app/assets/webpack/* || true && cd client && yarn run build:development'
2
+ client: sh -c 'rm app/assets/webpack/* || true && cd client && bundle exec rake react_on_rails:locale && yarn run build:development'
@@ -63,7 +63,7 @@ ReactOnRails.configure do |config|
63
63
  # I18N OPTIONS
64
64
  ################################################################################
65
65
  # Replace the following line to the location where you keep translation.js & default.js.
66
- config.i18n_dir = Rails.root.join("client", "app", "libs", "i18n")
66
+ # config.i18n_dir = Rails.root.join("client", "app", "libs", "i18n")
67
67
 
68
68
  ################################################################################
69
69
  # MISCELLANEOUS OPTIONS
@@ -27,6 +27,10 @@ module ReactOnRails
27
27
  # Be sure we don't do this again.
28
28
  self.class.has_been_run = true
29
29
 
30
+ if ReactOnRails.configuration.i18n_dir.present? && Rails.application.present?
31
+ ReactOnRails::LocalesToJs.new
32
+ end
33
+
30
34
  stale_gen_files = webpack_assets_status_checker.stale_generated_webpack_files
31
35
 
32
36
  # All done if no stale files!
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ReactOnRails
3
- VERSION = "6.6.0".freeze
3
+ VERSION = "6.7.1".freeze
4
4
  end
@@ -50,7 +50,7 @@ Compile assets with webpack
50
50
  Uses command defined with ReactOnRails.configuration.npm_build_production_command
51
51
  sh "cd client && `ReactOnRails.configuration.npm_build_production_command`"
52
52
  DESC
53
- task webpack: :environment do
53
+ task webpack: :locale do
54
54
  if ReactOnRails.configuration.npm_build_production_command.present?
55
55
  sh "cd client && #{ReactOnRails.configuration.npm_build_production_command}"
56
56
  end
@@ -0,0 +1,14 @@
1
+ require "react_on_rails/locales_to_js"
2
+
3
+ namespace :react_on_rails do
4
+ desc <<-DESC
5
+ Generate i18n javascript files
6
+ This task generates javascript locale files: `translations.js` & `default.js` and places them in
7
+ the "ReactOnRails.configuration.i18n_dir".
8
+ DESC
9
+ task locale: :environment do
10
+ if ReactOnRails.configuration.i18n_dir.present?
11
+ ReactOnRails::LocalesToJs.new
12
+ end
13
+ end
14
+ end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "6.6.0",
3
+ "version": "6.7.1",
4
4
  "description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5
5
  "main": "node_package/lib/ReactOnRails.js",
6
6
  "directories": {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.0
4
+ version: 6.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-18 00:00:00.000000000 Z
11
+ date: 2017-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -319,7 +319,8 @@ files:
319
319
  - SUMMARY.md
320
320
  - app/helpers/react_on_rails_helper.rb
321
321
  - book.json
322
- - docs/LICENSE
322
+ - docs/LICENSE.md
323
+ - docs/additional-reading/angular-js-integration-migration.md
323
324
  - docs/additional-reading/babel.md
324
325
  - docs/additional-reading/code-splitting.md
325
326
  - docs/additional-reading/foreman-issues.md
@@ -411,6 +412,7 @@ files:
411
412
  - lib/react_on_rails/version_checker.rb
412
413
  - lib/react_on_rails/version_syntax_converter.rb
413
414
  - lib/tasks/assets.rake
415
+ - lib/tasks/locale.rake
414
416
  - package.json
415
417
  - rakelib/docker.rake
416
418
  - rakelib/dummy_apps.rake