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

Logging in production removed #845

Merged
merged 6 commits into from
May 19, 2017
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Contributors: please follow the recommendations outlined at [keepachangelog.com]
## [Unreleased]
*Please add entries here for your pull requests.*

## Changed
- Logging no longer occurs when trace is turned to false. [#845](https://github.com/shakacode/react_on_rails/pull/845) by [conturbo](https://github.com/Conturbo)

## [8.0.0-beta.2] - 2017-05-08

### Changed
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/react_on_rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def react_component(component_name, raw_options = {})
type: "application/json",
class: "js-react-on-rails-component",
"data-component-name" => options.name,
"data-trace" => options.trace,
"data-trace" => (options.trace ? true : nil),
"data-dom-id" => options.dom_id)

# Create the HTML rendering part
Expand Down
8 changes: 7 additions & 1 deletion spec/dummy/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4178,7 +4178,7 @@ react-helmet@^5.0.3:
react-side-effect "^1.1.0"

"react-on-rails@file:../../../":
version "7.0.0"
version "8.0.0-beta.2"

react-proptypes@^0.0.1:
version "0.0.1"
Expand Down Expand Up @@ -5251,6 +5251,12 @@ webpack-manifest-plugin@^1.1.0:
fs-extra "^0.30.0"
lodash ">=3.5 <5"

webpack-merge@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-4.1.0.tgz#6ad72223b3e0b837e531e4597c199f909361511e"
dependencies:
lodash "^4.17.4"

webpack-sources@^0.1.0:
version "0.1.4"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.4.tgz#ccc2c817e08e5fa393239412690bb481821393cd"
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 @@ -30,6 +30,7 @@
i18nLocale: "en",
i18nDefaultLocale: "en",
httpAcceptLanguage: http_accept_language,
# railsEnv: Rails.env,
somethingUseful: "REALLY USEFUL"
}

Expand Down
22 changes: 19 additions & 3 deletions spec/dummy/spec/helpers/react_on_rails_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@
let(:react_definition_script) do
<<-SCRIPT
<script type="application/json" class="js-react-on-rails-component" data-component-name="App" \
data-trace="false" data-dom-id="App-react-component-0">{"name":"My Test Name"}</script>
data-dom-id="App-react-component-0">{"name":"My Test Name"}</script>
SCRIPT
end

let(:react_definition_script_no_params) do
<<-SCRIPT
<script type="application/json" class="js-react-on-rails-component" data-component-name="App" \
data-trace="false" data-dom-id="App-react-component-0">{}</script>
data-dom-id="App-react-component-0">{}</script>
SCRIPT
end

Expand Down Expand Up @@ -131,14 +131,30 @@
let(:react_definition_script) do
<<-SCRIPT
<script type="application/json" class="js-react-on-rails-component" data-component-name="App" \
data-trace="false" data-dom-id="shaka_div">{"name":"My Test Name"}</script>
data-dom-id="shaka_div">{"name":"My Test Name"}</script>
SCRIPT
end

it { is_expected.to include id }
it { is_expected.not_to include react_component_div }
it { is_expected.to include react_definition_script }
end

context "with 'trace' == true" do
it "adds the data-trace tag to the component_specification_tag" do
result = react_component("App", trace: true)

expect(result).to match(/data-trace="true"/)
end
end

context "with 'trace' == false" do
it "does not add the data-trace tag" do
result = react_component("App", trace: false)

expect(result).not_to match(/data-trace=/)
end
end
end

describe "#redux_store" do
Expand Down