Skip to content
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

Update configuration.md and default config.raise_on_prerender_error = Rails.env.development? #1145

Merged
merged 3 commits into from
Dec 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ Changes since last non-beta release.

- Enabled the use of webpack-dev-server with Server-side rendering. (https://github.com/shakacode/react_on_rails/pull/1173) by [justin808](https://github.com/justin808) and [judahmeek](https://github.com/judahmeek).

#### Changed
- Changed the default for:
```rb
config.raise_on_prerender_error = Rails.env.development?
```

Thus, developers will need to fix server rendering errors before continuing.
[PR 1145](https://github.com/shakacode/react_on_rails/pull/1145) by [justin808](https://github.com/justin808).

### [11.1.8] - 2018-10-14

#### Improved
Expand Down
14 changes: 9 additions & 5 deletions docs/api/view-helpers-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ Once the bundled files have been generated in your `app/assets/webpack` folder a
```ruby
react_component(component_name,
props: {},
prerender: nil,
trace: nil,
replay_console: nil,
raise_on_prerender_error: nil,
id: nil,
prerender: nil)
html_options: {})
```

Uncommonly used options:
```
trace: nil,
replay_console: nil,
raise_on_prerender_error: nil,
id: nil,
```

- **component_name:** Can be a React component, created using an ES6 class or a generator function that returns a React component (or, only on the server side, an object with shape { redirectLocation, error, renderedHtml }), or a "renderer function" that manually renders a React component to the dom (client side only).
All options except `props, id, html_options` will inherit from your `react_on_rails.rb` initializer, as described [here](../basics/configuration.md).
- **general options:**
Expand Down
7 changes: 4 additions & 3 deletions docs/basics/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ ReactOnRails.configure do |config|
#
config.logging_on_server = true

# Default is to false to NOT raise exception on server if the JS code throws.
# Reason is that it's easier to debug this when you get the error over to the client.
# Default is true only for development? to raise exception on server if the JS code throws for
# server rendering. The reason is that the server logs will show the error and force you to fix
# any server rendering issues immediately during development.
#
config.raise_on_prerender_error = false
config.raise_on_prerender_error = Rails.env.development?

################################################################################
# Server Renderer Configuration for ExecJS
Expand Down
2 changes: 1 addition & 1 deletion lib/react_on_rails/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.configuration
prerender: false,
replay_console: true,
logging_on_server: true,
raise_on_prerender_error: false,
raise_on_prerender_error: Rails.env.development?,
trace: Rails.env.development?,
development_mode: Rails.env.development?,
server_renderer_pool_size: DEFAULT_POOL_SIZE,
Expand Down