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 styles debugging throw error under dev environment #18955

Merged
merged 3 commits into from
Jul 15, 2021

Conversation

YuanboXue-Amber
Copy link
Contributor

@YuanboXue-Amber YuanboXue-Amber commented Jul 15, 2021

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ yarn change

Description of changes

Under dev environment, style debugging tool throw the following errors:
Screenshot 2021-07-15 at 16 11 01

To reproduce:

  1. start fluent UI docsite in dev mode
  2. navigate to Avatar component
  3. the screen went blank and this error appears in console

Reason:
This happens for components that has some slots without a default style.

Focus areas to test

(optional)

@size-auditor
Copy link

size-auditor bot commented Jul 15, 2021

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 445c04ac55f894b8265a38ddf31ff83979ba3854 (build)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 15, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8c2b818:

Sandbox Source
Fluent UI React Starter Configuration

@fabricteam
Copy link
Collaborator

fabricteam commented Jul 15, 2021

📊 Bundle size report

🤖 This report was generated against 445c04ac55f894b8265a38ddf31ff83979ba3854

@fabricteam
Copy link
Collaborator

fabricteam commented Jul 15, 2021

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 805 781 5000
BaseButton mount 911 877 5000
Breadcrumb mount 2620 2599 1000
ButtonNext mount 532 533 5000
Checkbox mount 1495 1500 5000
CheckboxBase mount 1285 1263 5000
ChoiceGroup mount 4692 4681 5000
ComboBox mount 974 942 1000
CommandBar mount 10018 10081 1000
ContextualMenu mount 6243 6206 1000
DefaultButton mount 1111 1137 5000
DetailsRow mount 3670 3681 5000
DetailsRowFast mount 3702 3751 5000
DetailsRowNoStyles mount 3441 3470 5000
Dialog mount 2112 2113 1000
DocumentCardTitle mount 133 136 1000
Dropdown mount 3191 3161 5000
FluentProviderNext mount 7272 7211 5000
FocusTrapZone mount 1788 1791 5000
FocusZone mount 1761 1817 5000
IconButton mount 1730 1677 5000
Label mount 328 333 5000
Layer mount 1768 1749 5000
Link mount 469 466 5000
MakeStyles mount 1801 1805 50000
MenuButton mount 1426 1428 5000
MessageBar mount 2004 2032 5000
Nav mount 3192 3221 1000
OverflowSet mount 1047 1006 5000
Panel mount 2044 2063 1000
Persona mount 823 840 1000
Pivot mount 1413 1390 1000
PrimaryButton mount 1269 1264 5000
Rating mount 7620 7548 5000
SearchBox mount 1300 1301 5000
Shimmer mount 2518 2539 5000
Slider mount 1922 1931 5000
SpinButton mount 4871 4898 5000
Spinner mount 418 428 5000
SplitButton mount 3131 3140 5000
Stack mount 492 503 5000
StackWithIntrinsicChildren mount 1474 1492 5000
StackWithTextChildren mount 4394 4451 5000
SwatchColorPicker mount 10010 10068 5000
Tabs mount 1388 1382 1000
TagPicker mount 2398 2379 5000
TeachingBubble mount 11785 11870 5000
Text mount 422 425 5000
TextField mount 1380 1341 5000
ThemeProvider mount 1187 1182 5000
ThemeProvider virtual-rerender 595 585 5000
Toggle mount 799 798 5000
buttonNative mount 109 104 5000

Perf Analysis (@fluentui/react-northstar)

⚠️ 1 potential perf regressions detected

Potential regressions comparing to master

