<aside> ✅ Option: On the naming convention: the tabel under Option A. Why?
</aside>
We have been discussing the purpose, visibility, and restrictions of the @mui/utils package for a long time. Let’s gather all the ideas here and make a decision.
The @mui/utils package currently is a mixture of utilities that could be helpful for 3rd party developers (like useForkRef), functions used mostly in MUI for building components (useControlled, all prop-types related helpers), and build-time Babel macros.
MUI X has created its own utils package, see the discussion in ‣. It uses @mui/x-internals
Previous conversation around this:
useForkRef from?
@mui/utils ?@base/utils ?@xxx/utils and @xxx/internals modulesTerminology:
| Name | On npm | Imported by developers | Follow semver | Use cases | API | Notes |
|---|---|---|---|---|---|---|
| public | ✅ | ✅ | ✅ | Our product. | Nothing special. | |
| unstable | ✅ | ✅ | No | API we want to try out with the community. They could become stable. | Same package, but modules exported with a prefix: unstable_ . |
Dependencies using must pin their version. |
| internals | ✅ | No | No | Avoid duplication of code between npm packages. | package name: | |
*-internals for logic used by public packages. |
||||||
@newco/internal-* for infra |
Dependencies using must pin their version. | |||||
| private | No | No | No | Workspace local packages, examples. | private: true value in package.json. |
|
@newco/private-* for logic used inside the repository. |
Playbook:
@product-name is named after the open-source project name. If the package is meant to be used by MUIers, it should be the company's org name. Typically for infra (e.g. docs-infra, code-infra).@product-name/MAIN: default to no new npm packages. If the module can stay in the main npm package, and simply be exported if public and not be exported if private, do this.@product-name/utils for public modules if they need to be shared between multiple @xxx scope npm packages.@product-name/*-internals for private modules if they need to be shared between multiple @xxx scope npm packages. alpha version.