docs/react-v9/contributing/rfcs/convergence/move-out-n-rename-makestyles.md
makeStyles to a separate repo@layershifter
makeStyles() is CSS-in-JS engine that is used in Fluent UI React v9. At this moment it seems that makeStyles() is more than just a piece of Fluent UI and moving it out a separate repository can bring result in more visibility in the community to both makeStyles and Fluent.
We can take Braid Design System as an example. It uses Vanilla Extract: as its CSS-in-JS engine which lives in a separate repositories.
In Fluent UI repository we have already 4 projects, makeStyles is invisible behind them 🙄 This results in inability to get community feedback and consumers outside of Fluent UI.
At the same time, the community might have interest in makeStyles as it solves its goals efficiently. Taking into account that:
It is a good opportunity to improve collaboration with the wider open source community as a company 🚀
makeStyles is coupled to Fluent UIEven if there is interest to use makeStyles separately from Fluent UI, it's currently impossible since it's coupled with Fluent UI React v9. There is a separate proposal to decouple makeStyles from Fluent (see RFC microsoft/fluentui#20651).
But while it stays as a folder in Fluent UI repo there is no clarity about how to use it for third parties.
Compared to other CSS-in-JS makeStyles does not have enough docs to explain APIs and design. While every other library has them 🙄 Currently there is no right place for them.
It's a point that was not considered initially, but makeStyles is also a function in MUI and any search queries will point to it.
Without a strict dependency on Fluent UI v9 we can potentially involve more partners to be consumers of makeStyles since they will be able to try the new styling engine even without consuming v9 components.
Partners using other component libraries can still see a performance improvement when using makeStyles with their components. This has been proven in the Teams chat list in T2.
Currently there are two unsolved issues: "buildless builds", "build dependency hell" once v9 & other packages are linked and circular dependencies with other repositories.
The problem is described in microsoft/fluentui#18357:
yarn build --to @fluentui/make-styles-webpack-loader@fluentui/jest-serializer-make-styles before running testsFor incremental adoption with Teams we are looking into a compat layer between makeStyles & Fela (microsoft/fluentui#20611). This requires Fluent UI React Northstar (v0) take makeStyles core as a dependency.
Existing issues:
Currently @fluentui/react-icons depends on @fluentui/react-make-styles. When we need to perform major bump of @fluentui/react-make-styles:
@fluentui/react-make-styles to v10@fluentui/react-icons still uses v10 (double dependency)@fluentui/react-make-styles in @fluentui/react-icons as v10 is not released yet 💥makeStyles will not use Fluent UI scope)Pros: It solves all problems described above ✅
Cons:
@fluentui/react-icons and others.makeStyles & Fluent UI docs will be in separate placesNA
NA