-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: strip comments for JSX pragma #29145
fix: strip comments for JSX pragma #29145
Conversation
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
InfoButton | mount | 15 | 15 | 5000 | Possible regression |
All results
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 605 | 651 | 5000 | |
Button | mount | 306 | 316 | 5000 | |
Field | mount | 1106 | 1082 | 5000 | |
FluentProvider | mount | 704 | 696 | 5000 | |
FluentProviderWithTheme | mount | 76 | 79 | 10 | |
FluentProviderWithTheme | virtual-rerender | 75 | 78 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 78 | 71 | 10 | |
InfoButton | mount | 15 | 15 | 5000 | Possible regression |
MakeStyles | mount | 855 | 867 | 50000 | |
Persona | mount | 1682 | 1706 | 5000 | |
SpinButton | mount | 1389 | 1346 | 5000 |
Perf Analysis (
|
Scenario | Current PR Ticks | Baseline Ticks | Ratio |
---|---|---|---|
TreeWith60ListItems.default | 89 | 74 | 1.2:1 |
AvatarMinimalPerf.default | 115 | 102 | 1.13:1 |
ButtonMinimalPerf.default | 94 | 86 | 1.09:1 |
LayoutMinimalPerf.default | 207 | 190 | 1.09:1 |
PortalMinimalPerf.default | 88 | 82 | 1.07:1 |
TextMinimalPerf.default | 194 | 182 | 1.07:1 |
RadioGroupMinimalPerf.default | 263 | 247 | 1.06:1 |
TableManyItemsPerf.default | 1133 | 1070 | 1.06:1 |
GridMinimalPerf.default | 189 | 180 | 1.05:1 |
AnimationMinimalPerf.default | 294 | 283 | 1.04:1 |
CheckboxMinimalPerf.default | 1149 | 1108 | 1.04:1 |
ListMinimalPerf.default | 317 | 306 | 1.04:1 |
PopupMinimalPerf.default | 353 | 338 | 1.04:1 |
RefMinimalPerf.default | 111 | 107 | 1.04:1 |
SegmentMinimalPerf.default | 196 | 189 | 1.04:1 |
TextAreaMinimalPerf.default | 288 | 277 | 1.04:1 |
TreeMinimalPerf.default | 492 | 471 | 1.04:1 |
AttachmentMinimalPerf.default | 89 | 86 | 1.03:1 |
BoxMinimalPerf.default | 195 | 190 | 1.03:1 |
ButtonOverridesMissPerf.default | 644 | 628 | 1.03:1 |
ButtonSlotsPerf.default | 317 | 308 | 1.03:1 |
ChatMinimalPerf.default | 431 | 418 | 1.03:1 |
ChatWithPopoverPerf.default | 199 | 193 | 1.03:1 |
HeaderSlotsPerf.default | 462 | 449 | 1.03:1 |
InputMinimalPerf.default | 547 | 533 | 1.03:1 |
MenuMinimalPerf.default | 503 | 489 | 1.03:1 |
SkeletonMinimalPerf.default | 204 | 199 | 1.03:1 |
SliderMinimalPerf.default | 743 | 723 | 1.03:1 |
SplitButtonMinimalPerf.default | 2298 | 2231 | 1.03:1 |
EmbedMinimalPerf.default | 1880 | 1835 | 1.02:1 |
ListWith60ListItems.default | 370 | 363 | 1.02:1 |
ProviderMergeThemesPerf.default | 658 | 644 | 1.02:1 |
ProviderMinimalPerf.default | 205 | 201 | 1.02:1 |
StatusMinimalPerf.default | 392 | 385 | 1.02:1 |
DatepickerMinimalPerf.default | 3485 | 3456 | 1.01:1 |
IconMinimalPerf.default | 400 | 395 | 1.01:1 |
DropdownMinimalPerf.default | 1412 | 1410 | 1:1 |
ItemLayoutMinimalPerf.default | 696 | 695 | 1:1 |
LabelMinimalPerf.default | 216 | 217 | 1:1 |
ListCommonPerf.default | 386 | 385 | 1:1 |
MenuButtonMinimalPerf.default | 954 | 957 | 1:1 |
TableMinimalPerf.default | 231 | 230 | 1:1 |
AlertMinimalPerf.default | 152 | 154 | 0.99:1 |
DialogMinimalPerf.default | 434 | 440 | 0.99:1 |
DropdownManyItemsPerf.default | 383 | 388 | 0.99:1 |
FlexMinimalPerf.default | 150 | 152 | 0.99:1 |
CustomToolbarPrototype.default | 1465 | 1481 | 0.99:1 |
ToolbarMinimalPerf.default | 520 | 525 | 0.99:1 |
ChatDuplicateMessagesPerf.default | 145 | 148 | 0.98:1 |
DividerMinimalPerf.default | 201 | 206 | 0.98:1 |
ListNestedPerf.default | 317 | 325 | 0.98:1 |
RosterPerf.default | 1515 | 1541 | 0.98:1 |
ReactionMinimalPerf.default | 205 | 209 | 0.98:1 |
VideoMinimalPerf.default | 418 | 427 | 0.98:1 |
CardMinimalPerf.default | 302 | 311 | 0.97:1 |
HeaderMinimalPerf.default | 207 | 213 | 0.97:1 |
TooltipMinimalPerf.default | 1215 | 1247 | 0.97:1 |
CarouselMinimalPerf.default | 246 | 256 | 0.96:1 |
FormMinimalPerf.default | 220 | 228 | 0.96:1 |
LoaderMinimalPerf.default | 184 | 192 | 0.96:1 |
AttachmentSlotsPerf.default | 604 | 638 | 0.95:1 |
AccordionMinimalPerf.default | 83 | 88 | 0.94:1 |
ImageMinimalPerf.default | 204 | 226 | 0.9:1 |
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 beeab0f:
|
🕵 fluentuiv8 No visual regressions between this PR and main |
🕵 FluentUIV0 No visual regressions between this PR and main |
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 3bf2de945735d2464b4aa4fcfccbf636a74651ef (build) |
🕵 fluentuiv9 No visual regressions between this PR and main |
If it's a problem we can fix it later - more important we should fix failing builds for our users |
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
BaseButton | mount | 636 | 637 | 5000 | |
Breadcrumb | mount | 1655 | 1661 | 1000 | |
Checkbox | mount | 1703 | 1696 | 5000 | |
CheckboxBase | mount | 1472 | 1489 | 5000 | |
ChoiceGroup | mount | 2884 | 2930 | 5000 | |
ComboBox | mount | 645 | 641 | 1000 | |
CommandBar | mount | 6218 | 6254 | 1000 | |
ContextualMenu | mount | 11667 | 12286 | 1000 | |
DefaultButton | mount | 748 | 755 | 5000 | |
DetailsRow | mount | 2178 | 2203 | 5000 | |
DetailsRowFast | mount | 2201 | 2205 | 5000 | |
DetailsRowNoStyles | mount | 2011 | 2043 | 5000 | |
Dialog | mount | 2661 | 2778 | 1000 | |
DocumentCardTitle | mount | 219 | 231 | 1000 | |
Dropdown | mount | 2002 | 1967 | 5000 | |
FocusTrapZone | mount | 1123 | 1102 | 5000 | |
FocusZone | mount | 1052 | 1072 | 5000 | |
GroupedList | mount | 41053 | 40967 | 2 | |
GroupedList | virtual-rerender | 19567 | 19438 | 2 | |
GroupedList | virtual-rerender-with-unmount | 50308 | 50585 | 2 | |
GroupedListV2 | mount | 229 | 234 | 2 | |
GroupedListV2 | virtual-rerender | 210 | 208 | 2 | |
GroupedListV2 | virtual-rerender-with-unmount | 233 | 231 | 2 | |
IconButton | mount | 1122 | 1077 | 5000 | |
Label | mount | 339 | 336 | 5000 | |
Layer | mount | 2752 | 2749 | 5000 | |
Link | mount | 394 | 384 | 5000 | |
MenuButton | mount | 929 | 949 | 5000 | |
MessageBar | mount | 21779 | 21670 | 5000 | |
Nav | mount | 1955 | 1940 | 1000 | |
OverflowSet | mount | 766 | 762 | 5000 | |
Panel | mount | 1820 | 1766 | 1000 | |
Persona | mount | 752 | 727 | 1000 | |
Pivot | mount | 873 | 871 | 1000 | |
PrimaryButton | mount | 860 | 833 | 5000 | |
Rating | mount | 4630 | 4597 | 5000 | |
SearchBox | mount | 936 | 917 | 5000 | |
Shimmer | mount | 1895 | 1879 | 5000 | |
Slider | mount | 1299 | 1298 | 5000 | |
SpinButton | mount | 2851 | 2861 | 5000 | |
Spinner | mount | 391 | 381 | 5000 | |
SplitButton | mount | 1847 | 1840 | 5000 | |
Stack | mount | 396 | 414 | 5000 | |
StackWithIntrinsicChildren | mount | 852 | 853 | 5000 | |
StackWithTextChildren | mount | 2606 | 2581 | 5000 | |
SwatchColorPicker | mount | 6102 | 6185 | 5000 | |
TagPicker | mount | 1484 | 1487 | 5000 | |
Text | mount | 375 | 377 | 5000 | |
TextField | mount | 951 | 927 | 5000 | |
ThemeProvider | mount | 817 | 826 | 5000 | |
ThemeProvider | virtual-rerender | 593 | 587 | 5000 | |
ThemeProvider | virtual-rerender-with-unmount | 1294 | 1280 | 5000 | |
Toggle | mount | 617 | 616 | 5000 | |
buttonNative | mount | 185 | 194 | 5000 |
@@ -43,14 +43,19 @@ async function swcTransform(options: Options) { | |||
outputPath, | |||
}); | |||
|
|||
// Strip @jsx comments, see https://github.com/microsoft/fluentui/issues/29126 |
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.
heads up that using @jsx
in a comment without it actually being a jsx pragma directive is causing eslint-plugin-react to crash, which is something we need to fix. See jsx-eslint/eslint-plugin-react#3632.
Feel free in the meantime to avoid having @
and jsx
next to each other in this comment if that ends up causing you any trouble :-)
Previous Behavior
We started to use new JSX pragma via comments, for example:
fluentui/packages/react-components/react-image/src/components/Image/renderImage.tsx
Lines 1 to 2 in 3bf2de9
The problem is that these comments appeared in our artifacts:
And it causes issues if Babel is used on
node_modules
, see #29126 (comment)New Behavior
These comments are removed during build. No comments => no problems.
Note: I haven't checked if sourcemaps still work after this change.
Related Issue(s)
Fixes #29126