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

Added exports to material-ui-icons package.json #26264

Closed
wants to merge 2 commits into from

Conversation

jollytoad
Copy link

@jollytoad jollytoad commented May 12, 2021

Fixes #26254

Copy link

@guybedford guybedford left a comment

Choose a reason for hiding this comment

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

There is one breaking change to note about this PR and that is that require('material-ui-icons/x.js') would no longer work with this merged as it would only work without the extension.

As a result it may be sensible to make this PR as part of a major upgrade to this library.

@@ -64,5 +64,8 @@
},
"engines": {
"node": ">=8.0.0"
},
"exports": {
"./*": "./*.js"
Copy link

@guybedford guybedford May 12, 2021

Choose a reason for hiding this comment

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

The main should likely remain included. For backwards compat it can be useful to export the package.json. Perhaps include the ES versions as well. Then you can use null entries to avoid the repeated entries:

Suggested change
"./*": "./*.js"
".": "./index.js",
"./package.json": "./package.json",
"./index": null,
"./es/*": null,
"./*": {
"require": "./*.js",
"import": "./es/*.js"

@mui-pr-bot
Copy link

mui-pr-bot commented May 12, 2021

Details of bundle changes.

Comparing: d7993b5...eff69e9

Details of page changes
bundle Size Change Size Gzip Change Gzip
/components/grid ▲ +100 B (+0.31% ) 32.7 kB -- -1 B
/components/button-group ▲ +10 B (+0.13% ) 8 kB -- -1 B
/getting-started/templates/album ▲ +10 B (+0.18% ) 5.57 kB -- -1 B
/getting-started/templates/blog ▲ +10 B (+0.13% ) 7.44 kB -- -1 B
/getting-started/templates/pricing ▲ +10 B (+0.13% ) 7.78 kB -- -1 B
/getting-started/templates/sign-in-side ▲ +10 B (+0.12% ) 8.21 kB -- -1 B
/performance/table-emotion ▼ -10 B (-0.12% ) 8.49 kB -- -1 B
/premium-themes/onepirate/sign-up ▲ +10 B (+0.89% ) 1.13 kB -- -1 B
/system/palette ▲ +10 B (+0.24% ) 4.16 kB -- -1 B
/_app -- 36.9 kB -- -1 B
/api-docs/accordion-actions -- 1.48 kB -- -1 B
/api-docs/accordion-details -- 1.4 kB -- -1 B
/api-docs/accordion-summary -- 1.7 kB -- -1 B
/api-docs/accordion -- 1.97 kB -- -1 B
/api-docs/alert-title -- 1.4 kB -- -1 B
/api-docs/alert -- 2.4 kB -- -1 B
/api-docs/app-bar -- 1.94 kB -- -1 B
/api-docs/autocomplete -- 4.62 kB -- -1 B
/api-docs/avatar-group -- 1.51 kB -- -1 B
/api-docs/avatar -- 1.88 kB -- -1 B
/api-docs/backdrop -- 1.73 kB -- -1 B
/api-docs/badge -- 2.13 kB -- -1 B
/api-docs/bottom-navigation-action -- 1.81 kB -- -1 B
/api-docs/bottom-navigation -- 1.7 kB -- -1 B
/api-docs/breadcrumbs -- 1.79 kB -- -1 B
/api-docs/button-base -- 2.22 kB -- -1 B
/api-docs/button-group -- 2.22 kB -- -1 B
/api-docs/button -- 2.53 kB -- -1 B
/api-docs/card-action-area -- 1.58 kB -- -1 B
/api-docs/card-actions -- 1.47 kB -- -1 B
/api-docs/card-content -- 1.45 kB -- -1 B
/api-docs/card-header -- 1.78 kB -- -1 B
/api-docs/card-media -- 1.69 kB -- -1 B
/api-docs/card -- 1.5 kB -- -1 B
/api-docs/checkbox -- 2.3 kB -- -1 B
/api-docs/chip -- 2.46 kB -- -1 B
/api-docs/circular-progress -- 2.09 kB -- -1 B
/api-docs/click-away-listener -- 1.45 kB -- -1 B
/api-docs/collapse -- 2.13 kB -- -1 B
/api-docs/container -- 1.83 kB -- -1 B
/api-docs/css-baseline -- 1.4 kB -- -1 B
/api-docs/dialog-actions -- 1.47 kB -- -1 B
/api-docs/dialog-content-text -- 1.48 kB -- -1 B
/api-docs/dialog-content -- 1.45 kB -- -1 B
/api-docs/dialog-title -- 1.49 kB -- -1 B
/api-docs/dialog -- 2.74 kB -- -1 B
/api-docs/divider -- 1.81 kB -- -1 B
/api-docs/drawer -- 2.13 kB -- -1 B
/api-docs/expansion-panel-actions -- 1.55 kB -- -1 B
/api-docs/expansion-panel-details -- 1.47 kB -- -1 B
/api-docs/expansion-panel-summary -- 1.84 kB -- -1 B
/api-docs/expansion-panel -- 2.04 kB -- -1 B
/api-docs/fab -- 2.1 kB -- -1 B
/api-docs/fade -- 1.5 kB -- -1 B
/api-docs/filled-input -- 2.87 kB -- -1 B
/api-docs/form-control-label -- 1.99 kB -- -1 B
/api-docs/form-control -- 2.36 kB -- -1 B
/api-docs/form-group -- 1.55 kB -- -1 B
/api-docs/form-helper-text -- 1.91 kB -- -1 B
/api-docs/form-label -- 1.84 kB -- -1 B
/api-docs/grid-list-tile-bar -- 1.8 kB -- -1 B
/api-docs/grid-list-tile -- 1.73 kB -- -1 B
/api-docs/grid-list -- 1.63 kB -- -1 B
/api-docs/grid -- 2.56 kB -- -1 B
/api-docs/grow -- 1.55 kB -- -1 B
/api-docs/hidden -- 1.53 kB -- -1 B
/api-docs/icon-button -- 2.07 kB -- -1 B
/api-docs/icon -- 1.78 kB -- -1 B
/api-docs/input-adornment -- 1.95 kB -- -1 B
/api-docs/input-base -- 2.95 kB -- -1 B
/api-docs/input-label -- 2.07 kB -- -1 B
/api-docs/input -- 2.83 kB -- -1 B
/api-docs/linear-progress -- 2.03 kB -- -1 B
/api-docs/link -- 1.94 kB -- -1 B
/api-docs/list-item-avatar -- 1.51 kB -- -1 B
/api-docs/list-item-icon -- 1.51 kB -- -1 B
/api-docs/list-item-secondary-action -- 1.47 kB -- -1 B
/api-docs/list-item-text -- 1.79 kB -- -1 B
/api-docs/list-item -- 2.25 kB -- -1 B
/api-docs/list-subheader -- 1.75 kB -- -1 B
/api-docs/list -- 1.68 kB -- -1 B
/api-docs/menu-item -- 1.74 kB -- -1 B
/api-docs/menu-list -- 1.57 kB -- -1 B
/api-docs/menu -- 2.42 kB -- -1 B
/api-docs/mobile-stepper -- 1.94 kB -- -1 B
/api-docs/modal -- 2.43 kB -- -1 B
/api-docs/native-select -- 2.11 kB -- -1 B
/api-docs/no-ssr -- 1.3 kB -- -1 B
/api-docs/outlined-input -- 2.98 kB -- -1 B
/api-docs/pagination-item -- 1.97 kB -- -1 B
/api-docs/pagination -- 2.23 kB -- -1 B
/api-docs/paper -- 1.87 kB -- -1 B
/api-docs/popover -- 2.7 kB -- -1 B
/api-docs/popper -- 1.92 kB -- -1 B
/api-docs/portal -- 1.34 kB -- -1 B
/api-docs/radio-group -- 1.45 kB -- -1 B
/api-docs/radio -- 2.12 kB -- -1 B
/api-docs/rating -- 2.49 kB -- -1 B
/api-docs/root-ref -- 1.42 kB -- -1 B
/api-docs/scoped-css-baseline -- 1.4 kB -- -1 B
/api-docs/select -- 2.96 kB -- -1 B
/api-docs/skeleton -- 1.87 kB -- -1 B
/api-docs/slide -- 1.54 kB -- -1 B
/api-docs/slider -- 3.11 kB -- -1 B
/api-docs/snackbar-content -- 1.61 kB -- -1 B
/api-docs/snackbar -- 2.71 kB -- -1 B
/api-docs/speed-dial-action -- 2.04 kB -- -1 B
/api-docs/speed-dial-icon -- 1.55 kB -- -1 B
/api-docs/speed-dial -- 2.32 kB -- -1 B
/api-docs/step-button -- 1.63 kB -- -1 B
/api-docs/step-connector -- 1.54 kB -- -1 B
/api-docs/step-content -- 1.72 kB -- -1 B
/api-docs/step-icon -- 1.57 kB -- -1 B
/api-docs/step-label -- 1.9 kB -- -1 B
/api-docs/step -- 1.64 kB -- -1 B
/api-docs/stepper -- 1.84 kB -- -1 B
/api-docs/svg-icon -- 2.26 kB -- -1 B
/api-docs/swipeable-drawer -- 2.01 kB -- -1 B
/api-docs/switch -- 2.46 kB -- -1 B
/api-docs/tab-context -- 1.08 kB -- -1 B
/api-docs/tab-list -- 1.09 kB -- -1 B
/api-docs/tab-panel -- 1.48 kB -- -1 B
/api-docs/tab-scroll-button -- 1.62 kB -- -1 B
/api-docs/tab -- 1.97 kB -- -1 B
/api-docs/table-body -- 1.47 kB -- -1 B
/api-docs/table-cell -- 2.13 kB -- -1 B
/api-docs/table-container -- 1.48 kB -- -1 B
/api-docs/table-footer -- 1.47 kB -- -1 B
/api-docs/table-head -- 1.46 kB -- -1 B
/api-docs/table-pagination -- 2.47 kB -- -1 B
/api-docs/table-row -- 1.69 kB -- -1 B
/api-docs/table-sort-label -- 1.83 kB -- -1 B
/api-docs/table -- 1.7 kB -- -1 B
/api-docs/tabs -- 2.68 kB -- -1 B
/api-docs/text-field -- 3.18 kB -- -1 B
/api-docs/textarea-autosize -- 1.13 kB -- -1 B
/api-docs/timeline-connector -- 1.4 kB -- -1 B
/api-docs/timeline-content -- 1.43 kB -- -1 B
/api-docs/timeline-dot -- 1.63 kB -- -1 B
/api-docs/timeline-item -- 1.54 kB -- -1 B
/api-docs/timeline-opposite-content -- 1.44 kB -- -1 B
/api-docs/timeline-separator -- 1.4 kB -- -1 B
/api-docs/timeline -- 1.52 kB -- -1 B
/api-docs/toggle-button-group -- 1.92 kB -- -1 B
/api-docs/toggle-button -- 1.79 kB -- -1 B
/api-docs/toolbar -- 1.65 kB -- -1 B
/api-docs/tooltip -- 2.57 kB -- -1 B
/api-docs/tree-item -- 1.89 kB -- -1 B
/api-docs/tree-view -- 1.92 kB -- -1 B
/api-docs/typography -- 2.59 kB -- -1 B
/api-docs/unstable-trap-focus -- 1.46 kB -- -1 B
/api-docs/zoom -- 1.52 kB -- -1 B
/blog/2019-developer-survey-results -- 7.6 kB -- -1 B
/blog/2019 -- 5.46 kB -- -1 B
/blog/2020-developer-survey-results -- 9.51 kB -- -1 B
/blog/2020-introducing-sketch -- 4.73 kB -- -1 B
/blog/2020-q1-update -- 5.55 kB -- -1 B
/blog/2020-q2-update -- 5.61 kB -- -1 B
/blog/2020-q3-update -- 7.35 kB -- -1 B
/blog/2020 -- 6.49 kB -- -1 B
/blog/2021-q1-update -- 7.07 kB -- -1 B
/blog/april-2019-update -- 4.34 kB -- -1 B
/blog/august-2019-update -- 3.46 kB -- -1 B
/blog/danail-hadjiatanasov-joining -- 3.41 kB -- -1 B
/blog/december-2019-update -- 3.6 kB -- -1 B
/blog/july-2019-update -- 3.36 kB -- -1 B
/blog/june-2019-update -- 3.24 kB -- -1 B
/blog/march-2019-update -- 3.77 kB -- -1 B
/blog/marija-najdova-joining -- 3.32 kB -- -1 B
/blog/material-ui-v1-is-out -- 7.92 kB -- -1 B
/blog/material-ui-v4-is-out -- 10.9 kB -- -1 B
/blog/matheus-wichman-joining -- 3.46 kB -- -1 B
/blog/may-2019-update -- 3.58 kB -- -1 B
/blog/november-2019-update -- 3.98 kB -- -1 B
/blog/october-2019-update -- 3.73 kB -- -1 B
/blog/september-2019-update -- 3.91 kB -- -1 B
/blog/spotlight-damien-tassone -- 3.3 kB -- -1 B
/company/about -- 1.75 kB -- -1 B
/company/careers -- 2.57 kB -- -1 B
/company/contact -- 1.34 kB -- -1 B
/company/software-engineer -- 5.22 kB -- -1 B
/components/about-the-lab -- 11.1 kB -- -1 B
/components/accordion -- 22.7 kB -- -1 B
/components/alert -- 14.1 kB -- -1 B
/components/app-bar -- 30.3 kB -- -1 B
/components/autocomplete -- 103 kB -- -1 B
/components/avatars -- 10.1 kB -- -1 B
/components/backdrop -- 3.12 kB -- -1 B
/components/badges -- 15.4 kB -- -1 B
/components/bottom-navigation -- 6.16 kB -- -1 B
/components/box -- 8.34 kB -- -1 B
/components/breadcrumbs -- 14.5 kB -- -1 B
/components/buttons -- 27.3 kB -- -1 B
/components/cards -- 17.3 kB -- -1 B
/components/checkboxes -- 16.7 kB -- -1 B
/components/chips -- 21.7 kB -- -1 B
/components/click-away-listener -- 5.5 kB -- -1 B
/components/container -- 3.93 kB -- -1 B
/components/css-baseline -- 7.24 kB -- -1 B
/components/dialogs -- 43.2 kB -- -1 B
/components/dividers -- 12.8 kB -- -1 B
/components/drawers -- 31.2 kB -- -1 B
/components/floating-action-button -- 10.9 kB -- -1 B
/components/grid-list -- 11.8 kB -- -1 B
/components/hidden -- 10.3 kB -- -1 B
/components/icons -- 28 kB -- -1 B
/components/links -- 7.35 kB -- -1 B
/components/lists -- 26.2 kB -- -1 B
/components/material-icons -- 729 kB -- -1 B
/components/menus -- 24.3 kB -- -1 B
/components/modal -- 12.5 kB -- -1 B
/components/no-ssr -- 5.5 kB -- -1 B
/components/pagination -- 8.32 kB -- -1 B
/components/paper -- 3.38 kB -- -1 B
/components/pickers -- 37.7 kB -- -1 B
/components/popover -- 17.5 kB -- -1 B
/components/popper -- 22.9 kB -- -1 B
/components/portal -- 3.33 kB -- -1 B
/components/progress -- 19.5 kB -- -1 B
/components/radio-buttons -- 15.5 kB -- -1 B
/components/rating -- 10.7 kB -- -1 B
/components/selects -- 32.7 kB -- -1 B
/components/skeleton -- 13.9 kB -- -1 B
/components/slider -- 16.2 kB -- -1 B
/components/snackbars -- 23.2 kB -- -1 B
/components/speed-dial -- 15.3 kB -- -1 B
/components/steppers -- 37.3 kB -- -1 B
/components/switches -- 17.2 kB -- -1 B
/components/tables -- 108 kB -- -1 B
/components/tabs -- 24.9 kB -- -1 B
/components/text-fields -- 56.2 kB -- -1 B
/components/textarea-autosize -- 3.02 kB -- -1 B
/components/timeline -- 7.48 kB -- -1 B
/components/toggle-button -- 11.7 kB -- -1 B
/components/tooltips -- 17.9 kB -- -1 B
/components/transfer-list -- 9.77 kB -- -1 B
/components/transitions -- 12.1 kB -- -1 B
/components/tree-view -- 11.5 kB -- -1 B
/components/typography -- 12.6 kB -- -1 B
/components/use-media-query -- 13.6 kB -- -1 B
/customization/breakpoints -- 17.1 kB -- -1 B
/customization/color -- 19.1 kB -- -1 B
/customization/components -- 37.3 kB -- -1 B
/customization/default-theme -- 8.8 kB -- -1 B
/customization/density -- 10.2 kB -- -1 B
/customization/globals -- 5.12 kB -- -1 B
/customization/palette -- 15.1 kB -- -1 B
/customization/spacing -- 2.87 kB -- -1 B
/customization/theming -- 19.4 kB -- -1 B
/customization/typography -- 13.4 kB -- -1 B
/customization/z-index -- 3.5 kB -- -1 B
/discover-more/backers -- 3.25 kB -- -1 B
/discover-more/changelog -- 1.39 kB -- -1 B
/discover-more/languages -- 3.4 kB -- -1 B
/discover-more/related-projects -- 9.23 kB -- -1 B
/discover-more/roadmap -- 2.9 kB -- -1 B
/discover-more/showcase -- 15.4 kB -- -1 B
/discover-more/team -- 7.25 kB -- -1 B
/discover-more/vision -- 6.83 kB -- -1 B
/getting-started/example-projects -- 7.29 kB -- -1 B
/getting-started/faq -- 40.5 kB -- -1 B
/getting-started/installation -- 8.7 kB -- -1 B
/getting-started/learn -- 8.51 kB -- -1 B
/getting-started/support -- 12.4 kB -- -1 B
/getting-started/supported-components -- 7.97 kB -- -1 B
/getting-started/supported-platforms -- 5.97 kB -- -1 B
/getting-started/templates -- 8.81 kB -- -1 B
/getting-started/templates/checkout -- 10.2 kB -- -1 B
/getting-started/templates/dashboard -- 8.85 kB -- -1 B
/getting-started/templates/sign-in -- 8.44 kB -- -1 B
/getting-started/templates/sign-up -- 8.54 kB -- -1 B
/getting-started/templates/sticky-footer -- 1.54 kB -- -1 B
/getting-started/usage -- 9.34 kB -- -1 B
/guides/api -- 14.8 kB -- -1 B
/guides/composition -- 15.6 kB -- -1 B
/guides/flow -- 2.36 kB -- -1 B
/guides/interoperability -- 16 kB -- -1 B
/guides/localization -- 10.1 kB -- -1 B
/guides/migration-v0x -- 7.78 kB -- -1 B
/guides/migration-v3 -- 18.7 kB -- -1 B
/guides/minimizing-bundle-size -- 14.9 kB -- -1 B
/guides/responsive-ui -- 4.22 kB -- -1 B
/guides/right-to-left -- 5.37 kB -- -1 B
/guides/server-rendering -- 9.93 kB -- -1 B
/guides/testing -- 8.18 kB -- -1 B
/guides/typescript -- 15.8 kB -- -1 B
/performance/table-component -- 1.44 kB -- -1 B
/performance/table-hook -- 2.24 kB -- -1 B
/performance/table-mui -- 4.49 kB -- -1 B
/performance/table-raw -- 613 B -- -1 B
/performance/table-styled-components -- 2.61 kB -- -1 B
/premium-themes/onepirate -- 7.34 kB -- -1 B
/premium-themes/onepirate/forgot-password -- 1.01 kB -- -1 B
/premium-themes/onepirate/privacy -- 4.44 kB -- -1 B
/premium-themes/onepirate/sign-in -- 1.07 kB -- -1 B
/premium-themes/onepirate/terms -- 11.8 kB -- -1 B
/premium-themes/paperbase -- 7.7 kB -- -1 B
/production-error -- 3.71 kB -- -1 B
/styles/advanced -- 32.6 kB -- -1 B
/styles/api -- 16.4 kB -- -1 B
/styles/basics -- 15.9 kB -- -1 B
/system/api -- 3.57 kB -- -1 B
/system/basics -- 27.2 kB -- -1 B
/system/borders -- 3.72 kB -- -1 B
/system/display -- 6.2 kB -- -1 B
/system/flexbox -- 5.39 kB -- -1 B
/system/positions -- 2.27 kB -- -1 B
/system/shadows -- 3.69 kB -- -1 B
/system/sizing -- 3.35 kB -- -1 B
/system/spacing -- 6.25 kB -- -1 B
/system/typography -- 4.03 kB -- -1 B
/versions -- 23 kB -- -1 B
docs:chunk:shared -- 64.4 kB -- -1 B
docs:shared:chunk/commons -- 5.99 kB -- -1 B
docs:shared:chunk/framework -- 42.3 kB -- -1 B
docs:shared:runtime/main -- 6.78 kB -- -1 B
docs:shared:runtime/webpack -- 1.24 kB -- -1 B
bundle Size Change Size Gzip Change Gzip
@material-ui/core -- 376 kB -- 102 kB
@material-ui/lab -- 224 kB -- 65.9 kB
@material-ui/styles -- 53.2 kB -- 15.9 kB
@material-ui/system -- 17.2 kB -- 4.51 kB
@material-ui/utils -- 7.19 kB -- 2.61 kB
Accordion -- 78.4 kB -- 24.5 kB
AccordionActions -- 67.7 kB -- 21.1 kB
AccordionDetails -- 67.6 kB -- 21 kB
AccordionSummary -- 83.4 kB -- 26.3 kB
Alert -- 88.5 kB -- 27.8 kB
AlertTitle -- 69.9 kB -- 21.8 kB
AppBar -- 69.7 kB -- 21.7 kB
Autocomplete -- 137 kB -- 43 kB
Avatar -- 70.8 kB -- 22 kB
AvatarGroup -- 71.9 kB -- 22.7 kB
Backdrop -- 74.3 kB -- 22.9 kB
Badge -- 71 kB -- 21.9 kB
BottomNavigation -- 68 kB -- 21.2 kB
BottomNavigationAction -- 80.7 kB -- 25.5 kB
Box -- 74.5 kB -- 22.5 kB
Breadcrumbs -- 85.7 kB -- 27 kB
Button -- 85 kB -- 26 kB
ButtonBase -- 79.2 kB -- 24.8 kB
ButtonGroup -- 88.6 kB -- 27.2 kB
Card -- 68.5 kB -- 21.3 kB
CardActionArea -- 80.3 kB -- 25.3 kB
CardActions -- 67.7 kB -- 21.1 kB
CardContent -- 67.6 kB -- 21 kB
CardHeader -- 70.7 kB -- 22.1 kB
CardMedia -- 68 kB -- 21.2 kB
Checkbox -- 87.5 kB -- 27.6 kB
Chip -- 87.9 kB -- 26.9 kB
CircularProgress -- 69.7 kB -- 21.8 kB
ClickAwayListener -- 4.16 kB -- 1.67 kB
Collapse -- 74.7 kB -- 23 kB
colorManipulator -- 4.14 kB -- 1.63 kB
Container -- 68.8 kB -- 21.4 kB
CssBaseline -- 67.6 kB -- 21.1 kB
Dialog -- 89.5 kB -- 27.9 kB
DialogActions -- 67.7 kB -- 21.1 kB
DialogContent -- 67.8 kB -- 21.1 kB
DialogContentText -- 69.7 kB -- 21.7 kB
DialogTitle -- 69.9 kB -- 21.8 kB
Divider -- 68.3 kB -- 21.3 kB
docs:/ -- 13.1 kB -- -1 B
docs:/_app -- 36.9 kB -- -1 B
Drawer -- 91.6 kB -- 27.8 kB
ExpansionPanel -- 78.4 kB -- 24.5 kB
ExpansionPanelActions -- 67.7 kB -- 21.1 kB
ExpansionPanelDetails -- 67.6 kB -- 21 kB
ExpansionPanelSummary -- 83.4 kB -- 26.3 kB
Fab -- 82.1 kB -- 25.5 kB
Fade -- 28.9 kB -- 9.66 kB
FilledInput -- 79.2 kB -- 24.5 kB
FormControl -- 70.1 kB -- 21.7 kB
FormControlLabel -- 71.2 kB -- 22.2 kB
FormGroup -- 67.6 kB -- 21.1 kB
FormHelperText -- 68.9 kB -- 21.3 kB
FormLabel -- 69.1 kB -- 21.3 kB
Grid -- 70.7 kB -- 22 kB
GridList -- 68.1 kB -- 21.3 kB
GridListTile -- 69.3 kB -- 21.6 kB
GridListTileBar -- 68.8 kB -- 21.4 kB
Grow -- 29.6 kB -- 9.88 kB
Hidden -- 71.6 kB -- 22.3 kB
Icon -- 68.5 kB -- 21.3 kB
IconButton -- 81.4 kB -- 25.4 kB
Input -- 78.1 kB -- 24.2 kB
InputAdornment -- 70.7 kB -- 22.2 kB
InputBase -- 76.2 kB -- 23.8 kB
InputLabel -- 71 kB -- 21.8 kB
LinearProgress -- 71.1 kB -- 22.1 kB
Link -- 72.2 kB -- 22.7 kB
List -- 67.9 kB -- 21 kB
ListItem -- 82.3 kB -- 25.7 kB
ListItemAvatar -- 67.7 kB -- 21.1 kB
ListItemIcon -- 67.8 kB -- 21.1 kB
ListItemSecondaryAction -- 67.6 kB -- 21 kB
ListItemText -- 70.6 kB -- 22.1 kB
ListSubheader -- 68.4 kB -- 21.4 kB
Menu -- 95.1 kB -- 29.2 kB
MenuItem -- 83.4 kB -- 26 kB
MenuList -- 71.6 kB -- 22.3 kB
MobileStepper -- 73.6 kB -- 22.9 kB
Modal -- 15.1 kB -- 5.28 kB
NativeSelect -- 82.5 kB -- 25.9 kB
NoSsr -- 2.18 kB -- 1.03 kB
OutlinedInput -- 80.2 kB -- 24.8 kB
packages/material-ui/material-ui.production.min.js -- 331 kB -- 95.6 kB
Pagination -- 89.7 kB -- 27.6 kB
PaginationItem -- 86.1 kB -- 26.5 kB
Paper -- 67.9 kB -- 21 kB
Popover -- 89.5 kB -- 27.6 kB
Popper -- 28.7 kB -- 10.3 kB
Portal -- 2.87 kB -- 1.29 kB
Radio -- 88.5 kB -- 27.9 kB
RadioGroup -- 69.5 kB -- 21.4 kB
Rating -- 76.5 kB -- 24.5 kB
RootRef -- 4.64 kB -- 1.76 kB
ScopedCssBaseline -- 68.4 kB -- 21.4 kB
Select -- 123 kB -- 36.4 kB
Skeleton -- 68.8 kB -- 21.6 kB
Slide -- 30.7 kB -- 10.3 kB
Slider -- 81.6 kB -- 25.8 kB
Snackbar -- 82.1 kB -- 25.7 kB
SnackbarContent -- 69.1 kB -- 21.6 kB
SpeedDial -- 92.3 kB -- 29.2 kB
SpeedDialAction -- 124 kB -- 39.4 kB
SpeedDialIcon -- 70.2 kB -- 21.9 kB
Step -- 68.3 kB -- 21.3 kB
StepButton -- 87.6 kB -- 27.5 kB
StepConnector -- 68.3 kB -- 21.4 kB
StepContent -- 75.8 kB -- 23.6 kB
StepIcon -- 70.2 kB -- 21.8 kB
StepLabel -- 74.2 kB -- 22.8 kB
Stepper -- 70.4 kB -- 22.1 kB
styles/createMuiTheme -- 21.9 kB -- 7.58 kB
SvgIcon -- 68.7 kB -- 21.3 kB
SwipeableDrawer -- 99 kB -- 31 kB
Switch -- 86.7 kB -- 27.1 kB
Tab -- 81.7 kB -- 25.9 kB
TabContext -- 2.65 kB -- 1.15 kB
Table -- 68.2 kB -- 21.3 kB
TableBody -- 67.7 kB -- 21.1 kB
TableCell -- 69.7 kB -- 21.8 kB
TableContainer -- 67.6 kB -- 21 kB
TableFooter -- 67.7 kB -- 21.1 kB
TableHead -- 67.7 kB -- 21.1 kB
TablePagination -- 149 kB -- 43.8 kB
TableRow -- 68.1 kB -- 21.3 kB
TableSortLabel -- 82.7 kB -- 26 kB
TabList -- 92.6 kB -- 29.5 kB
TabPanel -- 68.5 kB -- 21.3 kB
Tabs -- 91.4 kB -- 28.5 kB
TabScrollButton -- 82.2 kB -- 25.6 kB
TextareaAutosize -- 5.23 kB -- 2.19 kB
TextField -- 131 kB -- 38.5 kB
Timeline -- 68 kB -- 21.2 kB
TimelineConnector -- 67.6 kB -- 21 kB
TimelineContent -- 68.1 kB -- 21.2 kB
TimelineDot -- 68.7 kB -- 21.4 kB
TimelineItem -- 68.7 kB -- 21.4 kB
TimelineOppositeContent -- 68.2 kB -- 21.2 kB
TimelineSeparator -- 67.6 kB -- 21 kB
ToggleButton -- 81.3 kB -- 25.7 kB
ToggleButtonGroup -- 69 kB -- 21.5 kB
Toolbar -- 67.9 kB -- 21.2 kB
Tooltip -- 108 kB -- 34.1 kB
TreeItem -- 81.7 kB -- 25.9 kB
TreeView -- 73.9 kB -- 23.1 kB
Typography -- 69.3 kB -- 21.5 kB
Unstable_TrapFocus -- 3.87 kB -- 1.59 kB
useAutocomplete -- 14.7 kB -- 5.27 kB
useMediaQuery -- 2.56 kB -- 1.06 kB
useScrollTrigger -- 2.66 kB -- 1.08 kB
Zoom -- 29 kB -- 9.81 kB

Generated by 🚫 dangerJS against eff69e9

@eps1lon
Copy link
Member

eps1lon commented May 12, 2021

We want to do this with some extensive testing with different bundlers. I've heard too many horror stories from introducing exports and I want to be very careful. Especially considering that we don't really need that field at the moment.

@guybedford
Copy link

@eps1lon definitely makes sense, but at least the suggestion is there for the next major now. This is also part of the JSPM overrides process to create a PR even if it isn't merged to ensure there is some coordination with upstream (https://github.com/jspm/overrides#criteria-for-merging-an-override).

@eps1lon
Copy link
Member

eps1lon commented May 12, 2021

I definitely hear you. We want to do this in the future. But most of the work needs to be spend in testing. So pushing #23166 forward would really help us.

@guybedford
Copy link

@eps1lon Webpack 5 supports these features with a high level of parity with Node.js now, we've done quite a bit of testing here. If / when you can try this out against the testing PR feel free to copy me in any issues that arise.

@eps1lon
Copy link
Member

eps1lon commented May 12, 2021

@eps1lon Webpack 5 supports these features with a high level of parity with Node.js now, we've done quite a bit of testing here.

I know that. I also know that webpack 4 does not support exports. Looking at the download stats, we do keep supporting webpack 4. So please understand that isn't a trivial feature to add that we just add on the side.

@eps1lon eps1lon added the package: icons Specific to @mui/icons label May 15, 2021
@oliviertassinari
Copy link
Member

@jollytoad Note that the active branch is next, not master so we won't be able to merge this one.

Regarding rebasing on next, I assume @eps1lon will want to take the lead on this. So maybe we should close this PR?

@guybedford
Copy link

@oliviertassinari thanks for the follow up, please reference any tracking issue here if closing the PR. We ended up merging quite a few overrides for the projects in https://github.com/jspm/overrides/blob/main/overrides.json which could be a useful starting point for this work further. Would be happy to assist with further upstream review on these if that would help too.

@eps1lon
Copy link
Member

eps1lon commented May 18, 2021

@guybedford We're probably going with a simpler approach considering we only want to ship a single module format:

"exports": {
  ".": "./index.js",
  "./*": "./*.js"
},
"type": "module"

-- 8c3f6ee (#26310)

Though we do want to get all the fixtures in place first (#23166) and then test #26310 against those fixtures.

@guybedford
Copy link

@eps1lon that sounds good. Are there no subfolders or non-module or non-public JS files at all then? It would still be important to check you are not exporting any internal / private modules that shouldn't be directly imported. Tools can specifically optimize these out.

@eps1lon
Copy link
Member

eps1lon commented May 18, 2021

@eps1lon that sounds good. Are there no subfolders or non-module or non-public JS files at all then? It would still be important to check you are not exporting any internal / private modules that shouldn't be directly imported. Tools can specifically optimize these out.

We have utils/createSvgIcon but that is an internal module used by the other icons. The rest is really just icon components. @material-ui/icons is the simplest package we have though. Apart from 'utils/createSvgIcon.js' everything is auto-generated and we do need to optimize install/packed size since we're getting reports that the download is timing out.

@guybedford
Copy link

@eps1lon you can use null entries to exclude paths:

{
  "exports": {
    "./*": "./*.js",
    "./utils/*": null,
    // or just a specific entry
    "./utils/createSvgIcon": null
  }
}

This ensure they remain private and internal. I understand you're shipping optimized modules, but there can be an encapsulation benefit to this as well.

@eps1lon
Copy link
Member

eps1lon commented May 18, 2021

you can use null entries to exclude paths:

That's new to me. I thought exports acts as an "allow list" kind of field. You're making it sound like that I need to explicitly exclude paths. If I only match ./*.js why would I need to exclude ./utils/?

@guybedford
Copy link

@eps1lon exports are deep includes by default.

@eps1lon
Copy link
Member

eps1lon commented May 18, 2021

Nevermind, we match ./* not ./*.js. But what would the import from @material-ui/icons/utils even return?

@guybedford
Copy link

Per "./*": "./*.js", @material-ui/icons/utils would resolve to @material-ui/icons/utils.js.

@guybedford
Copy link

And also, @material-ui/icons/utils/any would resolve to @material-ui/icons/utils/any.js.

@eps1lon
Copy link
Member

eps1lon commented May 18, 2021

Do you know why the working group thought * being equivalent to **/* was a good idea?

@eps1lon
Copy link
Member

eps1lon commented May 18, 2021

Do you know why the working group thought * being equivalent to **/* was a good idea?

Oh so you were actually part of the modules team. Trying to understand why * mapping to ** is the right thing to do. Would implementing * and ** not have worked?

@guybedford
Copy link

@eps1lon this was discussed at length, and you can blame me for suggesting it, but the argument is that these are module specifiers and module URLs which are not file paths, and this maintains symmetry with the RHS replacement without having to bring an entire matching syntax grammar to the resolver specification. This syntax first originated in browser module loaders with resolver configurations like "mod/*": "/path/to/pkg/*.js" which was used for early mapping systems that would apply to all deep subpaths of mod. I personally hope import maps might be able to support something like this in future as well.

The best way to think about it is that this is a resolver map, acting on module specifier strings. That is there is no globbing or file system checking happening, just string replacement. These strings just happen to map to file paths on a file system.

@eps1lon
Copy link
Member

eps1lon commented May 18, 2021

Yeah makes sense. It just introduces a bit of a pain point for us since we think about @material-ui/icons/* different than exports does. https://next--material-ui.netlify.app/guides/minimizing-bundle-size/#option-1 captures our mental model about the valid imports from our package. But that doesn't translate to exports because * acts like **.

Though in the end we can always auto-generate exports with our mental model in mind. And for @material-ui/icons specifically we can exclude the internal packages manually with null values. Thanks for that suggestion.

For what it's worth: I think the "* as **" behavior should have an explicit warning in the Packages API docs. I didn't quite realize how * works when reading over the examples. I stopped reading thoroughly because I assumed * would work just like it works in file globbing e.g. popular glob implementations on npm, .gitignore etc.

@guybedford
Copy link

@eps1lon I checked that link you provided but couldn't quite follow what you mean by a difference? Is the issue that you do have lots of other subfolders that you don't want to expose?

I checked if there were any improvements we could make in the docs, but we do explicitly call out all these aspects including that it is a glob in https://nodejs.org/api/packages.html#packages_subpath_patterns:

the individual exports for a package can be determined by treating the right hand side target pattern as a ** glob against the list of files within the package. Because node_modules paths are forbidden in exports targets, this expansion is dependent on only the files of the package itself.

That said we don't currently document the null pattern so I've posted a PR with this at nodejs/node#38724. If you have further exact docs suggestions on this topic do let me know - the feedback is appreciated.

@eps1lon
Copy link
Member

eps1lon commented May 19, 2021

but we do explicitly call out all these aspects including that it is a glob in

You do, but it's only after you introduce *. If you have e.g. .gitignore in mind then you don't read further because you expect * to work just as it works in other "fields".

It's like saying "hey this car is blue" but only later clarifying that your "blue" is actually "red". It's still explicitly saying that what you mean by "blue" is actually "red" but it remains unclear for people opting out earlier. That's at least my perspective.

I checked that link you provided but couldn't quite follow what you mean by a difference? Is the issue that you do have lots of other subfolders that you don't want to expose?

When we (our team, .gitignore, eslint no-restricted-paths, path autocomplete in shells etc) think about core/* we don't match core/utils/utility. core/* would only match core/utils. So all packages but @material-ui/icons can't actually use * because that matches way too many paths. So instead we need to manually list all public paths that would match * when used in popular file globbing implementations.

@guybedford
Copy link

@eps1lon I've added an additional note in https://github.com/nodejs/node/pull/38724/files#diff-71a7964a5c439435680952125e31e9dd4fca3a427982e6db86770fd0fbbfde63R361, let me know if that seems clear to you?

I will repeat - this is not a matching syntax, it is a string mapping syntax like writing a function function resolvePkgPath (subpath) { return './newpath'; }. Glad you are clear on the null masking now, we didn't need many of these when putting together https://github.com/jspm/overrides/blob/main/overrides.json.

Feel free to copy me in for review in future.

@oliviertassinari
Copy link
Member

@guybedford I have tried to make Material-UI work with JSPM but I couldn't figure it out.

First, I have tried v5, it fails on an obscure case.

Capture d’écran 2021-05-30 à 19 36 14

Then, I have tried v4. I had to add a global variable to support if (process.env.NODE_ENV === 'production') {, but then, I got stuck on an error I could find the origin.

Capture d’écran 2021-05-30 à 19 36 51


@eps1lon What do you think about closing this PR as we have #26254 open?

@guybedford
Copy link

@oliviertassinari I believe it does work if you generate the import map with the "module" condition enabled. Currently this is supported via the generator API but not yet in the UI interface, see https://github.com/jspm/generator for the API.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 3, 2021

The exports key has been added in #26310 for this icons package, @jollytoad thanks for raising it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: icons Specific to @mui/icons
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants