https://github.com/angular/angular

sort by:
Revision Author Date Message Commit Date
25f79ba release: cut the v10.0.9 release 12 August 2020, 16:35:37 UTC
2590a9b docs: delete one superfluous sentence (#38339) PR Close #38339 12 August 2020, 15:23:19 UTC
f68a1d3 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:55 UTC
89f7f63 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:55 UTC
ca2b4bc fix(compiler-cli): avoid creating value expressions for symbols from type-only imports (#38415) 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. Backports #37912 to patch PR Close #38415 11 August 2020, 19:31:58 UTC
f6cfc92 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:40 UTC
5b87c67 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:54 UTC
f5b9d87 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:11 UTC
3acebdc 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:28 UTC
02aca13 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:52 UTC
32109dc 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:25 UTC
c9acb7b 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:46 UTC
545444d 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:44 UTC
7f11149 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:24 UTC
ee5123f 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:18 UTC
3dfaf56 docs: Remove redundant sentence from Router (#38398) PR Close #38398 10 August 2020, 16:52:31 UTC
432a688 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:51 UTC
42a649d docs: fix purpose description of "builders.json" (#36830) PR Close #36830 07 August 2020, 22:04:57 UTC
47fbfb3 refactor(forms): get rid of duplicate functions (#38371) (#38380) 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 #38380 07 August 2020, 19:11:37 UTC
4107abb refactor(common): use getElementById in ViewportScroller.scrollToAnchor (#38372) 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 #38372 07 August 2020, 18:17:53 UTC
1d26bc5 test: update components repo to test against recent revision (#38273) (#38378) The changes in angular/components#20136 are required to allow the framework tests to succeed. PR Close #38273 PR Close #38378 07 August 2020, 18:12:49 UTC
ef7b70a 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:12 UTC
deb290b refactor(core): extract `icuSwitchCase`, `icuUpdateCase`, `removeNestedIcu` (#38154) (#38370) Extract `icuSwitchCase`, `icuUpdateCase`, `removeNestedIcu` into separate functions to align them with the `.debug` property text. PR Close #38154 PR Close #38370 06 August 2020, 23:27:28 UTC
5c8b7d2 refactor(core): add human readable `debug` for i18n (#38154) (#38370) I18n code breaks up internationalization into opCodes which are then stored in arrays. To make it easier to debug the codebase this PR adds `debug` property to the arrays which presents the data in human readable format. PR Close #38154 PR Close #38370 06 August 2020, 23:27:27 UTC
f5d5bac 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
ad16e2f docs(service-worker): describe how asset-/data-group order affects request handling (#38364) The order of asset- and data-groups in `ngsw-config.json` affects how a request is handled by the ServiceWorker. Previously, this was not clearly documented. This commit describes how the order of asset-/data-groups affects request handling. Closes #21189 PR Close #38364 06 August 2020, 18:41:59 UTC
d0191a7 fix(docs-infra): correctly generate CLI commands docs when the overview page moves (#38365) Previously, the [processCliCommands][1] dgeni processor, which is used to generate the docs pages for the CLI commands, expected the CLI commands overview page (with a URL of `cli`) to exist as a child of a top-level navigation section (`CLI Commands`). If one tried to move the `CLI Commands` section inside another section, `processCliCommnads` would fail to find it and thus fail to generate the CLI commands docs. This problem came up in #38353. This commit updates the `processCliCommands` processor to be able to find it regardless of the position of the `CLI Commands` section inside the navigation doc. [1]: https://github.com/angular/angular/blob/dca4443a8ed65d341356fe62f6df9934e6314dfe/aio/tools/transforms/cli-docs-package/processors/processCliCommands.js#L7-L9 PR Close #38365 06 August 2020, 18:41:07 UTC
016a41b fix(compiler-cli): mark eager `NgModuleFactory` construction as not side effectful (#38320) Roll forward of #38147. This allows Closure compiler to tree shake unused constructor calls to `NgModuleFactory`, which is otherwise considered side-effectful. The Angular compiler generates factory objects which are exported but typically not used, as they are only needed for compatibility with View Engine. This results in top-level constructor calls, such as: ```typescript export const FooNgFactory = new NgModuleFactory(Foo); ``` `NgModuleFactory` has a side-effecting constructor, so this statement cannot be tree shaken, even if `FooNgFactory` is never imported. The `NgModuleFactory` continues to reference its associated `NgModule` and prevents the module and all its unused dependencies from being tree shaken, making Closure builds significantly larger than necessary. The fix here is to wrap `NgModuleFactory` constructor with `noSideEffects(() => /* ... */)`, which tricks the Closure compiler into assuming that the invoked function has no side effects. This allows it to tree-shake unused `NgModuleFactory()` constructors when they aren't imported. Since the factory can be removed, the module can also be removed (if nothing else references it), thus tree shaking unused dependencies as expected. The one notable edge case is for lazy loaded modules. Internally, lazy loading is done as a side effect when the lazy script is evaluated. For Angular, this side effect is registering the `NgModule`. In Ivy this is done by the `NgModuleFactory` constructor, so lazy loaded modules **cannot** have their top-level `NgModuleFactory` constructor call tree shaken. We handle this case by looking for the `id` field on `@NgModule` annotations. All lazy loaded modules include an `id`. When this `id` is found, the `NgModuleFactory` is generated **without** with `noSideEffects()` call, so Closure will not tree shake it and the module will lazy-load correctly. PR Close #38320 06 August 2020, 16:02:17 UTC
7a527b4 refactor(compiler): add `ModuleInfo` interface (#38320) This introduces a new `ModuleInfo` interface to represent some of the statically analyzed data from an `NgModule`. This gets passed into transforms to give them more context around a given `NgModule` in the compilation. PR Close #38320 06 August 2020, 16:02:17 UTC
fd28f0c refactor(core): add `noSideEffects()` as private export (#38320) This is to enable the compiler to generate `noSideEffects()` calls. This is a private export, gated by `ɵ`. PR Close #38320 06 August 2020, 16:02:17 UTC
7342b1e docs: remove https://angular.io from internal links (#38360) PR #36601 introduces icons on all links if the link contains https:// or http:// but there were some internal links left which contained https://angular.io. Removed https://angular.io from all these links. PR Close #38360 06 August 2020, 16:01:35 UTC
58f4b3a fix(common): ensure scrollRestoration is writable (#30630) (#38357) Some specialised browsers that do not support scroll restoration (e.g. some web crawlers) do not allow `scrollRestoration` to be writable. We already sniff the browser to see if it has the `window.scrollTo` method, so now we also check whether `window.history.scrollRestoration` is writable too. Fixes #30629 PR Close #30630 PR Close #38357 06 August 2020, 00:49:56 UTC
3974312 style(docs-infra): reformat ScrollService file (#30630) (#38357) Pre-empting code formatting changes when the code is updated in a subsequent commit. PR Close #30630 PR Close #38357 06 August 2020, 00:49:55 UTC
db897f4 docs: add a page with the Angular roadmap (#38356) PR Close #38356 06 August 2020, 00:16:38 UTC
77093c2 refactor(platform-browser): specify return type of parseEventName (#38089) This commit refactors the argument of the `parseEventName` function to use an object with named properties instead of using an object indexer. PR Close #38089 06 August 2020, 00:06:29 UTC
4151314 fix(router): prevent calling unsubscribe on undefined subscription in RouterPreloader (#38344) Previously, the `ngOnDestroy` method called `unsubscribe` regardless of if `subscription` had been initialized. This can lead to an error attempting to call `unsubscribe` of undefined. This change prevents this error, and instead only attempts `unsubscribe` when the subscription has been defined. PR Close #38344 05 August 2020, 17:54:42 UTC
df01a82 fix(compiler-cli): match wrapHost parameter types within plugin interface (#38004) The `TscPlugin` interface using a type of `ts.CompilerHost&Partial<UnifiedModulesHost>` for the `host` parameter of the `wrapHost` method. However, prior to this change, the interface implementing `NgTscPlugin` class used a type of `ts.CompilerHost&UnifiedModulesHost` for the parameter. This change corrects the inconsistency and allows `UnifiedModulesHost` members to be optional when using the `NgtscPlugin`. PR Close #38004 05 August 2020, 17:54:08 UTC
1912fa3 feat(dev-infra): provide organization-wide merge-tool label configuration (#38223) Previously, each Angular repository had its own strategy/configuration for merging pull requests and cherry-picking. We worked out a new strategy for labeling/branching/versioning that should be the canonical strategy for all actively maintained projects in the Angular organization. This PR provides a `ng-dev` merge configuration that implements the labeling/branching/merging as per the approved proposal. See the following document for the proposal this commit is based on for the merge script labeling/branching: https://docs.google.com/document/d/197kVillDwx-RZtSVOBtPb4BBIAw0E9RT3q3v6DZkykU The merge tool label configuration can be conveniently accesed within each `.ng-dev` configuration, and can also be extended if there are special labels on individual projects. This is one of the reasons why the labels are not directly built into the merge script. The script should remain unopinionated and flexible. The configuration is conceptually powerful enough to achieve the procedures as outlined in the versioning/branching/labeling proposal. PR Close #38223 05 August 2020, 17:53:18 UTC
db5e1de feat(dev-infra): support user-failures when computing branches for target label (#38223) The merge tool provides a way for configurations to determine the branches for a label lazily. This is supported because it allows labels to respect the currently selected base branch through the Github UI. e.g. if `target: label` is applied on a PR and the PR is based on the patch branch, then the change could only go into the selected target branch, while if it would be based on `master`, the change would be cherry-picked to `master` too. This allows for convenient back-porting of changes if they did not apply cleanly to the primary development branch (`master`). We want to expand this function so that it is possible to report failures if an invalid target label is appplied (e.g. `target: major` not allowed in some situations), or if the Github base branch is not valid for the given target label (e.g. if `target: lts` is used, but it's not based on a LTS branch). PR Close #38223 05 August 2020, 17:53:18 UTC
84661ea feat(dev-infra): provide github API instance to lazy merge configuration (#38223) The merge script currently accepts a configuration function that will be invoked _only_ when the `ng-dev merge` command is executed. This has been done that way because the merge tooling usually relies on external requests to Git or NPM for constructing the branch configurations. We do not want to perform these slow external queries on any `ng-dev` command though, so this became a lazily invoked function. This commit adds support for these configuration functions to run asynchronously (by returning a Promise that will be awaited), so that requests could also be made to the Github API. This is benefical as it could avoid dependence on the local Git state and the HTTP requests are more powerful/faster. Additionally, in order to be able to perform Github API requests with an authenticated instance, the merge tool will pass through a `GithubClient` instance that uses the specified `--github-token` (or from the environment). This ensures that all API requests use the same `GithubClient` instance and can be authenticated (mitigating potential rate limits). PR Close #38223 05 August 2020, 17:53:18 UTC
629203f docs: fix typo in glossary (#38318) Add missing comma in structural directive section that made dash display incorrectly. PR Close #38318 05 August 2020, 17:52:28 UTC
2ab8e88 release: cut the v10.0.8 release 04 August 2020, 22:51:57 UTC
a91dd2e build: cleanup .bazelrc file to no longer set unused flags (#38124) This option is no longer needed in Bazel and will be an error in the future PR Close #38124 03 August 2020, 19:53:11 UTC
6eca80b revert: docs(core): correct SomeService to SomeComponent (#38325) This reverts commit b4449e35bfd04c5858ded17c0ce56248d680e8d4. The example given from the previous change was for a component selector and not a provider selector. This change fixes it. Fixes #38323. PR Close #38325 03 August 2020, 19:52:20 UTC
cea4678 fix(compiler): update unparsable character reference entity error messages (#38319) Within an angular template, when a character entity is unable to be parsed, previously a generic unexpected character error was thrown. This does not properly express the issue that was discovered as the issue is actually caused by the discovered character making the whole of the entity unparsable. The compiler will now instead inform via the error message what string was attempted to be parsed and what it was attempted to be parsed as. Example, for this template: ``` <p> &#x123p </p> ``` Before this change: `Unexpected character "p"` After this change: `Unable to parse entity "&#x123p" - hexadecimal character reference entities must end with ";"` Fixes #26067 PR Close #38319 31 July 2020, 22:32:54 UTC
9c5fc16 refactor(docs-infra): update docs examples `tslint.json` to match CLI and fix failures (#38143) This commit updates the `tslint.json` configuration file, that is used to lint the docs examples, to match the one generated for new Angular CLI apps. There are some minimal differences (marked with `TODO` comments) for things, such as component selector prefix, that would require extensive and/or difficult to validate changes in guides. This commit also includes the final adjustments to make the docs examples code compatible with the new tslint rules. (The bulk of the work has been done in previous commits.) PR Close #38143 31 July 2020, 18:00:08 UTC
42f5770 refactor(docs-infra): fix docs examples for Angular-specific tslint rules (#38143) This commit updates the docs examples to be compatible with the following Angular-specific tslint rules: - `component-selector` - `directive-selector` - `no-conflicting-lifecycle` - `no-host-metadata-property` - `no-input-rename` - `no-output-native` - `no-output-rename` This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:08 UTC
01db374 refactor(docs-infra): fix docs examples for tslint rule `prefer-const` (#38143) This commit updates the docs examples to be compatible with the `prefer-const` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:08 UTC
07a0033 refactor(docs-infra): fix docs examples for tslint rules related to underscores in variable names (#38143) This commit updates the docs examples to be compatible with the `variable-name` tslint rule without requiring the `allow-leading-underscore` and `allow-trailing-underscore` options. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:08 UTC
ac009d2 refactor(docs-infra): fix docs examples for tslint rules related to variable names (#38143) This commit updates the docs examples to be compatible with the `no-shadowed-variable` and `variable-name` tslint rules. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:08 UTC
eb8f8c9 refactor(docs-infra): fix docs examples for tslint rule `member-ordering` (#38143) This commit updates the docs examples to be compatible with the `member-ordering` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:08 UTC
18a5117 refactor(docs-infra): fix docs examples for tslint rule `no-angle-bracket-type-assertion` (#38143) This commit updates the docs examples to be compatible with the `no-angle-bracket-type-assertion` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:08 UTC
ff72da6 refactor(docs-infra): fix docs examples for tslint rules related to object properties (#38143) This commit updates the docs examples to be compatible with the `no-string-literal`, `object-literal-key-quotes` and `object-literal-shorthand` tslint rules. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:08 UTC
d4a723a refactor(docs-infra): fix docs examples for tslint rule `only-arrow-functions` (#38143) This commit updates the docs examples to be compatible with the `only-arrow-functions` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:08 UTC
9c2f0b8 style(docs-infra): fix docs examples for tslint rule `jsdoc-format` (#38143) This commit updates the docs examples to be compatible with the `jsdoc-format` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:07 UTC
dc081fb style(docs-infra): fix docs examples for tslint rule `semicolon` (#38143) This commit updates the docs examples to be compatible with the `semicolon` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:07 UTC
f882099 style(docs-infra): fix docs examples for tslint rules related to whitespace (#38143) This commit updates the docs examples to be compatible with the `align`, `space-before-function-paren` and `typedef-whitespace` tslint rules. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:07 UTC
24498eb style(docs-infra): fix docs examples for tslint rule `import-spacing` (#38143) This commit updates the docs examples to be compatible with the `import-spacing` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143 31 July 2020, 18:00:07 UTC
4c2cdc6 refactor(docs-infra): remove unnecessary `use strict` from docs examples TS files (#38143) By default, TypeScript will emit `"use strict"` directives, so it is not necessary to include `'use strict'` in `.ts` files: https://www.typescriptlang.org/docs/handbook/compiler-options.html#:~:text=--noImplicitUseStrict PR Close #38143 31 July 2020, 18:00:07 UTC
1cb66bb refactor(docs-infra): remove unused styleguide examples (#38143) The `03-*` code style rule have been removed from the style guide in be0bc799f3fa99582238f29cb575e0705ce0c10f. This commit removes the corresponding files and related unused code from the`styleguide` example project. PR Close #38143 31 July 2020, 18:00:07 UTC
7ff5ef2 fix(language-service): [ivy] do not retrieve ts.Program at startup (#38120) This commit removes compiler instantiation at startup. This is because the constructor is invoked during the plugin loading phase, in which the project has not been completely loaded. Retrieving `ts.Program` at startup will trigger an `updateGraph` operation, which could only be called after the Project has loaded completely. Without this change, the Ivy LS cannot be loaded as a tsserver plugin. Note that the whole `Compiler` class is temporary, so changes made there are only for development. Once we have proper integration with ngtsc the `Compiler` class would be removed. PR Close #38120 30 July 2020, 23:54:20 UTC
03d8e31 fix(compiler): add PURE annotation to getInheritedFactory calls (#38291) Currently the `getInheritedFactory` function is implemented to allow closure to remove the call if the base factory is unused. However, this method does not work with terser. By adding the PURE annotation, terser will also be able to remove the call when unused. PR Close #38291 30 July 2020, 23:53:52 UTC
1de4fe5 release: cut the v10.0.7 release 30 July 2020, 23:37:25 UTC
879ff08 fix(compiler): Metadata should not include methods on Object.prototype (#38292) This commit fixes a bug in View Engine whereby the compiler errorneously thinks that a method of a component has decorator metadata when that method is one of those in `Object.prototype`, for example `toString`. This bug is discovered in v10.0.4 of `@angular/language-service` after the default bundle format was switched from ES5 to ES2015. ES5 output: ```js if (propMetadata[propName]) { decorators.push.apply(decorators, __spread(propMetadata[propName])); } ``` ES2015 output: ```js if (propMetadata[propName]) { decorators.push(...propMetadata[propName]); } ``` The bug was not discovered in ES5 because the polyfill for the spread operator happily accepts parameters that do not have the `iterable` symbol: ```js function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } ``` whereas in es2015 it’ll fail since the iterable symbol is not present in `propMetadata['toString']` which evaluates to a function. Fixes https://github.com/angular/vscode-ng-language-service/issues/859 PR Close #38292 30 July 2020, 22:18:28 UTC
a15d7ac Revert "fix(compiler): mark `NgModuleFactory` construction as not side effectful (#38147)" (#38303) This reverts commit 7f8c2225f2cba3dfcf3ec23e0fe08b7d2e3497e8. This commit caused test failures internally, which were traced back to the optimizer removing NgModuleFactory constructor calls when those calls caused side-effectful registration of NgModules by their ids. PR Close #38303 30 July 2020, 19:19:36 UTC
4a6abbd fix(compiler-cli): correct type of makeDiagnostic() This commit corrects the type of makeDiagnostic()'s messageText parameter, which was not compatible with some compiler refactorings merged to 10.0.x due to unforeseen dependencies on prior refactorings. 30 July 2020, 01:00:40 UTC
78eb5f6 refactor(compiler-cli): create diagnostics using `ts.DiagnosticRelatedInformation` (#37587) Previously, an anonymous type was used for creating a diagnostic with related information. The anonymous type would then be translated into the necessary `ts.DiagnosticRelatedInformation` shape within `makeDiagnostic`. This commit switches the `makeDiagnostic` signature over to taking `ts.DiagnosticRelatedInformation` directly and introduces `makeRelatedInformation` to easily create such objects. This is done to aid in making upcoming work more readable. PR Close #37587 30 July 2020, 00:50:08 UTC
0cdb523 test(compiler-cli): disable one TypeChecker test on Windows due to path sensitivity issue (#38294) This commit disables one TypeChecker test (added as a part of https://github.com/angular/angular/pull/38105) which make assertions about the filename while running on Windows. Such assertions are currently suffering from a case sensitivity issue. PR Close #38294 30 July 2020, 00:49:45 UTC
5af845d docs(router): clarify how base href is used to construct targets (#38123) The documentation is not clear on how the base href and APP_BASE_HREF are used. This commit should help clarify more complicated use-cases beyond the most common one of just a '/' PR Close #38123 29 July 2020, 20:34:02 UTC
a5c2849 fix(compiler): mark `NgModuleFactory` construction as not side effectful (#38147) This allows Closure compiler to tree shake unused constructor calls to `NgModuleFactory`, which is otherwise considered side-effectful. The Angular compiler generates factory objects which are exported but typically not used, as they are only needed for compatibility with View Engine. This results in top-level constructor calls, such as: ```typescript export const FooNgFactory = new NgModuleFactory(Foo); ``` `NgModuleFactory` has a side-effecting constructor, so this statement cannot be tree shaken, even if `FooNgFactory` is never imported. The `NgModuleFactory` continues to reference its associated `NgModule` and prevents the module and all its unused dependencies from being tree shaken. This effectively prevents all components from being tree shaken, making Closure builds significantly larger than they should be. The fix here is to wrap `NgModuleFactory` constructor with `noSideEffects(() => /* ... */)`, which tricks the Closure compiler into assuming that the invoked function has no side effects. This allows it to tree-shake unused `NgModuleFactory()` constructors when they aren't imported. Since the factory can be removed, the module can also be removed (if nothing else references it), thus tree shaking unused components as expected. PR Close #38147 29 July 2020, 20:32:08 UTC
801ad62 refactor(compiler): wrap large strings in function (#38253) Large strings constants are now wrapped in a function which is called whenever used. This works around a unique limitation of Closure, where it will **always** inline string literals at **every** usage, regardless of how large the string literal is or how many times it is used.The workaround is to use a function rather than a string literal. Closure has differently inlining semantics for functions, where it will check the length of the function and the number of times it is used before choosing to inline it. By using a function, `ngtsc` makes Closure more conservative about inlining large strings, and avoids blowing up the bundle size.This optimization is only used if the constant is a large string. A wrapping function is not included for other use cases, since it would just increase the bundle size and add unnecessary runtime performance overhead. PR Close #38253 29 July 2020, 20:31:04 UTC
7d4d2e2 docs: update bio picture (#38272) Updates my profile picture which was quite old. PR Close #38272 29 July 2020, 17:33:37 UTC
c33f719 refactor(docs-infra): Lazy-loads SVG icons (#38268) Prior to this commit, SVG icons were all loaded in the constructor of the `CustomIconRegistry`. This commit avoids that, and loads SVG icons on demand. PR Close #38268 29 July 2020, 17:32:55 UTC
69fc6b4 refactor(docs-infra): simplify/improve `CopierService` hidden textarea creation (#38244) This commit simplifies the creation of the temporary, hidden `<textarea>` element used by `CopierService` by switching from absolute to fixed positioning and not requiring page's scroll offset. It also makes the following minor improvements: - Make the element invisible (via `opacity: 0`). - Instruct screen-readers to ignore the element (via `aria-hidden: true`). NOTE: These improvements are based on Angular CDK's [PendingCopy][1] class and the changes proposed in PR angular/components#20073. [1]: https://github.com/angular/components/blob/89b5fa89d1437c3054c5/src/cdk/clipboard/pending-copy.ts PR Close #38244 29 July 2020, 17:32:07 UTC
5ec4c02 fix(docs-infra): preserve focus on copy (and prevent scrolling to bottom on IE11) (#38244) The `CopierService` is used for copying text to the user's clipboard. It is, for example, used in `CodeComponent` to copy example code snippets. This is implemented by creating a temporary, hidden `<textarea>` elements, setting its value to the text that needs to be copied, executing the `copy` command and finally removing the element from the DOM. Previously, as a result of `CopierService`'s implementation, the focused element would lose focus, while the temporary `<textarea>` element would implicitly gain focus when selecting its contents. This had an even worse side-effect on IE11, which seems to scroll to the bottom of the containing element (here `<body>`) when the focused element is removed. This commit fixes these issues by keeping track of the previously focused element and restoring its focus after the copy operation. NOTE: This fix is inspired by Angular CDK's [PendingCopy][1] class. [1]: https://github.com/angular/components/blob/89b5fa89d1437c3054c5/src/cdk/clipboard/pending-copy.ts Fixes #37796 PR Close #38244 29 July 2020, 17:32:07 UTC
f0489ee refactor(docs-infra): improve code readability of `CopierService` (#38244) This commit improves the code readability of the `CopierService` by: - Adding/Improving JSDoc comments for methods. - Avoiding unnecessary instance-wide properties. - Fixing indentation to be consistent (at two spaces). - Clearly separating the logic for creating and populating a `<textarea>` from the logic for selecting and copying its contents. PR Close #38244 29 July 2020, 17:32:06 UTC
d0f6253 refactor(compiler-cli): support type-checking a single component (#38105) This commit adds a method `getDiagnosticsForComponent` to the `TemplateTypeChecker`, which does the minimum amount of work to retrieve diagnostics for a single component. With the normal `ReusedProgramStrategy` this offers virtually no improvement over the standard `getDiagnosticsForFile` operation, but if the `TypeCheckingProgramStrategy` supports separate shims for each component, this operation can yield a faster turnaround for components that are declared in files with many other components. PR Close #38105 29 July 2020, 17:31:22 UTC
c15a58f refactor(compiler-cli): add `TemplateId` to template diagnostics (#38105) Previously, a stable template id was implemented for each component in a file. This commit adds this id to each `TemplateDiagnostic` generated from the template type-checker, so it can potentially be used for filtration. PR Close #38105 29 July 2020, 17:31:22 UTC
3d67d19 refactor(compiler-cli): allow overriding templates in the type checker (#38105) This commit adds an `overrideComponentTemplate` operation to the template type-checker. This operation changes the template used during template type-checking operations. Overriding a template causes any previous work for it to be discarded, and the template type-checking engine will regenerate the TCB for that template on the next request. This operation can be used by a consumer such as the language service to get rapid feedback or diagnostics as the user is editing a template file, without the need for a full incremental build iteration. Closes #38058 PR Close #38105 29 July 2020, 17:31:22 UTC
ce08a3c refactor(compiler-cli): efficient single-file type checking diagnostics (#38105) Previously, the `TemplateTypeChecker` abstraction allowed fetching diagnostics for a single file, but under the hood would generate type checking code for the entire program to satisfy the request. With this commit, an `OptimizeFor` hint is passed to `getDiagnosticsForFile` which indicates whether the user intends to request diagnostics for the whole program or is truly interested in just the single file. If the latter, the `TemplateTypeChecker` can perform only the work needed to produce diagnostics for just that file, thus returning answers more efficiently. PR Close #38105 29 July 2020, 17:31:22 UTC
bc29712 refactor(compiler-cli): allow program strategies to opt out of inlining (#38105) The template type-checking engine relies on the abstraction interface `TypeCheckingProgramStrategy` to create updated `ts.Program`s for template type-checking. The basic API is that the type-checking engine requests changes to certain files in the program, and the strategy provides an updated `ts.Program`. Typically, such changes are made to 'ngtypecheck' shim files, but certain conditions can cause template type-checking to require "inline" operations, which change user .ts files instead. The strategy used by 'ngc' (the `ReusedProgramStrategy`) supports these kinds of updates, but other clients such as the language service might not always support modifying user files. To accommodate this, the `TypeCheckingProgramStrategy` interface was modified to include a `supportsInlineOperations` flag. If an implementation specifies `false` for inline support, the template type-checking system will return diagnostics on components which would otherwise require inline operations. Closes #38059 PR Close #38105 29 July 2020, 17:31:22 UTC
cc48b5c refactor(compiler-cli): introduce the TemplateTypeChecker abstraction (#38105) This commit significantly refactors the 'typecheck' package to introduce a new abstraction, the `TemplateTypeChecker`. To achieve this: * a 'typecheck:api' package is introduced, containing common interfaces that consumers of the template type-checking infrastructure can depend on without incurring a dependency on the template type-checking machinery as a whole. * interfaces for `TemplateTypeChecker` and `TypeCheckContext` are introduced which contain the abstract operations supported by the implementation classes `TemplateTypeCheckerImpl` and `TypeCheckContextImpl` respectively. * the `TemplateTypeChecker` interface supports diagnostics on a whole program basis to start with, but the implementation is purposefully designed to support incremental diagnostics at a per-file or per-component level. * `TemplateTypeChecker` supports direct access to the type check block of a component. * the testing utility is refactored to be a lot more useful, and new tests are added for the new abstraction. PR Close #38105 29 July 2020, 17:31:22 UTC
deba0e2 refactor(compiler-cli): make file/shim split 1:n instead of 1:1 (#38105) Previously in the template type-checking engine, it was assumed that every input file would have an associated type-checking shim. The type check block code for all components in the input file would be generated into this shim. This is fine for whole-program type checking operations, but to support the language service's requirements for low latency, it would be ideal to be able to check a single component in isolation, especially if the component is declared along with many others in a single file. This commit removes the assumption that the file/shim mapping is 1:1, and introduces the concept of component-to-shim mapping. Any `TypeCheckingProgramStrategy` must provide such a mapping. To achieve this: * type checking record information is now split into file-level data as well as per-shim data. * components are now assigned a stable `TemplateId` which is unique to the file in which they're declared. PR Close #38105 29 July 2020, 17:31:21 UTC
0469d92 Revert "refactor(platform-browser): specify return type of parseEventName (#38089)" This reverts commit c3ddc3d6b15ed9da2f4a16d41cb8c41dffabbe35. 29 July 2020, 16:30:39 UTC
cdda60a release: cut the v10.0.6 release 28 July 2020, 21:38:28 UTC
7570356 build: fix broken build (#38274) ``` export const __core_private_testing_placeholder__ = ''; ``` This API should be removed. But doing so seems to break `google3` and so it requires a bit of investigation. A work around is to mark it as `@codeGenApi` for now and investigate later. PR Close #38274 28 July 2020, 19:31:00 UTC
c4a97d8 Revert "ci: roll back phased review conditions" (#38259) This reverts commit ca8eafc2983f983803cd03e4a08bf732672712dd. PR Close #38259 28 July 2020, 18:26:29 UTC
fc4dfc5 ci: only check active groups for the `no-groups-above-this-*` checks (#38259) Since PullApprove starts all inactive groups as a pending state, to properly assess if any groups we care about are pending we must only check the active groups. We additionally do this with rejected because the intention of the reusable checks is around checking active rules only. PR Close #38259 28 July 2020, 18:26:28 UTC
25d95da docs(elements): update api doc for custom elements (#38252) by adding cross-references to Angular Elements Overview guide. PR Close #38252 28 July 2020, 18:19:04 UTC
1c4fcce fix(core): `Attribute` decorator `attributeName` is mandatory (#38131) `Attribute` decorator has defined `attributeName` as optional but actually its mandatory and compiler throws an error if `attributeName` is undefined. Made `attributeName` mandatory in the `Attribute` decorator to reflect this functionality Fixes #32658 PR Close #38131 28 July 2020, 18:17:25 UTC
6e73faa docs(core): correct SomeService to SomeComponent (#38264) PR Close #38264 28 July 2020, 18:10:59 UTC
41c9910 docs: update api reference doc for router-link-active directive (#38247) Edits and organizes the usage information for the directive. PR Close #38247 28 July 2020, 18:09:45 UTC
aaddef2 ci: roll back phased review conditions (#38257) It was determined that the list of 'pending' groups also included inactive groups. That means that the 'no-groups-above-this-pending' would generally fail because there's almost always some inactive group above it. This commit removes the conditions for phased review while we investigate if the inactive groups can be excluded. PR Close #38257 28 July 2020, 17:02:15 UTC
02f3aee docs: Refactor module-types.md to make it easier to understand (#38206) Project DOCS-736 to rewrite headings to focus on user tasks, verify that the content is up-to-date and complete, and add relevant links to other NgModule topics to improve readability. Also addresses one of many issues in GitHub issue 21531. PR Close #38206 28 July 2020, 17:01:38 UTC
c27ba96 ci: add more owners for limited categories (#38170) * Add alxhub, atscott, and AndrewKushnir to code owners * Add atscott & AndrewKushnir to public-api and size-tracking Follow-up to #37994 PR Close #38170 28 July 2020, 17:01:05 UTC
c5a474c docs: Refactor ngmodule-vs-jsmodule.md to make it easier to understand (#38148) Project DOCS-734 to rewrite headings to focus on user tasks, verify that the content is up-to-date and complete, and add relevant links to other NgModule topics to improve readability. Also addresses one of many issues in GitHub issue 21531. PR Close #38148 28 July 2020, 17:00:29 UTC
d5264f5 fix(core): unify the signature between ngZone and noopZone (#37581) Now we have two implementations of Zone in Angular, one is NgZone, the other is NoopZone. They should have the same signatures, includes 1. properties 2. methods In this PR, unify the signatures of the two implementations, and remove the unnecessary cast. PR Close #37581 28 July 2020, 16:59:49 UTC
0cd4b87 Revert "refactor(core): remove unused export (#38224)" This reverts commit c6c8e1581371fcbb62dbeb5bf1128ae25f0220e3. 28 July 2020, 16:56:24 UTC
b1e7775 fix(compiler-cli): Add support for string literal class members (#38226) The current implementation of the TypeScriptReflectionHost does not account for members that are string literals, i.e. `class A { 'string-literal-prop': string; }` PR Close #38226 27 July 2020, 22:26:27 UTC
87f5fef docs: update api reference doc for router link directive (#38181) Edits and organizes the usage information for the directive. PR Close #38181 27 July 2020, 22:25:45 UTC
back to top