phlex icon indicating copy to clipboard operation
phlex copied to clipboard

Make Phlex::HTML functionality come from a Module

Open iachettifederico opened this issue 1 year ago • 3 comments

I have a project that has an HTML component that inherits from one of my domain models. I'd like to be able to write that class using Phlex, but Phlex forces me to inherit from Phlex::HTML. I wonder if it's possible to move all the behavior of the Phlex::HTML class into a separate module and then include that module in the class. The result of this would be no behavior change, but more flexibility for dealing with already established inheritance hierarchies.

What do you think about this? I'd be glad to contribute by doing it myself if you find it to be a good idea

iachettifederico avatar Jan 07 '24 12:01 iachettifederico

I agree we should do this. We should also separate out a Renderable interface from the SGML interface.

As long as we keep Phlex::HTML and Phlex::SVG as classes, we should be able to do this without breaking anything.

joeldrapper avatar Jan 08 '24 11:01 joeldrapper

I'm working on this ATM. I already extracted the Renderable interface from SGML. Any name you'd like me to use when extracting the interface HTML?

iachettifederico avatar Jan 09 '24 10:01 iachettifederico

@iachettifederico sorry I haven't given your PR much attention. I will get to it! ❤️

joeldrapper avatar Jan 27 '24 01:01 joeldrapper