Skip to content
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

Fix undefined reference in older browsers in useMessageBarReflow #32238

Conversation

MLoughry
Copy link
Contributor

@MLoughry MLoughry commented Aug 6, 2024

Previous Behavior

In older browsers, such as Chrome 80, ResizeObserverEntry.borderBoxSize is not implemented, and returns undefined. The unguarded dereference in useMessageBarReflow causes a TypeError in such cases.

New Behavior

Added an optional chaining guard ?. to the code, and a comment explaining the reason for it.

Related Issue(s)

@MLoughry MLoughry requested a review from a team as a code owner August 6, 2024 16:39
@fabricteam
Copy link
Collaborator

fabricteam commented Aug 6, 2024

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.095 MB
270.595 kB
1.095 MB
270.654 kB
125 B
59 B
react-message-bar
MessageBar (all components)
24.596 kB
9.18 kB
24.721 kB
9.223 kB
125 B
43 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
69.141 kB
20.157 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
217.412 kB
63.063 kB
react-components
react-components: FluentProvider & webLightTheme
44.442 kB
14.607 kB
react-portal-compat
PortalCompatProvider
8.39 kB
2.64 kB
react-timepicker-compat
TimePicker
106.751 kB
35.596 kB
🤖 This report was generated against d9541c4016946a6d80b532fc2f9fea83eab22b04

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 6, 2024

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 649 628 5000
Button mount 302 310 5000
Field mount 1161 1108 5000
FluentProvider mount 718 742 5000
FluentProviderWithTheme mount 78 95 10
FluentProviderWithTheme virtual-rerender 37 38 10
FluentProviderWithTheme virtual-rerender-with-unmount 77 75 10
MakeStyles mount 860 871 50000
Persona mount 1755 1735 5000
SpinButton mount 1396 1445 5000
SwatchPicker mount 1666 1647 5000

@spmonahan spmonahan merged commit f239694 into microsoft:master Aug 6, 2024
19 checks passed
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Aug 7, 2024
* master: (48 commits)
  chore: migrate to storybook v7 (microsoft#32018)
  release: applying package updates - react-components
  ci: make public-docsite-v9 deploy pipeline work and make it faster (microsoft#32248)
  fix(Toolbar): hardcode size of `ToolbarButton` (microsoft#32185)
  chore: deprecate @fluentui/react-motion-preview (microsoft#32190)
  release: applying package updates - web-components
  docs: add wrapping menu item example to ContextualMenu docs (microsoft#31289)
  docs: update title of v8 keyboard-accessible drag & drop example, add docs (microsoft#32216)
  release: applying package updates - react-components
  fix: Card does not override specified focusMode based on event listeners (microsoft#32200)
  Fix undefined reference in older browsers in useMessageBarReflow (microsoft#32238)
  feat: Add transparent appearance to ToolbarButton (microsoft#32205)
  fix(react-tabs): ignore ref for tab reserved space content slot (microsoft#31775)
  fix(Dialog): do not require ref forwarding (microsoft#32095)
  feat: add verify-packaging to react v8 release pipeline (microsoft#32212)
  chore(web-components): remove type-check definition and follow repo target defaults for consistency and type-check speeds (microsoft#32208)
  chore(react-tree): improve ImmutableSet and ImmutableMap internal implementation (microsoft#32167)
  release: applying package updates - web-components
  feat(web-components): add tablist (microsoft#32098)
  release: applying package updates - react-components
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: useMessageBarReflow throws a TypeError on older browsers
4 participants