diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 55bc9834..00000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -ruby-2.4.1 diff --git a/Gemfile b/Gemfile index eebbe349..e4c3e1ce 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source "https://rubygems.org" -ruby "2.4.1" +ruby "2.6.1" gem "react_on_rails", "11.0.7" gem "webpacker" @@ -94,13 +94,13 @@ end group :test do gem "capybara", "2.18.0" gem "capybara-screenshot" - gem "capybara-webkit" + # gem "capybara-webkit" gem "chromedriver-helper" gem "coveralls", require: false gem "database_cleaner" gem "generator_spec" gem "launchy" - gem "poltergeist" + # gem "poltergeist" gem "rails_best_practices" gem "rspec-rails", "3.7.2" gem "selenium-webdriver" diff --git a/Gemfile.lock b/Gemfile.lock index b811edae..43e22bd2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,15 +70,11 @@ GEM capybara-screenshot (1.0.21) capybara (>= 1.0, < 4) launchy - capybara-webkit (1.15.0) - capybara (>= 2.3, < 4.0) - json childprocess (0.9.0) ffi (~> 1.0, >= 1.0.11) chromedriver-helper (1.2.0) archive-zip (~> 0.10) nokogiri (~> 1.8) - cliver (0.3.2) code_analyzer (0.4.8) sexp_processor coderay (1.1.2) @@ -128,7 +124,7 @@ GEM json (2.1.0) launchy (2.4.3) addressable (~> 2.3) - libv8 (6.3.292.48.1) + libv8 (6.7.288.46.1) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -144,8 +140,8 @@ GEM mimemagic (0.3.2) mini_mime (1.0.0) mini_portile2 (2.3.0) - mini_racer (0.1.15) - libv8 (~> 6.3) + mini_racer (0.2.4) + libv8 (>= 6.3) minitest (5.11.3) multi_json (1.13.1) nio4r (2.3.1) @@ -155,10 +151,6 @@ GEM parser (2.5.1.0) ast (~> 2.4.0) pg (1.0.0) - poltergeist (1.18.0) - capybara (>= 2.1, < 4) - cliver (~> 0.3.1) - websocket-driver (>= 0.2.0) powerpack (0.1.1) pry (0.11.3) coderay (~> 1.1.0) @@ -334,7 +326,6 @@ DEPENDENCIES bundler-audit capybara (= 2.18.0) capybara-screenshot - capybara-webkit chromedriver-helper coffee-rails coveralls @@ -347,7 +338,6 @@ DEPENDENCIES listen mini_racer pg - poltergeist pry pry-byebug pry-doc @@ -375,7 +365,7 @@ DEPENDENCIES webpacker RUBY VERSION - ruby 2.4.1p111 + ruby 2.6.1p33 BUNDLED WITH - 1.16.0 + 1.17.3 diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 3f3956c7..48f79286 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -33,6 +33,7 @@ def no_router end def simple; end + def simple_hooks; end private diff --git a/app/views/pages/simple_hooks.html.erb b/app/views/pages/simple_hooks.html.erb new file mode 100644 index 00000000..8c44b430 --- /dev/null +++ b/app/views/pages/simple_hooks.html.erb @@ -0,0 +1,13 @@ +

Using React (with Hooks) + Rails Backend (with + react_on_rails gem)

+

This example is much simpler than the one using React + Redux and is appropriate when:

+ +
+ + +<%= react_component('SimpleHooksCommentScreen', props: {}, prerender: false) %> diff --git a/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx b/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx index c184b945..bb028138 100644 --- a/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx +++ b/client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx @@ -33,13 +33,16 @@ const NavigationBar = (props) => {