metal / metal.js

Build UI components in a solid, flexible way
http://metaljs.com
Other
229 stars 59 forks source link

Proposal: Renames STATE to PROPS in SOY Components #248

Open fernandosouza opened 7 years ago

fernandosouza commented 7 years ago

In components based in SOY it causes confusion in many people that have used React already. I've seen that in candidates in Brazil's offices and Liferay employees that started learning MetalJS. It also makes easier to document and learning.

yuchi commented 7 years ago

IMHO this would add confusion to the table since there's no clear distinction between them.

ethib137 commented 7 years ago

Is this a proposal that it would be good rename state to props?

fernandosouza commented 7 years ago

Yes, @ethib137. It's a proposal in order to make the learning processes easier. STATE static property in Soy Components behaves differently from JSX Components. In my humble opinion, this layer should be as similar as possible to both.

pragmaticivan commented 7 years ago

When I started using metal.js, I got confused because of that. I agree with @fernandosouza

Also, IMHO as a beginner with that would be easier to compare with JSX implementation and React. I got confused with the naming used for the static property STATE.

It also would be nice to see something like

{ state: true} instead of {internal: true}

So that would be similar to compare with what it has on JSX.

robframpton commented 7 years ago

Wouldn't this be a breaking change that would require us to update all metal components? Even if we had some kind of backwards compatibility, how would it work if one component used STATE, and a dependency used PROPS?

ethib137 commented 7 years ago

I think if we simply rename STATE to PROPS it might make more sense to a beginner, but we aren't really that much better off. STATE in soy is not the same as PROPS in jsx. If we want to avoid that confusion I think we would be better off pointing out the difference and possibly choosing a name that lines up with the soy template. Renaming STATE to PARAMS.

I think @Robert-Frampton has an important point though. This would likely be a really difficult change regarding compatibility.

fernandosouza commented 7 years ago

Yeah. Thank you for the feedback, guys. I agree that it is not an easy change. But it is something to think about, maybe. To find a way to avoid confusion.