Polish renderer teardown follow-ups#3718
Conversation
Greptile SummaryThis is a pure polish follow-up to PR #3663, addressing nine open review threads with comment rewrites, one redundant test-cleanup removal, and one test-timing robustness fix. No runtime behavior is changed.
Confidence Score: 4/5Safe to merge — all changes are confined to comments and test code, with no production logic altered. The TestRenderer to TestComponent rename was applied to only the one test cited in the follow-up checklist; roughly nine other tests in the same file still declare TestRenderer while registering it under the TestComponent key, leaving the cosmetic inconsistency mostly intact. packages/react-on-rails-pro/tests/ClientSideRenderer.test.ts — several remaining TestRenderer/TestComponent mismatches were not addressed. Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Test (thenable rejection)
participant Renderer as ClientSideRenderer
participant Teardown as teardown fn (non-native thenable)
participant Console as console.error
Test->>Renderer: renderOrHydrateComponent(componentSpec)
Renderer->>Teardown: registers renderer returns teardown
Test->>Renderer: unmountAll()
Renderer->>Teardown: calls teardown()
Teardown-->>Renderer: returns non-native thenable
Note over Renderer: Promise.resolve(thenable) calls onRejected synchronously
Renderer->>Console: .catch() logs error
Note over Test: await setTimeout(0) flushes all pending microtasks and macrotasks
Test->>Console: expect(consoleErrorSpy).toHaveBeenCalledWith(...)
|
Code Review — PR #3718: Polish renderer teardown follow-upsOverviewSmall but well-scoped follow-up: comment clarifications, one redundant cleanup removal, and a test reliability fix aligning the Pro package with the established OSS pattern. All five files are touched for polish only; no runtime logic changes. What's Good
Redundant
Comment in Minor Observations
VerdictClean polish PR with no correctness risks. The test fix is the most substantive change and it is correct. LGTM. |
size-limit report 📦
|
Pro Node Renderer Benchmark Summary
▲/▼ non-zero change vs baseline · 0.0% exact/near-zero match · 🔴 significant regression · 🟢 significant improvement (tracked measures) · (n) = baseline |
Pro (shard 2/2) Benchmark Summary
▲/▼ non-zero change vs baseline · 0.0% exact/near-zero match · 🔴 significant regression · 🟢 significant improvement (tracked measures) · (n) = baseline |
Core Benchmark Summary
▲/▼ non-zero change vs baseline · 0.0% exact/near-zero match · 🔴 significant regression · 🟢 significant improvement (tracked measures) · (n) = baseline |
Pro (shard 1/2) Benchmark Summary
▲/▼ non-zero change vs baseline · 0.0% exact/near-zero match · 🔴 significant regression · 🟢 significant improvement (tracked measures) · (n) = baseline |
|
Current status: all visible checks are complete with no failures (39 success, 2 skipped), but the PR is still blocked by |
Summary
Closes #3675.
Validation
gh issue view 3675 --json number,title,body,state,author,comments,urlgh pr list --state all --search "3675 renderer teardown polish" --json number,title,state,url,headRefNamepnpm --filter react-on-rails exec jest tests/ClientRenderer.test.ts --runInBandpnpm --filter react-on-rails-pro exec jest tests/ClientSideRenderer.test.ts tests/wrapServerComponentRenderer.client.test.jsx --runInBandpnpm --filter react-on-rails type-checkpnpm --filter react-on-rails-pro type-checkgit diff --checkscript/ci-changes-detector origin/main fix/3675-renderer-teardown-polishcodex review --uncommitted: no actionable defectsLabels
Labels: none. This is a small comment/test polish follow-up with no runtime behavior reordering.