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

fix(core): static-query schematic should detect static queries in getters #29609

Conversation

Projects
None yet
3 participants
@devversion
Copy link
Member

commented Mar 30, 2019

Queries can also be statically accessed within getters. e.g.

ngOnInit() {
  this.myQueryGetter.doSomething();
}

In that case we need to check if the myQueryGetter definition accesses
a query statically. As we need to use the type checker for every property acess
within lifecylce hooks, the schematic might become slower than before, but considering
that this is a one-time execution, it is totally fine using the type-checker extensively.

fix(core): static-query schematic should detect static queries in get…
…ters.

Queries can also be statically accessed within getters. e.g.

```ts
ngOnInit() {
  this.myQueryGetter.doSomething();
}
```

In that case we need to check if the `myQueryGetter` definition accesses
a query statically. As we need to use the type checker for every property acess
within lifecylce hooks, the schematic might become slower than before, but considering
that this is a one-time execution, it is totally fine using the type-checker extensively.

@devversion devversion requested a review from angular/fw-core as a code owner Mar 30, 2019

@ngbot ngbot bot added this to the needsTriage milestone Mar 30, 2019

@googlebot googlebot added the cla: yes label Mar 30, 2019

@kara

kara approved these changes Mar 30, 2019

Copy link
Contributor

left a comment

LGTM

@kara kara removed their assignment Mar 30, 2019

@jasonaden jasonaden closed this in 33016b8 Apr 1, 2019

wKoza added a commit to wKoza/angular that referenced this pull request Apr 17, 2019

fix(core): static-query schematic should detect static queries in get…
…ters. (angular#29609)

Queries can also be statically accessed within getters. e.g.

```ts
ngOnInit() {
  this.myQueryGetter.doSomething();
}
```

In that case we need to check if the `myQueryGetter` definition accesses
a query statically. As we need to use the type checker for every property acess
within lifecylce hooks, the schematic might become slower than before, but considering
that this is a one-time execution, it is totally fine using the type-checker extensively.

PR Close angular#29609
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.