facebook / stylex

StyleX is the styling system for ambitious user interfaces.
https://stylexjs.com
MIT License
8.34k stars 307 forks source link

Add ability to customise class names generation so we can use one letter classnames. #493

Closed igoryusha22 closed 6 months ago

igoryusha22 commented 6 months ago

Describe the feature request

Please give us a small sizes for class names as it was introduced from the beginning.

image

necolas commented 6 months ago

The current class names are deterministic (ie stable) and don't clash with any other potential styling systems, which makes them safer and easier to scale than having a sequential or iterative naming method

igoryusha22 commented 6 months ago

@necolas but it is less performant compare to one letter classnames, is not it?

necolas commented 6 months ago

There is no significant difference in performance. Even if it were, performance at the cost of reliability is the wrong trade off

igoryusha22 commented 6 months ago

@necolas hm. Could not you please expand your point of view about reliability? What's wrong with sequential or iterative naming methods?

nmn commented 6 months ago

What's wrong with sequential or iterative naming methods?

This kind of approach makes caching impossible. If you don't compile in the same order, you get different results. You can't do partial compiles. You can't do hot-reloading. etc. etc.