refactor(ccv2): rename BidiComponentResult to ComponentResult#14253
Conversation
✅ PR preview is ready!
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
SummaryThis PR renames Code QualityReviewers unanimously agree the refactoring is clean, consistent, and low-risk:
No issues identified. Test CoverageReviewers unanimously agree test coverage is adequate for this rename-with-alias refactor:
Backwards CompatibilityReviewers unanimously agree there are no breaking changes:
Security & RiskReviewers unanimously agree there are no security concerns. This is a pure naming refactoring with no changes to WebSocket handling, authentication, file serving, or any security-sensitive code paths. Regression risk is minimal and limited to type-name/documentation consistency, which is covered by updated tests. External test recommendation
AccessibilityNot applicable. No frontend UI/component implementation files were changed; no DOM interaction behavior changed. Accessibility impact is neutral. RecommendationsNo blocking issues. Two minor non-blocking suggestions:
Reviewer Agreement
All expected reviewers completed their reviews. Both reviewers are in full agreement on all substantive points. The only differences are in which optional, non-blocking suggestions each reviewer offered. VerdictAPPROVED: Both reviewers approve unanimously. The refactor is clean, well-executed, backward-compatible, comprehensively tested, and introduces zero behavioral changes. No blocking quality or security concerns were identified by any reviewer. This is a consolidated AI review by 📋 Review by `gpt-5.3-codex-high`SummaryThis PR is a focused refactor that promotes Code QualityThe changes are clean, consistent, and low-risk:
Test CoverageCoverage is appropriate for a rename-with-alias refactor:
Overall, test updates are sufficient for the scope of change. Backwards CompatibilityBackwards compatibility is preserved:
Security & RiskNo security-sensitive surfaces were modified (no routing, auth/session transport, cookies/XSRF, file serving, iframe/postMessage, external networking, or dynamic code execution changes). External test recommendation
AccessibilityNo frontend UI/component implementation files were changed, and no DOM interaction behavior changed. Accessibility impact is neutral. Recommendations
VerdictAPPROVED: The refactor is coherent, backward-compatible, and sufficiently covered for its scope, with no blocking quality or security concerns identified. This is an automated AI review by 📋 Review by `opus-4.6-thinking`SummaryThis PR renames Files changed (10): The core rename happens in Code QualityThe refactoring is clean and consistent:
No issues identified. Test CoverageTest coverage is adequate for this refactoring:
Since this is a pure rename with no behavioral changes, the existing comprehensive test suite for CCV2 provides strong coverage. Backwards CompatibilityNo breaking changes. The backward compatibility strategy is sound:
Security & RiskNo security concerns. This is a pure naming refactoring:
External test recommendationRecommendation: No —
AccessibilityNot applicable. This PR contains no frontend changes — only Python backend type annotations, docstrings, and class naming. No UI, ARIA, or DOM changes are involved. RecommendationsNo blocking issues. One minor suggestion:
VerdictAPPROVED: Clean, well-executed rename from This is an automated AI review by |
There was a problem hiding this comment.
Pull request overview
This PR standardizes the CCV2 bidirectional component return type name by promoting ComponentResult as the canonical result type across the public API surface, while keeping BidiComponentResult as a backward-compatible alias.
Changes:
- Renames
BidiComponentResult→ComponentResultin the implementation, public typing surface, and docstrings. - Keeps
BidiComponentResultas an alias for backward compatibility and adds an explicit compatibility test. - Updates unit tests and e2e app scripts to use
ComponentResultin type annotations and assertions.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/tests/streamlit/runtime/state/test_presentation.py | Updates docstring reference to the new canonical result type name. |
| lib/tests/streamlit/components/v2/test_bidi_component.py | Updates tests to construct/assert ComponentResult instead of BidiComponentResult. |
| lib/tests/streamlit/components/v2/bidi_component/test_state.py | Switches tests to ComponentResult and adds alias compatibility coverage. |
| lib/streamlit/components/v2/types.py | Updates the public ComponentRenderer protocol return type and docstrings to ComponentResult. |
| lib/streamlit/components/v2/bidi_component/state.py | Renames the concrete result class to ComponentResult and adds BidiComponentResult alias. |
| lib/streamlit/components/v2/bidi_component/main.py | Updates return type annotations and returned value construction to ComponentResult. |
| lib/streamlit/components/v2/bidi_component/init.py | Exports ComponentResult while keeping BidiComponentResult in __all__. |
| lib/streamlit/components/v2/init.py | Updates TYPE_CHECKING imports + return type annotations/docstrings to ComponentResult. |
| e2e_playwright/bidi_components/session_state_interactions.py | Updates e2e app typing to use ComponentResult. |
| e2e_playwright/bidi_components/basics.py | Updates e2e app typing to use ComponentResult. |
Promote `ComponentResult` as the canonical CCV2 result type across the public API, internal type hints, and docstrings to align naming with the rest of the v2 surface. Keep `BidiComponentResult` as a backward-compatible alias to avoid breaking existing imports and user code. Update tests and e2e typing annotations to use `ComponentResult`, and add explicit compatibility coverage for the alias.
334cf8b to
ccb44aa
Compare
## Describe your changes - Promote `ComponentResult` as the canonical CCV2 result type across the public API, internal type hints, and docstrings to align naming with the rest of the v2 surface. - Keep `BidiComponentResult` as a backward-compatible alias to avoid breaking existing imports and user code. Update tests and e2e typing annotations to use `ComponentResult`, and add explicit compatibility coverage for the alias. ## Screenshot or video (only for visual changes) ## GitHub Issue Link (if applicable) ## Testing Plan - Adds a backwards compat test --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

Describe your changes
ComponentResultas the canonical CCV2 result type across the public API, internal type hints, and docstrings to align naming with the rest of the v2 surface.BidiComponentResultas a backward-compatible alias to avoid breaking existing imports and user code. Update tests and e2e typing annotations to useComponentResult, and add explicit compatibility coverage for the alias.Screenshot or video (only for visual changes)
GitHub Issue Link (if applicable)
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.