Skip to content

Support direct react components and server console messages and linting #20

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 16 commits into from
Sep 20, 2015

Conversation

justin808
Copy link
Member

  • Added console & error logging
  • Catch exceptions and log them on the server side
  • Issue with HelloWorld component is not loade properly.
    Visit /focused to see the issue
  • Created /focused so that a specific part can be individually tested.
  • Lots of cleanup and refactoring.
  • Consistency with using suffix App for generator functions
  • Added default for generator_function

Replace #19

josiasds and others added 6 commits September 9, 2015 21:00
- Add support to React components generated with React.createClass()
- Add “generator” property to allow creating a React component via a
function
- Add HelloES5 component to the dummy application
- Renaming Ruby variables to snake case
- Make ReactRenderer#render_js_react_element a class method
- Improve generated JS code
* Added console & error logging
* Catch exceptions and log them on the server side
* Issue with HelloWorld component is not loade properly.
  Visit /focused to see the issue
* Created /focused so that a specific part can be individually tested.
* Lots of cleanup and refactoring.
* Consistency with using suffix App for generator functions
* Added default for generator_function
@justin808
Copy link
Member Author

@alexfedoseev @josiasds Please pull this code. I need some help. This is really close, but if you go to http://localhost:3000/focused then you'll see the error which is that the HelloWorld component is not found. This is doing simple client rendering. Same issue server rendering. Thanks.

Also, we added the option for the helper of generator_function. We couldn't figure out a better way to identify the function created by React.createClass vs. our own generator function, and thus, we'll just specify this in the helper.

@@ -1,7 +1,7 @@
import React from 'react';

// Super simple example of the simplest possible React component
export default class HelloWorld extends React.Component {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to split definition and export if we don't do anything with exported class?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexfedoseev We don't need to split. We were experimenting. Voodoo coding.


<<-HTML.strip_heredoc.html_safe
#{data_from_server_script_tag}
#{rendered_output}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be aligned?

index.html.erb crashing

need to put all the example in separate web pages with clear
explanations of what is being demonstrated
* Also catches when generator_function is set to true when it's not a
  generator function.
* Reuse the same catch on both client and server.
* Started to format JS code better.
* Some readme improvements
@@ -88,10 +109,11 @@ Contributions and pull requests welcome!

## Installation

Add this line to your application's Gemfile:
Add these linesto your application's Gemfile, sustituting your preferable JavaScript engine.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: "these lines to"

@justin808 justin808 changed the title Support direct react components Support direct react components and server console messages and linting Sep 17, 2015
mapreal19 and others added 4 commits September 18, 2015 11:59
# Conflicts:
#	README.md
#	spec/dummy/Gemfile.lock
#	spec/dummy/bin/setup
#	spec/dummy/spec/rails_helper.rb
#	spec/dummy/spec/spec_helper.rb
All tests passing
justin808 added a commit that referenced this pull request Sep 20, 2015
Support direct react components and server console messages and linting
@justin808 justin808 merged commit b7d02c4 into master Sep 20, 2015
@justin808 justin808 deleted the support-direct-react-components branch September 20, 2015 02:35
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.

5 participants