-
-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use <script type="application/json"> for props and store (#775) for p…
…erformance Initial implementation started by https://github.com/eliaslopezgt and then https://github.com/squadette * Refactor console output to use <script> tag with a certain ID * Use <script type="application/json"> with JSON content instead of attribute * Pretty-print JSON in development and testing * getAttribute() is better, because it handles attributes which are not present. * Return skip display none to react on rails configuration * Extract data-js-react-on-rails-store attribute to the const * Return to_json method call to app_props_server_render to ensure handling the both cases * Delete unnecessary style method and HIDDEN constant from react component module * Improve jsonEl parsing to handle props as already converted from JSON to a string * Move handling props already converted to json string to ruby code * Escape json from props as json string * Add test to ensure that even json string props are sanitezed * Delete test json props because we parse all props to a hash now
- Loading branch information
1 parent
cca1351
commit 7ccd603
Showing
16 changed files
with
113 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
This causes a serious performance issue for those with String props. @cheremukhin23 @robwise @dylangrafmyre @squadette . The parsing was not necessary.
See #819.
Thanks @dzirtusss for finding this! AWESOME!!!