Skip to content

Conversation

@sfc-gh-bnisco
Copy link
Contributor

@sfc-gh-bnisco sfc-gh-bnisco commented Nov 20, 2025

TL;DR

Added support for Streamlit's Custom Component v2 API to the Bokeh component.

What changed?

  • Added version detection to use Custom Component v2 API when Streamlit >= 1.51.0 is available
  • Implemented v2 component with proper theme handling and responsive sizing
  • Created utility functions for loading Bokeh scripts and managing component state

Copy link
Contributor Author

sfc-gh-bnisco commented Nov 20, 2025

Copy link

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 adds support for Streamlit's Custom Component v2 API (CCv2) to the Bokeh component. The implementation includes version detection to conditionally use the v2 API when Streamlit >= 1.51.0 is available, while maintaining backward compatibility with v1. The v2 implementation features improved theme handling with Streamlit theme integration, responsive sizing support, and robust script loading utilities. The CCv2 feature is currently disabled via a flag pending full rollout in a future PR.

Key changes:

  • Added v2 component implementation with theme-aware rendering and state management
  • Created utility functions for idempotent Bokeh script loading
  • Implemented version detection to switch between CCv1 and CCv2 APIs

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
streamlit_bokeh/pyproject.toml Added project metadata and CCv2 component configuration
streamlit_bokeh/frontend/src/v2/streamlit-theme.ts Implements Streamlit-to-Bokeh theme translation
streamlit_bokeh/frontend/src/v2/loaders.ts Provides idempotent Bokeh script loading utilities
streamlit_bokeh/frontend/src/v2/index.ts Main v2 component implementation with state management
streamlit_bokeh/frontend/src/v2/index.test.ts Unit tests for theme and dimension calculation functions
streamlit_bokeh/init.py Added version detection and dual v1/v2 registration
e2e_playwright/bokeh_chart_basics.py Updated test to include keys for multiple chart instances

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@sfc-gh-nbellante sfc-gh-nbellante left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor Author

sfc-gh-bnisco commented Nov 24, 2025

Merge activity

  • Nov 24, 9:44 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Nov 24, 10:04 PM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 24, 10:11 PM UTC: @sfc-gh-bnisco merged this pull request with Graphite.

@sfc-gh-bnisco sfc-gh-bnisco changed the base branch from feat-ccv2-dual-vite to graphite-base/40 November 24, 2025 21:45
@sfc-gh-bnisco sfc-gh-bnisco changed the base branch from graphite-base/40 to main November 24, 2025 22:02
@sfc-gh-bnisco sfc-gh-bnisco merged commit c33bf59 into main Nov 24, 2025
4 checks passed
@sfc-gh-bnisco sfc-gh-bnisco deleted the feat-ccv2-dual-v2 branch November 25, 2025 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants