-
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
Adding lib-commonjs top-level entries to exports map #24792
Conversation
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 5456327:
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: b111dddd3dab26c409857723a6e34810a60c41b2 (build) |
📊 Bundle size reportUnchanged fixtures
|
Can you expand on why this is necessary? It seems like the existing exports map already lets Node users |
Perf Analysis (
|
Scenario | Current PR Ticks | Baseline Ticks | Ratio |
---|---|---|---|
AttachmentMinimalPerf.default | 126 | 117 | 1.08:1 |
BoxMinimalPerf.default | 290 | 274 | 1.06:1 |
ButtonMinimalPerf.default | 137 | 129 | 1.06:1 |
FlexMinimalPerf.default | 244 | 230 | 1.06:1 |
GridMinimalPerf.default | 281 | 266 | 1.06:1 |
TextMinimalPerf.default | 291 | 275 | 1.06:1 |
AccordionMinimalPerf.default | 120 | 115 | 1.04:1 |
CarouselMinimalPerf.default | 383 | 370 | 1.04:1 |
ChatWithPopoverPerf.default | 299 | 288 | 1.04:1 |
HeaderSlotsPerf.default | 636 | 613 | 1.04:1 |
ListWith60ListItems.default | 522 | 500 | 1.04:1 |
SkeletonMinimalPerf.default | 287 | 275 | 1.04:1 |
AvatarMinimalPerf.default | 154 | 150 | 1.03:1 |
ButtonSlotsPerf.default | 455 | 443 | 1.03:1 |
ImageMinimalPerf.default | 321 | 312 | 1.03:1 |
ItemLayoutMinimalPerf.default | 984 | 957 | 1.03:1 |
RadioGroupMinimalPerf.default | 369 | 358 | 1.03:1 |
RefMinimalPerf.default | 181 | 176 | 1.03:1 |
SegmentMinimalPerf.default | 286 | 279 | 1.03:1 |
AttachmentSlotsPerf.default | 931 | 913 | 1.02:1 |
DialogMinimalPerf.default | 649 | 634 | 1.02:1 |
DividerMinimalPerf.default | 294 | 287 | 1.02:1 |
LayoutMinimalPerf.default | 288 | 282 | 1.02:1 |
RosterPerf.default | 1781 | 1747 | 1.02:1 |
PopupMinimalPerf.default | 527 | 518 | 1.02:1 |
PortalMinimalPerf.default | 142 | 139 | 1.02:1 |
ProviderMinimalPerf.default | 335 | 329 | 1.02:1 |
ReactionMinimalPerf.default | 312 | 307 | 1.02:1 |
AnimationMinimalPerf.default | 439 | 436 | 1.01:1 |
ChatMinimalPerf.default | 609 | 601 | 1.01:1 |
DropdownManyItemsPerf.default | 551 | 546 | 1.01:1 |
EmbedMinimalPerf.default | 3015 | 2990 | 1.01:1 |
InputMinimalPerf.default | 948 | 939 | 1.01:1 |
ListCommonPerf.default | 503 | 496 | 1.01:1 |
ListNestedPerf.default | 461 | 457 | 1.01:1 |
LoaderMinimalPerf.default | 558 | 550 | 1.01:1 |
IconMinimalPerf.default | 555 | 551 | 1.01:1 |
TableMinimalPerf.default | 326 | 323 | 1.01:1 |
ToolbarMinimalPerf.default | 770 | 762 | 1.01:1 |
CheckboxMinimalPerf.default | 1723 | 1720 | 1:1 |
DropdownMinimalPerf.default | 2255 | 2245 | 1:1 |
HeaderMinimalPerf.default | 291 | 290 | 1:1 |
MenuMinimalPerf.default | 687 | 688 | 1:1 |
MenuButtonMinimalPerf.default | 1404 | 1401 | 1:1 |
SliderMinimalPerf.default | 1306 | 1302 | 1:1 |
SplitButtonMinimalPerf.default | 3621 | 3616 | 1:1 |
TreeMinimalPerf.default | 669 | 668 | 1:1 |
ButtonOverridesMissPerf.default | 1075 | 1082 | 0.99:1 |
CardMinimalPerf.default | 437 | 440 | 0.99:1 |
ListMinimalPerf.default | 415 | 421 | 0.99:1 |
ProviderMergeThemesPerf.default | 1054 | 1060 | 0.99:1 |
StatusMinimalPerf.default | 549 | 552 | 0.99:1 |
TableManyItemsPerf.default | 1540 | 1563 | 0.99:1 |
TextAreaMinimalPerf.default | 376 | 379 | 0.99:1 |
CustomToolbarPrototype.default | 2243 | 2258 | 0.99:1 |
TooltipMinimalPerf.default | 1918 | 1939 | 0.99:1 |
VideoMinimalPerf.default | 600 | 607 | 0.99:1 |
DatepickerMinimalPerf.default | 4739 | 4822 | 0.98:1 |
FormMinimalPerf.default | 302 | 307 | 0.98:1 |
ChatDuplicateMessagesPerf.default | 231 | 237 | 0.97:1 |
LabelMinimalPerf.default | 306 | 318 | 0.96:1 |
AlertMinimalPerf.default | 212 | 228 | 0.93:1 |
TreeWith60ListItems.default | 118 | 133 | 0.89:1 |
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
BaseButton | mount | 748 | 780 | 5000 | |
Breadcrumb | mount | 2352 | 2322 | 1000 | |
Checkbox | mount | 2251 | 2233 | 5000 | |
CheckboxBase | mount | 1959 | 1950 | 5000 | |
ChoiceGroup | mount | 3819 | 3833 | 5000 | |
ComboBox | mount | 758 | 765 | 1000 | |
CommandBar | mount | 8898 | 8897 | 1000 | |
ContextualMenu | mount | 9742 | 9637 | 1000 | |
DefaultButton | mount | 930 | 940 | 5000 | |
DetailsRow | mount | 3027 | 2930 | 5000 | |
DetailsRowFast | mount | 2964 | 2931 | 5000 | |
DetailsRowNoStyles | mount | 2848 | 2828 | 5000 | |
Dialog | mount | 2560 | 2543 | 1000 | |
DocumentCardTitle | mount | 163 | 137 | 1000 | |
Dropdown | mount | 2756 | 2761 | 5000 | |
FocusTrapZone | mount | 1529 | 1512 | 5000 | |
FocusZone | mount | 1510 | 1517 | 5000 | |
IconButton | mount | 1372 | 1383 | 5000 | |
Label | mount | 324 | 319 | 5000 | |
Layer | mount | 3711 | 3701 | 5000 | |
Link | mount | 440 | 431 | 5000 | |
MenuButton | mount | 1180 | 1199 | 5000 | |
MessageBar | mount | 1896 | 1897 | 5000 | |
Nav | mount | 2648 | 2639 | 1000 | |
OverflowSet | mount | 982 | 978 | 5000 | |
Panel | mount | 2095 | 2077 | 1000 | |
Persona | mount | 814 | 824 | 1000 | |
Pivot | mount | 1110 | 1099 | 1000 | |
PrimaryButton | mount | 1062 | 1072 | 5000 | |
Rating | mount | 6634 | 6572 | 5000 | |
SearchBox | mount | 1055 | 1069 | 5000 | |
Shimmer | mount | 2495 | 2510 | 5000 | |
Slider | mount | 1679 | 1680 | 5000 | |
SpinButton | mount | 3923 | 3865 | 5000 | |
Spinner | mount | 389 | 396 | 5000 | |
SplitButton | mount | 2438 | 2422 | 5000 | |
Stack | mount | 461 | 481 | 5000 | |
StackWithIntrinsicChildren | mount | 1830 | 1827 | 5000 | |
StackWithTextChildren | mount | 4500 | 4505 | 5000 | |
SwatchColorPicker | mount | 9015 | 9097 | 5000 | |
TagPicker | mount | 1894 | 1925 | 5000 | |
TeachingBubble | mount | 76611 | 75566 | 5000 | |
Text | mount | 394 | 390 | 5000 | |
TextField | mount | 1131 | 1130 | 5000 | |
ThemeProvider | mount | 1030 | 1024 | 5000 | |
ThemeProvider | virtual-rerender | 723 | 706 | 5000 | |
ThemeProvider | virtual-rerender-with-unmount | 1703 | 1586 | 5000 | |
Toggle | mount | 719 | 723 | 5000 | |
buttonNative | mount | 110 | 107 | 5000 |
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 1304 | 1318 | 5000 | |
Button | mount | 840 | 959 | 5000 | |
FluentProvider | mount | 1477 | 1562 | 5000 | |
FluentProviderWithTheme | mount | 629 | 623 | 10 | |
FluentProviderWithTheme | virtual-rerender | 590 | 513 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 629 | 631 | 10 | |
MakeStyles | mount | 1848 | 1913 | 50000 | |
SpinButton | mount | 2531 | 2443 | 5000 |
Thanks @dzearing! Is it possible to create a changefile for fluentui/react-charting too? We are trying to upgrade it when encountering this issue. |
@spmonahan I've updated the description with a specific scenario, let me know if that clears things up. TLDR: importing our own react-experiments and react-charting will apply the cjs transform to cjs artifacts. That is, replace Removing the transform and republishing will fix this to import from /lib/ always, which will resolve. And for backwards compatibility it still seems right to allow for the |
@dzearing That makes sense. Thanks for the example! |
packages/react-charting/src/components/HeatMapChart/__snapshots__/HeatMapChart.test.tsx.snap
Outdated
Show resolved
Hide resolved
those snapshots fixes has been merged #24808, pls update your PR. ty |
change/@fluentui-react-charting-743e453a-27eb-4dbc-9715-a1eeeefa66e5.json
Show resolved
Hide resolved
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.
unblocking - there are 2 actionable that need to be done. ty
* master: (28 commits) fix: use trigger prop for aria-haspopup (microsoft#24794) chore(react-dialog): scaffold DialogContent component (microsoft#24844) chore: Northstar screener should read from screenerStates.json (microsoft#24848) applying package updates (web components) Standardize focus treatment (microsoft#24771) Divider - allow default prop override (microsoft#24840) GroupedList: fix virtualization (unstable preview) (microsoft#24460) fix: Add explicit children prop to TeachingBubble to support React 18 (microsoft#24823) feat: Adds `visible` prop to `TableCellActions` (microsoft#24831) [Northstar][Dropdown] Fix styling mutation when merging themes (microsoft#24787) fix: export `tableCellActionsClassNames` from unstable (microsoft#24830) bugfix(react-dialog): Adds color style to DialogSurface (microsoft#24832) applying package updates Prevent group toggling from selecting the whole group (microsoft#24822) feat(react-textarea): Add shadow variant of filled appearance (microsoft#24512) applying package updates Adding lib-commonjs top-level entries to exports map (microsoft#24792) Created shim packages (microsoft#24780) feat(react-menu): replace keydown handlers by useARIAButtonShorthand on MenuItem (microsoft#24738) fix: update version mismatches triggered by v9 release (microsoft#24812) ...
This change adds
lib-commonjs
entries to the@fluentui/react
exports map. It also disables the now-obsolete transform which is renaming/lib/
to/lib-commonjs/
for cjs files. Requiring a/lib/
top level entry should direct to the appropriate module format, thanks to the exports map.There are 2 cases where
@fluentui/react/lib-commonjs/*
imports are used:lib-commonjs
paths.The specific case where a partner hit this was in this jest cjs module:
This will cause the cjs
index.js
entry to be resolved. This traverses to a file which imports@fluentui/lib/Utilities
. Our transform would have renamed this to/lib-commonjs/Utilities
in the cjs source, which isn't a valid import.Removing the postprocess-commonjs task means that the import stays
/lib/Utilities
, which can be redirected to cjs or esm thanks to the exports map.But also, we're adding
/lib-commonjs/*
entries to the exports map. If charting package doesn't get re-published (it won't without a change file), it will still try and import this path. Now with the updated exports map, this will direct to the right path.