phlex icon indicating copy to clipboard operation
phlex copied to clipboard

Raise when overriding HTML elements

Open joeldrapper opened this issue 1 year ago • 2 comments

Phlex could issue a warning or raise whenever an element method is overridden in a subclass. The warning could be ignored explicitly with a macro, e.g.

override def title
  @post.title
end

I think this might make sense as a feature you can optionally enable.

joeldrapper avatar Jan 27 '24 01:01 joeldrapper

Implementation with a TracePoint.

joeldrapper avatar Jan 29 '24 15:01 joeldrapper

We could ship a 1.x version that doesn't break.

joeldrapper avatar Jan 29 '24 15:01 joeldrapper

I don’t love the idea of using a TracePoint to implement this, which we need to support the override def foo interface, since the definition will happen before override is called.

I’m just going to close this for now. If it comes up again, we can take another look.

joeldrapper avatar Jun 11 '24 10:06 joeldrapper