https://github.com/angular/angular

sort by:
Revision Author Date Message Commit Date
d36828a release: cut the v10.1.0-next.8 release 24 August 2020, 22:38:13 UTC
f18e2d5 docs: release notes for the v10.0.12 release 24 August 2020, 22:31:03 UTC
375f0a6 build: update tslint to 6.1.3 (#38076) This version supports TypeScript 4.0 PR Close #38076 24 August 2020, 20:07:05 UTC
281b647 refactor(compiler-cli): remove usage of `ts.updateIdentifier` (#38076) With Typescript 4, `ts.updateIdentifier` is no longer available. Calling `ts.updateIdentifier` used to return the same node when `typeArguments` was `undefined` because `node.typeArguments` was also `undefined`. Relevant TS code: ```js function updateIdentifier(node, typeArguments) { return node.typeArguments !== typeArguments ? updateNode(createIdentifier(ts.idText(node), typeArguments), node) : node; } ``` PR Close #38076 24 August 2020, 20:07:02 UTC
0fc44e0 feat(compiler-cli): add support for TypeScript 4.0 (#38076) With this change we add support for TypeScript 4.0 PR Close #38076 24 August 2020, 20:06:59 UTC
201a546 perf(forms): use internal `ngDevMode` flag to tree-shake error messages in prod builds (#37821) This commit adds a guard before throwing any forms errors. This will tree-shake error messages which cannot be minified. It should also help to reduce the bundle size of the `forms` package in production by ~20%. Closes #37697 PR Close #37821 24 August 2020, 16:26:28 UTC
6e643d9 docs(localize): fix angular.json syntax (#38553) In chapter internationalization (i18n) at section "Deploy multiple locales" the syntax for angular.json is wrong. This commit fixes the angular.json, when specifying the translation file and the baseHref for a locale. PR Close #38553 24 August 2020, 16:25:35 UTC
4985267 test(language-service): [Ivy] return cursor position in overwritten template (#38552) In many testing scenarios, there is a common pattern: 1. Overwrite template (inline or external) 2. Find cursor position 3. Call one of language service APIs 4. Inspect spans in result In order to faciliate this pattern, this commit refactors `MockHost.overwrite()` and `MockHost.overwriteInlineTemplate()` to allow a faux cursor symbol `¦` to be injected into the template, and the methods will automatically remove it before updating the script snapshot. Both methods will return the cursor position and the new text without the cursor symbol. This makes testing very convenient. Here's a typical example: ```ts const {position, text} = mockHost.overwrite('template.html', `{{ ti¦tle }}`); const quickInfo = ngLS.getQuickInfoAtPosition('template.html', position); const {start, length} = quickInfo!.textSpan; expect(text.substring(start, start + length)).toBe('title'); ``` PR Close #38552 24 August 2020, 16:25:04 UTC
b48cc6e feat(language-service): introduce hybrid visitor to locate AST node (#38540) This commit introduces two visitors, one for Template AST and the other for Expression AST to allow us to easily find the node that most closely corresponds to a given cursor position. This is crucial because many language service APIs take in a `position` parameter, and the information returned depends on how well we can find a good candidate node. In View Engine implementation of language service, the search for the node and the processing of information to return the result are strongly coupled. This makes the code hard to understand and hard to debug because the stack trace is often littered with layers of visitor calls. With this new feature, we could test the "searching" part separately and colocate all the logic (aka hacks) that's required to retrieve an accurate span for a given node. Right now, only the most "narrow" node is returned by the main exported function `findNodeAtPosition`. If needed, we could expose the entire AST path, or expose other methods to provide more context for a node. Note that due to limitations in the template AST interface, there are a few known cases where microsyntax spans are not recorded properly. This will be dealt with in a follow-up PR. PR Close #38540 24 August 2020, 16:24:18 UTC
874792d feat(compiler): support unary operators for more accurate type checking (#37918) Prior to this change, the unary + and - operators would be parsed as `x - 0` and `0 - x` respectively. The runtime semantics of these expressions are equivalent, however they may introduce inaccurate template type checking errors as the literal type is lost, for example: ```ts @Component({ template: `<button [disabled]="isAdjacent(-1)"></button>` }) export class Example { isAdjacent(direction: -1 | 1): boolean { return false; } } ``` would incorrectly report a type-check error: > error TS2345: Argument of type 'number' is not assignable to parameter of type '-1 | 1'. Additionally, the translated expression for the unary + operator would be considered as arithmetic expression with an incompatible left-hand side: > error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. To resolve this issues, the implicit transformation should be avoided. This commit adds a new unary AST node to represent these expressions, allowing for more accurate type-checking. Fixes #20845 Fixes #36178 PR Close #37918 21 August 2020, 19:25:53 UTC
e7da404 fix(compiler-cli): adding references to const enums in runtime code (#38542) We had a couple of places where we were assuming that if a particular symbol has a value, then it will exist at runtime. This is true in most cases, but it breaks down for `const` enums. Fixes #38513. PR Close #38542 21 August 2020, 19:23:21 UTC
2a643e1 docs: change function name from async -> waitForAsync (#38548) async function name was changed to waitForAsync but it was left in testing-utility-api file. PR Close #38548 21 August 2020, 19:17:51 UTC
364284b fix(dev-infra): ignore comments when validating commit messages (#38438) When creating a commit with the git cli, git pre-populates the editor used to enter the commit message with some comments (i.e. lines starting with `#`). These comments contain helpful instructions or information regarding the changes that are part of the commit. As happens with all commit message comments, they are removed by git and do not end up in the final commit message. However, the file that is passed to the `commit-msg` to be validated still contains these comments. This may affect the outcome of the commit message validation. In such cases, the author will not realize that the commit message is not in the desired format until the linting checks fail on CI (which validates the final commit messages and is not affected by this issue), usually several minutes later. Possible ways in which the commit message validation outcome can be affected: - The minimum body length check may pass incorrectly, even if there is no actual body, because the comments are counted as part of the body. - The maximum line length check may fail incorrectly due to a very long line in the comments. This commit fixes the problem by removing comment lines before validating a commit message. Fixes #37865 PR Close #38438 21 August 2020, 19:17:14 UTC
956b25a docs: apply code styling in template reference variables guide (#38522) PR Close #38522 20 August 2020, 20:01:33 UTC
8017ca4 fix(docs-infra): fix vertical alignment of external link icons (#38410) At some places external link icons appear as a subscript. For example https://github.com/angular/angular/blame/8366effeec8e74c1a11d2a6e1a48d42e849e4653/aio/content/guide/roadmap.md\#L37 this commit places external link icons in the middle to improve there positioning in a line. PR Close #38410 20 August 2020, 16:40:01 UTC
22f1ac3 docs: udpate the details (#37967) updating my twitter handle and bio as it is changed from Angular and Web Tech to Angular also the twitter handle is changed to SantoshYadavDev PR Close #37967 20 August 2020, 16:38:58 UTC
4ee5e73 build: upgrade cli command docs sources to ef770f1cb (#38546) 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/b0b27361d...ef770f1cb): **Modified** - help/build.json - help/generate.json - help/test.json - help/xi18n.json PR Close #38546 20 August 2020, 16:32:11 UTC
6442875 docs(core): Fix typo in JSDoc for AbstractType<T> (#38541) PR Close #38541 20 August 2020, 16:30:17 UTC
8f24bc9 Revert "fix(router): support lazy loading for empty path named outlets (#38379)" This reverts commit 7ad32649c0d0004fcc3604c62cf0c1ae159a825b. 20 August 2020, 04:05:31 UTC
ac461e1 fix(localize): extract the correct message ids (#38498) Previously, if `useLegacyIds` was enabled, the message extractor was always rendering the legacy message ids in translation files even if an explicit "custom message id" had been provided in the original message. PR Close #38498 19 August 2020, 21:19:41 UTC
f245c6b fix(core): remove closing body tag from inert DOM builder (#38454) Fix a bug in the HTML sanitizer where an unclosed iframe tag would result in an escaped closing body tag as the output: _sanitizeHtml(document, '<iframe>') => '&lt;/body&gt;' This closing body tag comes from the DOMParserHelper where the HTML to be sanitized is wrapped with surrounding body tags. When an opening iframe tag is parsed by DOMParser, which DOMParserHelper uses, everything up until its matching closing tag is consumed as a text node. In the above example this includes the appended closing body tag. By removing the explicit closing body tag from the DOMParserHelper and relying on the body tag being closed implicitly at the end, the above example is sanitized as expected: _sanitizeHtml(document, '<iframe>') => '' PR Close #38454 19 August 2020, 21:18:44 UTC
68a9a01 fix(localize): parse all parts of a translation with nested HTML (#38452) Previously nested container placeholders (i.e. HTML elements) were not being fully parsed from translation files. This resulted in bad translation of messages that contain these placeholders. Note that this causes the canonical message ID to change for such messages. Currently all messages generated from templates use "legacy" message ids that are not affected by this change, so this fix should not be seen as a breaking change. Fixes #38422 PR Close #38452 19 August 2020, 21:16:41 UTC
8cd4099 fix(localize): include the last placeholder in parsed translation text (#38452) When creating a `ParsedTranslation` from a set of message parts and placeholder names a textual representation of the message is computed. Previously the last placeholder and text segment were missing from this computed message string. PR Close #38452 19 August 2020, 21:16:38 UTC
0b54c0c refactor(compiler-cli): add getTemplateOfComponent to TemplateTypeChecker (#38355) This commit adds a `getTemplateOfComponent` method to the `TemplateTypeChecker` API, which retrieves the actual nodes parsed and used by the compiler for template type-checking. This is advantageous for the language service, which may need to query other APIs in `TemplateTypeChecker` that require the same nodes used to bind the template while generating the TCB. Fixes #38352 PR Close #38355 19 August 2020, 21:07:03 UTC
1ec6099 docs: Typos fixes in the binding syntax guide (#38519) PR Close #38519 19 August 2020, 21:05:48 UTC
7ad3264 fix(router): support lazy loading for empty path named outlets (#38379) In general, the router only matches and loads a single Route config tree. However, named outlets with empty paths are a special case where the router can and should actually match two different `Route`s and ensure that the modules are loaded for each match. This change updates the "ApplyRedirects" stage to ensure that named outlets with empty paths finish loading their configs before proceeding to the next stage in the routing pipe. This is necessary because if the named outlet has `loadChildren` but the associated lazy config is not loaded before following stages attempt to match and activate relevant `Route`s, an error will occur. fixes #12842 PR Close #38379 19 August 2020, 18:36:06 UTC
9ad69c1 release: cut the zone.js-0.11.1 release (#38537) PR Close #38537 19 August 2020, 17:50:46 UTC
9af2de8 release: cut the v10.1.0-next.7 release 19 August 2020, 16:35:47 UTC
0270020 docs: release notes for the v10.0.11 release 19 August 2020, 16:16:16 UTC
6b662d1 fix(zone.js): zone.js package.json should not include files/directories field (#38528) Close #38526, #38516, #38513 After update to `APF`, the `directories` and `files` options are not compatible, so we need to remove those fileds to make sure everything work as expected. PR Close #38528 19 August 2020, 16:06:28 UTC
55fd725 docs: Fix typo in the inputs and outputs guide (#38524) PR Close #38524 19 August 2020, 15:27:44 UTC
f77fd5e feat(dev-infra): create a wizard for building commit messages (#38457) Creates a wizard to walk through creating a commit message in the correct template for commit messages in Angular repositories. PR Close #38457 19 August 2020, 00:01:14 UTC
63ba74f feat(dev-infra): tooling to check out pending PR (#38474) Creates a tool within ng-dev to checkout a pending PR from the upstream repository. This automates an action that many developers on the Angular team need to do periodically in the process of testing and reviewing incoming PRs. Example usage: ng-dev pr checkout <pr-number> PR Close #38474 18 August 2020, 23:22:47 UTC
aaa1d8e release: cut the zone.js-0.11.0 release (#38473) PR Close #38473 18 August 2020, 18:47:23 UTC
dbfb50e fix(router): ensure routerLinkActive updates when associated routerLinks change (#38511) This commit introduces a new subscription in the `routerLinkActive` directive which triggers an update when any of its associated routerLinks have changes. `RouterLinkActive` not only needs to know when links are added or removed, but it also needs to know about if a link it already knows about changes in some way. Quick note that `from...mergeAll` is used instead of just a simple `merge` (or `scheduled...mergeAll`) to avoid introducing new rxjs operators in order to keep bundle size down. Fixes #18469 PR Close #38511 18 August 2020, 17:21:49 UTC
bee44b3 Revert "fix(router): ensure routerLinkActive updates when associated routerLinks change (#38349)" (#38511) This reverts commit e0e5c9f195460c7626c30248e7a79de9a2ebe377. Failures in Google tests were detected. PR Close #38511 18 August 2020, 17:21:47 UTC
723a9ff docs(common): Wrong parameter description on TrackBy (#38495) Track By Function receive the T[index] data, not the node id. TrackByFunction reference description has the same issue. PR Close #38495 18 August 2020, 17:08:44 UTC
e472f5f refactor(ngcc): update yargs and typings for yargs (#38470) Updating yargs and typings for the updated yargs module. PR Close #38470 17 August 2020, 22:30:33 UTC
8373b72 refactor(localize): update yargs and typings for yargs (#38470) Updating yargs and typings for the updated yargs module. PR Close #38470 17 August 2020, 22:30:32 UTC
3015133 refactor(dev-infra): update yargs and typings for yargs (#38470) Updating yargs and typings for the updated yargs module. PR Close #38470 17 August 2020, 22:30:32 UTC
64cf087 release: cut the v10.1.0-next.6 release 17 August 2020, 20:23:09 UTC
fec9dcb docs: release notes for the v10.0.10 release 17 August 2020, 20:19:03 UTC
e0e5c9f fix(router): ensure routerLinkActive updates when associated routerLinks change (#38349) This commit introduces a new subscription in the `routerLinkActive` directive which triggers an update when any of its associated routerLinks have changes. `RouterLinkActive` not only needs to know when links are added or removed, but it also needs to know about if a link it already knows about changes in some way. Quick note that `from...mergeAll` is used instead of just a simple `merge` (or `scheduled...mergeAll`) to avoid introducing new rxjs operators in order to keep bundle size down. Fixes #18469 PR Close #38349 17 August 2020, 19:33:59 UTC
cfe424e refactor(language-service): [Ivy] remove temporary compiler (#38310) Now that Ivy compiler has a proper `TemplateTypeChecker` interface (see https://github.com/angular/angular/pull/38105) we no longer need to keep the temporary compiler implementation. The temporary compiler was created to enable testing infrastructure to be developed for the Ivy language service. This commit removes the whole `ivy/compiler` directory and moves two functions `createTypeCheckingProgramStrategy` and `getOrCreateTypeCheckScriptInfo` to the `LanguageService` class. Also re-enable the Ivy LS test since it's no longer blocking development. PR Close #38310 17 August 2020, 18:30:33 UTC
3b9c802 fix(ngcc): detect synthesized delegate constructors for downleveled ES2015 classes (#38463) Similarly to the change we landed in the `@angular/core` reflection capabilities, we need to make sure that ngcc can detect pass-through delegate constructors for classes using downleveled ES2015 output. More details can be found in the preceding commit, and in the issue outlining the problem: #38453. Fixes #38453. PR Close #38463 17 August 2020, 17:55:40 UTC
ca07da4 fix(core): detect DI parameters in JIT mode for downleveled ES2015 classes (#38463) In the Angular Package Format, we always shipped UMD bundles and previously even ES5 module output. With V10, we removed the ES5 module output but kept the UMD ES5 output. For this, we were able to remove our second TypeScript transpilation. Instead we started only building ES2015 output and then downleveled it to ES5 UMD for the NPM packages. This worked as expected but unveiled an issue in the `@angular/core` reflection capabilities. In JIT mode, Angular determines constructor parameters (for DI) using the `ReflectionCapabilities`. The reflection capabilities basically read runtime metadata of classes to determine the DI parameters. Such metadata can be either stored in static class properties like `ctorParameters` or within TypeScript's `design:params`. If Angular comes across a class that does not have any parameter metadata, it tries to detect if the given class is actually delegating to an inherited class. It does this naively in JIT by checking if the stringified class (function in ES5) matches a certain pattern. e.g. ```js function MatTable() { var _this = _super.apply(this, arguments) || this; ``` These patterns are reluctant to changes of the class output. If a class is not recognized properly, the DI parameters will be assumed empty and the class is **incorrectly** constructed without arguments. This actually happened as part of v10 now. Since we downlevel ES2015 to ES5 (instead of previously compiling sources directly to ES5), the class output changed slightly so that Angular no longer detects it. e.g. ```js var _this = _super.apply(this, __spread(arguments)) || this; ``` This happens because the ES2015 output will receive an auto-generated constructor if the class defines class properties. This constructor is then already containing an explicit `super` call. ```js export class MatTable extends CdkTable { constructor() { super(...arguments); this.disabled = true; } } ``` If we then downlevel this file to ES5 with `--downlevelIteration`, TypeScript adjusts the `super` call so that the spread operator is no longer used (not supported in ES5). The resulting super call is different to the super call that would have been emitted if we would directly transpile to ES5. Ultimately, Angular no longer detects such classes as having an delegate constructor -> and DI breaks. We fix this by expanding the rather naive RegExp patterns used for the reflection capabilities so that downleveled pass-through/delegate constructors are properly detected. There is a risk of a false-positive as we cannot detect whether `__spread` is actually the TypeScript spread helper, but given the reflection patterns already make lots of assumptions (e.g. that `super` is actually the superclass, we should be fine making this assumption too. The false-positive would not result in a broken app, but rather in unnecessary providers being injected (as a noop). Fixes #38453 PR Close #38463 17 August 2020, 17:55:37 UTC
81c3e80 fix(localize): render ICU placeholders in extracted translation files (#38484) Previously placeholders were only rendered for dynamic interpolation expressons in `$localize` tagged strings. But there are also potentially dynamic values in ICU expressions too, so we need to render these as placeholders when extracting i18n messages into translation files. PR Close #38484 17 August 2020, 17:44:26 UTC
be96510 test(compiler): add additional i18n serialization tests (#38484) The addiational tests check that ICUs containing interpolations are serialized correctly. PR Close #38484 17 August 2020, 17:44:24 UTC
cb05c01 fix(core): move generated i18n statements to the `consts` field of ComponentDef (#38404) This commit updates the code to move generated i18n statements into the `consts` field of ComponentDef to avoid invoking `$localize` function before component initialization (to better support runtime translations) and also avoid problems with lazy-loading when i18n defs may not be present in a chunk where it's referenced. Prior to this change the i18n statements were generated at the top leve: ``` var I18N_0; if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) { var MSG_X = goog.getMsg(“…”); I18N_0 = MSG_X; } else { I18N_0 = $localize('...'); } defineComponent({ // ... template: function App_Template(rf, ctx) { i0.ɵɵi18n(2, I18N_0); } }); ``` This commit updates the logic to generate the following code instead: ``` defineComponent({ // ... consts: function() { var I18N_0; if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) { var MSG_X = goog.getMsg(“…”); I18N_0 = MSG_X; } else { I18N_0 = $localize('...'); } return [ I18N_0 ]; }, template: function App_Template(rf, ctx) { i0.ɵɵi18n(2, 0); } }); ``` Also note that i18n template instructions now refer to the `consts` array using an index (similar to other template instructions). PR Close #38404 17 August 2020, 17:13:57 UTC
5f90b64 refactor(compiler): i18n compiler tests refactoring (#38404) This commit refactors i18n compiler tests to avoid code duplication and simplify further maintenance and updates. PR Close #38404 17 August 2020, 17:13:55 UTC
71079ce fix(common): Allow scrolling when browser supports scrollTo (#38468) This commit fixes a regression from "fix(common): ensure scrollRestoration is writable (#30630)" that caused scrolling to not happen at all in browsers that do not support scroll restoration. The issue was that `supportScrollRestoration` was updated to return `false` if a browser did not have a writable `scrollRestoration`. However, the previous behavior was that the function would return `true` if `window.scrollTo` was defined. Every scrolling function in the `ViewportScroller` used `supportScrollRestoration` and, with the update in bb88c9fa3daac80086efbda951d81c159e3840f4, no scrolling would be performed if a browser did not have writable `scrollRestoration` but _did_ have `window.scrollTo`. Note, that this failure was detected in the saucelabs tests. IE does not support scroll restoration so IE tests were failing. PR Close #38468 14 August 2020, 18:41:22 UTC
ca79880 fix(router): export DefaultRouteReuseStrategy to Router public_api (#31575) export DefaultRouteStrategy class that was used internally and exposed, and add documentation for each one of methods PR Close #31575 13 August 2020, 23:02:41 UTC
b071495 fix(core): fix multiple nested views removal from ViewContainerRef (#38317) When removal of one view causes removal of another one from the same ViewContainerRef it triggers an error with views length calculation. This commit fixes this bug by removing a view from the list of available views before invoking actual view removal (which might be recursive and relies on the length of the list of available views). Fixes #38201. PR Close #38317 13 August 2020, 20:35:53 UTC
d5f819e style(compiler-cli): remove unused constant (#38441) Remove unused constant allDiagnostics PR Close #38441 13 August 2020, 20:32:41 UTC
1388c17 perf(compiler-cli): don't emit template guards when child scope is empty (#38418) For a template that contains for example `<span *ngIf="first"></span>` there's no need to render the `NgIf` guard expression, as the child scope does not have any type-checking statements, so any narrowing effect of the guard is not applicable. This seems like a minor improvement, however it reduces the number of flow-node antecedents that TypeScript needs to keep into account for such cases, resulting in an overall reduction of type-checking time. PR Close #38418 13 August 2020, 20:28:46 UTC
fb8f4b4 perf(compiler-cli): only generate directive declarations when used (#38418) The template type-checker would always generate a directive declaration even if its type was never used. For example, directives without any input nor output bindings nor exportAs references don't need the directive to be declared, as its type would never be used. This commit makes the `TcbOp`s that are responsible for declaring a directive as optional, such that they are only executed when requested from another operation. PR Close #38418 13 August 2020, 20:28:44 UTC
f42e6ce perf(compiler-cli): only generate type-check code for referenced DOM elements (#38418) The template type-checker would generate a statement with a call expression for all DOM elements in a template of the form: ``` const _t1 = document.createElement("div"); ``` Profiling has shown that this is a particularly expensive call to perform type inference on, as TypeScript needs to perform signature selection of `Document.createElement` and resolve the exact type from the `HTMLElementTagNameMap`. However, it can be observed that the statement by itself does not contribute anything to the type-checking result if `_t1` is not actually used anywhere, which is only rarely the case---it requires that the element is referenced by its name from somewhere else in the template. Consequently, the type-checker can skip generating this statement altogether for most DOM elements. The effect of this optimization is significant in several phases: 1. Less type-check code to generate 2. Less type-check code to emit and parse again 3. No expensive type inference to perform for the call expression The effect on phase 3 is the most significant here, as type-checking is not currently incremental in the sense that only phases 1 and 2 can be reused from a prior compilation. The actual type-checking of all templates in phase 3 needs to be repeated on each incremental compilation, so any performance gains we achieve here are very beneficial. PR Close #38418 13 August 2020, 20:28:42 UTC
175c79d test(docs-infra): remove deprecated `ReflectiveInjector` (#38408) This commit replaces the old and slow `ReflectiveInjector` that was deprecated in v5 with the new `Injector`. Note: This change was only done in the spec files inside the `aio` folder. While changing this, it was not possible to directly use `Injector.get` to get the correct typing for the mocked classes. For example: ```typescript locationService = injector.get<TestLocationService>(LocationService); ``` Fails with: > Argument of type 'typeof LocationService' is not assignable to parameter of type 'Type<TestLocationService> | InjectionToken<TestLocationService> | AbstractType<TestLocationService>'. Type 'typeof LocationService' is not assignable to type 'Type<TestLocationService>'. Property 'searchResult' is missing in type 'LocationService' but required in type 'TestLocationService'. Therefore, it was necessary to first convert to `unknown` and then to `TestLocationService`. ```typescript locationService = injector.get(LocationService) as unknown as TestLocationService; ``` PR Close #38408 13 August 2020, 19:56:13 UTC
945751e ci: disable closure size tracking test (#38449) We should define ngDevMode to false in Closure, but --define only works in the global scope. With ngDevMode not being set to false, this size tracking test provides little value but a lot of headache to continue updating the size. PR Close #38449 13 August 2020, 18:41:13 UTC
b769771 refactor(router): Add annotations to correct Router documentation (#38448) The `@HostListener` functions and lifecycle hooks aren't intended to be public API but do need to appear in the `.d.ts` files or type checking will break. Adding the nodoc annotation will correctly hide this function on the docs site. Again, note that `@internal` cannot be used because the result would be that the functions then do not appear in the `.d.ts` files. This would break lifecycle hooks because the class would be seen as not implementing the interface correctly. This would also break `HostListener` because the compiled templates would attempt to call the `onClick` functions, but those would also not appear in the `d.ts` and would produce errors like "Property 'onClick' does not exist on type 'RouterLinkWithHref'". PR Close #38448 13 August 2020, 18:36:10 UTC
a80f654 fix(core): error if CSS custom property in host binding has number in name (#38432) Fixes an error if a CSS custom property, used inside a host binding, has a number in its name. The error is thrown because the styling parser only expects characters from A to Z,dashes, underscores and a handful of other characters. Fixes #37292. PR Close #38432 13 August 2020, 17:35:07 UTC
aa847cb build: run browsers tests on chromium locally (#38435) Previously we added a browser target for `firefox` into the dev-infra package. It looks like as part of this change, we accidentally switched the local web testing target to `firefox`. Web tests are not commonly run locally as we use Domino and NodeJS tests for primary development. Sometimes though we intend to run tests in a browser. This would currently work with Firefox but not on Windows (as Firefox is a noop there in Bazel). This commit switches the primary browser back to `chromium`. Also Firefox has been added as a second browser to web testing targets. This allows us to reduce browsers in the legacy Saucelabs job. i.e. not running Chrome and Firefox there. This should increase stability and speed up the legacy job (+ reduced rate limit for Saucelabs). PR Close #38435 13 August 2020, 16:37:02 UTC
8763d82 build: update ng-dev config file for new commit message configuration (#38430) Removes the commit message types from the config as they are now staticly defined in the dev-infra code. PR Close #38430 13 August 2020, 16:11:19 UTC
9f7a37b feat(dev-infra): migrate to unified commit message types in commit message linting (#38430) Previously commit message types were provided as part of the ng-dev config in the repository using the ng-dev toolset. This change removes this configuration expectation and instead predefines the valid types for commit messages. Additionally, with this new unified set of types requirements around providing a scope have been put in place. Scopes are either required, optional or forbidden for a given commit type. PR Close #38430 13 August 2020, 16:11:17 UTC
773f790 feat(dev-infra): update to latest benchpress version (#38440) We recently updated the benchpress package to have a more loose Angular core peer dependency, and less other unused dependencies. We should make sure to use that in the dev-infra package so that peer dependencies can be satisified in consumer projects, and so that less unused dependencies are brought into projects. PR Close #38440 13 August 2020, 16:09:31 UTC
f4ced74 feat(dev-infra): save invalid commit message attempts to be restored on next commit attempt (#38304) When a commit message fails validation, rather than throwing out the commit message entirely the commit message is saved into a draft file and restored on the next commit attempt. PR Close #38304 13 August 2020, 15:45:25 UTC
8366eff refactor(dev-infra): extract the commit message parsing function into its own file (#38429) Extracts the commit message parsing function into its own file. PR Close #38429 12 August 2020, 23:10:07 UTC
5f2e475 docs: remove unused Input decorator (#38306) In the part "5. Add In-app Navigation" of the tutorial it was already removed PR Close #38306 12 August 2020, 18:26:10 UTC
aa3520e refactor(dev-infra): use promptConfirm util in ng-dev's formatter (#38419) Use the promptConfirm util instead of manually creating a confirm prompt with inquirer. PR Close #38419 12 August 2020, 18:25:10 UTC
823dd5b docs: update web-worker CLI commands to bash style (#38421) With this change we update the CLI generate commands to be in bash style. PR Close #38421 12 August 2020, 18:24:35 UTC
d6d7caa release: cut the v10.1.0-next.5 release 12 August 2020, 16:57:20 UTC
dcf7baf docs: release notes for the v10.0.9 release 12 August 2020, 16:49:28 UTC
4d17418 docs: delete one superfluous sentence (#38339) PR Close #38339 12 August 2020, 15:23:18 UTC
a2e069f build: run formatting automatically on pre-commit hook (#38402) Runs the `ng-dev format changed` command whenever the `git commit` command is run. As all changes which are checked by CI will require this check passing, this change can prevent needless roundtrips to correct lint/formatting errors. This automatic formatting can be bypassed with the `--no-verify` flag on the `git commit` command. PR Close #38402 11 August 2020, 23:32:54 UTC
28534d8 feat(dev-infra): Add support for formatting all staged files (#38402) Adds an ng-dev formatter option to format all of the staged files. This will can be used to format only the staged files during the pre-commit hook. PR Close #38402 11 August 2020, 23:32:54 UTC
a6292fa docs: remove solution style tsconfig (#38394) Following the issues highlighted in https://docs.google.com/document/d/1eB6cGCG_2ircfS5GzpDC9dBgikeYYcMxghVH5sDESHw/edit?usp=sharing and discussions held with the TypeScript team. Together with the TypeScript team it was decided that the best course of action is to rollback this feature. In future, it is not excluded that solution style tsconfigs are re-introduced. See: https://github.com/angular/angular-cli/pull/18478 PR Close #38394 11 August 2020, 23:32:20 UTC
e2e5f83 ci: update payload size limits for Closure tests (#38411) Currently the Closure-related tests are not tree-shaking the dev-mode-only content, thus payload size checks are failing even if dev-mode-only content is added. The https://github.com/angular/angular/commit/2e9fdbde9eb26fea17e3e68e272dc1c2cc9f4fa3 commit added some logic to JIT compiler, which is likely triggered the payload size increase. This commit updates the payload size limits for Closure-related test to get master and patch branches back to the "green" state. PR Close #38411 11 August 2020, 17:59:39 UTC
71138f6 feat(compiler-cli): Add compiler option to report errors when assigning to restricted input fields (#38249) The compiler does not currently report errors when there's an `@Input()` for a `private`, `protected`, or `readonly` directive/component class member. This change adds an option to enable reporting errors when a template attempts to bind to one of these restricted input fields. PR Close #38249 11 August 2020, 16:55:48 UTC
fa01040 refactor(compiler-cli): only use type constructors for directives with generic types (#38249) Prior to this change, the template type checker would always use a type-constructor to instantiate a directive. This type-constructor call serves two purposes: 1. Infer any generic types for the directive instance from the inputs that are passed in. 2. Type check the inputs that are passed into the directive's inputs. The first purpose is only relevant when the directive actually has any generic types and using a type-constructor for these cases inhibits a type-check performance penalty, as a type-constructor's signature is quite complex and needs to be generated for each directive. This commit refactors the generated type-check blocks to only generate a type-constructor call for directives that have generic types. Type checking of inputs is achieved by generating individual statements for all inputs, using assignments into the directive's fields. Even if a type-constructor is used for type-inference of generic types will the input checking also be achieved using the individual assignment statements. This is done to support the rework of the language service, which will start to extract symbol information from the type-check blocks. As a future optimization, it may be possible to reduce the number of inputs passed into a type-constructor to only those inputs that contribute the the type-inference of the generics. As this is not a necessity at the moment this is left as follow-up work. Closes #38185 PR Close #38249 11 August 2020, 16:55:48 UTC
80b67e0 fix(compiler-cli): infer quote expressions as any type in type checker (#37917) "Quote expressions" are expressions that start with an identifier followed by a comma, allowing arbitrary syntax to follow. These kinds of expressions would throw a an error in the template type checker, which would make them hard to track down. As quote expressions are not generally used at all, the error would typically occur for URLs that would inadvertently occur in a binding: ```html <a [href]="https://example.com"></a> ``` This commit lets such bindings be inferred as the `any` type. Fixes #36568 Resolves FW-2051 PR Close #37917 11 August 2020, 16:54:53 UTC
18098d3 fix(compiler-cli): avoid creating value expressions for symbols from type-only imports (#37912) In TypeScript 3.8 support was added for type-only imports, which only brings in the symbol as a type, not their value. The Angular compiler did not yet take the type-only keyword into account when representing symbols in type positions as value expressions. The class metadata that the compiler emits would include the value expression for its parameter types, generating actual imports as necessary. For type-only imports this should not be done, as it introduces an actual import of the module that was originally just a type-only import. This commit lets the compiler deal with type-only imports specially, preventing a value expression from being created. Fixes #37900 PR Close #37912 11 August 2020, 16:53:25 UTC
9514fd9 fix(compiler): evaluate safe navigation expressions in correct binding order (#37911) When using the safe navigation operator in a binding expression, a temporary variable may be used for storing the result of a side-effectful call. For example, the following template uses a pipe and a safe property access: ```html <app-person-view [enabled]="enabled" [firstName]="(person$ | async)?.name"></app-person-view> ``` The result of the pipe evaluation is stored in a temporary to be able to check whether it is present. The temporary variable needs to be declared in a separate statement and this would also cause the full expression itself to be pulled out into a separate statement. This would compile into the following pseudo-code instructions: ```js var temp = null; var firstName = (temp = pipe('async', ctx.person$)) == null ? null : temp.name; property('enabled', ctx.enabled)('firstName', firstName); ``` Notice that the pipe evaluation happens before evaluating the `enabled` binding, such that the runtime's internal binding index would correspond with `enabled`, not `firstName`. This introduces a problem when the pipe uses `WrappedValue` to force a change to be detected, as the runtime would then mark the binding slot corresponding with `enabled` as dirty, instead of `firstName`. This results in the `enabled` binding to be updated, triggering setters and affecting how `OnChanges` is called. In the pseudo-code above, the intermediate `firstName` variable is not strictly necessary---it only improved readability a bit---and emitting it inline with the binding itself avoids the out-of-order execution of the pipe: ```js var temp = null; property('enabled', ctx.enabled) ('firstName', (temp = pipe('async', ctx.person$)) == null ? null : temp.name); ``` This commit introduces a new `BindingForm` that results in the above code to be generated and adds compiler and acceptance tests to verify the proper behavior. Fixes #37194 PR Close #37911 11 August 2020, 16:51:10 UTC
2e9fdbd fix(core): prevent NgModule scope being overwritten in JIT compiler (#37795) In JIT compiled apps, component definitions are compiled upon first access. For a component class `A` that extends component class `B`, the `B` component is also compiled when the `InheritDefinitionFeature` runs during the compilation of `A` before it has finalized. A problem arises when the compilation of `B` would flush the NgModule scoping queue, where the NgModule declaring `A` is still pending. The scope information would be applied to the definition of `A`, but its compilation is still in progress so requesting the component definition would compile `A` again from scratch. This "inner compilation" is correctly assigned the NgModule scope, but once the "outer compilation" of `A` finishes it would overwrite the inner compilation's definition, losing the NgModule scope information. In summary, flushing the NgModule scope queue could trigger a reentrant compilation, where JIT compilation is non-reentrant. To avoid the reentrant compilation, a compilation depth counter is introduced to avoid flushing the NgModule scope during nested compilations. Fixes #37105 PR Close #37795 11 August 2020, 16:50:27 UTC
df76a20 fix(router): restore 'history.state' object for navigations coming from Angular router (#28108) (#28176) When navigations coming from Angular router we may have a payload stored in state property. When this exists, set extras's state to the payload. PR Close #28176 11 August 2020, 15:36:13 UTC
3d15616 fix(dev-infra): update i18n-related file locations in PullApprove config (#38403) The changes in https://github.com/angular/angular/pull/38368 split `render3/i18n.ts` files into smaller scripts, but the PullApprove config was not updated to reflect that. This commit updates the PullApprove config to reflect the recent changes in i18n-related files. PR Close #38403 11 August 2020, 00:29:51 UTC
5dc8d28 fix(core): queries not matching string injection tokens (#38321) Queries weren't matching directives that provide themselves via string injection tokens, because the assumption was that any string passed to a query decorator refers to a template reference. These changes make it so we match both template references and providers while giving precedence to the template references. Fixes #38313. Fixes #38315. PR Close #38321 10 August 2020, 22:27:24 UTC
6da9e58 fix(compiler-cli): preserve quotes in class member names (#38387) When we were outputting class members for `setClassMetadata` calls, we were using the string representation of the member name. This can lead to us generating invalid code when the name contains dashes and is quoted (e.g. `@Output() 'has-dashes' = new EventEmitter()`), because the quotes will be stripped for the string representation. These changes fix the issue by using the original name AST node that was used for the declaration and which knows whether it's supposed to be quoted or not. Fixes #38311. PR Close #38387 10 August 2020, 22:26:45 UTC
250e299 refactor(core): break `i18n.ts` into smaller files (#38368) This commit contains no changes to code. It only breaks `i18n.ts` file into `i18n.ts` + `i18n_apply.ts` + `i18n_parse.ts` + `i18n_postprocess.ts` for easier maintenance. PR Close #38368 10 August 2020, 22:07:42 UTC
8f708b5 fix(router): defer loading of wildcard module until needed (#38348) Defer loading the wildcard module so that it is not loaded until subscribed to. This fixes an issue where it was being eagerly loaded. As an example, wildcard module loading should only occur after all other potential matches have been exhausted. A test case for this was also added to demonstrate the fix. Fixes #25494 PR Close #38348 10 August 2020, 20:20:08 UTC
e34c33c fix(platform-server): remove styles added by ServerStylesHost on destruction (#38367) When a ServerStylesHost instance is destroyed, all of the shared styles added to the DOM head element by that instance should be removed. Without this removal, over time a large number of style rules will build up and cause extra memory pressure. This brings the ServerStylesHost in line with the DomStylesHost used by the platform browser, which performs this same cleanup. PR Close #38367 10 August 2020, 20:12:23 UTC
6d8c73a fix(core): Store the currently selected ICU in `LView` (#38345) The currently selected ICU was incorrectly being stored it `TNode` rather than in `LView`. Remove: `TIcuContainerNode.activeCaseIndex` Add: `LView[TIcu.currentCaseIndex]` PR Close #38345 10 August 2020, 19:41:17 UTC
6ff28ac docs: Remove redundant sentence from Router (#38398) PR Close #38398 10 August 2020, 16:52:30 UTC
0de93fd docs: update team contributors page (#38384) Removing Kara, Denny, Judy, Tony, Matias as they are no longer actively working on the project PR Close #38384 10 August 2020, 16:51:50 UTC
445ac15 docs: fix purpose description of "builders.json" (#36830) PR Close #36830 07 August 2020, 22:04:56 UTC
856db56 refactor(forms): get rid of duplicate functions (#38371) This commit performs minor refactoring in Forms package to get rid of duplicate functions. It looks like the functions were duplicated due to a slightly different type signatures, but their logic is completely identical. The logic in retained functions remains the same and now these function also accept a generic type to achieve the same level of type safety. PR Close #38371 07 August 2020, 18:40:04 UTC
354e66e refactor(common): use getElementById in ViewportScroller.scrollToAnchor (#30143) This commit uses getElementById and getElementsByName when an anchor scroll happens, to avoid escaping the anchor and wrapping the code in a try/catch block. Related to #28960 PR Close #30143 07 August 2020, 18:14:31 UTC
702958e refactor(core): add debug ranges to `LViewDebug` with matchers (#38359) This change provides better typing for the `LView.debug` property which is intended to be used by humans while debugging the application with `ngDevMode` turned on. In addition this chang also adds jasmine matchers for better asserting that `LView` is in the correct state. PR Close #38359 06 August 2020, 23:58:11 UTC
df7f3b0 fix(service-worker): fix the chrome debugger syntax highlighter (#38332) The Chrome debugger is not able to render the syntax properly when the code contains backticks. This is a known issue in Chrome and they have an open [issue](https://bugs.chromium.org/p/chromium/issues/detail?id=659515) for that. This commit adds the work-around to use double backslash with one backtick ``\\` `` at the end of the line. This can be reproduced by running the following command: `yarn bazel test //packages/forms/test --config=debug` When opening the chrome debugger tools, you should see the correct code highlighting syntax. PR Close #38332 06 August 2020, 22:22:57 UTC
7525f3a fix(compiler-cli): type-check inputs that include undefined when there's coercion members (#38273) For attribute bindings that target a directive's input, the template type checker is able to verify that the type of the input expression is compatible with the directive's declaration for said input. This checking adheres to the `strictNullChecks` flag as configured in the TypeScript compilation, such that errors are reported for expressions that include `undefined` or `null` in their type if the input's declaration does not include those types. There was a bug with this level of type-checking for directives that also declare coercion members, where binding an expression that includes the `undefined` type to a directive's input that does not include the `undefined` type would not be reported as error. This commit fixes the bug by changing the type-constructor in type-check code to use an intersection type of regular inputs and coerced inputs, instead of a union type. The union type would inadvertently allow `undefined` types to be assigned into the regular inputs, as that would still satisfy the characteristics of a union type. As a result of this change, you may start to see build failures if `strictTemplates` is enabled and `strictInputTypes` is not disabled. These errors are legitimate and some action is required to achieve a successful build: 1. Update the templates for which an error is reported and introduce the non-null assertion operator at the end of the expression. This removes the `undefined` type from the expression's type, making it appear as a valid assignment. 2. Disable `strictNullInputTypes` in the compiler options. This will implicitly add the non-null assertion operators similar to option 1, but all templates in the compilation are affected. 3. Update the directive's input declaration to include the `undefined` type, if the directive is not implemented in an external library. PR Close #38273 06 August 2020, 22:21:02 UTC
570d156 test: update components repo to test against recent revision (#38273) The changes in angular/components#20136 are required to allow the framework tests to succeed. PR Close #38273 06 August 2020, 22:21:02 UTC
back to top