-
Notifications
You must be signed in to change notification settings - Fork 4k
[feat] Rename some external CCv2 types #13515
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
[feat] Rename some external CCv2 types #13515
Conversation
✅ 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. |
✅ PR preview is ready!
|
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.
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
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.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
4a7da13 to
3a6fc16
Compare
|
@cursor review |
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.
✅ Bugbot reviewed your changes and found no bugs!
lukasmasuch
left a comment
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.
LGTM 👍
3a6fc16 to
eb1e96a
Compare

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.