-
Notifications
You must be signed in to change notification settings - Fork 2
[chore] Migrate from cra to vite #39
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
777ff4c to
b97af96
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
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:
- Use relative paths like
./bokeh/bokeh-3.8.0.min.js - Or use Vite's
import.meta.env.BASE_URLin a script tag - 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.
sfc-gh-nbellante
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.
RIP CRA 🫡
b97af96 to
e263f37
Compare
ac16cb7 to
110cebf
Compare
e263f37 to
d0cfb30
Compare
110cebf to
c9690c7
Compare
d0cfb30 to
26a1518
Compare
c9690c7 to
bca5022
Compare
Merge activity
|
26a1518 to
ee90756
Compare

Uh oh!
There was an error while loading. Please reload this page.