Skip to content

Conversation

@sfc-gh-bnisco
Copy link
Collaborator

@sfc-gh-bnisco sfc-gh-bnisco commented Jan 6, 2026

Describe your changes

Renamed some external-facing CCv2 types to better reflect their purpose and improve API clarity:

  • Renamed ComponentState to FrontendState
  • Renamed ComponentArgs to FrontendRendererArgs
  • Renamed Component to FrontendRenderer
  • Renamed ComponentCleanupFunction to CleanupFunction
  • Renamed BidiComponentCallable to ComponentRenderer in Python types

Added 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

  • No additional tests are needed as this is a type-only change
  • Existing tests will continue to validate the functionality

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@snyk-io
Copy link
Contributor

snyk-io bot commented Jan 6, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-13515/streamlit-1.52.2-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-13515.streamlit.app (☁️ Deploy here if not accessible)

@sfc-gh-bnisco sfc-gh-bnisco added change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users labels Jan 6, 2026 — with Graphite App
Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sfc-gh-bnisco sfc-gh-bnisco added the security-assessment-completed Security assessment has been completed for PR label Jan 6, 2026 — with Graphite App
@sfc-gh-bnisco sfc-gh-bnisco requested a review from Copilot January 6, 2026 17:15
Copy link
Contributor

Copilot AI left a 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., ComponentStateFrontendState, BidiComponentCallableComponentRenderer)
  • 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 ComponentStateFrontendState, ComponentArgsFrontendRendererArgs, ComponentFrontendRenderer, 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

@sfc-gh-bnisco sfc-gh-bnisco force-pushed the 01-06-_feat_rename_some_external_ccv2_types branch from 2c7b13d to 4a7da13 Compare January 6, 2026 19:02
@sfc-gh-bnisco sfc-gh-bnisco requested a review from Copilot January 6, 2026 19:02
Copy link
Contributor

Copilot AI left a 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.

@sfc-gh-bnisco sfc-gh-bnisco force-pushed the 01-06-_feat_rename_some_external_ccv2_types branch from 4a7da13 to 3a6fc16 Compare January 6, 2026 21:40
@sfc-gh-bnisco sfc-gh-bnisco added the change:breaking PR contains breaking change that affects backwards compatibility label Jan 6, 2026 — with Graphite App
@sfc-gh-bnisco sfc-gh-bnisco marked this pull request as ready for review January 6, 2026 22:39
@lukasmasuch
Copy link
Collaborator

@cursor review

Copy link

@cursor cursor bot left a 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!

Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@sfc-gh-bnisco sfc-gh-bnisco force-pushed the 01-06-_feat_rename_some_external_ccv2_types branch from 3a6fc16 to eb1e96a Compare January 7, 2026 21:55
@sfc-gh-bnisco sfc-gh-bnisco merged commit e1ef07c into develop Jan 9, 2026
43 checks passed
@sfc-gh-bnisco sfc-gh-bnisco deleted the 01-06-_feat_rename_some_external_ccv2_types branch January 9, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:breaking PR contains breaking change that affects backwards compatibility change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants