Overview
The frontend currently uses both Fluent UI packages:
@fluentui/react (v8) - 20 import locations
@fluentui/react-components (v9) - 6 import locations
We should consider migrating fully to v9 (@fluentui/react-components) for several reasons:
- Official React 19 support - v9 has proper peer dependencies for React 19, while v8 hasn't updated its declared peer deps yet
- Active development - v9 is the actively maintained version with new features
- Modern patterns - v9 uses more modern React patterns and CSS-in-JS via Griffel
- Reduced bundle size - Using only one Fluent UI package would reduce duplication
Current v8 usage
Components imported from @fluentui/react:
| Component |
Files using it |
Stack |
Answer, AnswerError, AnswerLoading, HelpCallout, QuestionInput, Settings, ThoughtProcess, VectorSettings |
Dropdown |
LanguagePicker, Settings, VectorSettings |
TextField |
QuestionInput, Settings |
Checkbox |
Settings, VectorSettings |
Panel |
Chat, HistoryPanel |
DefaultButton |
Chat, HelpCallout, HistoryItem, LoginButton |
IconButton |
Answer, HelpCallout, MarkdownViewer, SpeechOutputAzure, SpeechOutputBrowser |
PrimaryButton |
AnswerError |
Callout |
HelpCallout, UploadFile |
Label |
TokenClaimsDisplay, UploadFile |
Text |
UploadFile |
Pivot, PivotItem |
AnalysisPanel |
Spinner |
HistoryPanel, MarkdownViewer |
MessageBar |
MarkdownViewer |
Link |
MarkdownViewer |
initializeIcons |
index.tsx |
Migration considerations
Breaking changes
- No
Stack component - v9 expects direct use of CSS flexbox/grid
- Different props - Component APIs differ between v8 and v9
- Different styling - v9 uses
makeStyles from Griffel instead of IStyleProps
- Different theming - Provider-based theming vs. global
v9 equivalents
| v8 Component |
v9 Equivalent |
Stack |
Use CSS flexbox/grid directly |
Dropdown |
Dropdown or Combobox |
TextField |
Input or Textarea |
Checkbox |
Checkbox |
Panel |
Drawer |
DefaultButton |
Button |
IconButton |
Button with icon prop |
PrimaryButton |
Button appearance="primary" |
Callout |
Popover |
Pivot |
TabList |
Spinner |
Spinner |
MessageBar |
MessageBar |
initializeIcons |
Not needed (icons bundled differently) |
Suggested approach
- Migrate one component at a time, starting with simpler ones
- Update styling to use Griffel's
makeStyles
- Replace
Stack with semantic HTML + CSS
- Run e2e tests after each component migration
- Remove
@fluentui/react dep and legacy-peer-deps setting once complete
References
Overview
The frontend currently uses both Fluent UI packages:
@fluentui/react(v8) - 20 import locations@fluentui/react-components(v9) - 6 import locationsWe should consider migrating fully to v9 (
@fluentui/react-components) for several reasons:Current v8 usage
Components imported from
@fluentui/react:StackDropdownTextFieldCheckboxPanelDefaultButtonIconButtonPrimaryButtonCalloutLabelTextPivot,PivotItemSpinnerMessageBarLinkinitializeIconsMigration considerations
Breaking changes
Stackcomponent - v9 expects direct use of CSS flexbox/gridmakeStylesfrom Griffel instead ofIStylePropsv9 equivalents
StackDropdownDropdownorComboboxTextFieldInputorTextareaCheckboxCheckboxPanelDrawerDefaultButtonButtonIconButtonButtonwithiconpropPrimaryButtonButton appearance="primary"CalloutPopoverPivotTabListSpinnerSpinnerMessageBarMessageBarinitializeIconsSuggested approach
makeStylesStackwith semantic HTML + CSS@fluentui/reactdep andlegacy-peer-depssetting once completeReferences