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`
With this change we do several changes to the `angular.json` configuration for `build` , `server` and `app-shell` targets so that these are `production` by default.
- build, server and app-shell targets are configured to run production by default.
- We add a new configuration named `development` to run the mentioned builder targets in development. Ex: `ng build --configuration development`.
- When adding `universal` or `app-shell`, we generate the full set of configurations as per the `buiid` target. Previously, we only generated the `production` configuration.
- We added a helper script in `package.json` to run build in watch mode. `npm run watch` which is a shortcut for `ng build --watch --configuration development`
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.
Bugfix for the ng new --createApplication=false command.
Currently, it creates an e2e script in package.json. This change will only add the script when the application is created.
Closes#13412
Since the tsconfig for e2e’s is named tsconfig.json there is no reason why it should be included in the solutions typescript configuration file.
Closes#18190
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() {
~~~~~~~~~~~~