-
Notifications
You must be signed in to change notification settings - Fork 375
Fix SSR runtime failures for React Server Components #723
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
base: master
Are you sure you want to change the base?
Changes from all commits
4d09e13
4c0df6e
2f3c42c
ae420af
05cb2bc
0d8d75a
aaeba86
92306ff
3f7e452
1022234
e16612c
c0a66b1
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -33,6 +33,7 @@ jobs: | |||||
| DRIVER: selenium_chrome | ||||||
| CHROME_BIN: /usr/bin/google-chrome | ||||||
| USE_COVERALLS: true | ||||||
| RENDERER_PASSWORD: devPassword | ||||||
|
|
||||||
| steps: | ||||||
| - name: Install Chrome | ||||||
|
|
@@ -82,6 +83,20 @@ jobs: | |||||
| - name: Build shakapacker chunks | ||||||
| run: NODE_ENV=development bundle exec bin/shakapacker | ||||||
|
|
||||||
| - name: Start Node renderer for SSR | ||||||
| run: | | ||||||
| node react-on-rails-pro-node-renderer.js & | ||||||
|
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. CI: Node renderer output is discarded, making failures undiagnosable The background process started with
Suggested change
Then add a log dump on failure: echo "Node renderer failed to start within 30 seconds"
echo "--- node-renderer.log ---"
cat node-renderer.log || true
exit 1This preserves renderer output for the failure case without adding noise to successful runs. |
||||||
| echo "Waiting for Node renderer on port 3800..." | ||||||
|
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. CI reliability:
Use Bash's built-in
Suggested change
|
||||||
| for i in $(seq 1 30); do | ||||||
| if nc -z localhost 3800 2>/dev/null; then | ||||||
| echo "Node renderer is ready" | ||||||
| exit 0 | ||||||
| fi | ||||||
| sleep 1 | ||||||
| done | ||||||
| echo "Node renderer failed to start within 30 seconds" | ||||||
| exit 1 | ||||||
|
|
||||||
| - name: Run rspec with xvfb | ||||||
| uses: coactions/setup-xvfb@v1 | ||||||
| with: | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,8 @@ def simple; end | |
|
|
||
| def rescript; end | ||
|
|
||
| def server_components; end | ||
|
|
||
| private | ||
|
|
||
| def set_comments | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| <%= append_javascript_pack_tag('rsc-client-components') %> | ||||||
| <%= react_component("ServerComponentsPage", | ||||||
| prerender: false, | ||||||
| auto_load_bundle: false, | ||||||
| trace: Rails.env.development?, | ||||||
| id: "ServerComponentsPage-react-component-0") %> | ||||||
|
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. Hardcoded DOM
Suggested change
Unless there is a specific reason the RSC payload route needs to target this exact |
||||||
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.
Security: hardcoded secret in plain text
devPasswordis committed in the clear. Anyone who reads this repo can authenticate directly to the node renderer if it were ever accidentally exposed. Use a GitHub Actions secret instead:Add a
RENDERER_PASSWORDsecret to the repository settings (Settings → Secrets → Actions) with any value for the test environment.