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

feat(core): update schematic to migrate to explicit query timing #28983

Closed

Conversation

@devversion
Copy link
Member

commented Feb 26, 2019

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: #28810

@devversion devversion self-assigned this Feb 26, 2019

@googlebot googlebot added the cla: yes label Feb 26, 2019

@devversion devversion force-pushed the devversion:feat/schematics-core-static-query branch 2 times, most recently from a7f19f2 to 75ee651 Feb 26, 2019

@ngbot ngbot bot added this to the needsTriage milestone Feb 26, 2019

@devversion devversion marked this pull request as ready for review Feb 26, 2019

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

@devversion devversion removed their assignment Feb 26, 2019

@devversion devversion requested review from alexeagle and jelbourn Feb 26, 2019

@kara
Copy link
Contributor

left a comment

Thanks so much for doing this! A few thoughts below.

@devversion devversion force-pushed the devversion:feat/schematics-core-static-query branch from 0675789 to ad707f9 Feb 27, 2019

@devversion

This comment has been minimized.

Copy link
Member Author

commented Feb 27, 2019

@kara @JoostK I've addressed the feedback. thank you!

@devversion devversion force-pushed the devversion:feat/schematics-core-static-query branch from b916b33 to 604b587 Mar 1, 2019

@kara

kara approved these changes Mar 1, 2019

Copy link
Contributor

left a comment

LGTM for behavior. @alexeagle should probably look at bazel sections.

Note: Looks like linter is upset

@devversion devversion force-pushed the devversion:feat/schematics-core-static-query branch from 604b587 to ad88378 Mar 1, 2019

@alexeagle
Copy link
Contributor

left a comment

no issues from Bazel

@AndrewKushnir

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2019

@alexeagle
Copy link
Contributor

left a comment

caretaker: I was able to get this green in g3 by

  1. fixing the type-check error mentioned in a comment here
  2. 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.

devversion added some commits Feb 27, 2019

feat(core): update schematic to migrate to explicit query timing
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:
#28810
fixup! feat(core): update schematic to migrate to explicit query timing
Properly handle chained class inheritances
fixup! feat(core): update schematic to migrate to explicit query timing
Detect input setters with static query usage
fixup! feat(core): update schematic to migrate to explicit query timing
Fix no implicit returns G3 error. Move specs into packages/core/schematis/test/* folder

@devversion devversion force-pushed the devversion:feat/schematics-core-static-query branch from ad88378 to b2e2580 Mar 5, 2019

@alexeagle

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2019

Mailed cl/236891637 to @AndrewKushnir so that the new schematics/ directory here won't be compiled in g3 yet

@AndrewKushnir

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2019

@AndrewKushnir

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2019

@alexeagle it looks like Presubmit and Guitar tests are still failing. Could you please help look into this?

@AndrewKushnir

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2019

Presubmit #3 (after additional changes in g3)

@AndrewKushnir

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2019

Presubmit was successful, I've merged this PR. Thanks everyone for the help!

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.