Closed alex-vladut closed 3 years ago
Leaving a note for reference. After a session with @alex-vladut we realised that the syntax wasn't color <dt.colors.primary
because that would name the slot as dt.colors.primary
so instead, we need to do this:
# fixed color to a DS value
color dt.colors.primary
# color opened as prop with default to DS value
color < dt.colors.primary
With this PR I try to solve this issue where data related slots appear in the view's props as unused variables: https://github.com/viewstools/morph/issues/242
I need this change because I'll try to reuse the mechanism for the design tokens, otherwise it will even lead to syntax errors as the design token slots now contain dots as well:
will end up with some code like this:
There could be an edge case issue with the approach, but I'm not expecting it to be a problem at the moment as those
isValid
,onChange
etc. keywords should be used only with data anyway. e.g.This use case will not work with the approach I implemented here, as the slot won't appear in the props. I couldn't think of a better solution, but let me know please if you think this could be problematic and we could dig into that more. Thanks