react_on_rails 4.0.1 → 4.0.2

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: bd9b9b65d290177a63655ae64925547393005194
4
- data.tar.gz: 46092839fb6e7248821eb54c2fe36df79182fb58
3
+ metadata.gz: 092a8cc44f2de9c2d7bc797cd41fb77d63cf5f3e
4
+ data.tar.gz: f848872f97b2ffa10ed5adc1cfcc51b60c902aae
5
5
  SHA512:
6
- metadata.gz: 824085aad96d224ee346a02a84a93ef283a760b48296d7c5e2307d94f7d08438aa9d5d2b7feaa6565dda89d8c30485d76686f7008824e78ed9c5a5b81ba3b506
7
- data.tar.gz: 791025cd056f9e2515a2a0240a4077804642069603e54855c224a95834f57ca30a70c32923aaad5273bf449f833125d296d26da3a478678b5af13d03794be771
6
+ metadata.gz: 378dc456fc275a8cc7182a195bb97ed9ccecae153e8e455cd3fa35fe8f130571f33b3f6b4bed9e5cf78d5c5f33d94491b4a3501ef4f47690015b554ab065122a
7
+ data.tar.gz: 5c2bb03f33ebece69661835b0fe1b1ae83d82e12fcae2b19b76b94b4766d12f20446125c660945fa67c4faa06e7d15e9999c6d195c15c811778b8787156ec3bf
@@ -3,15 +3,23 @@ All notable changes to this project will be documented in this file. Items under
3
3
 
