2355 Commits

Author SHA1 Message Date
Charles Lyding
6d0f99a2de feat(@angular-devkit/build-angular): support JSON comments in dev-server proxy configuration file
The `proxyConfig` option for the `dev-server` builder now supports JSON files containing comments and trailing commas.
Several additional tests regarding the use of ESM and CommonJS JavaScript configuration files were also added to reduce the likelihood of future regressions.

Closes: #21862
2021-11-16 10:50:39 +00:00
Renovate Bot
c20153db81 build: update all non-major dependencies 2021-11-10 14:24:25 -05:00
Renovate Bot
f049feeace build: update all non-major dependencies 2021-11-09 13:04:00 -05:00
Alan Agius
f5b2d7e031 refactor: remove no longer needed caniuse-lite dependency 2021-11-09 13:03:34 -05:00
Alan Agius
5990ed91cd fix(@angular-devkit/build-angular): improve sourcemap fidelity during code-coverage
We now pass the input sourcemap to istanbul babel plugin, since this is used directly by the instrumenter d58c92a7de/src/index.js (L126-L129) and is needed to remapped instrumented code back to the original source.

Previously, the lack of this caused incorrect reports of uncovered and coverage code and also incorrectly mappings in the HTML report.

Closes #22118
2021-11-09 11:08:03 -05:00
Renovate Bot
1a2467560c build: update all non-major dependencies 2021-11-08 10:20:09 -05:00
Alan Agius
b3e588801d fix(@angular-devkit/build-angular): suppress "@charset" must be the first rule in the file warning
esbuild will issue a warning when `@charset` is in the middle of the file. This is caused by css-loader will concats the file and doesn't hoist `@charset`, (https://github.com/webpack-contrib/css-loader/issues/1212).

While, esbuild will issue a warning regarding the above, it will hoist to the very top.

In many cases, this warning is not actionable by the users as the `@charset` would be likely specified in 3rd party libs.

Closes #22097
2021-11-08 10:17:44 -05:00
Alan Agius
3a89358d33 fix(@angular-devkit/build-angular): don't show [NG HMR] Unknown input type when restoring file type input 2021-11-04 16:35:09 -04:00
Renovate Bot
37b9493ed3 build: update all non-major dependencies 2021-11-04 12:58:51 -04:00
Renovate Bot
0d864a4239 build: update angular 2021-11-04 12:16:49 -04:00
Charles Lyding
e1bac5bbb3 fix(@angular-devkit/build-angular): update Angular peer dependencies to v13.1 prerelease
This change allows framework v13.1 prelease versions to be used with the Angular CLI 13.1 preleases without peer dependency warnings.
2021-11-04 12:15:13 -04:00
Alan Agius
47fd128a06 fix(@angular-devkit/build-angular): don't restore input of type file during HMR
```
Uncaught DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.
```

Closes #22084
2021-11-04 12:14:03 -04:00
Renovate Bot
73a2a28291 build: update dependency core-js to v3.19.1 2021-11-03 08:24:26 +01:00
Alan Agius
d526e87506 refactor(@angular-devkit/build-angular): clean up webpack configurations
With this change we remove the worker and typescript configuration.
2021-11-03 08:23:34 +01:00
Renovate Bot
5b186c15b7 build: update all non-major dependencies 2021-11-02 16:58:48 +01:00
Charles Lyding
d9e819313a fix(@angular-devkit/build-angular): remove potential race condition in i18n worker execution
There was previously the potential for two workers to complete quickly at the same time which could result in one of the results not being propagated to the remainder of the system. This situation has now been corrected by removing the worker execution at a later point in the process.

(cherry picked from commit 802b1b0378c1816dbfd8f4320b5d69e82f0c7aa6)
2021-11-02 16:58:32 +01:00
Alan Agius
cec0ef0855 fix(@angular-devkit/build-angular): use es2015 when generating server bundles
ES2020 can contain JS syntax which are not compatible with all supported Node.js versions such as optional chaining.
2021-11-01 21:10:00 +01:00
Alan Agius
d90e8a7746 build: update @types/sass to ^1.43.0 2021-11-01 19:39:09 +01:00
Charles Lyding
b6fa4adc0d build: add all used babel plugins to bazel BUILD file 2021-11-01 18:44:03 +01:00
Alan Agius
cf34e2f254 build: update all non-major dependencies 2021-11-01 13:37:47 +01:00
Alan Agius
5a2a2fc297 refactor(@angular-devkit/build-angular): unify webpack configurations
With this change we unify most of the webpack configuration into the common configuration. A number of lengthy functions and code portions have been moved into a seperate file to make the configuration easier to follow.
2021-10-28 18:04:57 +02:00
Alan Agius
12c88f32cd build: update all non-major dependencies 2021-10-28 15:42:41 +02:00
Alan Agius
70494824df fix(@angular-devkit/build-angular): move @angular/localize detection prior to webpack initialization
Fail faster if `@angular/localize` is not installed and update the error message since now there is a single extraction mode.
2021-10-28 15:31:32 +02:00
Alan Agius
0c44ab3058 fix(@angular-devkit/build-angular): improve sourcemaps fidelity when code coverage is enabled
With this change we replace `@jsdevtools/coverage-istanbul-loader` webpack loader with [`babel-plugin-istanbul`](https://github.com/istanbuljs/babel-plugin-istanbul) which is an official Babel plugin by the istanbuljs team.

Previously, when code coverage was enabled we had multiple Babel runs on the same file. This is because istanbuljs' `instrumentSync` and `instrument` APIs which are used by the Webpack plugin invokes Babel directly 66bc39b3c7/packages/istanbul-lib-instrument/src/instrumenter.js (L98)

By using the babel plugin directly, we avoid this which also improves the sourcemaps correctness and test performance.

Closes #22010
2021-10-27 11:17:17 -05:00
Renovate Bot
6bf379726c build: update all non-major dependencies 2021-10-27 04:44:14 -05:00
Alan Agius
9171fc087a fix(@angular-devkit/build-angular): update critters to version 0.0.12
This change brings in a security fix causes was causes by an outdated dependency. See https://github.com/GoogleChromeLabs/critters/pull/82 for more information.

Also, remote stylesheets are excluded from processing, were previously this caused build failures.

Closes #20794
2021-10-26 04:45:59 -05:00
Alan Agius
6944d9d795 test(@angular-devkit/build-angular): update tests to use xxhash64
`loader-utils` version 3, introduced a breaking change with uses the faster `xxhash64` hashing algo.
2021-10-21 05:41:37 -05:00
Renovate Bot
844ef76a8a build: update dependency loader-utils to v3 2021-10-21 05:41:37 -05:00
Alan Agius
03d839f220 test(@angular-devkit/build-angular): update tests to reflect new output of critters
The tests have been re-introduced in the code base via a revert #21899
2021-10-21 05:41:14 -05:00
Alan Agius
2764915724 test(@angular-devkit/build-angular): update tests to match critters 0.0.11 output 2021-10-21 03:25:33 -05:00
Renovate Bot
8298afed72 build: update all non-major dependencies 2021-10-21 03:25:33 -05:00
Alan Agius
f3c0c98fbd Revert "feat(@angular-devkit/build-angular): disable critical CSS inlining by default"
This reverts commit bf0709b14c1f0d47af77a64e586a5d4564b75766.
2021-10-21 03:24:36 -05:00
Alan Agius
ba54a8d2d8 test: update css minification spec to match new Esbuild output
For more context see https://github.com/evanw/esbuild/blob/master/CHANGELOG.md#%E2%80%8B0137
2021-10-19 12:01:08 -04:00
Renovate Bot
80b026c051 build: update all non-major dependencies 2021-10-19 12:01:08 -04:00
Charles Lyding
f44cb908c3 refactor(@angular-devkit/build-angular): eagerly remove used i18n temporary files
Temporary JavaScript application files that have been queued for i18n processing are now removed immediately after reading their content. This reduces the on-disk size of temporary files as well as reduces the needed disk access during the final asset copy phase of the i18n inlining process. Additional debug logging has also been added to the i18n inlining process which can be enabled via the `NG_DEBUG=1` environment variable.
2021-10-19 10:09:10 -04:00
Alan Agius
da1733cc69 fix(@angular-devkit/build-angular): transform remapped sourcemap into a plain object
`remapping` will return a SourceMap which it's prototype is not a simple object. This causes Babel to fail when it invoked from `istanbul-lib-instrument` because Babel with `don't know how to turn this value into a node` error as Babel will not process not simple objects.

See: 780aa48d2a/packages/babel-types/src/converters/valueToNode.ts (L115-L130)

Closes #21967
2021-10-19 09:33:14 -04:00
Alan Agius
1dac761f56 fix(@angular-devkit/build-angular): generate unique webpack runtimes
Currently, using 2 Angular applications from the same workspace on the same page causes a conflict because both of the webpack runtime chunks naming are the same.

With this change we configure the runtime chunk name to be inferred from the project name. This also results in reducing unnecessary file reads which Webpack needs to do to infer the name from the workspace package.json.

For more information about this option see: https://webpack.js.org/configuration/output/#outputuniquename

Closes #21957
2021-10-19 09:30:07 -04:00
Extacy
08fb32eb5e fix(@angular-devkit/build-angular): add "Failed to compile" message
Add missing "Failed to compile" message when the webpack build is not
successful. This is useful for [background problem matchers](https://code.visualstudio.com/docs/editor/tasks#_background-watching-tasks).
Previously, it was not possible to tell using a regular expression when
the compiler has stopped when there was an error, as no message was
printed.
2021-10-19 09:29:40 -04:00
Ruslan Lekhman
ef45c7543b refactor(@angular-devkit/build-angular): consistent import from webpack style 2021-10-15 09:57:27 -04:00
Renovate Bot
167706a5d7 build: update all non-major dependencies 2021-10-14 12:55:20 -04:00
Alan Agius
079ef070c9 refactor(@angular-devkit/build-angular): replace Ivy Enabled analytics dimension with AOT Enabled
The motivation behind this change is that since version 12, application are always built using Ivy, in addition to this, adding AOT as dimension might be  helpful in our decision process if we want to remove JIT.
2021-10-13 21:03:50 +02:00
Renovate Bot
7c0ae75add build: update all non-major dependencies 2021-10-13 10:56:08 +02:00
Renovate Bot
32e644518b build: update all non-major dependencies 2021-10-11 10:22:59 +02:00
Alan Agius
81531d1b64 fix(@schematics/angular): remove target and lib options for library tsconfig
The `target` option is set directly in ng-packagr binary and cannot be overridden, while the `lib` option is inherited from the root level tsconfig.
2021-10-08 14:40:54 +02:00
Renovate Bot
7c2119e48a build: update all non-major dependencies 2021-10-08 10:32:47 +02:00
Alan Agius
94c00afbf3 fix(@schematics/angular): don't export renderModuleFactory from server file
Using `renderModuleFactory` is no longer needed since this was used for ViewEngine.
2021-10-07 18:50:54 +02:00
Alan Agius
9a3b63766a refactor(@angular-devkit/build-angular): remove redundant require.resolve for @angular/service-worker
This was mainly done prior to the introduction of optional peer dependencies.
2021-10-07 17:34:19 +02:00
Charles Lyding
5dba8a22b1 test(@angular-devkit/build-angular): disable Webpack caching during harness-based unit tests
The default set of metadata fields provided to all builders executed via the BuilderHarness is controlled programmatically. The BuilderHarness is eventually intended to operate in-memory and without file system access unlike the legacy unit tests. The `cli.cache.enabled` option must therefore be set within the BuilderHarness initialization code. `cli.cache.enabled` set to false provides improved test isolation guarantees by disabling Webpack’s caching.
2021-10-07 17:33:14 +02:00
Renovate Bot
6bcbc77b91 build: update all non-major dependencies to v7.15.8 2021-10-07 08:50:01 +02:00
Charles Lyding
93ae204047 test(@angular-devkit/build-angular): correctly disable caching in unit-tests
The unit-tests where intended to not use build caching to better ensure test isolation. However, the configuration format was incorrect and did not disable the build caching.
2021-10-06 19:10:24 -04:00