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

Components that do not extend LightningElement should get dev warnings for missing @api #3761

Open
nolanlawson opened this issue Oct 2, 2023 · 3 comments

Comments

@nolanlawson
Copy link
Contributor

nolanlawson commented Oct 2, 2023

Follow-up to #3713 and #3758

Components that extend a non-LightningElement superclass:

export default class extends CustomSuperclass {}

... should still get dev warnings when they declare a method that is not @api-annotated. (Implemented in #3713)

This is disabled for now because it turned out to be tricky to handle superclasses that declare @api but whose subclasses do not.

@nolanlawson
Copy link
Contributor Author

nolanlawson commented Oct 2, 2023

This is a little more subtle than the bug title implies – subclasses can "inherit" the warnings from their superclasses, e.g. in this case:

export default class Subclass extends Superclass () {}
export default class Superclass extends LightningElement () {
  method()
}
subclass.method() // warns

However, the following case does not cause a warning:

export default class Subclass extends Superclass () {
  method()
}
export default class Superclass extends LightningElement () {
}
subclass.method() // does not warn

In any case, we should just be consistent everywhere. Maybe this is best to tackle after #3762 since the existing behavior is pretty hard to reason about.

@mayurrkukreja
Copy link

I want to work on this issue, can it be assigned to me ? @nolanlawson

@nolanlawson
Copy link
Contributor Author

@mayurrkukreja We don't have a process of assigning issues, but please feel free to take this up 🙂

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

No branches or pull requests

2 participants