-
-
Notifications
You must be signed in to change notification settings - Fork 629
[EXPERIMENT] Send render request body as JSON (closes #3280 hypothesis) #3293
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,15 @@ def reset_connection | |
| def render_code(path, js_code, send_bundle) | ||
| Rails.logger.info { "[ReactOnRailsPro] Perform rendering request #{path}" } | ||
| form = form_with_code(js_code, send_bundle) | ||
| perform_request(path, form: form) | ||
| # Experiment (issue #3280): use JSON for steady-state render to skip | ||
| # form-urlencode CPU/GC. Keep multipart when send_bundle=true because | ||
| # form_with_code embeds the bundle file as a Pathname which can't be | ||
| # JSON-serialized. | ||
| if send_bundle | ||
| perform_request(path, form: form) | ||
| else | ||
| perform_request(path, json: form) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Watch out for a subtle |
||
| end | ||
|
Comment on lines
+31
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Switching from |
||
| end | ||
|
|
||
| def render_code_as_stream(path, js_code, is_rsc_payload:) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4-line block comment and "Experiment" language are fine for an experiment branch, but project conventions (CLAUDE.md) cap comments at one line and restrict them to non-obvious WHY. For the production PR this should be reduced to something like: