958 Commits

Author SHA1 Message Date
Charles Lyding
a6d886d313 test(@angular-devkit/build-angular): use port 0 in dev-server builder tests
This change updates the remainder of the non-builder harness tests to use a random port when testing. This change reduces the frequency of test flakes as well as improves the opportunity for parallel test execution.
2021-04-07 10:29:49 +02:00
Charles Lyding
119256f72b test(@angular-devkit/build-angular): add dev-server builder port option tests
This change adds expanded unit tests for the dev-server builder's `port` option using the builder test harness.
2021-04-07 10:29:49 +02:00
Charles Lyding
c9a002c04b test(@angular-devkit/build-angular): add initial dev-server builder hmr and liveReload option tests
The CommonJS usage warning tests are moved to use the builder harness for both the `hmr` and `liveReload` options.
2021-04-07 10:29:49 +02:00
Charles Lyding
8770d5f015 refactor(@angular-devkit/build-angular): remove use of deprecated ngtools ivy namespace export
With the removal of the deprecated ViewEngine-based Webpack plugin, the ivy namespace export that was previously used is now deprecated in favor of direct exports of the Ivy-based plugin.
2021-04-05 19:20:56 +02:00
Charles Lyding
8c9b2a2589 test(@angular-devkit/build-angular): remove unneeded custom Jasmine test timeouts
The default Jasmine test timeout is set to 2.5 minutes for all builder tests. The smaller timeouts (that are now removed from individual tests) can lead to test flakes especially on CI which can have large performance variability.
2021-04-04 09:07:06 +02:00
Charles Lyding
9f331e2772 test(@angular-devkit/build-angular): remove redundant browser assets unit test
These unit tests have been rewritten to use the builder test harness in the new test directory structure and can be removed.
2021-04-04 09:07:06 +02:00
Alan Agius
5cf9a08dc7 refactor(@angular-devkit/build-angular): remove deprecated i18n options from server and browser builder
BREAKING CHANGE:

Removal of deprecated browser and server command options.
- `i18nFile`,  use `locales` object in the project metadata instead.
- `i18nFormat`, No longer needed as the format will be determined automatically.
- `i18nLocale`, use `localize` option instead.
2021-04-03 14:45:58 +02:00
Charles Lyding
eca5a01f6e fix(@angular-devkit/build-angular): remove deprecated i18nLocale and i18nFormat options from i18n-extract
BREAKING CHANGE: Removal of deprecated `extract-i18n` command options
The deprecated `i18nLocale` option has been removed and the `i18n.sourceLocale` within a project's configuration should be used instead.
The deprecated `i18nFormat` option has been removed and the `format` option should be used instead.
2021-04-02 21:13:26 +02:00
Charles Lyding
677913fc38 fix(@angular-devkit/build-angular): remove usage of deprecated View Engine compiler
BREAKING CHANGE: Removal of View Engine support from application builds
With the removal of the deprecated View Engine compiler in Angular version 12 for applications, Ivy-based compilation will always be used when building an application.
The default behavior for applications is to use the Ivy compiler when building and no changes are required for these applications.
For applications that have opted-out of Ivy, a warning will be shown and an Ivy-based build will be attempted. If the build fails,
the application may need to be updated to become Ivy compatible.
2021-04-02 08:11:11 +02:00
Alan Agius
fd2dbb37ca test(@angular-devkit/build-angular): clean up tests from ViewEngine code 2021-03-31 10:04:23 -06:00
Alan Agius
3d1bd01641 refactor(@angular-devkit/build-angular): remove ngfactories checks 2021-03-30 14:37:09 -06:00
Alan Agius
b35517505f refactor(@angular-devkit/build-angular): remove view engine check from analytics collector 2021-03-30 14:37:09 -06:00
Alan Agius
1c2aeeb46a refactor(@angular-devkit/build-angular): remove view engine app-shell generation
BREAKING CHANGE:  App-shell builder now only supports generation using Ivy
2021-03-30 14:37:09 -06:00
Alan Agius
27a41f2615 build: update to critters 0.0.10 2021-03-30 14:35:11 -06:00
Charles Lyding
012700ace5 fix(@angular-devkit/build-angular): remove deprecated View Engine support for i18n extraction
BREAKING CHANGE: Removal of View Engine support from i18n extraction
With the removal of the deprecated View Engine compiler in Angular version 12 for applications, the `ng extract-i18n` command will now always use the Ivy compiler.
The `--ivy` option has also been removed as Ivy-based extraction is always enabled.
The default behavior for applications is to use the Ivy compiler for building/extraction and no changes are required for these applications.
For applications that have opted-out of Ivy, a warning will be shown and Ivy-based extraction will be attempted. If the extraction fails,
the application may need to be updated to become Ivy compatible.
2021-03-30 14:34:52 -06:00
Charles Lyding
db4c6baf5a test(@angular-devkit/build-angular): add dev-server builder proxyConfig option tests
This change adds expanded unit tests for the dev-server builder's `proxyConfig` option using the builder test harness.
2021-03-30 14:33:49 -06:00
Charles Lyding
66f1b13eab test(@angular-devkit/build-angular): add dev-server builder servePath option tests
This change adds expanded unit tests for the dev-server builder's `servePath` option using the builder test harness.
2021-03-30 14:33:49 -06:00
Alan Agius
51cb3181ea fix(@angular-devkit/build-angular): validate scripts and styles bundleName
Closes #20360
2021-03-29 08:17:49 -06:00
Charles Lyding
aeebd14f04 perf(@ngtools/webpack): only check affected files for Angular semantic diagnostics
This change improves the performance of incremental type checking of Angular templates by reducing the number of calls to retrieve the diagnostics.
Only the set of affected files will be queried on a rebuild. The affected set includes files TypeScript deems affected, files that
are required to be emitted by the Angular compiler, and the original file for any TTC shim file that TypeScript deems affected.
2021-03-29 08:16:36 -06:00
Charles Lyding
ac4c109beb fix(@angular-devkit/build-angular): ensure output directory is present before writing stats JSON
If an error occurs during a build, it is possible that the output path directory may not be present and then cause the stats JSON file write to fail.

