2255 Commits

Author SHA1 Message Date
Charles Lyding
734d61df3f refactor(@angular-devkit/build-angular): remove empty.js Webpack alias file
Webpack 5 supports setting a module's alias to `false` to signify that a module should be ignored. This option removes the need for the `empty.js` file as an alias option value.
2021-08-05 06:48:55 +02:00
Charles Lyding
28f302855f refactor(@angular-devkit/build-angular): remove Node.js 10 copyfile workaround
The workaround code was gated on the presence of Node.js 10 but the CLI no longer supports Node.js 10 and will execute with an error if attempted. As a result, the workaround code would never be executed.
2021-08-05 06:48:55 +02:00
Alan Agius
20e48a33c1 feat(@angular-devkit/build-angular): remove deprecated options
BREAKING CHANGE:

With this change we removed several deprecated builder options
- `extractCss` has been removed from the browser builder. CSS is now always extracted.
- `servePathDefaultWarning` and `hmrWarning` have been removed from the dev-server builder. These options had no effect.
2021-08-03 15:07:04 +01:00
Charles Lyding
3e80b8841f test(@angular-devkit/build-angular): remove unused tslint builder tests
The tslint builder has been removed and these tests are no longer executed.
2021-08-03 11:07:32 +01:00
Charles Lyding
7576136b2f feat(@angular-devkit/build-angular): remove automatic inclusion of ES5 browser polyfills
BREAKING CHANGE:
The automatic inclusion of Angular-required ES2015 polyfills to support ES5 browsers has been removed. Previously when targetting ES5 within the application's TypeScript configuration or listing an ES5 requiring browser in the browserslist file, Angular-required polyfills were included in the built application. However, with Angular no longer supporting IE11, there are now no browsers officially supported by Angular that would require these polyfills. As a result, the automatic inclusion of these ES2015 polyfills has been removed. Any polyfills manually added to an application's code are not affected by this change.
2021-08-03 11:07:16 +01:00
Renovate Bot
5a46ff3fbc build: update all non-major dependencies 2021-08-02 17:02:31 +01:00
Charles Lyding
701214d174 feat(@angular-devkit/build-angular): remove differential loading support
BREAKING CHANGE:
Differential loading support has been removed. With Angular no longer supporting IE11, there are now no browsers officially supported by Angular that require ES5 code. As a result, differential loading's functionality for creating and conditionally loading ES5 and ES2015+ variants of an application is no longer required.
2021-08-02 16:59:48 +01:00
Alan Agius
e78f6ab5d8 feat(@angular-devkit/build-angular): remove deprecated tslint builder
BREAKING CHANGE:

Deprecated `@angular-devkit/build-angular:tslint` builder has been removed. Use https://github.com/angular-eslint/angular-eslint instead.
2021-08-02 16:57:56 +01:00
Alan Agius
e82eef924e refactor(@angular-devkit/build-angular): remove WOFF handling from inline-fonts processor
BREAKING CHANGE:

We remove inlining of Google fonts in WOFF format since IE 11 is no longer supported. Other supported browsers use WOFF2.
2021-07-30 14:27:07 +01:00
Alan Agius
ac3fc2752f feat(@angular-devkit/build-angular): drop support for node-sass
BREAKING CHANGE:

Support for `node-sass` has been removed. `sass` will be used by default to compile SASS and SCSS files.
2021-07-30 14:26:39 +01:00
Charles Lyding
bd9e3905b5 refactor(@angular-devkit/build-angular): remove unused code in webpack configuration partials
Several unused imports and variables as well as redundant conditional checks were removed from the Webpack configuration partials.
2021-07-30 12:44:55 +01:00
Alan Agius
0346d6953e refactor: move testy-utils under testing folder
This is so that it is easier to exlude this when globbing.
2021-07-30 12:43:18 +01:00
Alan Agius
8ea82e593c build: add tsconfig-build.json
This TypeScript configuration file is used to build the monorepo. This will only include actual sourcefiles ie. non test files.
2021-07-30 12:43:18 +01:00
Alan Agius
c1efaa17fe fix(@angular-devkit/build-angular): calculate valid Angular versions from peerDependencies
With this change we update the `assertCompatibleAngularVersion` logic to use `peerDependencies` on `@angular/compiler-cli` listed in the `package.json` to determine if the installed Angular version is supported or not.

This is a fix for:
https://github.com/angular/angular-cli/pull/21449
https://circleci.com/gh/angular/angular-cli/259835?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
2021-07-30 12:42:10 +01:00
Renovate Bot
edaa4c007a build: update all non-major dependencies 2021-07-30 12:39:46 +01:00
Renovate Bot
7e3a6227c1 build: update dependency webpack to v5.47.0 2021-07-28 11:27:39 -04:00
originalfrostig
d750c686fd fix(@angular-devkit/build-angular): add priority to copy-webpack-plugin patterns 2021-07-28 11:27:00 -04:00
Alan Agius
6153530220 fix(@angular-devkit/build-webpack): emit result when webpack is closed
With this change we emit the compilation result when the compilation is closed, when the compilation is not in watch mode.

This is needed so that when persistent caching is enabled and architect promise API is used (`.result`) instead of `.output` we wait for the cache to be written prior to terminating the process/resolving the result promise.

The `result` API currently, takes the first emit 4f9df9f4a4/packages/angular_devkit/architect/src/schedule-by-name.ts (L118-L120)

Closes #21419
2021-07-27 12:15:02 -04:00
Renovate Bot
1e9be09bfa build: update all non-major dependencies 2021-07-26 10:23:20 -04:00
Renovate Bot
0eb271ed5f build: update dependency regenerator-runtime to v0.13.9 2021-07-23 10:10:06 -04:00
Renovate Bot
734e396b14 build: update all non-major dependencies 2021-07-22 12:31:52 -04:00
Alan Agius
8bea912724 build: update angular dependencies to 12.2.0-next.3 2021-07-22 11:51:51 -04:00
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