react-router-rails 0.13.3.1 → 0.13.3.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: cb0ce84079fef0b790477509c1ce1e5abb8ce5da
4
- data.tar.gz: 1dec2b2b89c6881d297e744b72b92d8326049ce1
3
+ metadata.gz: 5660ef5812dc94aac9698b4bc6e616c0339ec98e
4
+ data.tar.gz: ec2c861bd65095af65ecbaa466bcfd6573ee83b3
5
5
  SHA512:
6
- metadata.gz: e12e1d4995676747a9b855d3bea2db9828cd13b5daf80cd7388970f369b7942e85b4f317b6968b8ac83c26e076b44734c361c0099526fb1eaeaeb3d9fb5a9940
7
- data.tar.gz: 975b8d56ce26efe6e27ff960b3c1ba1ebe304826c42d824ff4c41bb854246a9e737d77cc718c0caa4d174c0400286691d1b7bae9adef0fde54ab815d5741eb68
6
+ metadata.gz: fa5e348c9b41924b7c58cc87ef877d01603b0a3356ece751dac04ab0a676f4ccf10f1806a168cffcc24e7398e54312b5c172d7fd4843e095b1e008d3795d845b
7
+ data.tar.gz: 19e025dcf1faa57bcd0e3f86e81b54813877bf9430c34013a7008246e1cb07be5e24b3ae8bd7120a9b99f6d2ebe5b795386a6f26cf9a45c5e79a9769a78ce97f
data/README.md CHANGED
@@ -41,7 +41,7 @@
41
41
  ```
42
42
  3. Using the view helper:
43
43
 
44
- Define your routes 'MyRoutes' in any your react components folder like you would normally do:
44
+ Define your routes 'MyRoutes' in your react components folder, like you would normally do:
45
45
 
46
46
  ```js
47
47
  var Route = ReactRouter.Route;
@@ -76,7 +76,7 @@
76
76
 
77
77
  ```js
78
78
  ReactRouter.run(routes, function (Handler) {
79
- React.render(<Handler/>, document.body);
79
+ ReactDOM.render(<Handler/>, document.body);
80
80
  });
81
81
  ```
82
82
 
@@ -84,7 +84,7 @@
84
84
 
85
85
  ```coffeescript
86
86
  ReactRouter.run(routes, (Handler) ->
87
- React.render <Handler/>, document.body
87
+ ReactDOM.render <Handler/>, document.body
88
88
  )
89
89
  ```
90
90
 
@@ -9,6 +9,7 @@ module React
9
9
  config.react_router.max_renderers = 10
10
10
  config.react_router.timeout = 20 # seconds
11
11
  config.react_router.react_js = lambda { File.read(::Rails.application.assets.resolve('react.js')) }
12
+ config.react_router.react_server_js = lambda { File.read(::Rails.application.assets.resolve('react-server.js')) }
12
13
  config.react_router.react_router_js = lambda { File.read(::Rails.application.assets.resolve('react_router.js')) }
13
14
  config.react_router.route_filenames = ['components.js']
14
15
 
@@ -28,7 +29,7 @@ module React
28
29
 
29
30
  do_setup = lambda do
30
31
  cfg = app.config.react_router
31
- React::Router::Renderer.setup!(cfg.react_js, cfg.react_router_js, cfg.routes_js,
32
+ React::Router::Renderer.setup!(cfg.react_js, cfg.react_server_js, cfg.react_router_js, cfg.routes_js,
32
33
  {:size => cfg.max_renderers, :timeout => cfg.timeout})
33
34
  end
34
35
 
@@ -1,7 +1,7 @@
1
1
  module React
2
2
  module Router
3
3
  module Rails
4
- VERSION = "0.13.3.1"
4
+ VERSION = "0.13.3.2"
5
5
  end
6
6
  end
7
7
  end
@@ -12,8 +12,9 @@ module React
12
12
 
13
13
  cattr_accessor :pool
14
14
 
15
- def self.setup!(react_js, react_router_js, routes_js, args={})
15
+ def self.setup!(react_js, react_server_js, react_router_js, routes_js, args={})
16
16
  @@react_js = react_js
17
+ @@react_server_js = react_server_js
17
18
  @@react_router_js = react_router_js
18
19
  @@routes_js = routes_js
19
20
  @@pool.shutdown {} if @@pool
@@ -46,7 +47,7 @@ module React
46
47
  function() {
47
48
  var str = '';
48
49
  ReactRouter.run(#{routes}, #{location.to_json}, function (Handler) {
49
- str = React.renderToString(React.createElement(Handler, #{react_props}));
50
+ str = ReactDOMServer.renderToString(React.createElement(Handler, #{react_props}));
50
51
  });
51
52
  return str;
52
53
  }()
@@ -76,6 +77,8 @@ module React
76
77
 
77
78
  #{@@react_js.call};
78
79
  React = global.React;
80
+ #{@@react_server_js.call};
81
+ ReactDOMServer = global.ReactDOMServer;
79
82
  #{@@react_router_js.call}
80
83
  ReactRouter = global.ReactRouter;
81
84
  #{@@routes_js.call};
@@ -1,6 +1,6 @@
1
1
  // Unobtrusive scripting adapter for React Router based on react-rails gem.
2
2
  // https://github.com/reactjs/react-rails/blob/master/lib/assets/javascripts/react_ujs.js
3
- (function(document, window, React, ReactRouter) {
3
+ (function(document, window, React, ReactDOM, ReactRouter) {
4
4
  var ROUTER_CLASS_NAME = 'data-react-router-class';
5
5
  var LOCATION_CLASS_NAME = 'data-react-router-location';
6
6
  var DATA_CLASS_NAME = 'data-react-router-data';
@@ -37,7 +37,7 @@
37
37
  var data = JSON.parse(dataJson);
38
38
 
39
39
  ReactRouter.run(routes, location, function (Handler) {
40
- React.render(React.createElement(Handler, data), routerNode);
40
+ ReactDOM.render(React.createElement(Handler, data), routerNode);
41
41
  });
42
42
  }
43
43
  };
@@ -70,4 +70,4 @@
70
70
  handleNativeEvents();
71
71
  }
72
72
 
73
- })(document, window, React, ReactRouter);
73
+ })(document, window, React, ReactDOM, ReactRouter);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react-router-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3.1
4
+ version: 0.13.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Peixoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-23 00:00:00.000000000 Z
11
+ date: 2015-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: react-rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.12'
61
+ version: 1.4.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.12'
68
+ version: 1.4.0
69
69
  description: React-Router for Rails Asset Pipeline
70
70
  email:
71
71
  - mario.peixoto@gmail.com