Scenario Current PR Ticks Baseline Ticks Ratio Regression Analysis
GridMinimalPerf.default 330 330 1:1 analysis
Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
AnimationMinimalPerf.default 416 390 1.07:1
AvatarMinimalPerf.default 193 181 1.07:1
TreeWith60ListItems.default 176 165 1.07:1
HeaderMinimalPerf.default 364 344 1.06:1
AccordionMinimalPerf.default 157 149 1.05:1
CarouselMinimalPerf.default 461 441 1.05:1
ChatMinimalPerf.default 654 621 1.05:1
StatusMinimalPerf.default 680 648 1.05:1
TableMinimalPerf.default 410 391 1.05:1
AttachmentSlotsPerf.default 1051 1012 1.04:1
ReactionMinimalPerf.default 369 355 1.04:1
TextMinimalPerf.default 350 336 1.04:1
TreeMinimalPerf.default 793 759 1.04:1
AttachmentMinimalPerf.default 154 150 1.03:1
BoxMinimalPerf.default 346 337 1.03:1
ImageMinimalPerf.default 360 350 1.03:1
InputMinimalPerf.default 1257 1217 1.03:1
ListNestedPerf.default 552 538 1.03:1
ListWith60ListItems.default 629 612 1.03:1
MenuButtonMinimalPerf.default 1649 1606 1.03:1
ButtonMinimalPerf.default 166 162 1.02:1
DialogMinimalPerf.default 747 735 1.02:1
DividerMinimalPerf.default 347 341 1.02:1
HeaderSlotsPerf.default 743 728 1.02:1
LabelMinimalPerf.default 375 368 1.02:1
LoaderMinimalPerf.default 690 679 1.02:1
MenuMinimalPerf.default 850 831 1.02:1
PopupMinimalPerf.default 591 581 1.02:1
PortalMinimalPerf.default 176 172 1.02:1
CustomToolbarPrototype.default 3830 3744 1.02:1
CheckboxMinimalPerf.default 2690 2669 1.01:1
DropdownMinimalPerf.default 3071 3049 1.01:1
FormMinimalPerf.default 383 380 1.01:1
ListMinimalPerf.default 498 492 1.01:1
SegmentMinimalPerf.default 339 334 1.01:1
SplitButtonMinimalPerf.default 3723 3701 1.01:1
TableManyItemsPerf.default 1877 1860 1.01:1
DatepickerMinimalPerf.default 5314 5304 1:1
EmbedMinimalPerf.default 4056 4045 1:1
FlexMinimalPerf.default 275 276 1:1
ItemLayoutMinimalPerf.default 1194 1197 1:1
ProviderMinimalPerf.default 951 948 1:1
RadioGroupMinimalPerf.default 435 433 1:1
IconMinimalPerf.default 604 603 1:1
ToolbarMinimalPerf.default 914 914 1:1
TooltipMinimalPerf.default 993 989 1:1
AlertMinimalPerf.default 262 264 0.99:1
ButtonOverridesMissPerf.default 1650 1665 0.99:1
ChatDuplicateMessagesPerf.default 283 287 0.99:1
ChatWithPopoverPerf.default 344 346 0.99:1
DropdownManyItemsPerf.default 660 668 0.99:1
ListCommonPerf.default 611 616 0.99:1
ProviderMergeThemesPerf.default 1635 1647 0.99:1
SliderMinimalPerf.default 1522 1545 0.99:1
TextAreaMinimalPerf.default 479 484 0.99:1
LayoutMinimalPerf.default 343 351 0.98:1
ButtonSlotsPerf.default 520 534 0.97:1
CardMinimalPerf.default 536 551 0.97:1
RosterPerf.default 1133 1167 0.97:1
RefMinimalPerf.default 225 232 0.97:1
SkeletonMinimalPerf.default 340 349 0.97:1
VideoMinimalPerf.default 596 613 0.97:1

@@ -210,8 +210,8 @@ export const resolveStyles = (
}

if (process.env.NODE_ENV !== 'production' && isDebugEnabled) {
resolvedStylesDebug[slotName] = (resolvedStyles[slotName] as any)['_debug'];
delete (resolvedStyles[slotName] as any)['_debug'];
resolvedStylesDebug[slotName] = (resolvedStyles[slotName] as any)?.['_debug'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it would be worth a test if possible

@YuanboXue-Amber YuanboXue-Amber enabled auto-merge (squash) July 15, 2021 20:07
@YuanboXue-Amber YuanboXue-Amber merged commit 7ca92e7 into microsoft:master Jul 15, 2021
PeterDraex pushed a commit to PeterDraex/fluentui that referenced this pull request Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fluent UI react-northstar (v0) Work related to Fluent UI V0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants