Skip to content
Permalink
main
Switch branches/tags

Commits on May 19, 2022

  1. fix(forms): Warn on FormControls that are constructed with both optio…

    …ns and asyncValidators.
    
    DEPRECATED:
    
    It is now deprecated to provide *both* `AbstractControlOption`s and an async validators argument to a FormControl. Previously, the async validators would just be silently dropped, resulting in a probably buggy forms. Now, the constructor call is deprecated, and Angular will print a warning in devmode.
    dylhunn authored and alxhub committed May 19, 2022
  2. fix(forms): Add a nonNullable option to FormControl for consistency.

    DEPRECATED:
    
    The `initialValueIsDefault` option has been deprecated and replaced with the otherwise-identical `nonNullable` option, for the sake of naming consistency.
    dylhunn authored and alxhub committed May 19, 2022
  3. docs: fix inline JSDoc tags (@see --> @link) (#46040)

    In some places, the [@see][1] JSDoc tag was incorrectly used instead of
    the [@link][2] inline tag, leading to warnings during doc generation and
    the `@see` tags being ignored (and thus shown in the docs as is).
    Replace the `@see` tags with the intended `@link` tags.
    
    [1]: https://jsdoc.app/tags-see.html
    [2]: https://jsdoc.app/tags-inline-link.html
    
    PR Close #46040
    gkalpak authored and alxhub committed May 19, 2022

Commits on May 18, 2022

  1. test(router): Add tests for initialNavigation: enabledBlocking (#45733)

    Adds additional tests to verify `enabledBlocking` functionality. The
    initial attempt to fix #44355 would have broken the scenario where a new
    navigation cancels the initial navigation. We also cannot rely on
    `NavigationError` like the example workaround in that issue report is
    doing because there won't be one if a guard simply rejects
    the initial nav (#16211).
    
    PR Close #45733
    atscott authored and jessicajaniuk committed May 18, 2022
  2. fix(compiler-cli): use existing imports for standalone dependencies (#…

    …46029)
    
    This commit fixes a small issue in the logic around the calculation of
    template scopes for standalone components. These scopes include a
    `Reference` for each dependency of a standalone component, which is used to
    generate references to that dependency in various contexts.
    
    Previously, the `Reference` used for a dependency was the one generated from
    its own metadata. For example, a referenced directive used the `Reference`
    that was created when analyzing the directive declaration itself. This still
    works, as the compiler is always able to emit a reference to any valid
    `Reference`. However, it's not optimal.
    
    The `Reference` which should be used instead is the one generated from
    analyzing the standalone component's `imports` array, which has knowledge of
    how the dependency is referenced from within the standalone component's file
    itself. This allows the compiler to skip creating a new import for the
    dependency when emitting the standalone component, and use the existing,
    user-authored import instead. This saves on code size and avoids taxing the
    bundler with unnecessary imports.
    
    PR Close #46029
    alxhub authored and jessicajaniuk committed May 18, 2022
  3. fix(compiler-cli): handle standalone components with cycles (#46029)

    The Angular compiler performs cycle detection when generating imports within
    component files. This was previously necessary as reifying dependencies
    discovered via NgModules into the component output could add imports that
    weren't present in the original component and potentially create cycles.
    Doing this could cause order-of-execution issues with existing user imports,
    so the compiler detects this case and falls back to an alternative way of
    specifying component dependencies that doesn't risk creating cycles.
    
    For standalone components, Angular does not need to add new imports to the
    component file as the user has already explicitly referenced dependencies
    in the `@Component.imports`. As a result, the cycle detection can be
    skipped.
    
    Correctly authoring a program with import cycles is always challenging. One
    side of a cyclic import will always initially evaluate to `undefined`, and
    this can result in errors in the component definition when this happens
    within component `imports`.
    
    Our compiler _could_ detect the cycle and choose to wrap the component
    dependencies in an automatic closure instead, avoiding any issues with
    `undefined` during an eager evaluation. However, this commit makes an active
    choice not to do that as it only serves to mask the problems with cyclic
    imports. Future refactorings may cause the "other half" of the cycle to
    break. Users should instead be aware of the potential problems with cycles
    and explicitly defer evaluations with `forwardRef` where needed. This
    ensures that future implementations of Angular compilation which may not be
    able to automatically detect import cycles and correct accordingly can still
    compile such components.
    
    PR Close #46029
    alxhub authored and jessicajaniuk committed May 18, 2022

Commits on May 17, 2022

  1. revert "fix(forms): Value and RawValue should be part of the public A…

    …PI." (#46023)
    
    As per discussion on #fw-forms, this reverts #45978 (although the more in-depth comments were kept).
    
    PR Close #46023
    dylhunn authored and jessicajaniuk committed May 17, 2022
  2. docs(forms): Make some fixes to typed forms docs: (#46023)

    * `FormRecord` jsdocs should now appear on a.io
    * The `{@see foo#bar}` syntax previously did not work, and has been replace with backticks
    
    PR Close #46023
    dylhunn authored and jessicajaniuk committed May 17, 2022
  3. docs: explicitly specify a version in the CLI install command (#46020)

    Update the CLI install command in the CLI overview page to explicitly
    specify a version. This ensures that the version installed is
    appropriate for the version of the docs (e.g. installing CLI v12.x when
    following the v12 docs) and it consistent with the `setup-local` guide.
    
    PR Close #46020
    gkalpak authored and jessicajaniuk committed May 17, 2022
  4. fix(docs-infra): correctly style the CLI version in code snippet (#46020

    )
    
    Some CLI versions (such as `@next`) are not parsed (and thus not
    formatted) correctly in code snippets. Fix this by explicitly adding an
    appropriate CSS class to the `<aio-angular-dist-tag>` elements to let
    PrettyPrint know how to style this token.
    
    PR Close #46020
    gkalpak authored and jessicajaniuk committed May 17, 2022
  5. docs: remove Narco from hero list in code, text, and images (#46008)

    Fixes issue #45769
    
    Removes the malevolent comic book character, "Narco," from the list of heroes. This change removes the reference from the code, text and screenshots used in the documentation and makes other minor edits as necessary.
    
    PR Close #46008
    bob-watson authored and jessicajaniuk committed May 17, 2022
  6. build: update angular (#46016)

    PR Close #46016
    renovate-bot authored and jessicajaniuk committed May 17, 2022

Commits on May 16, 2022

  1. docs: add template overview doc (#45897)

    Organize bottom list into cards.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  2. docs: update links and TOC (#45897)

    Update links and TOC for updated content.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  3. docs: updated Property binding doc (#45897)

    Refined and edited as a task-based document with the assistance
    of the SME
    Add missing prerequisites and what's next sections
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  4. docs: updated Event binding doc (#45897)

    Document updated with the assistance of the SME.
    Add missing prerequisites and what's next sections
    Make suggested changes to Event binding doc.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  5. docs: new binding overview doc (#45897)

    New binding overview doc. Content derived from existing docs.
    Make changes suggested in PR for binding overview doc.
    Deleted bottom paragraph from Binding overview per comments made by
    atscott and alxhub.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  6. docs: Text interpolation doc amended to be task-based (#45897)

    Rewrite document as task-based
    Add prerequisites and What's next sections.
    Content edited with the assistance of the SME.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  7. docs: new Pipes in templates doc (#45897)

    New using a Pipe in a template document.
    Content taken from the original Pipes document.
    Content edited with the assistance of the SME.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  8. docs: Pipes transform data new doc (#45897)

    New Transforming data with pipes document.
    Content taken from the original Pipes document.
    Content edited with the assistance of the SME.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  9. docs: Understanding pipes new doc (#45897)

    New overview file using the Understanding… format.
    The original Pipes document was considered too long and
    was broken down into several separate topics.
    Content edited with the assistance of the SME.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  10. docs: new Template expressions overview doc (#45897)

    Create a new Template expressions overview doc in the Understanding...
    format.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  11. docs: class-binding created as a separate task-based doc (#45897)

    Class and style binding was pulled out of Attribute, class, and style
    binding doc and put in its own doc.
    Content edited with the assistance of the SME.
    Prerequisites and What's next sections were added.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  12. docs: Attribute binding changed to include attribute binding only (#4…

    …5897)
    
    Attribute document broken down into two separate documents:
    1) Attribute binding
    2) Class and style binding
    Content edited with the assistance of the SME.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  13. docs: Understanding template variables updated (#45897)

    This converts the "Template variables" doc to the new "Understanding"
    format and remove some irrelevant content.
    
    PR Close #45897
    trekladyone authored and jessicajaniuk committed May 16, 2022
  14. build: use updated commit sha for github actions (#46010)

    Update the commit sha for the dev-infra github actions.
    
    PR Close #46010
    josephperrott authored and jessicajaniuk committed May 16, 2022
  15. fix(forms): Value and RawValue should be part of the public API. (#45978

    )
    
    Consider a typed group for storing contact information:
    
    ```
    declare interface ContactControls {
    	name: FormControl<string|null>;
    }
    
    contactForm: FormGroup<ContactControls> = ...;
    
    saveForm(form: FormGroup<ContactControls>) {
    	service.newContact(contactForm.value);
    }
    ```
    
    What should be the type of `newContact`? The answer, of course, is the value type:
    
    ```
    declare interface Contact {
    	name: string|null;
    }
    
    class ContactService {
    	newContact(c: Contact) {}
    }
    ```
    
    This is quite redundant, and therefore, we should allow the value type to be generated automatically. We already have the helper types to do this -- we just need to document and export them. Then, this becomes possible:
    
    ```
    class ContactService {
    	newContact(c: RawValue<FormGroup<ContactControls>>) {}
    }
    ```
    
    PR Close #45978
    dylhunn authored and jessicajaniuk committed May 16, 2022
  16. docs(devtools): add firefox extension references (#45985)

    add a link to recent deployed firefox extension and use less specific terminology
    PR Close #45985
    4javier authored and jessicajaniuk committed May 16, 2022
  17. fix(devtools): Variables initialized to undefined appearing as [sette…

    …r] in property inspector (#45921)
    
    Fixed the condition and added a test case to catch the fix
    
    PR Close #45921
    Ahm3rIjaz authored and jessicajaniuk committed May 16, 2022
  18. refactor(core): avoid code duplication in standalone-related logic (#…

    …45949)
    
    This commit updates the standalone-related logic to address the feedback from previous code reviews (specifically: #45687 (comment)).
    
    PR Close #45949
    AndrewKushnir authored and jessicajaniuk committed May 16, 2022
  19. refactor(core): tree-shake away a DI error message string in prod bun…

    …dles (#45994)
    
    This commit adds the `ngDevMode` check to tree-shake away an error message string (which also retains a reference to an extra function).
    
    PR Close #45994
    AndrewKushnir authored and jessicajaniuk committed May 16, 2022
  20. fix(language-service): Fix detection of Angular for v14+ projects (#4…

    …5998)
    
    In v14, the .d.ts file for angular core is now "index.d.ts" rather than "core.d.ts".
    
    This change happened in ng-packagr/ng-packagr@c6f6e4d
    
    PR Close #45998
    ivanwonder authored and jessicajaniuk committed May 16, 2022
Older