cssinjs / istf-spec

Interoperable Style Transfer Format [DRAFT]
247 stars 8 forks source link

Function values #26

Closed kof closed 6 years ago

kof commented 7 years ago

cc @geelen, @mxstbr, @philpl

kof commented 7 years ago

Updated!

kof commented 7 years ago

@philpl do all functions receive props as an argument (also property fn and partial fn)?

kof commented 7 years ago

Bad thing about all this functions is that now every engine will have to implement all those functions, because otherwise it won't be fully conform with ISTF.

kof commented 7 years ago

If people refuse implementing them, because they have no use for these fn features, we will have troubles making it mainstream. Only template string based libs can have a use for them it seems. All the object based libs can't express that.

kof commented 7 years ago

Btw. I have added JS_FUNCTION_PROPERTY and just realized it is not really needed, because it can be expressed with JS_FUNCTION_PARTIAL.

kitten commented 7 years ago

@kof you could replace all of them with the function partial ;) but that prevents us from applying different invariants later on. I.e. we don't want to allow multiple rules where only a property should go. This can prevent unexpected bugs and the user won't have to worry about interpolation sanitisation as much

kof commented 7 years ago

@kof you could replace all of them with the function partial ;)

yeah, that is also true

kof commented 7 years ago

So the current state of this PR looks good to you all?

kof commented 7 years ago

I am not sure whats better JS_FUNCTION_PROPERTY and JS_FUNCTION_VALUE or JS_PROPERTY_FUNCTION and JS_VALUE_FUNCTION.

The first one reads semantically strange but the JS_FUNCTION is good. The last one reads nicer but JS_VALUE or JS_PROPERTY part is kinda wrong, because its CSS value and CSS property.

kitten commented 7 years ago

@kof Don't overthink it ;) Both are fine imho. The only question is, do we want to go for "_INTERPOLATION", to which I say no, I guess. It doesn't intuitively convey what it is.

But apart from that JS_FUNCTION_PROPERTY is good and can be read as "functional property" or "js function - property"

I'd say this PR is good to go :+1:

kof commented 7 years ago

do we want to go for "_INTERPOLATION",

Definitely not interpolation, because in the context of ISTF there is no interpolation. It only exists in template strings.

iamstarkov commented 6 years ago

can branch be deleted?