Skip to content

Commit f93daec

Browse files
committed
refactor(ServerRendering) simpler server rendering assets
1 parent f4fb018 commit f93daec

File tree

14 files changed

+159
-3936
lines changed

14 files changed

+159
-3936
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ _(It will also be mounted by the UJS on page load.)_
185185

186186
There are some requirements for this to work:
187187

188-
- `react-rails` must load your code. By convention it uses `components.js`, which was created
189-
by the install task. This file must include your components _and_ their dependencies (eg, Underscore.js).
188+
- `react-rails` must load your code. By convention it uses `server_rendering.js`, which was created
189+
by the install task. This file must include React, ReactDOMServer, your components _and_ their dependencies (eg, Underscore.js).
190190
- Your components must be accessible in the global scope.
191191
If you are using `.js.jsx.coffee` files then the wrapper function needs to be taken into account:
192192

@@ -210,7 +210,7 @@ MyApp::Application.configure do
210210
config.react.server_renderer_timeout ||= 20 # seconds
211211
config.react.server_renderer = React::ServerRendering::SprocketsRenderer
212212
config.react.server_renderer_options = {
213-
files: ["react-server.js", "components.js"], # files to load for prerendering
213+
files: ["server_rendering.js"], # files to load for prerendering
214214
replay_console: true, # if true, console.* will be replayed client-side
215215
}
216216
end

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace :react do
3434

3535
# With addons:
3636
copy_react_asset("#{environment}/react-browser-with-addons.js", "#{environment}-with-addons/react.js")
37-
copy_react_asset("#{environment}/react-server-with-addons.js", "#{environment}-with-addons/react-server.js")
37+
copy_react_asset("#{environment}/react-server.js", "#{environment}-with-addons/react-server.js")
3838

3939
addons = %w(
4040
addons-clone-with-props

0 commit comments

Comments
 (0)