The ViewEngine message extraction generates a variety of legacy formats
for extracted message ids. These formats have a number of issues related
to whitespace handling and reliance upon information inside the original
HTML of a template. The new message format is more resilient to things
like whitespace changes, and can be generated directly from calls to
`$localize`, which allows messages in application code to have the same
id as identical messages in templates.
As a first step in migrating projects away from the legacy id format
for i18n messages, this commit updates newly generated projects to turn
off the legacy ids.
In the future the default will be flipped and this can be removed.
Eventually the legacy message id support will be removed altogether,
probably in sync with removal of ViewEngine.
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.
Following feedback from the community, which showed a high number of users found it hard to work with the `no-any` lint rule and also the `sideEffects` package.json file. With DevRel we decided to remove both features when generating a strict workspace and/or application.
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
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.
With this change we enable stricter type checking and optimization effective coding rules when using the `--strict` option.
Changes in schematics
- `ng-new`: A prompt for the `--strict` option was added. This option is a proxy and will be passed to the application and workspace schematics.
- `application`: A `package.json` was added in the `app` folder, to tell the bundlers whether the application is free from side-effect code. When `strict` is `true`. the `sideEffects` will be set `false`.
- `workspace` When `strict` is true, we add stricter TypeScript and Angular type-checking options.
Note: AIO is already using these strict TypeScript compiler settings. PR to enable `strictTemplates` https://github.com/angular/angular/pull/36391
Reference: TOOL-1366
Previously "ng new" was generating angular.json file containing redundant whitespace after "version" property.
When file was edited some IDEs automatically removed this whitespace making additional change in diff.
If "packageManager" option is used, whitespace is still present.
* fix(@schematics/angular): regression tsconfig.json
fix(@schematics/angular): regression tsconfig.json …
Unverified
0e318ae
Regression in tsconfig.json set `"outDir": "./dist/out-tsc"` for problems in VSCode TS(2307) when building library referred in tsconfig "paths"
Closes: #16708
* fix(@schematics/angular): regression tsconfig.json
Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's.
Closes#16709
* fix(@schematics/angular): regression tsconfig.json
Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's.
Fix code lint.
Closes#16709
* fix(@schematics/angular): regression tsconfig.json
Improve paths in root tsconfig.json for better DX experience when using auto imports in IDE's.
Fix test code to conform new behaviour.
Closes#16709
Add skipLibCheck to speed up TypeScript analysis and prevent compilation errors caused by incompatible declaration files which were generated with older/new TS versions
Currently the library schematic doesn't support adding a secondary entry-point and having deep imports is not recommanded.
It's best if paths are more stricter when having a secondary entry-point instead of a wildcard.
Instead of :
```
"lib/*": [
"dist/lib/*"
]
```
Users should configure:
```
"lib/secondary": [
"dist/lib/secondary"
]
```
This would allow a better DX experience when using auto imports in IDE's.
Closes: #15952