Separately, developers are already required to build a certain number of affordable housing units in every development.
If you require developers to build units that are mostly or solely composed of affordable housing, those developers will not earn enough money to make it worth building the units in the first place. This leads to progressives holding up all kinds of development with endless planning meetings and environmental impact assessments. The result is no housing gets built - no affordable housing, no market-rate housing. They allow the perfect to become the enemy of the good.
We need to work with developers to build housing units of all kinds, including affordable housing, rather than demonizing the very developers who are going to end up building those affordable housing developments that I think we all want.