facebook / stylex

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

Open source the codemod that migrate from the old stylex syntax to the new stylex syntax #441

Open SukkaW opened 7 months ago

SukkaW commented 7 months ago

Describe the feature request

When stylex was first introduced at React Conf in 2019, its API looked like this:

const styles = stylex.create({
  red: {},
  blue: {}
});

<Button className={styles('red', blue && 'blue')} />

Upon its introduction, many projects attempted to replicate the concept, with the style9 doing an exceptional job.

Since then, stylex has evolved rapidly with significant changes to the API, while the community exploring ideas with projects like style9.

Since stylex is now open-sourced, I'm considering migrating my existing projects, which are currently powered by style9, to stylex. However, this transition would entail numerous modifications.

I understand that Facebook might use an internal codemod for this purpose. Is there any possibility of making it open-source?

nmn commented 7 months ago

@SukkaW Our internal codemods are based on Flow which is not really used outside of Meta and would likely not be useful. Also this particular transition happened a long time ago. I'll see if I can find something useful, but the chances of that are pretty low.