-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A class for each component #23
Comments
@tsujigiri thanks for your comment!
I really want to hear more about what you have in mind! |
I'm pretty much thinking of something similar to Cells. In order to get some more documentation out of it, I could imagine requiring the params each component accepts to be explicitly declared. E.g.: class Card < MountainView::Component
property :title
property :description
# ...
end Maybe with an additional boolean parameter for declaring mandatoryness. The styleguide generating code could then iterate over these classes. All properties would appear in the styleguide. In the YAML file, the example values could also be required to be set. This would then force the developer of a component to also document it. Additionally, having a short description of each property as well as the component itself might be nice. These could also live in the YAML file. The class part could also be achieved with POROs with a method that would return a Hash of properties to be passed to the You be the judge. :) |
@tsujigiri I like the idea initially. We'll have to give it a bit more thought though. You're proposition is really nice but, right now, means a big change to how Mountain View works—but the idea is really nice. We thought a bit about cells when we initially were developing MV, and it's definitively a route we'd like to explore. Of course, feel free to fork or send a PR :) Really glad you're using Mountain View. If you can share more info on how and for what, that would be super helpful. You can find our emails in the gemspec if you don't want to make it public. |
@tsujigiri would like your input on @tombeynon's contribution on #26 |
In order to be able to deal with more complex logic, each component should have it's own class. It looks to me like
MountainView::Component
was intended to be the super class to inherit from for this purpose, only that therender_component
helper doesn't use it but directly renders the partial and passes along the properties. Are there any plans to change this? I'd be glad to come up with something, as I (together with @matthewcorreia-hitfox) am currently working on incorporating MountainView in our own UI components lib.The text was updated successfully, but these errors were encountered: