Skip to content
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

Raise when overriding HTML elements #626

Closed
joeldrapper opened this issue Jan 27, 2024 · 3 comments
Closed

Raise when overriding HTML elements #626

joeldrapper opened this issue Jan 27, 2024 · 3 comments
Labels
Milestone

Comments

@joeldrapper
Copy link
Collaborator

joeldrapper commented Jan 27, 2024

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
Copy link
Collaborator Author

Implementation with a TracePoint.

@joeldrapper joeldrapper added this to the 2.0 milestone Jan 29, 2024
@joeldrapper
Copy link
Collaborator Author

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

@joeldrapper joeldrapper changed the title Warn when overriding HTML elements Raise when overriding HTML elements Jan 30, 2024
@joeldrapper
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant