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
feat(core): update schematic to migrate to explicit query timing #28983
feat(core): update schematic to migrate to explicit query timing #28983
Conversation
a7f19f2
to
75ee651
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for doing this! A few thoughts below.
packages/core/schematics/migrations/static-queries/index_spec.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/static-queries/index_spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! 🎉
packages/core/schematics/migrations/static-queries/angular/analyze_query_usage.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/static-queries/angular/analyze_query_usage.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/static-queries/angular/analyze_query_usage.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/static-queries/index_spec.ts
Outdated
Show resolved
Hide resolved
packages/core/schematics/migrations/static-queries/typescript/class_declaration.ts
Outdated
Show resolved
Hide resolved
0675789
to
ad707f9
Compare
packages/core/schematics/migrations/static-queries/angular/analyze_query_usage.ts
Outdated
Show resolved
Hide resolved
b916b33
to
604b587
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for behavior. @alexeagle should probably look at bazel sections.
Note: Looks like linter is upset
604b587
to
ad88378
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no issues from Bazel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
caretaker: I was able to get this green in g3 by
- fixing the type-check error mentioned in a comment here
- adding a new file
third_party/javascript/angular2/rc/packages/core/schematics/BUILD
containing
load("//javascript/typescript:build_defs.bzl", "ts_library")
licenses(["notice"]) # MIT License
ts_library(
name = "schematics",
srcs = glob(["migrations/**/*.ts"], exclude = [
"migrations/static-queries/*.ts",
"**/*_spec.ts",
]),
deps = [
"//third_party/javascript/node_modules/typescript:es2015.core",
"//third_party/javascript/node_modules/typescript:typings",
]
)
note that this also has to be treated specially in copybara since this file would be g3-only.
The fundamental problem is that we don't share the BUILD files between github and g3. Would be an interesting project.
packages/core/schematics/migrations/static-queries/angular/analyze_query_usage.ts
Show resolved
Hide resolved
Introduces an update schematic for the "@angular/core" package that automatically migrates pre-V8 "ViewChild" and "ContentChild" queries to the new explicit timing syntax. This is not required yet, but with Ivy, queries will be "dynamic" by default. Therefore specifying an explicit query timing ensures that developers can smoothly migrate to Ivy (once it's the default). Read more about the explicit timing API here: angular#28810
Properly handle chained class inheritances
Detect input setters with static query usage
Fix no implicit returns G3 error. Move specs into packages/core/schematis/test/* folder
ad88378
to
b2e2580
Compare
Mailed cl/236891637 to @AndrewKushnir so that the new schematics/ directory here won't be compiled in g3 yet |
@alexeagle it looks like Presubmit and Guitar tests are still failing. Could you please help look into this? |
Presubmit #3 (after additional changes in g3) |
Presubmit was successful, I've merged this PR. Thanks everyone for the help! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Introduces an update schematic for the
@angular/core
package thatautomatically migrates pre-V8
ViewChild
andContentChild
queries tothe new explicit timing syntax. This is not required yet, but with Ivy, queries
will be "dynamic" by default. Therefore specifying an explicit query timing
ensures that developers can smoothly migrate to Ivy (once it's the default).
Read more about the explicit timing API here: #28810