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

Added railsEnv to the default railsContext #1065

Merged
merged 1 commit into from
Apr 22, 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Changes since last non-beta release.
- Errors raised are of type ReactOnRailsError, so you can see they came from React on Rails for debugging.
- Removed ReactOnRails::Utils.server_bundle_file_name and ReactOnRails::Utils.bundle_file_name.
- No longer logging the `railsContext` when server logging.
- Rails.env is provided in the default railsContext, as suggested in [issue #697](https://github.com/shakacode/react_on_rails/issues/697).
[PR 1018](https://github.com/shakacode/react_on_rails/pull/1065) by [justin808](https://github.com/justin808).

#### Fixes
- More exact version checking. We keep the react_on_rails gem and the react-on-rails node package at
Expand Down
6 changes: 6 additions & 0 deletions docs/basics/upgrading-react-on-rails.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Upgrading React on Rails

## Upgrading to version 11
* Remove `server_render_method` from config/initializers/react_on_rails.rb. Alternate server rendering methods are part of React on Rails Pro. If you want to use a custom renderer, contact justin@shakacode.com. We have a custom node rendering solution in production for egghead.io.
* Remove your usage of ENV["TRACE_REACT_ON_RAILS"] usage. You can get all tracing with either specifying trace at your component or in your config/initializers/react_on_rails.rb file.
* ReactOnRails::Utils.server_bundle_file_name and ReactOnRails::Utils.bundle_file_name were removed. React on Rails Pro contains upgrades to enable component and other types caching with React on Rails.


## Upgrading to version 10

Pretty simple:
Expand Down
1 change: 1 addition & 0 deletions lib/react_on_rails/react_on_rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ def initialize_redux_stores
def rails_context(server_side: required("server_side"))
@rails_context ||= begin
result = {
railsEnv: Rails.env,
inMailer: in_mailer?,
# Locale settings
i18nLocale: I18n.locale,
Expand Down
1 change: 1 addition & 0 deletions spec/dummy/spec/features/rails_context_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
port = Capybara.current_session.server.port
host_port = "#{host}:#{port}"
keys_to_vals = {
railsEnv: Rails.env,
href: "http://#{host_port}/#{pathname}?ab=cd",
location: "/#{pathname}?ab=cd",
port: port,
Expand Down