4
4
  Contributors: please follow the recommendations outlined at [keepachangelog.com](http://keepachangelog.com/). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare to the latest release version.
5
5
  ## [Unreleased]
6
+ ## [4.0.2] - 2016-03-17
7
+ ##### Fixed
8
+ - `ReactOnRails::Controller#redux_store`: 2nd parameter changed to a named parameter `props` for consistency.
9
+
10
+ ## [4.0.1] - 2016-03-16
11
+ ##### Fixed
12
+ - Switched to `heroku buildpacks:set` syntax rather than using a `.buildpacks` file, which is deprecated. See [#319](https://github.com/shakacode/react_on_rails/pull/319) by [esauter5](https://github.com/esauter5). Includes both generator and doc updates.
6
13
 
7
14
  ## [4.0.0] - 2016-03-14
8
15
  ##### Added
16
+ - [spec/dummy](spec/dummy) is a full sample app of React on Rails techniques **including** the hot reloading of assets from Rails!
17
+ - Added helpers `env_stylesheet_link_tag` and `env_javascript_include_tag` to support hot reloading Rails. See the [README.md](./README.md) for more details and see the example application in `spec/dummy`. Also see how this is used in the [tutorial: application.html.erb](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/app%2Fviews%2Flayouts%2Fapplication.html.erb#L6)
9
18
  - Added optional parameter for ReactOnRails.getStore(name, throwIfMissing = true) so that you can check if a store is defined easily.
10
19
  - Added controller `module ReactOnRails::Controller`. Adds method `redux_store` to setup redux stores in the view.
11
20
  - Added option `defer: true` for view helper `redux_store`. This allows the view helper to specify the props for store hydration, yet still render the props at the bottom of the view.
12
21
  - Added view helper `redux_store_hydration_data` to render the props on the application's layout, near the bottom. This allows for the client hydration data to be parsed after the server rendering, which may result in a faster load time.
13
- - Added helpers `env_stylesheet_link_tag` and `env_javascript_include_tag` to support hot reloading Rails. See the [README.md](./README.md) for more details and see the example application in `spec/dummy`.
14
- - The checker for outdated bundles before running tests will default to including the directory with `server_bundle_js_file`.
22
+ - The checker for outdated bundles before running tests will two configuration options: `generated_assets_dir` and `webpack_generated_files`.
15
23
  - Better support for Turbolinks 5!
16
24
  - Fixed generator check of uncommitted code for foreign languages. See [#303](https://github.com/shakacode/react_on_rails/pull/303) by [nmatyukov](https://github.com/nmatyukov).
17
25
  - Added several parameters used for ensuring webpack assets are built for running tests:
@@ -27,11 +35,10 @@ Contributors: please follow the recommendations outlined at [keepachangelog.com]
27
35
  - Improved the **spec/dummy** sample app so that it supports CSS modules, hot reloading, etc, and it can server as a template for a new ReactOnRails installation.
28
36
 
29
37
  ##### Breaking Changes
30
- - Deprecated calling `redux_store(store_name, props)`. The API has changed. Use `redux_store(store_name, props: props, defer: false)` A new option called `defer` allows the rendering of store hydration at the bottom of the your layout. Place `redux_store_hydration_data` on your layout.
38
+ - Deprecated calling `redux_store(store_name, props)`. The API has changed. Use `redux_store(store_name, props: props, defer: false)` A new option called `defer` allows the rendering of store hydration at the bottom of the your layout. Place `redux_store_hydration_data` on your layout.
31
39
  - `config.server_bundle_js_file` has changed. The default value is now blank, meaning no server rendering. Addtionally, if you specify the file name, you should not include the path, as that should be specified in the `config.generated_assets_dir`.
32
40
  - `config.generated_assets_dirs` has been renamed to `config.generated_assets_dir` (singular) and it only takes one directory.
33
41
 
34
-
35
42
  ## [3.0.6] - 2016-03-01
36
43
  ##### Fixed
37
44
  - Improved errors when registered store is not found. See [#301](https://github.com/shakacode/react_on_rails/pull/301) by [justin808](https://github.com/justin808).
@@ -220,7 +227,8 @@ Best done with Object destructing:
220
227
 
221
228
  ##### Fixed
222
229
  - Fix several generator related issues.
223
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/4.0.0...master
230
+ [Unreleased]: https://github.com/shakacode/react_on_rails/compare/4.0.1...master
231
+ [4.0.1]: https://github.com/shakacode/react_on_rails/compare/4.0.0...4.0.1
224
232
  [4.0.0]: https://github.com/shakacode/react_on_rails/compare/3.0.6...4.0.0
225
233
  [3.0.6]: https://github.com/shakacode/react_on_rails/compare/3.0.5...3.0.6
226
234
  [3.0.5]: https://github.com/shakacode/react_on_rails/compare/3.0.4...3.0.5
data/NEWS.md ADDED
@@ -0,0 +1,27 @@
1
+ # NEWS
2
+
3
+ *We'll keep a history of the news. A few bullets at the top will also show on the [README.md](./README.md).*
4
+
5
+ * Always see the [CHANGELOG.md](./CHANGELOG.md) for the latest project changes.
6
+ * 2016-03-17: **4.0.2** Shipped! Includes using the new Heroku buildpack steps.
7
+ * Better support for hot reloading of assets from Rails with new helpers and updates to the sample testing app, [spec/dummy](spec/dummy).
8
+ * Better support for Turbolinks 5.
9
+ * Controller rendering of shared redux stores and ability to render store data at bottom of HTML page.
10
+ * See [#311](https://github.com/shakacode/react_on_rails/pull/311/files).
11
+ * Some breaking changes! See [CHANGELOG.md](./CHANGELOG.md) for details.
12
+ * 2016-02-28: We added a [Projects page](PROJECTS.md). Please edit the page your project or [email us](mailto:contact@shakacode.com) and we'll add you. We also love stars as it helps us attract new users and contributors. [jbhatab](https://github.com/jbhatab) is leading an effort to ease the onboarding process for newbies with simpler project generators. See [#245](https://github.com/shakacode/react_on_rails/issues/245).
13
+ * 3.0.6 shipped on Tuesday, 2016-03-01. Please see the [Changelog](CHANGELOG.md) for details, and let us know if you see any issues! [Migration steps from 1.x](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#migration-steps-v1-to-v2). [Migration steps from 2.x](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#migration-steps-v2-to-v3).
14
+ * [RubyGems](https://rubygems.org/gems/react_on_rails/)
15
+ * [NPM](https://www.npmjs.com/package/react-on-rails)
16
+ * 3.0.0 Highlights:
17
+ 1. Support for ensuring JavaScript is current when running tests.
18
+ 2. Support for multiple React components with one Redux store. So you can have a header React component and different body React components talking to the same Redux store!
19
+ 3. Support for Turbolinks 5!
20
+ * There was a fatal error when using the lastest version of Redux for server rendering. See [Redux #1335](https://github.com/reactjs/redux/issues/1335). See [diff 3.1.6...3.1.4](https://github.com/reactjs/redux/commit/e2e14d26f09ca729ae0555442f50fcfc45bfb423#diff-1fdf421c05c1140f6d71444ea2b27638). Workaround for server rendering: Use Redux 3.1.7 or upgrade to React On Rails v2.3.0. [this commit](https://github.com/shakacode/react_on_rails/commit/59f1e68d3d233775e6abc63bff180ea59ac2d79e) on [PR #244](https://github.com/shakacode/react_on_rails/pull/244/).
21
+ * 2.x Highlights:
22
+ 1. Fixed a **critical** problem with TurboLinks. Be sure to see [turbolinks docs](docs/additional_reading/turbolinks.md) for more information on how to debug TurboLinks issues.
23
+ 2. Provides a convenient helper to ensure that JavaScript assets are compiled before running tests.
24
+ * React on Rails does not yet have *generator* support for building new apps that use CSS modules and hot reloading via the Rails server as is demonstrated in the [shakacode/react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/). *We do support this, but we don't generate the code.* If you did generate a fresh app from react_on_rails and want to move to CSS Modules, then see [PR 175: Babel 6 / CSS Modules / Rails hot reloading](https://github.com/shakacode/react-webpack-rails-tutorial/pull/175). Note, while there are probably fixes after this PR was accepted, this has the majority of the changes. See [the tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/#news) for more information. Ping us if you want to help!
25
+ * [ShakaCode](http://www.shakacode.com) is doing Skype plus Slack/Github based coaching for "React on Rails". [Click here](http://www.shakacode.com/work/index.html) for more information.
26
+ * Be sure to read our article [The React on Rails Doctrine](https://medium.com/@railsonmaui/the-react-on-rails-doctrine-3c59a778c724).
27
+
data/README.md CHANGED
@@ -1,26 +1,21 @@
1
1
  [![Build Status](https://travis-ci.org/shakacode/react_on_rails.svg?branch=master)](https://travis-ci.org/shakacode/react_on_rails) [![Dependency Status](https://gemnasium.com/shakacode/react_on_rails.svg)](https://gemnasium.com/shakacode/react_on_rails) [![Gem Version](https://badge.fury.io/rb/react_on_rails.svg)](https://badge.fury.io/rb/react_on_rails) [![npm version](https://badge.fury.io/js/react-on-rails.svg)](https://badge.fury.io/js/react-on-rails) [![Code Climate](https://codeclimate.com/github/shakacode/react_on_rails/badges/gpa.svg)](https://codeclimate.com/github/shakacode/react_on_rails) [![Coverage Status](https://coveralls.io/repos/shakacode/react_on_rails/badge.svg?branch=master&service=github)](https://coveralls.io/github/shakacode/react_on_rails?branch=master)
2
2
 
3
3
  # NEWS
4
- * 4.0.0 Highlights
4
+ * Always see the [CHANGELOG.md](./CHANGELOG.md) for the latest project changes.
5
+ * 2016-03-16: **4.0.1** Shipped! Includes using the new Heroku buildpack steps.
6
+ * 2016-03-14: **4.0.0** Highlights
7
+ * Better support for hot reloading of assets from Rails with new helpers and updates to the sample testing app, [spec/dummy](spec/dummy).
5
8
  * Better support for Turbolinks 5.
6
9
  * Controller rendering of shared redux stores and ability to render store data at bottom of HTML page.
7
10
  * See [#311](https://github.com/shakacode/react_on_rails/pull/311/files).
8
- * See [CHANGELOG.md](CHANGELOG.md) for full details.
11
+ * Some breaking changes! See [CHANGELOG.md](./CHANGELOG.md) for details.
9
12
  * 2016-02-28: We added a [Projects page](PROJECTS.md). Please edit the page your project or [email us](mailto:contact@shakacode.com) and we'll add you. We also love stars as it helps us attract new users and contributors. [jbhatab](https://github.com/jbhatab) is leading an effort to ease the onboarding process for newbies with simpler project generators. See [#245](https://github.com/shakacode/react_on_rails/issues/245).
10
- * 3.0.6 shipped on Tuesday, 2016-03-01. Please see the [Changelog](CHANGELOG.md) for details, and let us know if you see any issues! [Migration steps from 1.x](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#migration-steps-v1-to-v2). [Migration steps from 2.x](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md#migration-steps-v2-to-v3).
11
- * [RubyGems](https://rubygems.org/gems/react_on_rails/)
12
- * [NPM](https://www.npmjs.com/package/react-on-rails)
13
- * 3.0.0 Highlights:
14
- 1. Support for ensuring JavaScript is current when running tests.
15
- 2. Support for multiple React components with one Redux store. So you can have a header React component and different body React components talking to the same Redux store!
16
- 3. Support for Turbolinks 5!
17
- * There was a fatal error when using the lastest version of Redux for server rendering. See [Redux #1335](https://github.com/reactjs/redux/issues/1335). See [diff 3.1.6...3.1.4](https://github.com/reactjs/redux/commit/e2e14d26f09ca729ae0555442f50fcfc45bfb423#diff-1fdf421c05c1140f6d71444ea2b27638). Workaround for server rendering: Use Redux 3.1.7 or upgrade to React On Rails v2.3.0. [this commit](https://github.com/shakacode/react_on_rails/commit/59f1e68d3d233775e6abc63bff180ea59ac2d79e) on [PR #244](https://github.com/shakacode/react_on_rails/pull/244/).
18
- * 2.x Highlights:
19
- 1. Fixed a **critical** problem with TurboLinks. Be sure to see [turbolinks docs](docs/additional_reading/turbolinks.md) for more information on how to debug TurboLinks issues.
20
- 2. Provides a convenient helper to ensure that JavaScript assets are compiled before running tests.
13
+ * *See [NEWS.md](NEWS.md) for the full news history.*
14
+
15
+ # NOTES
21
16
  * React on Rails does not yet have *generator* support for building new apps that use CSS modules and hot reloading via the Rails server as is demonstrated in the [shakacode/react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/). *We do support this, but we don't generate the code.* If you did generate a fresh app from react_on_rails and want to move to CSS Modules, then see [PR 175: Babel 6 / CSS Modules / Rails hot reloading](https://github.com/shakacode/react-webpack-rails-tutorial/pull/175). Note, while there are probably fixes after this PR was accepted, this has the majority of the changes. See [the tutorial](https://github.com/shakacode/react-webpack-rails-tutorial/#news) for more information. Ping us if you want to help!
22
17
  * [ShakaCode](http://www.shakacode.com) is doing Skype plus Slack/Github based coaching for "React on Rails". [Click here](http://www.shakacode.com/work/index.html) for more information.
23
- * Be sure to read our new article [The React on Rails Doctrine](https://medium.com/@railsonmaui/the-react-on-rails-doctrine-3c59a778c724).
18
+ * Be sure to read our article [The React on Rails Doctrine](https://medium.com/@railsonmaui/the-react-on-rails-doctrine-3c59a778c724).
24
19
 
25
20
  # React on Rails
26
21
 
@@ -249,12 +244,12 @@ This is how you actually render the React components you exposed to `window` ins
249
244
  #### Controller Extension
250
245
  Include the module ReactOnRails::Controller in your controller, probably in ApplicationController. This will provide the following controller method, which you can call in your controller actions:
251
246
 
252
- `redux_store(store_name, props = {})`
247
+ `redux_store(store_name, props: {})`
253
248
 
254
249
  + **store_name:** A name for the store. You'll refer to this name in 2 places in your JavaScript:
255
250
  1. You'll call `ReactOnRails.registerStore({storeName})` in the same place that you register your components.
256
251
  2. In your component definition, you'll call `ReactOnRails.getStore('storeName')` to get the hydrated Redux store to attach to your components.
257
- + **props:** ReactOnRails takes care of setting up the hydration of your store with props from the view.
252
+ + **props:** Named parameter `props`. ReactOnRails takes care of setting up the hydration of your store with props from the view.
258
253
 
259
254
  For an example, see [spec/dummy/app/controllers/pages_controller.rb](spec/dummy/app/controllers/pages_controller.rb).
260
255
 
@@ -440,7 +435,7 @@ From your Rails view, you can use the provided helper `redux_store(store_name, p
440
435
  **app/views/layouts/application.html.erb**
441
436
  ```erb
442
437
  ...
443
- <%= redux_store("appStore", @react_props) %>;
438
+ <%= redux_store("appStore", props: @react_props) %>;
444
439
  <%= react_component("NavbarApp") %>
445
440
  yield
446
441
  ...
@@ -5,11 +5,12 @@ module ReactOnRails
5
5
  #
6
6
  # store_name: name of the store, corresponding to your call to ReactOnRails.registerStores in your
7
7
  # JavaScript code.
8
- # props: Ruby Hash or JSON string which contains the properties to pass to the redux store.
8
+ # props: Named parameter props which is a Ruby Hash or JSON string which contains the properties
9
+ # to pass to the redux store.
9
10
  #
10
11
  # Be sure to include view helper `redux_store_hydration_data` at the end of your layout or view
11
12
  # or else there will be no client side hydration of your stores.
12
- def redux_store(store_name, props)
13
+ def redux_store(store_name, props: {})
13
14
  redux_store_data = { store_name: store_name,
14
15
  props: props }
15
16
  @registered_stores_defer_render ||= []
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ReactOnRails
3
- VERSION = "4.0.1".freeze
3
+ VERSION = "4.0.2".freeze
4
4
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
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: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-16 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -311,6 +311,7 @@ files:
311
311
  - CHANGELOG.md
312
312
  - Dockerfile_tests
313
313
  - Gemfile
314
+ - NEWS.md
314
315
  - PROJECTS.md
315
316
  - README.md
316
317
  - Rakefile