-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Expand @fluentui/react root index file's export *s to uncover and fix duplicate exports. #25545
Conversation
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 65b289ef0e47b684365058f16b50587a5fae8633 (build) |
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 4474f53:
|
📊 Bundle size reportUnchanged fixtures
|
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
BaseButton | mount | 1182 | 1177 | 5000 | |
Breadcrumb | mount | 2801 | 2762 | 1000 | |
Checkbox | mount | 2646 | 2644 | 5000 | |
CheckboxBase | mount | 2368 | 2368 | 5000 | |
ChoiceGroup | mount | 4308 | 4304 | 5000 | |
ComboBox | mount | 1169 | 1181 | 1000 | |
CommandBar | mount | 9229 | 9242 | 1000 | |
ContextualMenu | mount | 10032 | 10056 | 1000 | |
DefaultButton | mount | 1349 | 1353 | 5000 | |
DetailsRow | mount | 3385 | 3335 | 5000 | |
DetailsRowFast | mount | 3377 | 3343 | 5000 | |
DetailsRowNoStyles | mount | 3252 | 3245 | 5000 | |
Dialog | mount | 2919 | 2967 | 1000 | |
DocumentCardTitle | mount | 580 | 586 | 1000 | |
Dropdown | mount | 3171 | 3150 | 5000 | |
FocusTrapZone | mount | 1973 | 1986 | 5000 | |
FocusZone | mount | 1923 | 1937 | 5000 | |
GroupedList | mount | 1810 | 2048 | 2 | |
GroupedList | virtual-rerender | 1103 | 1100 | 2 | |
GroupedList | virtual-rerender-with-unmount | 1589 | 1579 | 2 | |
GroupedListV2 | mount | 571 | 547 | 2 | |
GroupedListV2 | virtual-rerender | 524 | 544 | 2 | |
GroupedListV2 | virtual-rerender-with-unmount | 557 | 571 | 2 | |
IconButton | mount | 1784 | 1813 | 5000 | |
Label | mount | 747 | 762 | 5000 | |
Layer | mount | 4206 | 4154 | 5000 | |
Link | mount | 860 | 874 | 5000 | |
MenuButton | mount | 1628 | 1623 | 5000 | |
MessageBar | mount | 2394 | 2315 | 5000 | |
Nav | mount | 3081 | 3061 | 1000 | |
OverflowSet | mount | 1420 | 1429 | 5000 | |
Panel | mount | 2498 | 2531 | 1000 | |
Persona | mount | 1261 | 1265 | 1000 | |
Pivot | mount | 1503 | 1518 | 1000 | |
PrimaryButton | mount | 1476 | 1487 | 5000 | |
Rating | mount | 6973 | 6978 | 5000 | |
SearchBox | mount | 1481 | 1488 | 5000 | |
Shimmer | mount | 2900 | 2937 | 5000 | |
Slider | mount | 2109 | 2112 | 5000 | |
SpinButton | mount | 4390 | 4278 | 5000 | |
Spinner | mount | 821 | 821 | 5000 | |
SplitButton | mount | 2833 | 2855 | 5000 | |
Stack | mount | 865 | 871 | 5000 | |
StackWithIntrinsicChildren | mount | 2363 | 2346 | 5000 | |
StackWithTextChildren | mount | 5028 | 5058 | 5000 | |
SwatchColorPicker | mount | 9481 | 9423 | 5000 | |
TagPicker | mount | 2359 | 2384 | 5000 | |
TeachingBubble | mount | 73698 | 73706 | 5000 | |
Text | mount | 823 | 815 | 5000 | |
TextField | mount | 1551 | 1541 | 5000 | |
ThemeProvider | mount | 1450 | 1458 | 5000 | |
ThemeProvider | virtual-rerender | 1134 | 1135 | 5000 | |
ThemeProvider | virtual-rerender-with-unmount | 1998 | 1990 | 5000 | |
Toggle | mount | 1109 | 1132 | 5000 | |
buttonNative | mount | 545 | 530 | 5000 |
I believe this is done in v9. See #22099 |
|
while that might work the DX would far from ideal. we have rule for this. I'd suggest to enable similar to |
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.
following things need to be adressed before merging:
- eslint plugin config needed
- proper resolution of deprecation lints
Updated react-legacy lint config to set export * to warn. |
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 1280 | 1277 | 5000 | |
Button | mount | 915 | 924 | 5000 | |
FluentProvider | mount | 1466 | 1495 | 5000 | |
FluentProviderWithTheme | mount | 573 | 583 | 10 | |
FluentProviderWithTheme | virtual-rerender | 536 | 543 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 572 | 586 | 10 | |
MakeStyles | mount | 1925 | 1945 | 50000 | |
SpinButton | mount | 2327 | 2352 | 5000 |
Perf Analysis (
|
Scenario | Current PR Ticks | Baseline Ticks | Ratio |
---|---|---|---|
SkeletonMinimalPerf.default | 318 | 291 | 1.09:1 |
FormMinimalPerf.default | 345 | 321 | 1.07:1 |
TreeWith60ListItems.default | 134 | 127 | 1.06:1 |
TextMinimalPerf.default | 314 | 299 | 1.05:1 |
ButtonMinimalPerf.default | 142 | 137 | 1.04:1 |
HeaderMinimalPerf.default | 324 | 313 | 1.04:1 |
LabelMinimalPerf.default | 349 | 335 | 1.04:1 |
PortalMinimalPerf.default | 147 | 142 | 1.04:1 |
ReactionMinimalPerf.default | 339 | 325 | 1.04:1 |
CarouselMinimalPerf.default | 368 | 356 | 1.03:1 |
RadioGroupMinimalPerf.default | 403 | 393 | 1.03:1 |
SegmentMinimalPerf.default | 314 | 306 | 1.03:1 |
SliderMinimalPerf.default | 1262 | 1230 | 1.03:1 |
TextAreaMinimalPerf.default | 426 | 413 | 1.03:1 |
VideoMinimalPerf.default | 623 | 607 | 1.03:1 |
AvatarMinimalPerf.default | 168 | 165 | 1.02:1 |
ButtonOverridesMissPerf.default | 1044 | 1028 | 1.02:1 |
ChatDuplicateMessagesPerf.default | 222 | 218 | 1.02:1 |
DividerMinimalPerf.default | 317 | 311 | 1.02:1 |
DropdownManyItemsPerf.default | 554 | 542 | 1.02:1 |
LayoutMinimalPerf.default | 318 | 311 | 1.02:1 |
LoaderMinimalPerf.default | 267 | 261 | 1.02:1 |
MenuMinimalPerf.default | 748 | 733 | 1.02:1 |
PopupMinimalPerf.default | 574 | 563 | 1.02:1 |
ProviderMinimalPerf.default | 331 | 323 | 1.02:1 |
BoxMinimalPerf.default | 302 | 298 | 1.01:1 |
ChatMinimalPerf.default | 653 | 649 | 1.01:1 |
DropdownMinimalPerf.default | 2210 | 2187 | 1.01:1 |
EmbedMinimalPerf.default | 2675 | 2650 | 1.01:1 |
FlexMinimalPerf.default | 255 | 253 | 1.01:1 |
ListWith60ListItems.default | 506 | 502 | 1.01:1 |
RosterPerf.default | 1737 | 1718 | 1.01:1 |
RefMinimalPerf.default | 191 | 189 | 1.01:1 |
TableManyItemsPerf.default | 1610 | 1597 | 1.01:1 |
CustomToolbarPrototype.default | 2263 | 2250 | 1.01:1 |
ToolbarMinimalPerf.default | 808 | 798 | 1.01:1 |
ButtonSlotsPerf.default | 431 | 432 | 1:1 |
CardMinimalPerf.default | 469 | 470 | 1:1 |
CheckboxMinimalPerf.default | 1548 | 1541 | 1:1 |
DialogMinimalPerf.default | 696 | 697 | 1:1 |
HeaderSlotsPerf.default | 680 | 680 | 1:1 |
InputMinimalPerf.default | 862 | 862 | 1:1 |
ListNestedPerf.default | 474 | 472 | 1:1 |
ProviderMergeThemesPerf.default | 1007 | 1012 | 1:1 |
SplitButtonMinimalPerf.default | 3307 | 3303 | 1:1 |
StatusMinimalPerf.default | 618 | 616 | 1:1 |
TooltipMinimalPerf.default | 1925 | 1923 | 1:1 |
AnimationMinimalPerf.default | 470 | 473 | 0.99:1 |
AttachmentSlotsPerf.default | 870 | 877 | 0.99:1 |
DatepickerMinimalPerf.default | 4984 | 5032 | 0.99:1 |
ImageMinimalPerf.default | 348 | 352 | 0.99:1 |
ListMinimalPerf.default | 465 | 470 | 0.99:1 |
MenuButtonMinimalPerf.default | 1385 | 1395 | 0.99:1 |
TreeMinimalPerf.default | 710 | 714 | 0.99:1 |
AlertMinimalPerf.default | 227 | 232 | 0.98:1 |
ItemLayoutMinimalPerf.default | 970 | 992 | 0.98:1 |
ListCommonPerf.default | 518 | 527 | 0.98:1 |
IconMinimalPerf.default | 567 | 576 | 0.98:1 |
TableMinimalPerf.default | 359 | 365 | 0.98:1 |
AttachmentMinimalPerf.default | 125 | 129 | 0.97:1 |
GridMinimalPerf.default | 293 | 301 | 0.97:1 |
ChatWithPopoverPerf.default | 294 | 305 | 0.96:1 |
AccordionMinimalPerf.default | 124 | 135 | 0.92:1 |
Will this break folks who may have specific imports to specify which export they depend on? I've seen some partners with specific esbuild config to resolve import issues and wonder if they will need to delete their workaround. |
@GeoffCoxMSFT I don't see this affecting anything with specific imports. It only affects the root index, and even then should not change any api surface. Before: After: Does not affect top-level export files at all. |
@@ -10,4 +10,13 @@ module.exports = { | |||
'jsdoc/check-tag-names': 'off', | |||
'@griffel/no-shorthands': 'off', | |||
}, | |||
overrides: [ |
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.
this should go to configs/base-legacy.js
as it has nothing specific with react
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.
one more change needed
config in packages/eslint-plugin/src/configs/react-legacy.js
should go to packages/eslint-plugin/src/configs/base-legacy.js
.
ty!
* stress-test: add "afterframe" dependency (microsoft#25560) Previously stress-test used a "requestPostAnimationFrame" function that is used to measure from just before style recalc, layout and paint are executed to just afterward. This change drops that function in favor of taking a dependency on afterframe, a library that does the same thing. * Fix: Update tabs to remain the same size between unselected and selected states (microsoft#25542) * Add support to keep tabs from changing size when selected * Update for naming and tests * Rename update * Update packages/react-components/react-tabs/src/components/TabList/TabList.types.ts Co-authored-by: Sean Monahan <[email protected]> Co-authored-by: Sean Monahan <[email protected]> * chore: Add reduced-motion documentation to Spinner (microsoft#25561) * chore: Add reduced-motion documentation to Spinner * change file * chore: Add documentation to Progress about reduced-motion (microsoft#25563) * chore: Add documentation to Progress about reduced-motion * change file * stress-test: disable CSS transitions on injected styles (microsoft#25559) This addresses an issue where Firefox's style recalculation measurement becomes unstable when controls under test have CSS transitions. Specifically, our test injects styles that update the background color of selected controls and many Fluent controls transition the background color for different states like "hover" and "focus". With transitions running Firefox will sometimes include the transition time in the style recalc measurement and sometimes not. Additionally, Chromium browsers never include the transition time in the measurement. Disabling transitions ensures measurement behavior is consistent in Firefox and in alignment with the behavior of Chromium browsers. * docs(rfcs): add triage automation rfc (microsoft#24817) * chore: update beachball ignore list to apply to new project structure (microsoft#25531) * bugfix(react-switch): adds line-height=0 to switch indicator slot (microsoft#25507) * chore: add both options to useArrowNavigationGroup (microsoft#25568) * chore: add both options to useArrowNavigationGroup * chore: add changes * chore: update api * chore(vr-tests-v9): Convert Dialog and Image VR tests to CSF (microsoft#25527) * chore: toolbar a11y improvements (microsoft#25562) * feat: create vertical example * chore: add navigation arrows for vertical scenario * chore: add labels for all toolbar stories * chore: update tooltip example * chore: update radio example * chore: update toolbar stories examples * chore: add changes * chore: use both in toolbar arrow key nav * chore: update snapshot * chore(react-dialog): migrate to new package structure (microsoft#25523) Co-authored-by: Oleksandr Fediashov <[email protected]> * chore(react-overflow): migrate to new package structure (microsoft#25524) * Expand @fluentui/react root index file's export *s to uncover and fix duplicate exports. (microsoft#25545) * expanding index. * change. * Replacing with inline deprecation exclusions. * setting export * to warning. * change. * moving rules around. * fix: v9 form controls with underline should have underline-specific disabled styling (microsoft#25543) Updates disabled form styling for Input, Select, Spinbutton, Combobox, and Dropdown * docs(public-docsite-v9): Adding a basic setup section to the SSR docs (microsoft#25564) * applying package updates * update regex * updatE * Update azure-pipelines.vrt-baseline.yml for Azure Pipelines * Update azure-pipelines.vrt-baseline.yml for Azure Pipelines * chore(deps): bump loader-utils from 2.0.0 to 2.0.3 (microsoft#25567) Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.0 to 2.0.3. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.3/CHANGELOG.md) - [Commits](webpack/loader-utils@v2.0.0...v2.0.3) --- updated-dependencies: - dependency-name: loader-utils dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: migrate @types/node to 14 to align with our supported node version (microsoft#25510) * chore(deps): resolve only to 1 @types/node version to mitigate global leaks and api-generation errors * fix(bundle-size): fix type errors exposed by node 14 typings * fix(tools): fix type errors exposed by node 14 typings * fix(typings): fix type errors exposed by node 14 typings * revert: use resolution for @types/node * chore(ts-minbar-test-react): use @types/node 14 explicitly * generate changefiles * chore: dedupe deps * fix(scripts): fix type errors exposed by node 14 typings * test: replace deprecated module.parent with require.main within isConformance * generate changefiles * test(react): clean up persona-coin test and use isConformant without side-effects * fix(storybook): fix theme picker current selection (microsoft#25533) * update * chore(vr-tests-v9): Convert Accordion VR tests to CSF (microsoft#25525) * fix: Update Avatar active ring color to match base color (microsoft#25497) * RFC: Field Package Layout (microsoft#25380) * Feature: Added large tab size to react-tabs (microsoft#25577) * Added large tab size * yarn change * Update vr-tests * Code review fix * feat(react-infobutton): Adding size prop, HCM styles, and updating styles to match design spec (microsoft#25519) * updating styles and adding size prop * updating comment * adding requested changes * fix: Adding expanded styles for MenuButtons and making various other styling fixes for Button components (microsoft#25521) * fix: Adding expanded styles for MenuButtons and making various other styling fixes for Button components. * Adding change file. * Addressing PR feedback. Co-authored-by: KHMakoto <[email protected]> * chore: Clean up Field tests and story imports in preparation of moving to individual packages (microsoft#25594) * Remove custom `isConformant` function for Field tests, and instead inline the customizations in each call to `isConformant` * Disable the `exported-top-level` test because the components will be exported as e.g. `InputField_unstable` from the component packages. * Change the stories to import from `@fluentui/react-components/unstable`, instead of the individual package. * Rename the `FieldComponent` type to `FieldControl` to correspond to the `control` slot name. * Tabs icon toggle (microsoft#25597) * Added regular filled icon toggling * yarn change * chore: Refactor Field components into the base component's package (microsoft#25593) Move Field components into their respective packages, as discussed in RFC microsoft#25380 * Update Component Implementation Epic template (microsoft#25480) * update to use vrscreenshotdiff beta * change lock file * update package version * applying package updates * update pr pipeline to add v8 * PR to add tasks in pipeline for v9 VRT integration (microsoft#25606) * fix: create valid export maps (microsoft#25558) * generate changefiles * chore(deps): bump socket.io-parser from 4.0.4 to 4.0.5 (microsoft#25604) Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.0.4 to 4.0.5. - [Release notes](https://github.com/socketio/socket.io-parser/releases) - [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md) - [Commits](socketio/socket.io-parser@4.0.4...4.0.5) --- updated-dependencies: - dependency-name: socket.io-parser dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(react-dialog): removes unnecessary union case for DialogOpenChangeData (microsoft#25504) * templatize * update * templatize * updatE * refactor(scripts): remove deprecated exec abstractions (microsoft#25569) * fix(scripts): make eslint run again on pre-commit (microsoft#25537) * feat(react-components): Move AvatarGroup to stable (microsoft#25005) * update * update version * run partial tests * update * update * update * update * update * update * updatE * updatE * update version * update lock file * update name * update version * add quotes * docs: refactor Text documentation and add missing guidance for presets/alignment (microsoft#25587) Fixes microsoft#24341 Fixes microsoft#25548 * update * package version * fix(react-menu): remove unwanted aria attributes on context menu (microsoft#25615) * fix(react-menu): remove unwanted aria attributes on context menu * chore: updates trigger selector for cypress tests * remove unwanted param * update * applying package updates * convert * checkpoint * add regex * change convert script * updates * update sw version Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Sean Monahan <[email protected]> Co-authored-by: Geoff Cox (Microsoft) <[email protected]> Co-authored-by: tomi-msft <[email protected]> Co-authored-by: Martin Hochel <[email protected]> Co-authored-by: Bernardo Sunderhus <[email protected]> Co-authored-by: chajun <[email protected]> Co-authored-by: Tristan Watanabe <[email protected]> Co-authored-by: Oleksandr Fediashov <[email protected]> Co-authored-by: David Zearing <[email protected]> Co-authored-by: Sarah Higley <[email protected]> Co-authored-by: Esteban Munoz Facusse <[email protected]> Co-authored-by: Fluent UI Build <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tudor Popa <[email protected]> Co-authored-by: Ben Howell <[email protected]> Co-authored-by: Makoto Morimoto <[email protected]> Co-authored-by: KHMakoto <[email protected]> Co-authored-by: Marcos Moura <[email protected]>
… duplicate exports. (microsoft#25545) * expanding index. * change. * Replacing with inline deprecation exclusions. * setting export * to warning. * change. * moving rules around.
… duplicate exports. (microsoft#25545) * expanding index. * change. * Replacing with inline deprecation exclusions. * setting export * to warning. * change. * moving rules around.
Repro
date-time-utilities
.DayOfWeek
from bundle.Current Behavior
It's not exported because there are multiple paths to the external library, and esbuild gives up trying to dedupe across external boundaries.
New Behavior
Due to expanding the root barrel index.ts star exports, paths to the exported things are now straightened out and you can now import
DayOfWeek
from the resulting bundle.Notes
{namedThing} from './SomeTopLevelThing'
could translate to more nested export * ambiguity deeper int the tree, without getting rid of all export *s in sub-level barrel files. I'm minimizing the change here, and so far I don't see a need to go beyond the root. In v9 hopefully export * is totally disallowed, because it causes problems downstream. Better to be explicit.Related Issue(s)
See issue: evanw/esbuild#2658