Skip to content

Conversation

@sfc-gh-bnisco
Copy link
Contributor

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

  • Migrates from create-react-app to Vite

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 migrates the frontend build system from Create React App (CRA) to Vite, modernizing the development and build tooling for the Streamlit Bokeh component.

Key Changes:

  • Replaced CRA with Vite for faster builds and better development experience
  • Added separate Vite configurations for v1 (React component) and v2 (vanilla JS) builds
  • Migrated from Jest to Vitest for testing
  • Updated TypeScript target from ES5 to ESNext

Reviewed Changes

Copilot reviewed 12 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package.json Updated dependencies and scripts to use Vite instead of react-scripts; added vitest, vite, and related tooling
vitest.config.ts New Vitest test configuration merging with v2 Vite config
vite.v1.config.ts New Vite configuration for v1 React component development
vite.v2.config.ts New Vite configuration for v2 vanilla JS library build
tsconfig.json Updated TypeScript target to ESNext and added Vite client types
index.html Updated script and stylesheet references for Vite compatibility
src/vite-env.d.ts Added Vite environment type definitions
src/v1/index.ts New entry point for v1 component (migrated from previous structure)
src/v1/index.test.ts Added Vitest imports for test compatibility
src/v1/index.css Updated font paths from ./fonts/ to ../fonts/ for correct resolution
src/v1/streamlit-theme.ts Updated Bokeh version reference in comment from 3.6.2 to 3.8.0
src/v2/index.ts New placeholder entry point for v2 component
src/setupTests.js Migrated from Jest to Vitest mocking utilities
.env Changed PORT to VITE_PORT environment variable
Comments suppressed due to low confidence (1)

streamlit_bokeh/frontend/index.html:52

  • The %BASE_URL% placeholder is used for Bokeh script paths, but Vite doesn't process this placeholder by default. This will result in broken script paths in the built output.

For Vite, you should either:

  1. Use relative paths like ./bokeh/bokeh-3.8.0.min.js
  2. Or use Vite's import.meta.env.BASE_URL in a script tag
  3. Or configure a custom plugin to replace %BASE_URL%

Since these are static scripts in the public folder, the simplest solution is to use relative paths.


💡 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.

RIP CRA 🫡

@sfc-gh-bnisco sfc-gh-bnisco force-pushed the feat-ccv2-dual-pyproject branch from ac16cb7 to 110cebf Compare November 20, 2025 19:36
@sfc-gh-bnisco sfc-gh-bnisco force-pushed the feat-ccv2-dual-pyproject branch from 110cebf to c9690c7 Compare November 20, 2025 19:44
@sfc-gh-bnisco sfc-gh-bnisco marked this pull request as ready for review November 21, 2025 19:43
@sfc-gh-bnisco sfc-gh-bnisco force-pushed the feat-ccv2-dual-pyproject branch from c9690c7 to bca5022 Compare November 21, 2025 21:23
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, 9:46 PM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 24, 10:02 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-pyproject to graphite-base/39 November 24, 2025 21:44
@sfc-gh-bnisco sfc-gh-bnisco changed the base branch from graphite-base/39 to main November 24, 2025 21:45
@sfc-gh-bnisco sfc-gh-bnisco merged commit beb0be1 into main Nov 24, 2025
4 of 5 checks passed
@sfc-gh-bnisco sfc-gh-bnisco deleted the feat-ccv2-dual-vite 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