2083 Commits

Author SHA1 Message Date
Charles Lyding
1cb07caddc build: transition from ts-api-guardian to dev-infra api-golden utility
The dev-infra tooling now directly provides public API change testing capabilities that leverage the `api-extractor` utility. These new testing capabilities are shared with framework and components.
`ts-api-guardian` has been removed as a dependency as a result.
2021-07-21 14:55:18 -07:00
Charles Lyding
4bcd1dc9ee fix(@angular-devkit/build-angular): allow classes with pure annotated static properties to be optimized
When script optimizations are enabled, classes containing downlevelled static properties are wrapped in a pure annotated IIFE to allow the class to be removed if it is otherwise unused. Only properties with initializer values that do not have the potential for side effects can be safely wrapped. Previously, pure annotations were not considered when analyzing the values and this caused classes to be retained that could be considered safe for removal. To resolve this issue, pure annotations are now considered when analyzing a property's initializer value for potential side effects.
2021-07-21 14:54:57 -07:00
Renovate Bot
33ec9d6ec3 build: update all non-major dependencies 2021-07-21 11:57:17 +02:00
Renovate Bot
cd3eb98d80 build: update all non-major dependencies 2021-07-20 08:46:06 +02:00
LeonEck
ceade0c27e fix(@angular-devkit/build-angular): dasherize disable-host-check suggestion
Camel case arguments have been deprecated and therefore shouldn't be suggested.
2021-07-19 07:06:51 +02:00
Renovate Bot
cb1db78f12 build: update all non-major dependencies 2021-07-19 07:05:44 +02:00
Renovate Bot
577dcfa618 build: update dependency css-loader to v6 2021-07-15 14:49:23 +02:00
Renovate Bot
a155bc5467 build: update all non-major dependencies 2021-07-14 13:57:01 -07:00
Alan Agius
1be3b07836 fix(@angular-devkit/build-angular): exclude outputPath from persistent build cache key
With this change we exclude `outputPath` from cache key due to i18n extraction which causes it to change on every build 736a5f89de/packages/angular_devkit/build_angular/src/utils/i18n-options.ts (L264-L265)

Closes #21275
2021-07-14 13:13:37 -07:00
Charles Lyding
2c2b499193 fix(@angular-devkit/build-angular): limit advanced terser passes to two
Limiting the terser passes to two helps to workaround an issue with terser wherein terser will errantly inline a function argument containing a `yield` expression inside an inner arrow function.  This results in a syntax error since the yield expression is no longer within the scope of a generator.
2021-07-13 15:21:06 +01:00
Charles Lyding
fefd6d0421 perf(@angular-devkit/build-angular): use esbuild as a CSS optimizer for component styles
The stylesheet optimization pipeline now uses `esbuild` for component stylesheets. The usage of `esbuild` provides noticeable build time improvements as well as, on average, smaller output sizes.
`esbuild` currently does not support stylesheet sourcemaps. However, since the Angular CLI does not support component stylesheet sourcemaps when optimizing, this lack of support is problematic.
Global stylesheets will continue to use `cssnano` as an optimizer due to sourcemaps being required for global stylesheets even when optimizing. When `esbuild` adds stylesheet sourcemap support, global stylesheets may be transitioned to `esbuild` as well.
2021-07-13 15:20:49 +01:00
Renovate Bot
2c9a6f0c55 build: update all non-major dependencies 2021-07-12 16:41:09 +01:00
Alan Agius
2ac8e9c0e1 fix(@angular-devkit/build-angular): display incompatibility errors
The logger API writes logs in an async fasion which previously caused messages not to be printed in the terminal when `process.exit` was invoked.

Closes #21322
2021-07-12 16:40:35 +01:00
Alan Agius
9a04975a21 fix(@angular-devkit/build-angular): extractLicenses didn't have an effect when using server builder 2021-07-12 16:39:34 +01:00
Alan Agius
54c170b20d test(@angular-devkit/build-angular): refactor server builder tests to use test harness 2021-07-12 16:39:34 +01:00
Alan Agius
3d71c63b3a fix(@angular-devkit/build-angular): fix issue were @media all causing critical CSS inling to fail
Workaround for Critters as it doesn't work when `@media all {}` is minified to `@media {}`.

