-
Notifications
You must be signed in to change notification settings - Fork 380
Bump react_on_rails gem version to 1.0.3 #99
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
Conversation
Add server-bundle.js to .gitignore Add server webpack command to Procfile.dev Create webpack.server.config.js for server side rendering. Add react_on_rails config initializer file Rename App.jsx to ServerApp.jsx to use for App server-side Add clientGlobals.jsx entry point for client-side rendering Add serverGlobals.jsx entry point for server-side rendering Add ClientApp.jsx for client-side App
@alexfedoseev @mapreal19 @justin808 The client-side rendering works with the changes. However, server-side is broken.
I see that we are import jquery here in client/assets/javascripts/utils/CommentsManager.jsx
image
reac-rails gem refers to server-side prerendering not working with jquery. Is this our issue here?
Thanks for the help!
We should switch from jQuery to axios. I'll take care of this in a few hours.
@alexfedoseev Thank you!
@dylangrafmyre @justin808
Fixed. I'll deal with initial data loading via props in #96 after this one will be merged.
@alexfedoseev Looks great!!! Thanks!
@dylangrafmyre @alexfedoseev Are we merging in #96 first and then this one?
@justin808 I am assuming that is what @alexfedoseev means since he references it within #96
@justin808 Let's merge this one first, I'll rebase #96 against master with react_on_rails gem (this PR), finish it and then merge into master.
@alexfedoseev @justin808 I will get the build passing and any final reviews? Than we can merge.
@alexfedoseev There's some problem with Axios from poltergeist. The UI tests fail. Also, if there's a CSRF issue, we don't see that when running the development server, but only if we run as "production" or deploy to Heroku. @dylangrafmyre can confirm.
@justin808 @alexfedoseev after production assets:precompile and running rails server -e production. The app works properly with server-rendering and no CSRF issues.
However, the tests are still failing due to the CommentList not being rendered by phantomjs during the tests.
@dylangrafmyre @alexfedoseev @samnang @geoffevason @josiasds @mapreal19 Passes for Chrome and Firefox! But not for headless setups!
DRIVER=chrome rspec
DRIVER=firefox rspec
DRIVER=webkit rspec
DRIVER=poltergeist rspec
➜ ~/shakacode/react-webpack-rails-tutorial (bump-react_on_rails u=) ✗ DRIVER=chrome rspec ✚ [18:26:07]
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's 'rails' settings.
Capybara using driver: selenium
Add new comment
Horizonal Form
behaves like Comments Form
submits form
iframe text
doesn't add an iframe
Inline Form
behaves like Comments Form
submits form
Stacked Form
behaves like Comments Form
submits form
Finished in 6.78 seconds (files took 4.15 seconds to load)
4 examples, 0 failures
[Coveralls] Outside the CI environment, not sending data.
➜ ~/shakacode/react-webpack-rails-tutorial (bump-react_on_rails u=) ✗ DRIVER=firefox rspec ✚ [18:26:33]
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's 'rails' settings.
Capybara using driver: selenium
Add new comment
Horizonal Form
behaves like Comments Form
submits form
iframe text
doesn't add an iframe
Inline Form
behaves like Comments Form
submits form
Stacked Form
behaves like Comments Form
submits form
Finished in 6.58 seconds (files took 3.45 seconds to load)
4 examples, 0 failures
[Coveralls] Outside the CI environment, not sending data.
➜ ~/shakacode/react-webpack-rails-tutorial (bump-react_on_rails u=) ✗ DRIVER=webkit rspec 1 ↵ ✚ [18:27:14]
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's 'rails' settings.
Capybara using driver: webkit
Add new comment
Horizonal Form
behaves like Comments Form
submits form (FAILED - 1)
iframe text
doesn't add an iframe (FAILED - 2)
Inline Form
behaves like Comments Form
submits form
Stacked Form
behaves like Comments Form
submits form
Finished in 6.34 seconds (files took 3.41 seconds to load)
4 examples, 2 failures
Failed examples:
rspec './spec/features/comments_spec.rb[1:1:1:1]' # Add new comment Horizonal Form behaves like Comments Form submits form
rspec ./spec/features/comments_spec.rb:43 # Add new comment Horizonal Form iframe text doesn't add an iframe
[Coveralls] Outside the CI environment, not sending data.
➜ ~/shakacode/react-webpack-rails-tutorial (bump-react_on_rails u=) ✗ DRIVER=poltergeist rspec 1 ↵ ✚ [18:27:37]
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's 'rails' settings.
Capybara using driver: poltergeist
Add new comment
Horizonal Form
behaves like Comments Form
Finished in 12.39 seconds (files took 3.3 seconds to load)
4 examples, 3 failures
Failed examples:
rspec './spec/features/comments_spec.rb[1:1:1:1]' # Add new comment Horizonal Form behaves like Comments Form submits form
rspec './spec/features/comments_spec.rb[1:2:1:1]' # Add new comment Inline Form behaves like Comments Form submits form
rspec './spec/features/comments_spec.rb[1:3:1:1]' # Add new comment Stacked Form behaves like Comments Form submits form
[Coveralls] Outside the CI environment, not sending data.
Default is poltergeist Sample commands to try: DRIVER=chrome rspec DRIVER=firefox rspec DRIVER=webkit rspec DRIVER=poltergeist rspec
61ded35 to
63cf052
Compare
Remove gem poltergeist and phantomjs Add gems selenium-webdriver and chromedriver-helper Configure Capybara webdriver for :selenium_chrome
I'm a bit confuse, should we have tests/specs in react_on_rails gem and for rails integration testings, we could put them under react_on_rails/spec/dummy instead?
@alexfedoseev @justin808 @samnang I removed phantomjs and poltergeist. Added selenium-webdriver and chromdriver-helper. Removed all other webdrivers. The tests pass with selenium using chromedriver.
Our build is passing on Codeship. I will need to tweak the Travis-CI yml file tomorrow to get the tests passing using xvfb for a web browser.
Bump react_on_rails gem version to 1.0.3
Add server-bundle.js to .gitignore
Add server webpack command to Procfile.dev
Create webpack.server.config.js for server side rendering.
Add react_on_rails config initializer file
Rename App.jsx to ServerApp.jsx to use for App server-side
Add clientGlobals.jsx entry point for client-side rendering
Add serverGlobals.jsx entry point for server-side rendering
Add ClientApp.jsx for client-side App
Take the existing setup and add server-side rendering.