-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Support VSCode intellisense for @Attribute
/ HostAttributeToken
usage.
#56504
Comments
It looks like there are 2 different things being discussed here:
To start with, I can understand the worry that adding inputs for "static" attributes might come with the "unnecessary perf penalty" and this is here we've got #14033 open. Ultimately, after the above explanations, I think that this is a duplicate of #14033 |
@pkozlowski-opensource thanks for clarification. Sorry for messed explanation. The main point was adding property intellisense for |
Depending on what you've got in mind in terms of intellisense |
@pkozlowski-opensource Such as @Component({selector: 'child-with-attributes'})
class ChildComponent {
public color = inject(new HostAttributeToken('color'));
} @Component({
template: `
<child-with-attributes co... /> // here we get hint: color=""
`
})
class ParentComponent {} or visually: |
@pkozlowski-opensource is aforementioned feature appropriate framework-wise for implementing in language service? |
Which @angular/* package(s) are relevant/related to the feature request?
language-service
Description
@Attribute
decorator is already banned by angular-eslint/no-attribute-decorator.Instead we have
HostAttributeToken
which lacks support for:@angular/core
) (as in inputs)one-time binding
capabilities.Proposed solution
Completing bullets above would allow to close feature requests for one-time inputs: #14033 #55581 and the need of detaching the view from changeDetection runs as a workaround.
Such approach to
HostAttributeToken
usage would then make easy to switch toinject
/signal
/non-reactive value
/@Input
/input
if a framework user would need it because of preserving typings during rewrite.Library developers and advanced users would benefit from it from performance and bundle size perspective.
Alternatives considered
Only alternative is typed
@Input
orinput()
.But this approach creates unnecessary bindings for expected-as-one-time inputs with primitive values, in the end makes bundle bigger and client app work more every cd run, instead of making
language-service
to work a tiny bit more.The text was updated successfully, but these errors were encountered: