angular-cn/tools/public_api_guard
Alex Rickabaugh 95c729f5d1 build: typescript 3.8 support (#35864)
This commit adds support in the Angular monorepo and in the Angular
compiler(s) for TypeScript 3.8. All packages can now compile with
TS 3.8.

For most of the repo, only a handful few typings adjustments were needed:

* TS 3.8 has a new `CustomElementConstructor` DOM type, which enforces a
  zero-argument constructor. The `NgElementConstructor` type previously
  declared a required `injector` argument despite the fact that its
  implementation allowed `injector` to be optional. The interface type was
  updated to reflect the optionality of the argument.
* Certain error messages were changed, and expectations in tests were
  updated as a result.
* tsserver (part of language server) now returns performance information in
  responses, so test expectations were changed to only assert on the actual
  body content of responses.

For compiler-cli and schematics (which use the TypeScript AST) a major
breaking change was the introduction of the export form:

```typescript
export * as foo from 'bar';
```

This is a `ts.NamespaceExport`, and the `exportClause` of a
`ts.ExportDeclaration` can now take this type as well as `ts.NamedExports`.
This broke a lot of places where `exportClause` was assumed to be
`ts.NamedExports`.

For the most part these breakages were in cases where it is not necessary
to handle the new `ts.NamedExports` anyway. ngtsc's design uses the
`ts.TypeChecker` APIs to understand syntax and so automatically supports the
new form of exports.

The View Engine compiler on the other hand extracts TS structures into
metadata.json files, and that format was not designed for namespaced
exports. As a result it will take a nontrivial amount of work if we want to
support such exports in View Engine. For now, these new exports are not
accounted for in metadata.json, and so using them in "folded" Angular
expressions will result in errors (probably claiming that the referenced
exported namespace doesn't exist).

Care was taken to only use TS APIs which are present in 3.7/3.6, as Angular
needs to remain compatible with these for the time being.

This commit does not update angular.io.

PR Close #35864
2020-03-10 17:51:20 -04:00
..
animations docs: update animations to use `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00
common fix(ivy): narrow `NgIf` context variables in template type checker (#35125) 2020-02-28 07:39:57 -08:00
core fix(core): remove side effects from `ɵɵNgOnChangesFeature()` (#35769) 2020-03-03 08:50:03 -08:00
elements build: typescript 3.8 support (#35864) 2020-03-10 17:51:20 -04:00
forms build: update API Golden files after node 12 update (#34955) 2020-01-27 09:31:22 -08:00
http build: update API Golden files after node 12 update (#34955) 2020-01-27 09:31:22 -08:00
localize fix(ivy): i18n - use `MessageId` for matching translations (#32594) 2019-09-17 09:17:44 -07:00
platform-browser feat(ivy): make Hammer support tree-shakable (#32203) 2019-08-21 11:43:51 -07:00
platform-browser-dynamic docs: update platform-browser-dynamic to use `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00
platform-server build: typescript 3.7 support (#33717) 2020-01-14 16:42:21 -08:00
platform-webworker docs(platform-webworker): mark all public APIs as deprecated (#33824) 2019-11-15 16:14:37 -08:00
platform-webworker-dynamic feat(platform-webworker): deprecate platform-webworker (#30642) 2019-05-23 15:09:48 -07:00
router build: typescript 3.7 support (#33717) 2020-01-14 16:42:21 -08:00
service-worker build: typescript 3.7 support (#33717) 2020-01-14 16:42:21 -08:00
upgrade feat(upgrade): provide unit test helpers for wiring up injectors (#16848) 2019-06-20 17:04:01 -07:00
BUILD.bazel test(compiler): add a public API guard for the public compiler options (#35885) 2020-03-10 14:15:28 -04:00
compiler_options.d.ts test(compiler): add a public API guard for the public compiler options (#35885) 2020-03-10 14:15:28 -04:00
error_code.d.ts fix(compiler): type-checking error for duplicate variables in templates (#35674) 2020-03-03 13:52:50 -08:00
global_utils.d.ts refactor(ivy): remove markDirty from global utilities (#34453) 2020-01-30 11:30:32 -08:00
public_api_guard.bzl build(ivy): remove the remains of ivy-jit mode (#27278) 2018-11-27 10:30:58 -08:00