https://github.com/angular/angular

sort by:
Revision Author Date Message Commit Date
967e934 release: cut the v14.0.0-next.16 release (#45875) PR Close #45875 04 May 2022, 20:55:01 UTC
c988487 docs: release notes for the v13.3.6 release (#45874) PR Close #45874 04 May 2022, 20:07:02 UTC
2dbdebc feat(forms): Add `FormBuilder.nonNullable`. (#45852) With typed forms, all `FormControl`s are nullable by default, because they can be reset to `null`. This behavior is possible to change by passing the option `initialValueIsDefault: true`. However, in a large form, this is extremely cumbersome, as the option must be repeated over and over. Additionally, it is not possible to take full advantage of `FormBuilder`, since `FormBuilder.group` and `FormBuilder.array` will produce nullable controls. This PR introduces a new accessor `FormBuilder.nonNullable`, which produces *non-nullable* controls. Specifically, any call to `.control` will produce controls with `{initialValueIsDefault: true}`, and calls to `.array` or `.group` that implicitly build inner controls will have the same effect. ```ts let nfb = new FormBuilder().nonNullable; let name = nfb.group({who: 'Alex'}); // FormGroup<{who: FormControl<string>}> name.reset(); console.log(name); // {who: 'Alex'} ``` PR Close #45852 04 May 2022, 19:46:05 UTC
41e2a68 feat(router): add type properties to all router events (#44189) All router events now have a `type` property with a string name identifying the specific type of the event. The `type` property can be used to perform TypeScript type narrowing using an `if` statement, `switch` statement, or similar. This removes the need to perform `instanceof` checks but still allows them if preferred. An `instanceof` check requires the use of the event class value which may not be available or preferred in certain situations. The Router's `enableTracing` option is also now guarded with the `ngDevMode` flag which combined with the use of a new `stringifyEvent` function allows the tree-shaking of the string generation code for each router event class. However, the original `toString` class methods are still present to prevent a potential breaking change. As a result, full benefits of the tree-shaking potential will not be realized until they are removed. PR Close #44189 04 May 2022, 19:44:51 UTC
ea2b3a9 docs: update angular package format guide to reflect recent changes (#45725) Updates the Angular package format guide to reflect recent changes where we removed the secondary entry-point package.json files. PR Close #45725 04 May 2022, 19:44:28 UTC
32c625d fix(compiler-cli): handle forwardRef in imports of standalone component (#45869) Fixes that the compiler wasn't resolving `forwardRef` values when they're used in the `imports` of a standalone component. PR Close #45869 04 May 2022, 19:43:58 UTC
10691c6 fix(common): properly cast http param values to strings (#42643) Before this commit, when initializing `HttpParams` with: const body = new HttpParams({fromObject: {b: 2}}); then `body.get('b')` returned `2` instead of `'2'` as expected. This commit makes sure the values are converted to strings in such cases. Fixes #42641 PR Close #42643 04 May 2022, 19:43:37 UTC
a2d5358 Revert "feat(compiler-cli): exclude abstract classes from `strictInjectionParameters` requirement (#44615)" (#45862) This reverts commit 9cf14ff03dc7a848413b323dfb943fcd26f1217e. PR Close #45862 04 May 2022, 00:03:25 UTC
fa755b2 fix(core): prevent `BrowserModule` providers from being loaded twice (#45826) This commit updates the logic of the `BrowserModule` to detect a situation when it's used in the `bootstrapApplication` case, which already includes `BrowserModule` providers. PR Close #45826 03 May 2022, 23:08:04 UTC
a667592 feat(core): allow to throw on unknown properties in tests (#45853) Allows to provide a TestBed option to throw on unknown properties in templates: ```ts getTestBed().initTestEnvironment( BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { errorOnUnknownProperties: true } ); ``` The default value of `errorOnUnknownProperties` is `false`, so this is not a breaking change. PR Close #45853 03 May 2022, 22:49:00 UTC
7005da9 ci: decrease the number of required `public-api` and `size-tracking` reviews (#45855) This commit updates the PullApprove config to decrease the number of required reviews from `public-api` and `size-tracking` group members. PR Close #45855 03 May 2022, 22:48:26 UTC
410d81f refactor(core): disallow standalone components in importProvidersFrom calls (#45837) This commit narrows down acceptable argument types of the `importProvidersFrom` function. More specifically, it rejects standalone components as a source of imports. PR Close #45837 03 May 2022, 20:12:36 UTC
8ba4ddc refactor(compiler-cli): improve error for `imports` in non-standalone cmp (#45851) This commit improves the error message for using `imports` on a component that isn't set to `standalone: true`. Two concrete improvements are made: * A related information message is added to the diagnostic which suggests the fix of adding `standalone: true`. * The component is marked as poisoned, preventing other errors which might be caused by an incorrectly configured template scope from being generated and thus masking the original problem. Fixes #45850 PR Close #45851 03 May 2022, 18:04:09 UTC
9cf14ff feat(compiler-cli): exclude abstract classes from `strictInjectionParameters` requirement (#44615) In AOT compilations, the `strictInjectionParameters` compiler option can be enabled to report errors when an `@Injectable` annotated class has a constructor with parameters that do not provide an injection token, e.g. only a primitive type or interface. Since Ivy it's become required that any class with Angular behavior (e.g. the `ngOnDestroy` lifecycle hook) is decorated using an Angular decorator, which meant that `@Injectable()` may need to have been added to abstract base classes. Doing so would then report an error if `strictInjectionParameters` is enabled, if the abstract class has an incompatible constructor for DI purposes. This may be fine though, as a subclass may call the constructor explicitly without relying on Angular's DI mechanism. Therefore, this commit excludes abstract classes from the `strictInjectionParameters` check. This avoids an error from being reported at compile time. If the constructor ends up being used by Angular's DI system at runtime, then the factory function of the abstract class will throw an error by means of the `ɵɵinvalidFactory` instruction. In addition to the runtime error, this commit also analyzes the inheritance chain of an injectable without a constructor to verify that their inherited constructor is valid. Closes #37914 PR Close #44615 03 May 2022, 17:39:56 UTC
401dec4 feat(core): update TestBed to recognize Standalone Components (#45809) This commit updates an internal logic of the TestBed to recognize Standalone Components to be able to apply the necessary overrides correctly. PR Close #45809 03 May 2022, 17:33:52 UTC
bb8d709 fix(compiler): exclude empty styles from emitted metadata (#45459) Excludes styles that resolve to empty strings from the emitted metadata so that they don't result in empty `<style>` tags at runtime. Fixes #31191. PR Close #45459 03 May 2022, 16:38:36 UTC
9f55800 docs(service-worker): fix alert closing tag (#45797) This also allows correctly parsing other tags further below (such as the `@reviewed` tag at the end). PR Close #45797 03 May 2022, 16:27:36 UTC
9e6538c fix(dev-infra): Fix pullapprove by commenting out the empty availability (#45846) Fixes invalid yml caused by https://github.com/angular/angular/commit/509cab9972dc9ee3366649324e0b19ec9277d7f8 PR Close #45846 02 May 2022, 23:33:42 UTC
d322052 refactor(core): guard against `importProvidersFrom` in components (#45838) `importProvidersFrom` provides a bridge from the world of NgModule-based DI configuration to the new, "standalone" world of direct providers and environment injectors. Early user feedback suggested some confusion around where this function was supposed to be used, particularly around importing NgModule-based providers into standalone component `providers` arrays, which is not the intended use. This confusion is exacerbated by the fact that due to the unified `Provider` type, this kind of misconfiguration was happily accepted by the type system. This commit changes the return type of `importProvidersFrom` to wrap the returned providers in an opaque type that prevents them from being used in component provider contexts. This, together with stronger documentation around the purpose and functionality of `importProvidersFrom`, should address some of the above confusion. PR Close #45838 02 May 2022, 22:50:44 UTC
a521571 docs(devtools): create documentation on installing Angular DevTools in Safari (#45763) With the introduction of many new devtools extensions APIs, it is now possible to install Angular DevTools in Safari. This commit details how to convert an Angular DevTools build to a Safari web extension with Xcode and `xcrun safari-web-extension-converter ` PR Close #45763 02 May 2022, 22:36:37 UTC
509cab9 ci: mark pkozlowski as availabe for PR reviews (#45842) Change pullapprove configuration to re-include pkozlowski PR Close #45842 02 May 2022, 22:35:34 UTC
3d5363c docs(core): add public API for standalone entities (#45798) This commit adds public API docs for standalome components, directives and pipes. PR Close #45798 02 May 2022, 22:09:31 UTC
fce5063 docs(forms): Add documentation for typed forms. (#45841) Update the JSDoc on forms model classes with more specific information about the new types. PR Close #45841 02 May 2022, 22:03:40 UTC
ad5ffff refactor(core): rename `INJECTOR_INITIALIZER` -> `ENVIRONMENT_INITIALIZER` (#45845) This commit renames the `INJECTOR_INITIALIZER` to `ENVIRONMENT_INITIALIZER` to better represent the intention of the token. PR Close #45845 02 May 2022, 22:02:06 UTC
3ebf9e7 refactor(compiler-cli): improve error message formatting (#45827) Changes the message from: ``` The component 'HelloComponent' appears in 'imports', but is not standalone and cannot be imported directly It must be imported via an NgModule. ``` to ``` The component 'HelloComponent' appears in 'imports', but is not standalone and cannot be imported directly. It must be imported via an NgModule. ``` PR Close #45827 02 May 2022, 21:59:01 UTC
9cfea3d fix(compiler-cli): report invalid imports in standalone components during resolve phase (#45827) The analysis phase of the compiler should operate on individual classes, independently of the analysis of other classes. The validation that `Component.imports` only contains standalone entities or NgModules however did happen during the analysis phase, introducing a dependency on other classes and causing inconsistencies due to ordering and/or asynchronous timing differences. This commit fixes the issue by moving the validation to the resolve phase, which occurs after all classes have been analyzed. Fixes #45819 PR Close #45827 02 May 2022, 21:59:01 UTC
38f2906 docs(core): add public API docs for the ApplicationRef (#45836) This commits add the missing documentation for the ApplicationRef destroy() method. PR Close #45836 02 May 2022, 21:58:27 UTC
22c71be fix(platform-server): update `renderApplication` to move `appId` to options (#45844) This commit updates the `renderApplication` function to move the `appId` argument to the options object. The goal is to achieve a symmetry with the `bootstrapApplication` call (use to bootstrap apps for the browser environment). PR Close #45844 02 May 2022, 21:57:55 UTC
752ddbc feat(compiler-cli): Support template binding to protected component members (#45823) This commit adds support for creating template bindings to protected members within the component class. PR Close #45823 02 May 2022, 21:40:11 UTC
f0b5e83 build(bazel): change ngc-wrapped to use new bazelOpts.devmode (#45804) bazelOpts.es5Mode is being removed and replaced with devmode. Adding a check for either will allow a smooth migration. PR Close #45804 02 May 2022, 20:10:06 UTC
0eee114 docs: remove css keyframes scoping change from changelog (#45840) remove the css keyframes scpoing change present in the changelog since that commit has actually been reverted PR Close #45840 02 May 2022, 19:00:00 UTC
fde4942 fix(core): throw if standalone components are present in `@NgModule.bootstrap` (#45825) This commit updates the logic to detect a situation when a standalone component is used in the NgModule-based bootstrap (`@NgModule.bootstrap`). Both AOT and JIT compilers are updated to handle this situation. PR Close #45825 02 May 2022, 18:43:17 UTC
9a04ded docs(docs-infra): improve clarity of toh-pt2 click code snippet (#45829) make clearer that the click code snippet present in the tour of heroes part 2 guide is not complete but adding ellipsis at the end of the snippet and also by slightly tweaking the text introducing the snippet resolves #45758 PR Close #45829 02 May 2022, 18:42:12 UTC
e702caf feat(core): allow to throw on unknown elements in tests (#45479) Allows to provide a TestBed option to throw on unknown elements in templates: ```ts getTestBed().initTestEnvironment( BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { errorOnUnknownElements: true } ); ``` The default value of `errorOnUnknownElements` is `false`, so this is not a breaking change. PR Close #45479 02 May 2022, 16:38:13 UTC
6a3ca0e Revert "feat(core): allow to throw on unknown elements in tests (#45479)" (#45839) This reverts commit 6662a97c61f133a14f2d117f71e4d2b8f4a83c32. PR Close #45839 02 May 2022, 16:36:28 UTC
9c2f219 build: update ng-dev with updated clang-format version to fix formatting (#45834) Updates ng-dev to the latest clang-format version which fixes the AMD x64 binaries. PR Close #45834 02 May 2022, 16:28:40 UTC
6662a97 feat(core): allow to throw on unknown elements in tests (#45479) Allows to provide a TestBed option to throw on unknown elements in templates: ```ts getTestBed().initTestEnvironment( BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { errorOnUnknownElements: true } ); ``` The default value of `errorOnUnknownElements` is `false`, so this is not a breaking change. PR Close #45479 02 May 2022, 16:22:34 UTC
8315974 fix(docs-infra): fix wrong heading structure in aio resources page (#45822) in the aio resources page there is a main h1 heading and then the next headings used are h3 and h4, thus h2 is being skipped, change such headings so that there is no heading skipping (which is a bad practice and can result to confusing experiences from screen reader users) PR Close #45822 02 May 2022, 16:20:36 UTC
a88bf20 refactor(compiler-cli): increase minimum version of partial declarations (#45782) In v14, the partial compilation output of components have changed in a way that prevents older versions of Angular to compile the partial declarations correctly. In particular, we used to emit used directives/components in separate arrays called `components` and `directives`, and used pipes in a property called `pipes`: ```js TestComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: TestComponent, selector: "ng-component", ngImport: i0, template: ``, isInline: true, directives: [{ type: i1.SomeDir, selector: "[some-dir]" }], components: [{ type: i1.SomeCmp, selector: "some-cmp" }], pipes: { 'async': i2.AsyncPipe }, }); ``` In the above example, the `version` property indicates which exact compiler version was used to compile the component, but the `minVersion` allows older versions of the compiler/Angular linker to "link" the partial declaration to its final AOT compilation output. In v14, the used directives, components and pipes are now emitted together into a single array under the `dependencies` property: ```js TestComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: TestComponent, selector: "ng-component", ngImport: i0, template: ``, isInline: true, dependencies: [ { kind: "directive", type: i1.SomeDir, selector: "[some-dir]" }, { kind: "component", type: i1.SomeCmp, selector: "some-cmp" }, { kind: "pipe", type: i2.AsyncPipe }, ], }); ``` This change has been made in support of standalone components, but it does mean that older compiler versions can no longer link these partial declarations as desirable as none of the components, directives and pipes would be included in the AOT-compiled code. By increasing the `minVersion` property, we hint to older compiler versions that they are not capable of processing the partial declaration. This allows reporting an error at compile time instead of resulting in runtime failures due to missing components, directives and pipes. PR Close #45782 29 April 2022, 21:19:16 UTC
dff5586 feat(platform-server): implement `renderApplication` function (#45785) This commit adds the `renderApplication` function to bootstrap an Angular app using a root standalone component to support SSR scenarios. PR Close #45785 29 April 2022, 21:18:54 UTC
e1454ae build(common): update CLDR to version 41 (#45714) Update CLDR, which is used to generate the locales files, to version 41. Also, make necessary code changes to account for changes in the CLDR data. Fixes #43301 PR Close #45714 29 April 2022, 16:20:08 UTC
57a9c17 build(common): specify CLDR version to use by `cldr` (#45714) While generating locales, two sets of data (both derived from the [CLDR project][1]) are used: - JSON data with the [`cldrjs` package][2], which is used for most operations. - XML data with the [`cldr` package][3], which is used for generating plural-related data. The JSON data is brought in from the [unicode-org/cldr-json][4] repository. Since we control the version of the repository that we use, we can control the CLDR version that these correspond to. Previously, however, we used the XML data that were bundled with the [`cldr` package[3]. As a result, the two sets of data could correspond to different CLDR versions, resulting in incorrect/inconsistent locales files. This commit addresses the problem by utilizing the `load()` method of the [`cldr` package][3], which allows passing in a custom path to the CLDR XML data (instead of using the bundled data. This way, we can ensure that the data used for all operations correspond to the same CLDR version. Related discussion: #43301 [1]: https://github.com/unicode-org/cldr [2]: https://www.npmjs.com/package/cldrjs [3]: https://www.npmjs.com/package/cldr [4]: https://github.com/unicode-org/cldr-json PR Close #45714 29 April 2022, 16:20:08 UTC
61b6b4f refactor(common): minor refactoring/simplification in `generate-locales-tool` (#45714) Make some minor changes in `generate-locales-tool` to make the code simpler and/or avoid unnecessary work. PR Close #45714 29 April 2022, 16:20:08 UTC
521bfc1 refactor(common): improve `dayPeriods`-related types in `generate-locales-tool` (#45714) Update some TypeScript types in `generate-locales-tool/day-periods.ts` to more closely reflect the actual shapes of the returned objects. Examples of the related raw JSON data for the `en` locale can be seen here: - [dayPeriods][1] - [dayPeriodRules][2] [1]: https://github.com/unicode-org/cldr-json/blob/41.0.0/cldr-json/cldr-dates-full/main/en/ca-gregorian.json#L223-L300 [2]: https://github.com/unicode-org/cldr-json/blob/41.0.0/cldr-json/cldr-core/supplemental/dayPeriods.json#L404-L427 PR Close #45714 29 April 2022, 16:20:08 UTC
0e5e4e2 refactor(common): consistently name tooling related to `closure-locale.ts` (#45714) Previously, some functions/targets related to the generation/verification of the `closure-locale.ts` file included `closure_locales` instead of `closure_locale` in their name, which was inconsistent and confusing. Rename all tooling to use `closure_locale` (which more closely matches the generated file's name). PR Close #45714 29 April 2022, 16:20:08 UTC
29039fc feat(core): support TypeScript 4.7 (#45749) Adds support for TypeScript 4.7. Changes include: * Bumping the TS version as well as some Bazel dependencies to include https://github.com/bazelbuild/rules_nodejs/pull/3420. * Adding a backwards-compatibility layer for calls to `updateTypeParameterDeclaration`. * Making `LView` generic in order to make it easier to type the context based on the usage. Currently the context can be 4 different types which coupled with stricter type checking would required a lot of extra casting all over `core`. * Fixing a bunch of miscellaneous type errors. * Removing assertions of `ReferenceEntry.isDefinition` in a few of the language service tests. The field isn't returned by TS anymore and we weren't using it for anything. * Resolving in error in the language service that was caused by TS attempting to parse HTML files when we try to open them. Previous TS was silently setting them as `ScriptKind.Unknown` and ignoring the errors, but now it throws. I've worked around it by setting them as `ScriptKind.JSX`. PR Close #45749 29 April 2022, 16:19:45 UTC
fcc548a test(core): verify inheritance for standalone components (#45796) This commit verifies that component inheritance works properly for various combinations of standalone and non-stndalone components. PR Close #45796 29 April 2022, 16:19:04 UTC
d4fc12f fix(router): Remove deprecated initialNavigation option (#45729) BREAKING CHANGE: `initialNavigation: 'enabled'` was deprecated in v11 and is replaced by `initialNavigation: 'enabledBlocking'`. PR Close #45729 28 April 2022, 21:40:03 UTC
aba8fb5 build: update ng-dev to latest snapshot build (#45805) Updates ng-dev to the latest snapshot build, with an improvement to the `new-main-branch` command. PR Close #45805 28 April 2022, 18:53:29 UTC
3a60063 build: updates to account for github primary branch rename This is the commit accounting for the Github primary branch rename when we actually perform the update. We have three change phases: Prepare, Direct, Cleanup. This commit is for the `direct` phase. 28 April 2022, 17:17:01 UTC
b596a50 build: update dev-infra to latest snapshot (#45800) Updates dev-infra to the latest snapshot, supporting for the new migrate to main helper command. PR Close #45800 28 April 2022, 17:14:04 UTC
8dda463 refactor(core): do not allow `standalone` flag overrides via TestBed APIs (#45788) This commit adds a check into the TestBed APIs to throw an error if the `standalone` flag is overridden. PR Close #45788 28 April 2022, 16:47:26 UTC
0840ece build: lock file maintenance (#45751) PR Close #45751 28 April 2022, 16:39:06 UTC
a097be9 test(core): verify `importProvidersFrom` work correctly with `ModuleWithProviders` (#45787) This commit adds a test to make sure the NgModule providers are collected correctly by the `importProvidersFrom` function when the `ModuleWithProviders` type is used and some providers are overridden. PR Close #45787 28 April 2022, 16:37:54 UTC
4e413d9 fix(core): support nested arrays of providers in `EnvironmentInjector` (#45789) This commit updates the `EnvironmentInjector` logic to support arrays of providers as an argument(for example, when an injector is created via `createEnvironmentInjector` function). PR Close #45789 28 April 2022, 16:37:18 UTC
2941793 test(core): verify nested array in standalone component imports (#45794) This test verifies that nested arrays are supported in the standalone's component import field. PR Close #45794 28 April 2022, 16:35:45 UTC
14c4979 build(docs-infra): upgrade cli command docs sources to f258be5be (#45795) Updating [angular#master](https://github.com/angular/angular/tree/master) from [cli-builds#master](https://github.com/angular/cli-builds/tree/master). ## Relevant changes in [commit range](https://github.com/angular/cli-builds/compare/5bd17a256...f258be5be): **Modified** - help/generate.json PR Close #45795 28 April 2022, 16:34:31 UTC
2f5fd41 refactor(core): verify that standalone entities are not declared in NgModule (#45777) This commits adds JiT checks to verify that a standalone component, directive, pipe are not declared in any NgModule. PR Close #45777 27 April 2022, 22:46:10 UTC
aafac72 fix(core): verify standalone component imports in JiT (#45777) This commits adds verifications assuring that items imported into standalone components are one of: - standalone component / directive / pipe; - NgModule; - forwardRef resolving to one of the above. It explicitly disallows modules with providers. PR Close #45777 27 April 2022, 22:46:09 UTC
58e8f4b Revert "fix(compiler): scope css keyframes in emulated view encapsulation (#42608)" (#45786) This reverts commit 4d6a1d672210219328b33f4f96210870563066ee. PR Close #45786 27 April 2022, 22:00:41 UTC
f3eb7d9 fix(core): Ensure the `StandaloneService` is retained after closure minification (#45783) In order to survive closure minification correctly, static properties need to be annotated with @nocollapse. For more history, see https://github.com/angular/angular/pull/28050 PR Close #45783 27 April 2022, 20:05:33 UTC
b9a07d6 release: cut the v14.0.0-next.15 release (#45784) 27 April 2022, 19:01:09 UTC
c589e4d docs: release notes for the v13.3.5 release (#45781) 27 April 2022, 18:50:36 UTC
4d6a1d6 fix(compiler): scope css keyframes in emulated view encapsulation (#42608) Ensure that keyframes rules, defined within components with emulated view encapsulation, are scoped to avoid collisions with keyframes in other components. This is achieved by renaming these keyframes to add a prefix that makes them unique across the application. In order to enable the handling of keyframes names defined as strings the previous strategy of replacing quoted css content with `%QUOTED%` (introduced in commit 7f689a2) has been removed and in its place now only specific characters inside quotes are being replaced with placeholder text (those are `;`, `:` and `,`, more can be added in the future if the need arises). Closes #33885 BREAKING CHANGE: Keyframes names are now prefixed with the component's "scope name". For example, the following keyframes rule in a component definition, whose "scope name" is host-my-cmp: @keyframes foo { ... } will become: @keyframes host-my-cmp_foo { ... } Any TypeScript/JavaScript code which relied on the names of keyframes rules will no longer match. The recommended solutions in this case are to either: - change the component's view encapsulation to the `None` or `ShadowDom` - define keyframes rules in global stylesheets (e.g styles.css) - define keyframes rules programmatically in code. PR Close #42608 27 April 2022, 17:27:17 UTC
3d45484 refactor(compiler-cli): support schemas in standalone components (#45752) This commit adds support for `@Component.schemas` in both JIT and AOT. PR Close #45752 27 April 2022, 17:25:53 UTC
2eb39c0 fix(devtools): inline loading svg (#45762) * inlined loading animation svg instead of using absolute url * removing unused assets folder from the build PR Close #45762 27 April 2022, 16:07:38 UTC
7d8998c docs: empty alt of aio home decorative images (#45740) in the aio home page the sections' decorative images provide an alt texts, which shouldn't actually be present (see: https://www.w3.org/WAI/tutorials/images/decorative/), empty such alt text for a better user experience PR Close #45740 27 April 2022, 16:06:12 UTC
a895da6 docs: use proper sections in aio home (#45740) convert the `div` groups in the aio home page to proper `section`s with a valid heading/title PR Close #45740 27 April 2022, 16:06:12 UTC
d1a9fd5 docs: make sure aio home has a non-ignored h1 (#45740) currently the aio home page presents a single h1 which is ignored by assistive technologies since it has its display set none, so replace it with a new h1 containing the main text of the page instead PR Close #45740 27 April 2022, 16:06:12 UTC
882f595 refactor(core): support `ModuleWithProviders` directly in `importProvidersFrom` (#45722) There were two problems with the `importProvidersFrom` function related to `ModuleWithProviders` values: * The public type did not accept `ModuleWithProviders` values directly. * The implementation of `walkProviderTree` delegates collection of MWP providers to its caller, in order for the ordering of such providers to be correct. However, `importProvidersFrom` was not performing that collection, causing MWP providers passed in at the top level to be dropped. PR Close #45722 27 April 2022, 16:05:51 UTC
3896f57 refactor(core): move ModuleWithProviders type (#45722) This commit moves the ModuleWithProviders type from `metadata` to `di`, avoiding the need for `di` to reference `metadata` (in this particular case). PR Close #45722 27 April 2022, 16:05:51 UTC
39c1681 test(core): add more tests for the standalone components (#45709) Add more tests verifying the following conditions: - discovery of DI providers from exported NgModules - forwardRef in standalone component imports PR Close #45709 27 April 2022, 16:05:33 UTC
f282ca4 fix(docs-infra): fix alert child margin issue (#45761) replace the generic `*` selector used in the alert styling with `p` (which is what gets generated from the markdown) as the styling adds margins which are not always wanted PR Close #45761 27 April 2022, 16:04:30 UTC
71f64f2 docs(upgrade): move import back into docregion in `rollup-config.js` (#45778) This was accidentally broken in #45405. PR Close #45778 27 April 2022, 16:04:09 UTC
2b5c2d6 refactor(core): create a standalone injector during applicationBootstrap (#45766) This commit changes the injectors hiearchy created during applicationBootstrap. From now on a standalone injector (holding all the ambient providers of a standalone component) is create as a child of the application injector. This change alligns injectors hierarchy for bootstrapped and dynamically created standalone components. PR Close #45766 27 April 2022, 16:03:50 UTC
7b367d9 refactor(router): Remove unnecessary setTimeout in UrlTree redirects (#45735) Using `setTimeout` in the Router navigation pipeline creates fragile and unpredictable behavior. Additionally, it creates a new macrotask, which would trigger an unnecessary change detection in the application. This `setTimeout` was added in https://github.com/angular/angular/commit/15e397816f98ec16839c30fd5c1ea01c7444fb84. Both tests added in that commit still pass. Additionally, the comment for _why_ the `setTimeout` was added doesn't really explain how the described bug would occur. There has been a lot of work in the Router since then to stabalize edge case scenarios so it's possible it existed before but doesn't anymore. Removing this `setTimeout` revealed tests that relied on the navigation not completing. For example, the test suite did not have a route which matched the redirect, but the test passed because it ended before the redirect was flushed, so the `Router` never threw an error. Similar situations exist for the other use of `setTimeout` in the Route (the one in the location change listener). There were no other failures in TGP other than incorrectly written tests. BREAKING CHANGE: When a guard returns a `UrlTree`, the router would previously schedule the redirect navigation within a `setTimeout`. This timeout is now removed, which can result in test failures due to incorrectly written tests. Tests which perform navigations should ensure that all timeouts are flushed before making assertions. Tests should ensure they are capable of handling all redirects from the original navigation. PR Close #45735 27 April 2022, 15:56:31 UTC
f1cc4a6 build: update tsec and drop corresponding postinstall patch (#45767) Updates tsec and drops the corresponding postinstall patch that we added when we updated to Bazel v5. See: https://github.com/google/tsec/pull/25 PR Close #45767 26 April 2022, 18:48:34 UTC
9d755fa build: update actions/checkout action to v3.0.2 (#45764) PR Close #45764 26 April 2022, 17:11:43 UTC
284329e refactor(core): delay standalone component scoping in JIT (#45720) This commit moves standalone component scoping into the closures for `directiveDefs` and `pipeDefs` in JIT mode. This is necessary to support recursive standalone components, which necessarily use a `forwardRef` within their import cycle. Previously, the JIT compiler for standalone components attempted immediate `forwardRef` resolution, resulting in infinite recursion. PR Close #45720 26 April 2022, 17:07:41 UTC
4e0784c refactor(compiler-cli): optimize InjectorDef imports generation (#45701) Before standalone, everything that could appear in an NgModule's `imports` was relevant to DI, and needed to be emitted in the `imports` of the generated `InjectorDef` definition. With the introduction of standalone types, NgModule `imports` can now contain components, directives, and pipes which are standalone. Only standalone components need to be included in the `imports` of the generated injector definition - directives and pipes have no effect on DI. Having them present doesn't cause any errors in the runtime (they're filtered out by the injector itself) but it does prevent tree-shaking. With this commit, the generation of `InjectorDef` now filters the `imports` to exclude directives and pipes as much as possible. It's not _always_ possible because an expression in `imports` may pull in both a directive and a `ModuleWithProviders` reference, and we have no way of referencing just the MWP part of that expression. Therefore this is an optimization, not a rule of `InjectorDef` compilation. PR Close #45701 26 April 2022, 17:07:23 UTC
b0379c8 refactor(compiler-cli): NgModule handler resolves `imports` individually (#45701) Previously, the NgModule handler would resolve the `imports` field as one unit, producing an array of `Reference`s. With this refactoring, if `imports` is a literal array, each individual element will be resolved independently. This will allow filtering in the future at the element level, since there will be a separate `ts.Expression` for each individual element. PR Close #45701 26 April 2022, 17:07:23 UTC
18db4ef refactor(compiler-cli): introduce ResolvedModuleWithProviders (#45701) This commit updates the `ForeignFunctionResolver` used by the NgModule handler to resolve `ModuleWithProvider` types. Previously, this resolver returned the NgModule `Reference` directly, but there are two problems with this: * It's not completely accurate, as the expression returned by the MWP call will not return the NgModule at runtime. * We need the ability to distinguish the MWP call itself from an ordinary NgModule reference in future optimizations. PR Close #45701 26 April 2022, 17:07:23 UTC
c614f31 refactor(compiler-cli): rework ForeignFunctionResolvers (#45701) This commit reworks the partial evaluation system's concept of a ForeignFunctionResolver. Previously, resolvers were expected to return a `ts.Expression` which the partial evaluator would continue evaluating, eventually returning a value. This works well for "transparent" foreign functions like `forwardRef`, but for things like `ModuleWithProviders` it breaks down, because the desired resolution value (the NgModule `Reference`) is _not_ the "correct" evaluation of the function call. To support better FFR implementations, this commit refactors the FFR system so that resolvers operate on the `ts.CallExpression` instead, and are given a callback to resolve further expressions if needed. If they cannot resolve a given call expression, they have an `unresolvable` value that they can return to indicate that. PR Close #45701 26 April 2022, 17:07:23 UTC
7992132 test(core): dynamic component creation and standalone injectors hierarchy (#45726) This commits adds more tests around dynamic component creation and environement injectors hierarchy. PR Close #45726 25 April 2022, 22:00:33 UTC
31d7c3b feat(common): add getState method to LocationStrategy interface (#45648) Adds getState to LocationStrategy interface as it suppose to be the place to control all window.location interactions. BREAKING CHANGE: Adds new required class member that any implementors of the LocationStrategy will need to satisfy. Location does not depend on PlatformLocation anymore. PR Close #45648 25 April 2022, 17:41:30 UTC
50004c1 feat(router): Support lazy loading standalone components with `loadComponent` (#45705) Similarly to the symmetry being strengthened between children and loadChildren, a new loadComponent property will be introduced as the asynchronous version of component. This will allow for direct single-component lazy loading: ``` {path: 'lazy/a', loadComponent: () => import('./lazy/a.component').then(m => m.ACmp)}, {path: 'lazy/b', loadComponent: () => import('./lazy/b.component').then(m => m.BCmp)}, ``` This option requires that the component being loaded is standalone and is implemented as a runtime check. Other notes: * Components are not loaded until all guards and resolvers complete. * Loading the component is included in the function passed to the router preloading strategy * `RouteConfigLoadStart` and `RouteConfigLoadEnd` events emit at the start and end of the component loading * `CanLoad` guards _do not_ apply to `loadComponent`. `canActivate` should be used instead, just like you would do if it were simply `component` instead. PR Close #45705 25 April 2022, 16:39:44 UTC
970a3b5 fix(bazel): add this_is_bazel marker (#45728) Add marker for noting that this check confirms we are running in a bazel environment. PR Close #45728 22 April 2022, 19:46:23 UTC
4962a4a feat(router): Allow `loadChildren` to return a `Route` array (#45700) This commit expands the `LoadChildrenCallback` to accept returning `Routes` in addition to the existing `NgModule` type. In addition, it adds a check to ensure these loaded routes all use standalone components. The components must be standalone because if they were not, we would not have the required `NgModule` which the component is declared in. Existing API: ``` {path: 'lazy/route', loadChildren: import('./lazy').then(m => m.LazyModule)} @NgModule({ imports: [ ExtraCmpModule, RouterModule.forChild([ {path: 'extra/route', component: ExtraCmp}, ]), ], }) export class LazyModule {} ``` The new API for lazy loading route configs with standalone components (no NgModule) is to expand `loadChildren` to allow returning simply a `Routes` array. ``` // parent.ts { path: 'parent', loadChildren: () => import('./children').then(m => m.ROUTES), } // children.ts export const ROUTES: Route[] = [ {path: 'child', component: ChildCmp}, ]; ``` Note that this includes minimal documentation updates. We need to include a holistic update to the documentation for standalone components in the future that includes this feature. PR Close #45700 22 April 2022, 16:25:20 UTC
3e46a42 test(core): add integration test apps for the `bootstrapApplication` API (#45674) This commit adds 2 integration apps to verify the `bootstrapApplication` API behavior as well as keep track of the bundle size and retained symbols (tree-shaking). PR Close #45674 22 April 2022, 00:47:54 UTC
5771b18 feat(core): add the `bootstrapApplication` function (#45674) This commit implements the `bootstrapApplication` function that allows bootstrapping an application and pass a standalone component as a root component. PR Close #45674 22 April 2022, 00:47:54 UTC
612d6e0 test: update size golden for hello-world-ivy-compat integration test (#45405) The main bundle fell below the 500b threshold. Likely because the global constant was fixed and is now tree-shakeable. The actual diff in the commit is a little confusing since it makes it seem that polyfills increased as part of this commit. This is not the case but just a side-effect of us accumulating various changes which are not reflected on a per-commit basis in the size golden. The actual sizes in master were: ``` SUCCESS: Commit undefined uncompressed runtime did NOT cross size threshold of 500 bytes or >1% (expected: 1105, actual: 1102). SUCCESS: Commit undefined uncompressed polyfills did NOT cross size threshold of 500 bytes or >1% (expected: 33846, actual: 33957). SUCCESS: Commit undefined uncompressed main did NOT cross size threshold of 500 bytes or >1% (expected: 132392, actual: 131893). ``` Now with this change: ``` SUCCESS: Commit undefined uncompressed runtime did NOT cross size threshold of 500 bytes or >1% (expected: 1105, actual: 1102). SUCCESS: Commit undefined uncompressed polyfills did NOT cross size threshold of 500 bytes or >1% (expected: 33846, actual: 33957). FAIL: Commit undefined uncompressed main fell below expected size by 500 bytes or >1% (expected: 132392, actual: 131883). ``` PR Close #45405 21 April 2022, 18:09:39 UTC
067e4c2 build: update systemjs aio boilerplate to work with APF v13+ `exports` field (#45405) The SystemJS examples were using an outdated version of rollup that did not support export fields. Now with the recent changes where we removed secondary package.json files, the rather old/somewhat outdated SystemJS examples failed bundling since exports were not considered. PR Close #45405 21 April 2022, 18:09:39 UTC
a50e2da fix(localize): ensure transitively loaded compiler code is tree-shakable (#45405) The localize primary entry-point (used at runtime in application code) indirectly loads from the compiler package for computing message ids. The compiler package has a couple of constants which cannot be DCE-ded/ tree-shaken due to side-effect reliance that is detected by Terser. We fix these constants to be three-shakable. Note that another issue technically would be that the compiler package has a side-effect call for `publishFacade` (for JIT), but that invocation is marked as pure by the Angular CLI babel optimization pipeline. So this results is no unused code currently but is risky and should be addressed in the future. PR Close #45405 21 April 2022, 18:09:39 UTC
4c56c45 refactor(localize): init APF entry-point should not duplicate code (#45405) This commit addresses two issues: * The init entry-point currenly access code from another entry-point using relative imports, resulting in code to be duplicated. * The init types are now bundled as part of the ng_package APF rule. There is an API extractor bundling issue with global module augmentations. API extractor does not properly handle module augmentation. We need to disable dts bundling for this entry-point to ensure `$localize` remains globally accessible for users. This is an option in the `ng_package` rule. Note that this worked before because `localize/init` was a `ts_library` that did not have its types bundled. As part of this change, the `MessageId` and `TargetMessage` exports are also made public. The localize exported functions rely on these types but they were not exported. Related to types, an exception is added for three private exports from the primary entry-point so that they will show up in the API golden. These private exports are re-exposed publicly in the init entry-point but no golden would capture them due to the private symbol prefix. One might wonder why the symbols are not guarded in the init golden. The reason is that goldens never inline signatures from cross-entry-points/packages to avoid duplication. Lastly, the i18n integration test golden had to be updated because the polyfills bundle increased slightly. After thorough and time-consuming investigation, this mostly happens due to different mangle identifies being used (the input code changed --> so the mangling determinism) Size before this change: ``` SUCCESS: Commit undefined uncompressed runtime did NOT cross size threshold of 500 bytes or >1% (expected: 929, actual: 926). SUCCESS: Commit undefined uncompressed main did NOT cross size threshold of 500 bytes or >1% (expected: 124544, actual: 124660). SUCCESS: Commit undefined uncompressed polyfills did NOT cross size threshold of 500 bytes or >1% (expected: 34530, actual: 34641). ``` After: ``` SUCCESS: Commit undefined uncompressed runtime did NOT cross size threshold of 500 bytes or >1% (expected: 929, actual: 926). SUCCESS: Commit undefined uncompressed main did NOT cross size threshold of 500 bytes or >1% (expected: 124544, actual: 124650). FAIL: Commit undefined uncompressed polyfills exceeded expected size by 500 bytes or >1% (expected: 34530, actual: 35252). ``` Inspecting/comparing without mangling shows that the new changes would actually result in a bundle reduction (potentially visible with gzip/brotli): ``` ➜ Desktop stat -f%z master-nomangle.js 101357 ➜ Desktop stat -f%z with-changes-nomangle.js 101226 ``` PR Close #45405 21 April 2022, 18:09:39 UTC
7a8a929 refactor: fix duplication in platform-server NPM package (#45405) The platform-server init entry-point imported code from another entry-point using a relative import. This resulted in the code to be bundled into the `init` entry-point as well. This has no breaking impact but resulted in a little code duplication that we should clean up. PR Close #45405 21 April 2022, 18:09:39 UTC
dd0fc0f test: add test for new `types_bundle` rule from Angular bazel package (#45405) Adds a little golden test for the new `types_bundle` rule that ensures the rule works at a general level. This rule will be useful for non-APF ESM packages like the Angular compiler-cli (for which we also want to bundle types to make them compatible with TypeScripts ESM type resolution) PR Close #45405 21 April 2022, 18:09:39 UTC
68597bb feat(bazel): speed up dev-turnaround by bundling types only when packaging (#45405) Speeds up the dev-turnaround by only bundling types when packaging. Currently bundling occurs for all the `ng_module` targets in devmode. This has various positive benefits: * Avoidance of this rather slower operation in development * Makes APF-built packages also handle types for `ts_library` targets consistently. * Allows us to ensure APF entry-points have `d.ts` _always_ bundled (working with ESM module resolution in TypeScript -- currently experimental) * Allows us to remove the secondary `package.json` files from APF (maybe APF v14? - seems low-impact). This would clean-up the APF even more and fix resolution issues (like in Vite) PR Close #45405 21 April 2022, 18:09:39 UTC
3dee3d1 fix(docs-infra): fix placement of "Edit source" button on errors and diagnostics pages (#45634) This commit aligns the layout of errors and extended diagnostics pages more closely with other docs pages to ensure that the "Edit source" button is displayed correctly even when the heading is too long to fit on a single line. For error pages, in particular, this ensures that the button is not obscured by the error video. **Before:** ![error-pages before][1] **After:** ![error-pages after][2] [1]: https://user-images.githubusercontent.com/8604205/163408291-7aebd029-891c-4045-8fa2-a8e2b2b06dab.png [2]: https://user-images.githubusercontent.com/8604205/163408296-40e6df8e-aadc-4a82-978a-ab4d902b6f6e.png PR Close #45634 21 April 2022, 18:07:27 UTC
9292953 fix(docs-infra): include `tslib` into SystemJS config in `upgrade-module` example app (#45706) This commit updates the SystemJS for one of the example apps (the `upgrade-module` one) to include a resolution rule for the `tslib`. This is needed in case `tslib` is referenced from the framework code (for example in case of downleveling of some operators). This makes it consistent with other example app configs. PR Close #45706 21 April 2022, 18:05:37 UTC
9e4c4bc docs(core): add API documentation to standalone-related classes (#45687) This commit adds some internal documentation. PR Close #45687 20 April 2022, 23:01:56 UTC
back to top