Closes #20804
2021-07-09 17:04:23 +01:00
Alan Agius
c65b049996 fix(@angular-devkit/build-angular): fail browser build when index generation fails
Currently, when there is an error during index generation this is just been logged in the console.
2021-07-09 17:02:32 +01:00
Renovate Bot
fc78658cb5 build: update all non-major dependencies 2021-07-08 11:30:46 -04:00
Charles Lyding
6eca86b817 refactor(@angular-devkit/build-angular): replace raw-loader with Webpack 5 asset modules
With Webpack 5, the `raw-loader` is no longer needed and its functionality is provided via configuration options within the Webpack configuration via asset modules.  Asset modules (https://webpack.js.org/guides/asset-modules/) provide a built-in way to provide `raw-loader`, `url-loader`, and `file-loader` functionality without additional dependencies.
2021-07-07 15:51:19 -04:00
Renovate Bot
7ee3a80eaf build: update all non-major dependencies 2021-07-07 11:17:09 -04:00
Alan Agius
20fd33f6d4 feat(@schematics/angular): destroy test module after every test
In version 12.1, the framework added the `destroyAfterEach` an opt-in feature that improves tests performance and also addresses two long-standing issues.

The idea, is to have this enabled by default in the future.  Related PR: https://github.com/angular/angular/pull/42566

Closes #21280
2021-07-07 10:31:20 -04:00
Charles Lyding
beb78ef79e refactor(@angular-devkit/build-angular): use Webpack provided watcher typings instead of custom
Webpack 5 now provides type definitions for the majority of the watch subsystem. These type definitions allow the removal of the custom types that were previously used.
2021-07-07 09:24:09 -04:00
Alan Agius
a5c69722ff fix(@angular-devkit/build-angular): ensure NG_PERSISTENT_BUILD_CACHE always creates a cache in the specified cache directory
This change fixes `NG_PERSISTENT_BUILD_CACHE` sometimes creating cache
entries that live outside of the cache directory by using a hex encoding
rather than a base64 encoding. This error is caused because the base64
alphabet includes `/`. According to the webpack documentation [1] the
default `cacheLocation` is:

  path.resolve(cache.cacheDirectory, cache.name)

Which means cache names with a leading `/` would remove the
`cacheDirectory` altogether.

[1]: https://webpack.js.org/configuration/other-options/#cachecachelocation
2021-07-06 11:38:12 -04:00
Alan Agius
07763702fd fix(@angular-devkit/build-angular): force linker sourceMapping option to false.
This is an interim solution until https://github.com/angular/angular/issues/42769 is fixed.

Closes #21271
2021-07-06 11:37:52 -04:00
Alan Agius
32050cabe5 Revert "fix(@angular-devkit/build-angular): control linker template sourcemapping via builder sourcemap options"
This reverts commit d4c5f8518d4801b9fd76de289a015dcbb8d8f69b.

Following a debugging and investigation with @petebacondarwin it appears that when the external template handling in the linker generates Babel AST nodes that reference the external template files which breaks Babel when it tried to flatten final source-map, which ends up no emitting any source-maps.

As an interim solution we should revert this.

Closes #21271
2021-07-06 11:37:52 -04:00
Alan Agius
1f6a5519fb test(@angular-devkit/build-angular): modify RegExp to handle output of mini-css-extract-plugin v2.1+ 2021-07-06 10:21:28 -04:00
Renovate Bot
2bd859e6d5 build: update all non-major dependencies 2021-07-06 10:21:28 -04:00
Charles Lyding
34e66ff4d2 refactor(@angular-devkit/build-angular): use Webpack provided loader types
Webpack now provides loader function type definitions. These type definitions are now used in custom loaders within the package.
This improves type safety and behavior correctness of the loaders when used with Webpack.
2021-07-02 15:44:39 -04:00
Alan Agius
8383c6b421 fix(@angular-devkit/build-angular): silence Sass compiler warnings from 3rd party stylesheets
With this change we enable `quietDeps`, which causes the Sass compiler not to emit warnings from a stylesheet that is loaded through load-path.

The `--verbose` option can be used to opt-out from this behaviour and display all warnings.

Closes #21235
2021-07-02 11:55:56 -04:00
Charles Lyding
3c2fb5c9c1 refactor(@angular-devkit/build-angular): avoid loading Webpack for differential loading sourcemaps
The `@ampproject/remapping` package is now used for source map processing instead of Webpack for differential loading and i18n processing. This dependency is already used within the recently added JavaScript optimizer refactoring and reduces the amount of code that needs to be loaded into each worker to support differential loading sourcemaps.
2021-07-02 11:54:24 -04:00
Renovate Bot
356f25a1dd build: update all non-major dependencies 2021-07-02 11:49:49 -04:00
Charles Lyding
9afe185fc6 build: enable noImplicitOverride TypeScript option
The `noImplicitOverride` TypeScript option improves code quality by ensuring that properties from base classes are not accidentally overriden.
Reference: https://www.typescriptlang.org/tsconfig#noImplicitOverride
2021-07-02 06:40:36 -04:00
Alan Agius
212939d6a3 Revert "refactor: disable esbuild worker threads"
This reverts commit 47a1ccc50729ad25e4fa4e38704c8dbd3b1737f7.
2021-07-01 13:29:22 +02:00
Renovate Bot
7091295a83 build: update dependency mini-css-extract-plugin to v2 2021-07-01 12:23:38 +02:00
Renovate Bot
7ede2c9d80 build: update dependency esbuild to v0.12.13 2021-07-01 10:02:48 +02:00
Alan Agius
070a133647 fix(@angular-devkit/build-angular): configure webpack target in common configuration
Previously, `target` was unset for `test` which caused the target to be set incorrectly.

Closes #21239
2021-06-30 19:26:36 +02:00
Alan Agius
6a2b11906e perf(@angular-devkit/build-angular): cache JavaScriptOptimizerPlugin results
With this change we cache JavaScriptOptimizerPlugin results in memory or on the file system based on the caching strategy used.
2021-06-30 17:41:01 +02:00
Alan Agius
41e6457921 fix(@angular-devkit/build-angular): downlevel for await...of when targetting ES2018+
Closes #21196
2021-06-30 16:28:57 +02:00
Renovate Bot
398f56d545 build: update all non-major dependencies 2021-06-30 11:45:41 +02:00
Renovate Bot
73a0a04c24 build: update all non-major dependencies 2021-06-29 08:46:19 +02:00
Alan Agius
18cfa04317 feat(@angular-devkit/build-angular): add support to inline Adobe Fonts
With this change we add support to inline external Adobe fonts into the index html, we also add a `preconnect` hint which helps improve page load speed.

Closes #21186
2021-06-28 20:22:29 +02:00
Alan Agius
47a1ccc507 refactor: disable esbuild worker threads
This is a workaround for `TypeError [Error]: Cannot read property 'workerPort' of undefined`.
2021-06-28 17:57:57 +02:00
Renovate Bot
f69e4f3cc9 build: update all non-major dependencies 2021-06-28 17:57:57 +02:00
Alan Agius
9a751f0f81 fix(@angular-devkit/build-angular): handle ENOENT and ENOTDIR errors when deleting outputs
Closes #21202
2021-06-28 17:15:19 +02:00
Charles Lyding
fd4ae0fb16 refactor(@angular-devkit/build-angular): lazy load Webpack in differential loading processor
Webpack is a large dependency with a large dependency graph. By only loading Webpack when needed in the differential loading and i18n processors, initial startup time can be improved and memory usage can be reduced.
2021-06-28 14:42:12 +02:00
Charles Lyding
e49079d971 refactor(@angular-devkit/build-angular): remove jest-worker direct dependency
The worker pool for differential loading and i18n processing is now managed by the `piscina` dependency. This dependency is already used within the recently added JavaScript optimizer refactoring and reduces both the number of direct dependencies and amount of code to setup the worker pools.
2021-06-28 14:42:12 +02:00
Renovate Bot
ada64401d0 build: update all non-major dependencies 2021-06-27 16:02:14 +02:00
Renovate Bot
7d2f09875a build: update dependency style-loader to v3 2021-06-25 10:18:22 +02:00
Renovate Bot
82fbb993b3 build: update dependency esbuild to v0.12.9 2021-06-25 08:45:04 +02:00
Alan Agius
05a52c8c59 refactor: clean up remove unused code 2021-06-25 07:46:22 +02:00