Replies: 1 comment
-
Hey @johnnynia, thanks for the feedback! I agree it would be really nice to make the component-rendering syntax more concise. We talked about using the constant names as methods before (#55) and ran into the issue that methods can't include I did another experiment (#88) which stored the buffer in a Anyway, your post inspired me to have another go at this and I came up with s slightly different approach prototyped here. #252 With this, you can access name-spaced views by using an underscore You should be able to install this branch to try it out: gem "phlex", github: "joeldrapper/phlex", branch: "experimental-view-methods" Let me know what you think. |
Beta Was this translation helpful? Give feedback.
-
This code snippet in the docs got me hooked on phlex immediately:
But looking deeper into phlex I've realized that only standard HTML elements get this really nice interface of just a method call — while custom components won't.
Let's say we want to render a basic modal and the final HTML code should look like this:
At the current state of phlex a possible implementation could look like this:
What I've had imagined by first looking at phlex was the possibility to write this like so:
Would an interface like this be feasible?
Maybe as a user I wouldn't have to write a class per component but some scoped mixins for one huge render class including them all? I really just don't know what may be possible and how! Just my naive suggestions as a too early adopter. 🙃❤️
Beta Was this translation helpful? Give feedback.
All reactions