Skip to content

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

Merged
merged 14 commits into from
Sep 22, 2015
Merged

Conversation

dylangrafmyre
Copy link
Contributor

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.

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
@dylangrafmyre
Copy link
Contributor Author

@alexfedoseev @mapreal19 @justin808 The client-side rendering works with the changes. However, server-side is broken.

image

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!

@alex35mil
Copy link
Member

We should switch from jQuery to axios. I'll take care of this in a few hours.

@dylangrafmyre
Copy link
Contributor Author

@alexfedoseev Thank you!

@alex35mil alex35mil mentioned this pull request Sep 21, 2015
6 tasks
@alex35mil
Copy link
Member

@dylangrafmyre @justin808
Fixed. I'll deal with initial data loading via props in #96 after this one will be merged.

@dylangrafmyre
Copy link
Contributor Author

@alexfedoseev Looks great!!! Thanks!

@justin808
Copy link
Member

@dylangrafmyre @alexfedoseev Are we merging in #96 first and then this one?

@dylangrafmyre
Copy link
Contributor Author

@justin808 I am assuming that is what @alexfedoseev means since he references it within #96

image

@alex35mil
Copy link
Member

@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.

@dylangrafmyre
Copy link
Contributor Author

@alexfedoseev @justin808 I will get the build passing and any final reviews? Than we can merge.

@justin808
Copy link
Member

@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.

@dylangrafmyre
Copy link
Contributor Author

@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.

@justin808
Copy link
Member

@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
Remove gem poltergeist and phantomjs
Add gems selenium-webdriver and chromedriver-helper
Configure Capybara webdriver for :selenium_chrome
@samnang
Copy link
Contributor

samnang commented Sep 22, 2015

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?

@dylangrafmyre
Copy link
Contributor Author

@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.

@alex35mil
Copy link
Member

@dylangrafmyre 👍

dylangrafmyre added a commit that referenced this pull request Sep 22, 2015
Bump react_on_rails gem version to 1.0.3
@dylangrafmyre dylangrafmyre merged commit 2ab439c into master Sep 22, 2015
@dylangrafmyre dylangrafmyre deleted the bump-react_on_rails branch September 22, 2015 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants