Skip to content
Permalink
Branch: master
Commits on Apr 23, 2019
  1. refactor(core): static-query migration should not fail for test files (

    devversion authored and benlesh committed Apr 22, 2019
    …#30034)
    
    Currently when someone runs `ng update` with the static-query migration,
    the migration can fail with an error saying that the `AOT` compiler could not
    be created. This can happen if the CLI project contains a test `tsconfig.json`
    that is picked up by the schematic.
    
    Due to the fact that spec tsconfig files cannot be ran with NGC (e.g. test
    components are not part of a module; not all source files are guaranteed to
    be included), test `tsconfig` projects will now use a new `test` migration
    strategy where all queries within tests are left untouched and a TODO is added.
    
    PR Close #30034
Commits on Apr 22, 2019
  1. refactor(core): template-var-assignment migration incorrectly warns (#…

    devversion authored and benlesh committed Apr 22, 2019
    …30026)
    
    Currently the `template-var-assignment` migration incorrectly warns if
    the template writes to a property in the component that has the same
    `ast.PropertyWrite´ name as a template input variable but different
    receiver. e.g.
    
    ```html
    <!-- "someProp.element" will be incorrectly reported as template variable assignment -->
    <button *ngFor="let element of list" (click)="someProp.element = null">Reset</button>
    ```
    
    Similarly if an output writes to a component property with the same name as a
    template input variable, but the expression is within a different template scope,
    the schematic currently incorrectly warns. e.g.
    
    ```html
    <button *ngFor="let element of list">{{element}}</button>
    
    <!-- The "element = null" expression does not refer to the "element" template input variable -->
    <button (click)="element = null"></button>
    ```
    
    PR Close #30026
  2. ci: remove integration test "uname -a" command (#30006)

    devversion authored and benlesh committed Apr 20, 2019
    We recently added the "uname -a" command to the CircleCI
    integration test in order to identify Linux kernels that
    broke Chrome sandboxing.
    
    Since this issue seems to be claimed as fixed by the CircleCI
    support and we didn't see any sandboxing issues the last month,
    we are removing the debugging command we added.
    
    PR Close #30006
Commits on Apr 19, 2019
  1. refactor(core): static-query template strategy should not parse style…

    devversion authored and benlesh committed Apr 12, 2019
    …sheets (#29876)
    
    Currently the `template-strategy` for the static query migration uses the
    Angular compiler in order to determine the query timing. This is problematic
    as the AngularCompilerProgram also collects metadata for referenced
    component stylesheets which aren't necessarily present. e.g. in a CLI
    project the component can reference a Sass file. It's not guaranteed
    that the standalone Angular compiler plugin supports Sass without
    custom logic that is brought in by the Angular CLI webpack plugin.
    
    In order to avoid any failures for invalid stylesheets, we just disable
    normalizing of all referenced stylesheets.
    
    PR Close #29876
  2. refactor(core): allow developers to select static-query migration str…

    devversion authored and benlesh committed Apr 12, 2019
    …ategy (#29876)
    
    Currently there are two available migration strategies for the `static-query`
    schematic. Both have benefits and negatives which depend on what the
    developer prefers. Since we can't decide which migration strategy is the
    best for a given project, the developer should be able to select a specific
    strategy through a simple choice prompt.
    
    In order to be able to use prompts in a migration schematic, we need to
    take advantage of the "inquirer" package which is also used by the CLI
    schematic prompts (schematic prompts are usually only statically defined
    in the schema). Additionally the schematic needs to be made "async"
    because with prompts the schematic can no longer execute synchronously
    without implementing some logic that blocks the execution.
    
    PR Close #29876
  3. fix(bazel): do not typecheck core schematic files (#29876)

    devversion authored and benlesh committed Apr 13, 2019
    Currently for Angular Bazel projects, NGC needs to be run in the
    "postinstall" NPM script in order to generate required summary files.
    
    We need to update the postinstall `tsconfig` to not check/re-build the
    `@angular/core` schematic code which has transitive dependencies
    which are only available inside of a CLI project. As this is not guaranteed
    to be the case with Angular Bazel projects, we need to make sure that
    we don't check/re-build these files.
    
    PR Close #29876
Commits on Apr 15, 2019
  1. refactor(core): migrations do not properly handle multiple templates …

    devversion authored and alxhub committed Apr 11, 2019
    …in source file (#29841)
    
    Currently if there are multiple source files within a given
    TypeScript source file, only the last template in the source
    file is checked as we store templates in a `Map` with the
    source file paths as keys.
    
    This is problematic as multiple templates can live within the
    same source file and we therefore accidentally overwrite
    existing entries in the resolved templates map.
    
    PR Close #29841
  2. refactor(core): add static-query template strategy (#29815)

    devversion authored and alxhub committed Apr 12, 2019
    Introduces a new strategy for the `static-query` schematic that
    is enabled by default. In order to provide a migration that works
    for the most Angular applications and makes the upgrade as easy
    as possible, the template strategy leverages the view engine
    Angular compiler logic in order to determine the query timing
    that is currently used within applications using view engine.
    
    PR Close #29815
  3. refactor(compiler): export static-query detection logic (#29815)

    devversion authored and alxhub committed Apr 10, 2019
    The `@angular/compiler` package currently contains the logic for determining whether
    given queries are used statically or dynamically. This logic would be necessary in order
    to build a schematic that leverages the Angular compiler API's in order to simulate the
    query timing based on what ViewEngine computed at compilation-time/runtime.
    
    Exporting the logic that is necessary to detect the timing should not affect the public
    API as the `@angular/compiler` package is denoted as private in `PUBLIC_API.md`
    
    PR Close #29815
  4. refactor(core): move usage detection into usage strategy (#29815)

    devversion authored and alxhub committed Apr 8, 2019
    In order to support multiple strategies for detecting the query timing, the
    query usage logic has been moved into a query usage strategy.
    
    PR Close #29815
Commits on Apr 11, 2019
  1. refactor(core): static-query schematic should check templates (#29713)

    devversion authored and IgorMinar committed Apr 8, 2019
    Queries can technically be also accessed within component templates
    e.g.
    
    ```html
    <my-comp [binding]="myQuery"></my-comp>
    ```
    
    In that case the query with the property "myQuery" is accessed
    statically and needs to be marked with `static: true`. There are
    other edge cases that need to be handled as the template property
    read doesn't necessarily resolve to the actual query property.
    
    For example:
    
    ```html
    <foo #myQuery></foo>
    <my-comp [binding]="myQuery"></my-comp>
    ```
    
    In this scenario the binding doesn't refer to the actual query
    because the template reference variable takes precedence. The
    query doesn't need to be marked with "static: true" this time.
    
    This commit ensures that the `static-query` migration schematic
    now handles this cases properly. Also template property reads
    that access queries from within a `<ng-template>` are ignored
    as these can't access the query before the view has been initialized.
    
    Resolves FW-1216
    
    PR Close #29713
Commits on Apr 10, 2019
  1. refactor(core): run migration schematics for v8 beta and rc releases (#…

    devversion authored and IgorMinar committed Apr 5, 2019
    …29735)
    
    Currently the `static-query` and `template-var-assignment` schematic only runs
    for `8.0.0` which does not include any betas or release candidates. We want to
    run the schematic in the beta's and RC in order to get early feedback about the
    schematics. Enabling it promptly with V8 stable release can result in accidental
    breakages that we would like to fix/identify before.
    
    PR Close #29735
  2. refactor(core): static-query schematic should handle abstract classes (

    devversion authored and IgorMinar committed Apr 8, 2019
    …#29688)
    
    Queries can not only be accessed within derived classes, but also in
    the super class through abstract methods. e.g.
    
    ```
    abstract class BaseClass {
    
      abstract getEmbeddedForm(): NgForm {}
    
      ngOnInit() {
         this.getEmbeddedForm().doSomething();
      }
    }
    
    class Subclass extends BaseClass {
      @ViewChild(NgForm) form: NgForm;
    
      getEmbeddedForm() { return this.form; }
    
    }
    ```
    
    Same applies for abstract properties which are implemented in the base class
    through accessors. This case is also now handled by the schematic.
    
    Resolves FW-1213
    
    PR Close #29688
Commits on Apr 9, 2019
  1. refactor(core): static-query schematic should handle function callbac…

    devversion authored and IgorMinar committed Apr 8, 2019
    …ks (#29663)
    
    Currently the static-query schematic is not able to properly handle
    call expressions that pass function declarations that access a given
    query. e.g.
    
    ```ts
    ngOnInit() {
      this._callFunction(() => this.myQuery.doSomething());
    }
    
    _callFunction(cb: any) { cb(); }
    ```
    
    In that case the passed function is executed synchronously in
    the "ngOnInit" lifecycle and therefore the query needs to be
    detected as "static".
    
    We can fix this by keeping track of the current function context
    and using it to resolve identifiers to the passed arguments.
    
    PR Close #29663
  2. refactor(core): static-query schematic should handle binary expressio…

    devversion authored and IgorMinar committed Apr 2, 2019
    …ns (#29663)
    
    Currently we only check getters for property access expressions. This is wrong
    because property access expressions do not always cause the "getter" to be
    triggered. e.g.
    
    ```ts
    set a() {...}
    get a() {...}
    
    ngOnInit() {
      this.a = true;
    }
    ```
    
    In that case the schematic currently incorrectly checks the "getter", while this is a binary
    expression and the property access is used as left-side of the binary expression. In that
    case we need to check the setter declaration of the property and not the "getter". In order
    to fix this, we need to also check `ts.BinaryExpression` nodes and check getters/setters
    based on the used operator token. There are three types of binary expressions:
    
    1) Value assignment (using `=`). In that case only the setter is triggered.
    2) Compound assignment (e.g. using `+=`). In that case `getter` and `setter` are triggered.
    3) Comparison (e.g. using `===`). In that case only the getter is triggered.
    
    PR Close #29663
Commits on Apr 8, 2019
  1. test(core): add test for template variable object property assignment (

    devversion authored and IgorMinar committed Apr 4, 2019
    …#29708)
    
    The `template-var-assignment` schematic currently complains if someone
    assigns a value to a template variable. This will no longer work with Ivy, but
    it should be totally fine to update a property of the template variable if it refers
    to an object. This commit adds a test that ensures that we don't incorrectly report
    any failure for such property writes in bound events.
    
    PR Close #29708
  2. refactor(core): polish failure messages for template-var-assignment s…

    devversion authored and IgorMinar committed Apr 4, 2019
    …chematic (#29708)
    
    Improves the failure messages for the `template-var-assignment` schematic. After manual
    testing of the schematic it's not quite clear for developers what the failure message means
    without any context. The schematic now also references a short markdown file mentioning
    what needs to be changed, but eventually this document needs to be expanded with more
    information and context of the reasoning behind this change within Ivy.
    
    PR Close #29708
Commits on Apr 4, 2019
  1. build: add render3 entry-point to legacy test systemjs config (#29675)

    devversion authored and jasonaden committed Apr 2, 2019
    Until the legacy job has been migrated to Bazel w/ Saucelabs, we
    need to add the `render3` entry-point to the test SystemJS configuration
    so that developers don't get inconsistent behavior between Bazel tests
    and the legacy tests. e.g. https://circleci.com/gh/angular/angular/270102
    
    PR Close #29675
Commits on Apr 2, 2019
  1. feat(core): template-var-assignment update schematic (#29608)

    devversion authored and jasonaden committed Mar 30, 2019
    Introduces a new update schematic called "template-var-assignment"
    that is responsible for analyzing template files in order to warn
    developers if template variables are assigned to values.
    
    The schematic also comes with a driver for `tslint` so that the
    check can be used wtihin Google.
    
    PR Close #29608
Commits on Apr 1, 2019
  1. fix(core): static-query schematic should detect static queries in get…

    devversion authored and jasonaden committed Mar 30, 2019
    …ters. (#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 #29609
Commits on Mar 27, 2019
  1. fix(ivy): ngtsc is unable to detect flat module entry-point on windows (

    devversion authored and mhevery committed Mar 26, 2019
    #29453)
    
    Currently when building an Angular project with `ngtsc`
    and `flatModuleOutFile` enabled, the Ngtsc build will fail
    if there are multiple source files as root file names.
    
    Ngtsc and NGC currently determine the entry-point for multiple
    root file names by looking for files ending with `/index.ts`.
    
    This functionality is technically deprecated, but still supported
    and currently breaks on Windows as the root file names are not
    guaranteed to be normalized POSIX-like paths.
    
    In order to make this logic more reliable in the future, this commit
    also switches the shim generators and entry-point logic to the branded
    path types. This ensures that we don't break this in the future.
    
    PR Close #29453
  2. ci: lock chrome and firefox versions for saucelabs (#29529)

    devversion authored and mhevery committed Mar 27, 2019
    With 0f1da49, the Chrome beta job has
    been disabled because a new Chrome beta has been released, but Saucelabs
    didn't support a chromedriver that is compatible with that given beta version.
    
    Now the topic of pinning these external browsers to a specific version came up. In order to make the build less prone to unexpected new versions, we need to
    _permanently_ disable the Chrome beta browser. Otherwise pinning `SL_CHROME`
    to a specific version does not statisfy the requirement of making the CI jobs
    more deterministic.
    
    See original discussion: #29518 (comment)
    
    Chrome can be pinned to Chrome v73 (latest stable version at time of this commit)
    Firefox can be pinned to Firefox v65 (latest stable version available in Saucelabs platform)
    
    PR Close #29529
  3. build: add pre-release check that validates the version name (#29551)

    devversion authored and mhevery committed Mar 27, 2019
    Currently with the release of "8.0.0-beta.10", the Bazel npm packag accidentally
    was stamped with an incorrect version placeholder: `8.0.0-beta.10+1.sha-a28b3e3`.
    
    This can happen because the placeholder is based on latest tag that matches the
    Semver format. e.g. if `HEAD` equals to the commit that has the latest tag, the
    version name will be correct and refer to the tag name (e.g. `8.0.0-beta.10`). Though
    if the latest commit is not tagged with the most recent tag, the version
    name will also include the SHA of the commit (e.g.  `8.0.0-beta.10+1.sha-a28b3e3`).
    
    We can ensure that we don't accidentally release versions from a more recent commit
    that shouldn't be part of the release by adding a pre-release check that ensures that
    the `BUILD_SCM_VERSION` Bazel status variable matches the expected version format.
    
    PR Close #29551
Commits on Mar 26, 2019
  1. test(platform-browser): fix shadow dom test not working in firefox 65 (

    devversion authored and kara committed Mar 26, 2019
    …#29518)
    
    With 093dc91, Firefox has been updated
    to the latest available version within Saucelabs. Firefox added shadow DOM support
    in Firefox 63 and therefore the shadow dom test in `platform-browser` now runs as well.
    
    This test currently fails because Firefox does not support computed style property
    shorthands. In order to make this test work on Firefox now, we just switch from `border`
    to `background` (because of the overhead when comparing each `top`, `bottom`, `left`, `right`-border properties)
    
    PR Close #29518
  2. ci: temporarily disable chrome beta for saucelabs (#29518)

    devversion authored and kara committed Mar 26, 2019
    We need to temporarily disable Chrome beta within the
    `legacy-saucelabs-tests` and `test_saucelabs_bazel` job.
    
    This is necessary because Saucelabs added Chrome v74 to their
    beta version channel without providing the corresponding
    chromedriver that is *required* for that beta version.
    
    Explicitly specifying a chromedriver within the Selenium browser
    capabilities doesn't seem to work because Saucelabs seems to mirror
    their supported chromedriver versions. Meaning that we can't explicitly
    use chromedriver.storage.googleapis.com/index.html?path=74.0.3729.6/
    
    Re-enabling tracked with: FW-1205
    
    PR Close #29518
  3. ci: update chrome and firefox saucelabs versions (#29518)

    devversion authored and kara committed Mar 26, 2019
    Updates the browser versions of Chrome and Firefox to the latest releases. This
    matches what we claim to support according to https://angular.io/guide/browser-support.
    
    PR Close #29518
Commits on Mar 25, 2019
  1. fix(core): static-query schematic should detect queries in "ngDoCheck…

    devversion authored and mhevery committed Mar 23, 2019
    …" and "ngOnChanges" (#29492)
    
    Queries can be also used statically within the "ngDoCheck" and "ngOnChanges" lifecylce hook.
    In order to properly detect all queries, we need to also respect these lifecycle hooks.
    
    Resolves FW-1192
    
    PR Close #29492
Commits on Mar 21, 2019
  1. ci: disable sauce-connect ssl bumping (#29447)

    devversion authored and mhevery committed Mar 21, 2019
    By default we disable SSL bumping for all requests. This is because SSL
    bumping is not needed for our test setup and in order to perform the SSL
    bumping, Saucelabs intercepts all HTTP requests in the tunnel VM and modifies
    them. This can cause flakiness as it makes all requests dependent on the SSL bumping
    middleware.
    
    See: https://wiki.saucelabs.com/display/DOCS/Troubleshooting+Sauce+Connect#TroubleshootingSauceConnect-DisablingSSLBumping
    
    PR Close #29447
Commits on Mar 20, 2019
  1. ci: do not cache modified "node_modules" in "material-unit-tests" job (

    devversion authored and kara committed Mar 20, 2019
    …#29416)
    
    Currently we cache the Material `node_modules` after
    the `run_angular_material_unit_tests.sh` completed. This
    means that the cache will incorrectly contain the Ivy NPM
    package output which might be incompatible with the
    other Material dependencies. e.g. the Material postinstall
    command now uses a different NGC version that does not
    work with the `typescript` version that has been specified in
    the Material project.
    
    PR Close #29416
Commits on Mar 19, 2019
  1. ci: enable parallelism for material-unit tests job (#29378)

    devversion authored and matsko committed Mar 18, 2019
    PR Close #29378
Older
You can’t perform that action at this time.