With this change we update the TypeScript target of server compilation unit for new projects.
- E2E target has been update from `es2018` to `es2019`
- Browser target has been update from `es2015` to `es2017`
- Server target has been update from `es2016` to `es2019`
This change adjusts the E2E schematic to generate a protractor configuration with the selenium promise manager disabled. It also adjusts the generated test files to use native promises and async/await to control test execution.
With this change we update the target and module settings of various compilation units.
- We replace ES5 target in protractor. Protractor runs on Node.Js which support ES2018
- For applications we now use `ES2020` instead of `ESNext` as a module to avoid unexpected changes in behaviour
This changes also adds a migration to update existing projects and also removes `module` from the Universal tsconfig as per #17352 to enable lazy loading on the server.
If using `strictFunctionTypes: true` in `tsconfig.json`, the default e2e test is failing compilation with:
```
error TS2345: Argument of type 'ObjectContaining<{ level: Level; }>' is not assignable to parameter of type 'Expected<Entry>'.
Type 'ObjectContaining<{ level: Level; }>' is not assignable to type 'ObjectContaining<Entry>'.
Type 'Partial<{ level: Level; }>' is not assignable to type 'Partial<Entry>'.
Type '{ level: Level; }' is not assignable to type 'Entry'.
```
Explictely using `as logging.Entry` fixes the issue.
Currently when using `ivy-ngcc` it will print out a warning
```
Failed to read entry point info from //node_modules/@schematics/angular/workspace/files/package.json with error SyntaxError: Unexpected token < in JSON at position 1121.
```
Fixes#13378
When app.po.ts is compiled under Bazel with Typescript 3.2,
AppPage produces the following error:
e2e/src/app.po.ts:4:3 - error TS2742: The inferred type of 'navigateTo' cannot be named without a reference to '../../external/npm/node_modules/@types/selenium-webdriver/index'. This is likely not portable. A type annotation is necessary.
4 navigateTo() {
~~~~~~~~~~
e2e/src/app.po.ts:8:3 - error TS2742: The inferred type of 'getTitleText' cannot be named without a reference to '../../external/npm/node_modules/@types/selenium-webdriver/index'. This is likely not portable. A type annotation is necessary.
8 getTitleText() {
~~~~~~~~~~~~