-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
Use <script type="application/json"> for props and store #760
Conversation
…ribute Initial implementation by Elias Lopez Gutierrez <[email protected]>
@squadette What's pending here? |
Nothing, I guess it's ready for code review, fixes (if any) and merge. |
@squadette Really awesome work. My main concerns
Reviewed 17 of 17 files at r1. app/helpers/react_on_rails_helper.rb, line 226 at r1 (raw file):
Should this include Rails.env.test? @robwise @alexfedoseev Any need to see the JSON look pretty in tests? lib/react_on_rails/configuration.rb, line 128 at r1 (raw file):
Removing this may result in an error if this value is being set. Please set this value in the react_on_rails.rb and see if there's a crash. If so, let's leave this around with a deprecation message, and we'll remove with version 7.0. node_package/src/clientStartup.js, line 50 at r1 (raw file):
can we keep this a const at the top of the file? node_package/src/clientStartup.js, line 55 at r1 (raw file):
how is el.attributes different than getAttribute? node_package/src/clientStartup.js, line 63 at r1 (raw file):
should we DRY up 'data-js-react-on-rails-store'? spec/dummy/app/views/pages/server_side_hello_world_with_options.html.erb, line 30 at r1 (raw file):
Sometimes we're passed props that are already a JSON string. Sometimes we're given props that are a Hash. We need to be sure we handle both cases. Comments from Reviewable |
👍 amazing work |
Thank you. I've fixed two things, will fix the rest later. Review status: 15 of 17 files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. app/helpers/react_on_rails_helper.rb, line 226 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
Rewrote it to be pretty everywhere in non-production. node_package/src/clientStartup.js, line 50 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
I personally hate single-use constants because they inhibit grepping. I would prefer to leave it as, but of course I can change it. node_package/src/clientStartup.js, line 55 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
getAttribute() is better, because it handles attributes which are not present. Fixed, thank you. node_package/src/clientStartup.js, line 63 at r1 (raw file): Previously, justin808 (Justin Gordon) wrote…
I don't see a lot of value in micro-DRY. How would you suggest to change it? Comments from Reviewable |
This reverts commit 8492f0e.
Looking good! What's pending? Reviewed 1 of 1 files at r2. node_package/src/clientStartup.js, line 50 at r1 (raw file): Previously, squadette (Alexey Mahotkin) wrote…
OK -- for single use. Keep as is. Name is self explanatory. node_package/src/clientStartup.js, line 63 at r1 (raw file): Previously, squadette (Alexey Mahotkin) wrote…
If constant value is in two places, then declare at top of file as Comments from Reviewable |
@squadette Do you need any help from me on this one? I want to get this one shipped, and to then get started on v7 with Webpacker. |
@squadette We've got to get this one wrapped up. Any volunteers to get this one across the finish line? |
Work is now going into #775. @squadette Thanks for your help so far, and please help us review #775. |
See discussion in #660
Build passing: https://travis-ci.org/squadette/react_on_rails/builds/210095090
Thank you @eliaslopezgt for initial implementation.
This change is