1
0
mirror of https://github.com/angular/angular-cli.git synced 2025-05-23 23:59:27 +08:00

7583 Commits

Author SHA1 Message Date
Doug Parker
ec36583f35 release: v12.0.0-next.5
`latestVersions.ts` is incrementing by 2, because the previous release forgot to update it.
2021-03-17 12:03:19 -07:00
Alan Agius
79856644b4 feat(@angular/cli): support TypeScript 4.2
BREAKING CHANGE

Drop support for TypeScript versions prior to 4.2.3
2021-03-17 19:32:01 +01:00
Alan Agius
b1fa5bd1bf test(@schematics/angular): update version 8 migration to use NPM packages
This is needed as otherwise the installation of older packages will fai.
2021-03-17 19:06:37 +01:00
Alan Agius
0199170ec7 refactor(@schematics/angular): remove DevkitBuildNgPackagr and DevkitBuildWebpack from latest-versions 2021-03-17 19:06:37 +01:00
Kristiyan Kostadinov
1525e7ab2c feat(@angular-devkit/build-angular): expose legacy-migrate message format
We recently added a new message format called `legacy-extract` that is used to migrate between
legacy and canonical message IDs (see https://github.com/angular/angular/pull/41026).

These changes expose the new format in `extract-i18n`.
2021-03-17 18:27:22 +01:00
Alan Agius
d37f731f40 test(@angular/cli): add ng add e2e tests to yarn subset 2021-03-17 18:24:15 +01:00
Renovate Bot
02b7862813 build: update angular packages 2021-03-17 13:33:25 +01:00
Renovate Bot
97f05ad986 build: update verdaccio to version 4.12.0 2021-03-17 13:16:55 +01:00
Charles Lyding
8e5b83ba66 test(@angular-devkit/build-angular): avoid crashing during test failure in utility function
Previously, if a browser build failed using the `browserBuild` test utility function, the test utility would try to access properties that did not exist and would crash. This increased the complexity to debug failing tests. With the new behavior, the `browserBuild` test utility will return with an empty `files` object and the failed builder result.
2021-03-17 11:28:14 +01:00
Charles Lyding
2327ddc2f9 fixup! fix(@ngtools/webpack): remove Webpack 5 deprecation warning in resource loader 2021-03-17 11:27:53 +01:00
Charles Lyding
3504c43e48 fix(@ngtools/webpack): remove Webpack 5 deprecation warning in resource loader
This change adds support for using the Webpack `processAssets` hook to handle the resource loader child compilation's assets. This new hook is the recommended way to process assets in Webpack 5+.
2021-03-17 11:27:53 +01:00
Charles Lyding
d5645675fd fix(@angular-devkit/build-angular): support writing large Webpack stat outputs
When using the `statsJson` browser builder option, the resulting JSON data is now streamed into a file instead of written in one large block.  This mitigates crashes due to the generated string exceeded the Node.js limit.
2021-03-17 11:27:27 +01:00
Alan Agius
f815e08000 refactor(@angular-devkit/build-angular): deprecate showCircularDependencies 2021-03-16 16:42:45 +01:00
Alan Agius
871480a6aa test(@angular-devkit/build-angular): change showCircularDependencies tests to use new test harness 2021-03-16 16:42:45 +01:00
Alan Agius
00ff390fea perf(@angular-devkit/build-angular): disable showCircularDependencies by default
Change the default of this flag to disabled by default as this is a caused of rebuild performance degradation for large projects.

BREAKING CHANGE

The server and browser builder `showCircularDependencies` option default value has been changed from `true` to `false`.
2021-03-16 16:42:45 +01:00
Alan Agius
cc10302fd7 refactor(@angular/cli): add more actionable missing lint target message 2021-03-16 15:49:46 +01:00
Alan Agius
fe5c3e05f9 test(@angular-devkit/build-angular): remove tslint E2E tests 2021-03-16 15:49:46 +01:00
Alan Agius
226a8d274d feat(@schematics/angular): remove tslint and codelyzer from new projects
Both of these projects and the tslint builder are deprecated.

Closes  and closes 
2021-03-16 15:49:46 +01:00
Charles Lyding
b6d693fcd3 refactor(@ngtools/webpack): reduce complexity of resource loader processing
The resource loader used to process component styles and templates has been changed to be fully typed and to leverage more of Webpack's child compilation APIs.
The later of which removes the need to manually propagate most information from the child compilation to the parent compilation.
2021-03-16 12:16:03 +01:00
Renovate Bot
1b89617634 build: update @types/babel__core to version 7.1.13 2021-03-16 11:23:59 +01:00
Mouad Ennaciri
ee4918db40 fix(@schematics/angular): remove Native value from viewEncapsulation option 2021-03-16 08:57:42 +01:00
Alan Agius
6cc8c26083 refactor(@ngtools/webpack): remove suppressZoneJsIncompatibilityWarning option
BREAKING CHANGE

`suppressZoneJsIncompatibilityWarning` option has been removed. If you are using this plugin directly and `async/await` in ES2017 make sure you downlevel the async syntax using Babel.

See: https://github.com/angular/zone.js/pull/1140 for more information.
2021-03-15 20:31:25 +01:00
Alan Agius
0420f1a0d7 refactor(@angular-devkit/build-angular): remove differential loading with targets ES2016+ warning 2021-03-15 20:31:25 +01:00
Alan Agius
74537a11d4 test(@angular-devkit/build-angular): update tests to reflect the change in ES targets 2021-03-15 20:31:25 +01:00
Alan Agius
81129e12d0 feat(@schematics/angular): update several TypeScript compilation target (Syntax)
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`
2021-03-15 20:31:25 +01:00
Charles Lyding
6fd4da2ebf refactor(@angular-devkit/build-angular): use Webpack builder result provided output path
By using the output path provided directly by the Webpack builder's result, one additional reason for using the expensive `Stats.toJson` call is removed.
This change also removes multiple linting disable rule comments now that the output path property is guaranteed to be present.
2021-03-15 17:45:11 +01:00
Charles Lyding
ff32ada86b feat(@angular-devkit/build-webpack): provide output path in builder results
This change adds the output path for the Webpack build directly to the result of the builder. This removes one of the reasons for using the Webpack JSON stats object which is expensive to generate.
2021-03-15 17:45:11 +01:00
Alan Agius
3bf831fac6 fix(@schematics/angular): only show legacy browsers deprecation warning when option is used
This ensures that the deprecate warning is only displayed when the option is used.
2021-03-15 17:07:36 +01:00
Alan Agius
2d6e82fa10 perf(@angular-devkit/build-angular): enforce Babel not to load sourcemaps from file
Workaround for https://github.com/babel/babel-loader/pull/896
2021-03-15 14:53:49 +01:00
Alan Agius
217a02b879 refactor(@angular-devkit/build-angular): clean up linker detection code 2021-03-15 14:47:13 +01:00
Omar Hasan
9ea34ba202 fix(@schematics/angular): fix youtube icon margin 2021-03-15 13:30:48 +01:00
Renovate Bot
625f47d42c build: update angular packages 2021-03-15 09:02:21 +01:00
Charles Lyding
699b641b85 perf(@angular-devkit/build-angular): remove Webpack Stats.toJson usage in karma plugin
Webpack's `Stats.toJson` function is an expensive operation and is recommended to be avoided where possible. In the case of the karma plugin, the compilation errors can be accessed directly without the need for the function call.
2021-03-15 09:01:50 +01:00
Charles Lyding
3affd28f5e perf(@angular-devkit/build-angular): remove Webpack Stats.toJson usage in analytics plugin
Webpack's Stats.toJson function is an expensive operation and is recommended to be avoided where possible. In the case of the analytics plugin, the chunks and assets can be accessed directly from the Webpack compilation.
2021-03-15 09:01:36 +01:00
Charles Lyding
dfefd6ba4f perf(@ngtools/webpack): use precalculated dependencies in unused file check
This change uses the newly introduced precalculated file dependencies for each TypeScript file instead of querying TypeScript for the SourceFile's dependencies when performing the unused file check at the end of the build cycle. This change removes the need to recalculate the dependencies for each TypeScript file present in the Webpack compilation.
2021-03-12 17:04:22 +01:00
Alan Agius
63a2dbb8b4 perf(@angular-devkit/build-angular): skip FESM2015 from async transformation
Skip  `async` transformation when the path matches a FESM2015 entrypoint.  Ng-packagr doesn't allow changing the script target for entry-points which makes this possible https://github.com/ng-packagr/ng-packagr/blob/master/src/lib/ng-package/entry-point/compile-ngc.transform.ts#L48

This is important to reduce greatly the cold build performance overhead when targeting ES2017+
2021-03-12 16:51:51 +01:00
Alan Agius
9714aa92bf fix(@angular-devkit/build-angular): don't load an input sourcemap from file when using Babel
This ensures that vendor sourcemaps are not loaded from file when they have not been previously loaded via sourcemap-loader.

When vendor sourcemap is enabled, `inputSourceMap` is not needed, since the sourcemap is already available and the `sourceMappingURL` comment is removed from source.
2021-03-12 09:12:16 +01:00
Alan Agius
075c988dd1 fix(@angular-devkit/build-angular): display correct filename for bundles that are ES2016+ 2021-03-12 08:26:04 +01:00
Alan Agius
4b0223b64e build: automate @angular/cli schema.json generation
With this change we automate the generation of `@angular/cli/lib/config/schema.json`. While on paper we could use quicktype for this. Quicktype doesn't handle `patternProperties` and `oneOf` that well.

How does this works?
Relative `$ref` will be resolved and inlined as part of the root schema definitions.

Example
```json
"@schematics/angular:enum": {
    "$ref": "../../../../schematics/angular/enum/schema.json"
},
```

Will be parsed and transformed to
```json
"@schematics/angular:enum": {
  "$ref": "#/definitions/SchematicsAngularEnumSchema"
},
"definitions: {
  "SchematicsAngularEnumSchema": {
    "title": "Angular Enum Options Schema",
    "type": "object",
    "description": "Generates a new, generic enum definition for the given or default project.",
    "properties": {...}
   }
}
```
2021-03-11 21:51:37 +01:00
Alan Agius
d254d058f9 fix(@angular/cli): remove project from required properties in ng-packagr schema
Closes: 
2021-03-11 15:59:58 +01:00
Alan Agius
3fec85e073 build: update Angular CLI repo to use ES2019
Since we no longer support Node.JS 10 we can ship our code in ES2019
See: https://node.green/#ES2019
2021-03-11 13:35:38 +01:00
cexbrayat
663c4bc9c1 fix(@schematics/angular): remove references to the prod flag
As the `--prod` is now deprecated, and `ng build` uses by default the `production` configuration,
then we should remove the references to `ng build --prod` in the generated project.
2021-03-11 11:36:25 +01:00
Charles Lyding
95aa2b8f92 perf(@ngtools/webpack): avoid adding transitive dependencies to Webpack's dependency graph
This change augments a TypeScript Compiler Host's resolveModuleNames function to collect dependencies of the containing file based on the module names passed to the resolveModuleNames function. This process assumes that consumers of the Compiler Host will call resolveModuleNames with modules that are actually present in a containing file.  The TypeScript compiler exhibits such behavior making this process effective at generating a set of all direct dependencies for a given source file.
This process is a workaround for gathering a TypeScript SourceFile's dependencies as there is no currently exposed public method to do so. A BuilderProgram does have a `getAllDependencies` function. However, that function returns all transitive dependencies as well which can cause excessive Webpack rebuilds especially in larger programs.
2021-03-11 08:55:08 +01:00
Charles Lyding
985dc1a4c7 feat(@angular/cli): confirm ng add action before installation
BREAKING CHANGE:
The `ng add` command will now ask the user to confirm the package and version prior to installing and executing an uninstalled package.
This new behavior allows a user to abort the action if the version selected is not appropriate or if a typo occurred on the command line and an incorrect package would be installed.
A `--skip-confirmation` option has been added to skip the prompt and directly install and execute the package. This option is useful in CI and non-TTY scenarios such as automated scripts.
2021-03-11 08:54:07 +01:00
Renovate Bot
3c2f58314f build: update angular packages 2021-03-11 08:39:00 +01:00
Alan Agius
7711e12b8e build: update karma to version 6.2.0 2021-03-11 08:37:42 +01:00
Renovate Bot
f8b3508ab3 build: update karma to version 6.2.0 2021-03-11 08:37:42 +01:00
Joey Perrott
6469acf052 release: v12.0.0-next.4 v12.0.0-next.4 2021-03-10 11:34:23 -08:00
Alan Agius
1e9881bcb4 refactor(@angular-devkit/build-angular): replace lazy loading resources context path 2021-03-10 12:44:04 -06:00
Alan Agius
0d1826b2d1 test(@ngtools/webpack): update lazy loading string syntax to use dynamic imports 2021-03-10 12:44:04 -06:00