main
Commits on May 19, 2022
-
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.
-
fix(forms): Add a
nonNullableoption toFormControlfor consistency.DEPRECATED: The `initialValueIsDefault` option has been deprecated and replaced with the otherwise-identical `nonNullable` option, for the sake of naming consistency.
-
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
Commits on May 18, 2022
-
-
-
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
-
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
-
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
Commits on May 17, 2022
-
revert "fix(forms): Value and RawValue should be part of the public A…
-
-
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
-
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
-
docs: remove Narco from hero list in code, text, and images (#46008)
-
build: update angular (#46016)
PR Close #46016
Commits on May 16, 2022
-
docs: add template overview doc (#45897)
Organize bottom list into cards. PR Close #45897
-
docs: update links and TOC (#45897)
Update links and TOC for updated content. PR Close #45897
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
docs: new Template expressions overview doc (#45897)
Create a new Template expressions overview doc in the Understanding... format. PR Close #45897
-
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
-
docs: Attribute binding changed to include attribute binding only (#4…
-
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
-
build: use updated commit sha for github actions (#46010)
Update the commit sha for the dev-infra github actions. PR Close #46010
-
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
-
docs(devtools): add firefox extension references (#45985)
add a link to recent deployed firefox extension and use less specific terminology PR Close #45985
-
fix(devtools): Variables initialized to undefined appearing as [sette…
-
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
-
refactor(core): tree-shake away a DI error message string in prod bun…
-
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