mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.14k stars 1.29k forks source link

[TreeView][ESM] package exports are incorrect #12077

Open mkilpatrick opened 8 months ago

mkilpatrick commented 8 months ago

Steps to reproduce

https://publint.dev/@mui/x-tree-view@6.17.0

Current behavior

Proper exports should be defined so that resolution via Node/other bundlers properly import the correct thing. Please fix the warnings and suggestions defined by publint.

Expected behavior

No publint warnings.

Context

I found this when I found that a "worker" condition is breaking functionality of TreeView. I'm still not entirely sure if this is related to this library's exports or the way that Vite/Node resolve conditions. I've opened a separate issue with Vite.

Your environment

System: OS: Linux 5.0 undefined Binaries: Node: 18.18.0 - /usr/local/bin/node npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.14.0 - /usr/local/bin/pnpm Browsers: Chrome: Not Found npmPackages: @emotion/react: 11.11.3 @emotion/styled: 11.11.0 @mui/base: 5.0.0-beta.36 @mui/core-downloads-tracker: 5.15.10 @mui/material: 5.15.10 @mui/private-theming: 5.15.9 @mui/styled-engine: 5.15.9 @mui/system: 5.15.9 @mui/types: 7.2.13 @mui/utils: 5.15.9 @mui/x-tree-view: ^6.17.0 => 6.17.0 @types/react: 18.2.55 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0

Search keywords: package.json exports publint

oliviertassinari commented 8 months ago

It looks like a duplicate to one of the ESM issues on https://github.com/mui/material-ui.

michelengelen commented 8 months ago

Thanks @mkilpatrick for reporting. I have added this to our board for the team to assess and fix!

Thanks again for reporting! 🙇🏼

flaviendelangle commented 8 months ago

@oliviertassinari do you have a link for the "ESM issues"?

oliviertassinari commented 8 months ago

do you have a link for the "ESM issues"?

This issue description doesn't have clarity and fixing https://publint.dev/@mui/x-tree-view@6.17.0 warnings is not a goal on its own. So hard to say, but we should make sure people can bundle in a large variety of environments. I would look at https://github.com/mui/material-ui/issues?q=is%3Aissue+is%3Aopen+%22%5BESM%5D%22.