Fixes: #20349
2021-03-22 15:41:41 -04:00
Alan Agius
6916bc912b build: update @types/babel__core to version 7.1.14 2021-03-22 09:11:41 -04:00
Charles Lyding
5895105947 test(@angular-devkit/build-angular): reduce build time in browser builder watch test
This change removes application code during the test which is not needed for the watch option test.
2021-03-19 06:42:41 -04:00
Charles Lyding
2041c70f76 test(@angular-devkit/build-angular): add dev-server builder deployUrl behavior tests
This change adds expanded unit tests for the dev-server builder's build deploy URL behavior using the builder test harness.
2021-03-19 06:42:41 -04:00
Charles Lyding
352416fea8 test(@angular-devkit/build-angular): add dev-server builder publicHost option
This change adds expanded unit tests for the dev-server builder's `publicHost` option using the builder test harness.
2021-03-19 06:42:41 -04:00
Charles Lyding
888ac92127 test(@angular-devkit/build-angular): add dev-server builder disableHostCheck option
This change adds expanded unit tests for the dev-server builder's `disableHostCheck` option using the builder test harness.
2021-03-19 06:42:41 -04:00
Alan Agius
2616ef0d3f feat(@angular-devkit/build-angular): integrate JIT mode linker
With this change we intergate JIT mode linker into the Angular CLI.

Closes #20281
2021-03-18 15:38:52 +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
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
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
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
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
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
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
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
1e9881bcb4 refactor(@angular-devkit/build-angular): replace lazy loading resources context path 2021-03-10 12:44:04 -06:00
Alan Agius
988b05a8e5 refactor(@angular/cli): remove deprecated lazyModules option from schema 2021-03-10 12:44:04 -06:00
Alan Agius
8d66912323 refactor(@angular-devkit/build-angular): remove deprecated lazyModules option
BREAKING CHANGE:

Server and Browser builder `lazyModules` option has been removed without replacement.
2021-03-10 12:44:04 -06:00
Charles Lyding
b98d969a92 refactor(@angular-devkit/build-angular): remove speed-measure-plugin usage
The plugin was only used when the `NG_BUILD_PROFILING` environment variable was used.  The environment variable also enabled the Webpack builtin `ProfilingPlugin` which is retained.
The builtin plugin provides a chrome events JSON output which can be loaded in Chrome DevTools and allows for graphical timeline views of the build.
The `speed-measure-plugin` is also currently incompatible with Webpack 5 which would prevent the CLI profiling support from working with Webpack 5.
2021-03-10 08:19:56 -06:00
Alan Agius
71eab3ddb6 feat(@angular-devkit/build-angular): show warning during build when project requires IE 11 support
Internet Explorer 11 support is deprecated and will be removed in future versions of the Angular CLI.
2021-03-10 08:18:49 -06:00
Charles Lyding
a51eb6e864 test(@angular-devkit/build-angular): add dev-server execute and fetch unit test helper
This change extracts common test code into a helper function to reduce complexity of the dev-server builder unit tests.
2021-03-10 08:17:10 -06:00
Charles Lyding
06a354fb93 test(@angular-devkit/build-angular): add dev-server builder allowedHosts option tests
This change adds expanded unit tests for the dev-server builder's `allowedHosts` option using the builder test harness.
2021-03-10 08:17:10 -06:00