-
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
chore(bundle-size): extract classname consts to separate files #13145
Conversation
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Perf comparison
Perf tests with no regressions
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 446bf39dcf55c1a306c9e9674960f8c0027c71c9 (build) |
# Conflicts: # packages/fluentui/react-northstar/src/components/Dropdown/DropdownSelectedItem.tsx # packages/fluentui/react-northstar/src/themes/teams/components/Dropdown/dropdownSelectedItemStyles.ts
@mnajdova Is this intended to be checked in or is it just for demo purposes? If it's just a demo and is no longer needed we should close it. |
This pull request has been automatically marked as stale because it was marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 5 days of this comment. Thank you for your contributions to Fluent UI! |
This PR is experimenting with some optimization for the bundle size. I was doing some investigation of why for an application with one Button we are dragging all components in the bundle. The reason was quite surprising - because we are importing the constants for the classNames and slot's classNames from the component's file. Just extracting these constants to a separate file, removed the components from the bundle. This PR is showcasing the dropping of the Dropdown components from the bundle.
Before:

After:

We should probably do some more deeper investigation of why this is happening, and whether this is the default behavior of webpack (as one representative of the bundlers), but this seems like a low hanging fruit for dropping the bundle size for sure.