fix(ui): Make feast UI load in Vite without process.env and arrow_down imports - #6724
fix(ui): Make feast UI load in Vite without process.env and arrow_down imports#6724kchawlani19 wants to merge 2 commits into
Conversation
e5ceb05 to
0b5b96b
Compare
0b5b96b to
66102de
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6724 +/- ##
==========================================
+ Coverage 46.76% 46.79% +0.02%
==========================================
Files 415 415
Lines 50392 50395 +3
Branches 7214 7215 +1
==========================================
+ Hits 23567 23581 +14
+ Misses 25171 25162 -9
+ Partials 1654 1652 -2
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
…ependency and arrow_down icon import path Signed-off-by: kchawlani19 <kchawlan@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: kchawlani19 <kchawlan@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
66102de to
e6daf25
Compare
| return process; | ||
| }; | ||
|
|
||
| export const getProcessEnv = ( |
There was a problem hiding this comment.
The whole point of this PR is Vite compatibility, but the new helper only wraps process.env. In Vite, environment variables are accessed via import.meta.env, not process.env.
| }); | ||
|
|
||
| const basicSelectId = useGeneratedHtmlId({ prefix: "basicSelect" }); | ||
| const basicSelectId = React.useId(); |
There was a problem hiding this comment.
React.useId() introduced in React 18. Any consumer on React 17 will crash at runtime.
Either keep using useGeneratedHtmlId from EUI (it's a standalone utility, not tied to EuiSelect), or drop React 17 from peer dependencies if that's intentional.
Prefer Vite import.meta env resolution with safe fallback to process.env, and restore EUI useGeneratedHtmlId to avoid React 18-only APIs. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: kchawlani19 <kchawlan@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
026d8b3 to
d1ae04e
Compare
Problem
Importing
@feast-dev/feast-uiin a Vite app fails at runtime, blocking the documented module-integration path.Observed failures included:
ReferenceError: process is not definedFailed to fetch dynamically imported module: .../assets/arrow_down?importRoot cause
Two Vite-incompatible runtime paths were involved:
process.envreads in browser-executed UI code (FeastUIandCurlGeneratorTab).arrow_downdynamic module loading in this packaging context.Fix
getProcessEnv) and replaced directprocess.envaccess in:ui/src/FeastUI.tsxui/src/pages/feature-views/CurlGeneratorTab.tsxEuiSelectinProjectSelectorwith a native<select>to avoid the dynamic icon import path that causesarrow_downresolution failures.Layoutwith a local inline SVG glyph.ui/src/utils/environment.test.tsui/src/components/ProjectSelector.test.tsxTest plan
cd ui && npx jest src/utils/environment.test.ts src/components/ProjectSelector.test.tsx src/FeastUISansProviders.test.tsx --runInBandcd ui && npm run build:libRisk / rollback
Risk is low-to-medium and limited to UI behavior:
EuiSelect-> native<select>.Rollback is straightforward by reverting this PR commit.