[feat] Rename some external CCv2 types#13515
Merged
sfc-gh-bnisco merged 1 commit intodevelopfrom Jan 9, 2026
Merged
Conversation
Contributor
✅ 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. |
Contributor
✅ PR preview is ready!
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR renames external-facing CCv2 (Custom Components v2) types to improve API clarity and better reflect their purpose. The changes span both Python and TypeScript codebases, with backward compatibility maintained through type aliases.
Key changes:
- Renamed types to use clearer, more descriptive names (e.g.,
ComponentState→FrontendState,BidiComponentCallable→ComponentRenderer) - Added backward compatibility aliases in both Python and TypeScript to support existing code
- Updated internal usages throughout the codebase to use the new type names
- Improved documentation to reflect the new naming scheme
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
lib/streamlit/components/v2/types.py |
Renamed BidiComponentCallable to ComponentRenderer in Python, added backward-compatible alias, and updated documentation references |
lib/streamlit/components/v2/__init__.py |
Updated imports and type annotations to use the new ComponentRenderer name |
frontend/component-v2-lib/src/types.ts |
Renamed ComponentState → FrontendState, ComponentArgs → FrontendRendererArgs, Component → FrontendRenderer, simplified cleanup function types, and added deprecated aliases |
frontend/lib/src/components/widgets/BidiComponent/hooks/useHandleJsContent.ts |
Updated internal usage to import and use the new FrontendState, FrontendRendererArgs, and CleanupFunction types |
frontend/lib/src/components/widgets/BidiComponent/BidiComponentContext.tsx |
Updated import to use FrontendState instead of ComponentState |
2c7b13d to
4a7da13
Compare
4a7da13 to
3a6fc16
Compare
Collaborator
|
@cursor review |
3a6fc16 to
eb1e96a
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Describe your changes
Renamed some external-facing CCv2 types to better reflect their purpose and improve API clarity:
ComponentStatetoFrontendStateComponentArgstoFrontendRendererArgsComponenttoFrontendRendererComponentCleanupFunctiontoCleanupFunctionBidiComponentCallabletoComponentRendererin Python typesAdded backward compatibility aliases to maintain support for existing code in the frontend types. The renaming of the python type is technically a breaking change.
Updated documentation comments to reflect the new naming scheme and improve clarity.
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.