-
-
Notifications
You must be signed in to change notification settings - Fork 266
Open
Labels
package: utilsSpecific to the utils package.Specific to the utils package.status: waiting for maintainerThese issues haven't been looked at yet by a maintainer.These issues haven't been looked at yet by a maintainer.umbrellaFor grouping multiple issues to provide a holistic viewFor grouping multiple issues to provide a holistic view
Description
Summary
We have two console utils:
base-ui/packages/utils/src/warn.ts
Line 6 in 0f2b7a1
| export function warn(...messages: string[]) { |
base-ui/packages/utils/src/error.ts
Line 6 in 0f2b7a1
| export function error(...messages: string[]) { |
I believe we have a couple of issues/opportunities to improve them. I expect them to be used across the codebase, so the details will have a compounding impact, hence this umbrella issue. The list I can see:
- Add a reset cache util for the tests. See https://github.com/mui/mui-x/blob/e83c26a05fdf625c03c1636d451f0425dd96c9fc/packages/x-internals/src/warning/warning.ts#L32 as an example.
- Enforce production pruning: [code-infra] New lint rule: mandate production switch for certain function calls mui-public#207
- Rename the method to be clear. There are cases where we might need to warn/error each time the method is called, but it's not how this behaves, so I believe
warn()is confusing; it should bewarnOnce()to be clear. - The component stacks do not show up, even when the React DevTools is attached: [React 19] prop-types removal alternative / console component trace facebook/react#28992 (comment). If it doesn't get fixed, it feels like we have to add
captureOwnerStack(). https://react.dev/reference/react/captureOwnerStack. For example, finding the origin of the console was so painful in [docs][autocomplete] Fix console in unstyled demo material-ui#46804. - Migrate the Joy UI, Material UI, MUI X codebase to adopt it.
- Support arrays for multiple formatting clarity. Example: https://github.com/mui/mui-x/blob/e83c26a05fdf625c03c1636d451f0425dd96c9fc/packages/x-tree-view/src/RichTreeView/RichTreeView.tsx#L81
Metadata
Metadata
Assignees
Labels
package: utilsSpecific to the utils package.Specific to the utils package.status: waiting for maintainerThese issues haven't been looked at yet by a maintainer.These issues haven't been looked at yet by a maintainer.umbrellaFor grouping multiple issues to provide a holistic viewFor grouping multiple issues to provide a holistic view